@exaudeus/workrail 3.18.1 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();function Vc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eh={exports:{}},ws={};var Vx;function y_(){if(Vx)return ws;Vx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:l}}return ws.Fragment=t,ws.jsx=r,ws.jsxs=r,ws}var qx;function x_(){return qx||(qx=1,Eh.exports=y_()),Eh.exports}var b=x_(),Ch={exports:{}},Ae={};var Fx;function v_(){if(Fx)return Ae;Fx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function S(z,$,R){this.props=z,this.context=$,this.refs=N,this.updater=R||w}S.prototype.isReactComponent={},S.prototype.setState=function(z,$){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,$,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function A(){}A.prototype=S.prototype;function _(z,$,R){this.props=z,this.context=$,this.refs=N,this.updater=R||w}var k=_.prototype=new A;k.constructor=_,C(k,S.prototype),k.isPureReactComponent=!0;var B=Array.isArray;function T(){}var O={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function P(z,$,R){var te=R.ref;return{$$typeof:e,type:z,key:$,ref:te!==void 0?te:null,props:R}}function F(z,$){return P(z.type,$,z.props)}function I(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Y(z){var $={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(R){return $[R]})}var Q=/\/+/g;function L(z,$){return typeof z=="object"&&z!==null&&z.key!=null?Y(""+z.key):$.toString(36)}function V(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(T,T):(z.status="pending",z.then(function($){z.status==="pending"&&(z.status="fulfilled",z.value=$)},function($){z.status==="pending"&&(z.status="rejected",z.reason=$)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function M(z,$,R,te,ue){var fe=typeof z;(fe==="undefined"||fe==="boolean")&&(z=null);var de=!1;if(z===null)de=!0;else switch(fe){case"bigint":case"string":case"number":de=!0;break;case"object":switch(z.$$typeof){case e:case t:de=!0;break;case p:return de=z._init,M(de(z._payload),$,R,te,ue)}}if(de)return ue=ue(z),de=te===""?"."+L(z,0):te,B(ue)?(R="",de!=null&&(R=de.replace(Q,"$&/")+"/"),M(ue,$,R,"",function(we){return we})):ue!=null&&(I(ue)&&(ue=F(ue,R+(ue.key==null||z&&z.key===ue.key?"":(""+ue.key).replace(Q,"$&/")+"/")+de)),$.push(ue)),1;de=0;var le=te===""?".":te+":";if(B(z))for(var pe=0;pe<z.length;pe++)te=z[pe],fe=le+L(te,pe),de+=M(te,$,R,fe,ue);else if(pe=v(z),typeof pe=="function")for(z=pe.call(z),pe=0;!(te=z.next()).done;)te=te.value,fe=le+L(te,pe++),de+=M(te,$,R,fe,ue);else if(fe==="object"){if(typeof z.then=="function")return M(V(z),$,R,te,ue);throw $=String(z),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return de}function q(z,$,R){if(z==null)return z;var te=[],ue=0;return M(z,te,"","",function(fe){return $.call(R,fe,ue++)}),te}function X(z){if(z._status===-1){var $=z._result;$=$(),$.then(function(R){(z._status===0||z._status===-1)&&(z._status=1,z._result=R)},function(R){(z._status===0||z._status===-1)&&(z._status=2,z._result=R)}),z._status===-1&&(z._status=0,z._result=$)}if(z._status===1)return z._result.default;throw z._result}var Z=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},j={map:q,forEach:function(z,$,R){q(z,function(){$.apply(this,arguments)},R)},count:function(z){var $=0;return q(z,function(){$++}),$},toArray:function(z){return q(z,function($){return $})||[]},only:function(z){if(!I(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Ae.Activity=g,Ae.Children=j,Ae.Component=S,Ae.Fragment=r,Ae.Profiler=o,Ae.PureComponent=_,Ae.StrictMode=a,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(z){return O.H.useMemoCache(z)}},Ae.cache=function(z){return function(){return z.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(z,$,R){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var te=C({},z.props),ue=z.key;if($!=null)for(fe in $.key!==void 0&&(ue=""+$.key),$)!U.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(te[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)te.children=R;else if(1<fe){for(var de=Array(fe),le=0;le<fe;le++)de[le]=arguments[le+2];te.children=de}return P(z.type,ue,te)},Ae.createContext=function(z){return z={$$typeof:u,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},Ae.createElement=function(z,$,R){var te,ue={},fe=null;if($!=null)for(te in $.key!==void 0&&(fe=""+$.key),$)U.call($,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=$[te]);var de=arguments.length-2;if(de===1)ue.children=R;else if(1<de){for(var le=Array(de),pe=0;pe<de;pe++)le[pe]=arguments[pe+2];ue.children=le}if(z&&z.defaultProps)for(te in de=z.defaultProps,de)ue[te]===void 0&&(ue[te]=de[te]);return P(z,fe,ue)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(z){return{$$typeof:f,render:z}},Ae.isValidElement=I,Ae.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:X}},Ae.memo=function(z,$){return{$$typeof:d,type:z,compare:$===void 0?null:$}},Ae.startTransition=function(z){var $=O.T,R={};O.T=R;try{var te=z(),ue=O.S;ue!==null&&ue(R,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(T,Z)}catch(fe){Z(fe)}finally{$!==null&&R.types!==null&&($.types=R.types),O.T=$}},Ae.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ae.use=function(z){return O.H.use(z)},Ae.useActionState=function(z,$,R){return O.H.useActionState(z,$,R)},Ae.useCallback=function(z,$){return O.H.useCallback(z,$)},Ae.useContext=function(z){return O.H.useContext(z)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(z,$){return O.H.useDeferredValue(z,$)},Ae.useEffect=function(z,$){return O.H.useEffect(z,$)},Ae.useEffectEvent=function(z){return O.H.useEffectEvent(z)},Ae.useId=function(){return O.H.useId()},Ae.useImperativeHandle=function(z,$,R){return O.H.useImperativeHandle(z,$,R)},Ae.useInsertionEffect=function(z,$){return O.H.useInsertionEffect(z,$)},Ae.useLayoutEffect=function(z,$){return O.H.useLayoutEffect(z,$)},Ae.useMemo=function(z,$){return O.H.useMemo(z,$)},Ae.useOptimistic=function(z,$){return O.H.useOptimistic(z,$)},Ae.useReducer=function(z,$,R){return O.H.useReducer(z,$,R)},Ae.useRef=function(z){return O.H.useRef(z)},Ae.useState=function(z){return O.H.useState(z)},Ae.useSyncExternalStore=function(z,$,R){return O.H.useSyncExternalStore(z,$,R)},Ae.useTransition=function(){return O.H.useTransition()},Ae.version="19.2.4",Ae}var Yx;function fl(){return Yx||(Yx=1,Ch.exports=v_()),Ch.exports}var H=fl();const co=Vc(H);var _h={exports:{}},Ss={},Nh={exports:{}},kh={};var $x;function b_(){return $x||($x=1,(function(e){function t(M,q){var X=M.length;M.push(q);e:for(;0<X;){var Z=X-1>>>1,j=M[Z];if(0<o(j,q))M[Z]=q,M[X]=j,X=Z;else break e}}function r(M){return M.length===0?null:M[0]}function a(M){if(M.length===0)return null;var q=M[0],X=M.pop();if(X!==q){M[0]=X;e:for(var Z=0,j=M.length,z=j>>>1;Z<z;){var $=2*(Z+1)-1,R=M[$],te=$+1,ue=M[te];if(0>o(R,X))te<j&&0>o(ue,R)?(M[Z]=ue,M[te]=X,Z=te):(M[Z]=R,M[$]=X,Z=$);else if(te<j&&0>o(ue,X))M[Z]=ue,M[te]=X,Z=te;else break e}}return q}function o(M,q){var X=M.sortIndex-q.sortIndex;return X!==0?X:M.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],p=1,g=null,y=3,v=!1,w=!1,C=!1,N=!1,S=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function k(M){for(var q=r(d);q!==null;){if(q.callback===null)a(d);else if(q.startTime<=M)a(d),q.sortIndex=q.expirationTime,t(h,q);else break;q=r(d)}}function B(M){if(C=!1,k(M),!w)if(r(h)!==null)w=!0,T||(T=!0,Y());else{var q=r(d);q!==null&&V(B,q.startTime-M)}}var T=!1,O=-1,U=5,P=-1;function F(){return N?!0:!(e.unstable_now()-P<U)}function I(){if(N=!1,T){var M=e.unstable_now();P=M;var q=!0;try{e:{w=!1,C&&(C=!1,A(O),O=-1),v=!0;var X=y;try{t:{for(k(M),g=r(h);g!==null&&!(g.expirationTime>M&&F());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,y=g.priorityLevel;var j=Z(g.expirationTime<=M);if(M=e.unstable_now(),typeof j=="function"){g.callback=j,k(M),q=!0;break t}g===r(h)&&a(h),k(M)}else a(h);g=r(h)}if(g!==null)q=!0;else{var z=r(d);z!==null&&V(B,z.startTime-M),q=!1}}break e}finally{g=null,y=X,v=!1}q=void 0}}finally{q?Y():T=!1}}}var Y;if(typeof _=="function")Y=function(){_(I)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,L=Q.port2;Q.port1.onmessage=I,Y=function(){L.postMessage(null)}}else Y=function(){S(I,0)};function V(M,q){O=S(function(){M(e.unstable_now())},q)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(M){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var X=y;y=q;try{return M()}finally{y=X}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(M,q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var X=y;y=M;try{return q()}finally{y=X}},e.unstable_scheduleCallback=function(M,q,X){var Z=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?Z+X:Z):X=Z,M){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=X+j,M={id:p++,callback:q,priorityLevel:M,startTime:X,expirationTime:j,sortIndex:-1},X>Z?(M.sortIndex=X,t(d,M),r(h)===null&&M===r(d)&&(C?(A(O),O=-1):C=!0,V(B,X-Z))):(M.sortIndex=j,t(h,M),w||v||(w=!0,T||(T=!0,Y()))),M},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(M){var q=y;return function(){var X=y;y=q;try{return M.apply(this,arguments)}finally{y=X}}}})(kh)),kh}var Gx;function w_(){return Gx||(Gx=1,Nh.exports=b_()),Nh.exports}var Mh={exports:{}},Lt={};var Xx;function S_(){if(Xx)return Lt;Xx=1;var e=fl();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,d,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:d,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Lt.createPortal=function(h,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(h,d,null,p)},Lt.flushSync=function(h){var d=u.T,p=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=p,a.d.f()}},Lt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},Lt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Lt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var p=d.as,g=f(p,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):p==="script"&&a.d.X(h,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Lt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},Lt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,g=f(p,d.crossOrigin);a.d.L(h,p,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Lt.preloadModule=function(h,d){if(typeof h=="string")if(d){var p=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Lt.requestFormReset=function(h){a.d.r(h)},Lt.unstable_batchedUpdates=function(h,d){return h(d)},Lt.useFormState=function(h,d,p){return u.H.useFormState(h,d,p)},Lt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Lt.version="19.2.4",Lt}var Qx;function U1(){if(Qx)return Mh.exports;Qx=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(t){console.error(t)}}return e(),Mh.exports=S_(),Mh.exports}var Kx;function E_(){if(Kx)return Ss;Kx=1;var e=w_(),t=fl(),r=U1();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var i=n,s=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(s=i.return),n=i.return;while(n)}return i.tag===3?s:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(l(n)!==n)throw Error(a(188))}function d(n){var i=n.alternate;if(!i){if(i=l(n),i===null)throw Error(a(188));return i!==n?null:n}for(var s=n,c=i;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){s=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return h(m),n;if(x===c)return h(m),i;x=x.sibling}throw Error(a(188))}if(s.return!==c.return)s=m,c=x;else{for(var E=!1,D=m.child;D;){if(D===s){E=!0,s=m,c=x;break}if(D===c){E=!0,c=m,s=x;break}D=D.sibling}if(!E){for(D=x.child;D;){if(D===s){E=!0,s=x,c=m;break}if(D===c){E=!0,c=x,s=m;break}D=D.sibling}if(!E)throw Error(a(189))}}if(s.alternate!==c)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?n:i}function p(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=p(n),i!==null)return i;n=n.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),_=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=I&&n[I]||n["@@iterator"],typeof n=="function"?n:null)}var Q=Symbol.for("react.client.reference");function L(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Q?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case C:return"Fragment";case S:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case T:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case _:return n.displayName||"Context";case A:return(n._context.displayName||"Context")+".Consumer";case k:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case O:return i=n.displayName||null,i!==null?i:L(n.type)||"Memo";case U:i=n._payload,n=n._init;try{return L(n(i))}catch{}}return null}var V=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Z=[],j=-1;function z(n){return{current:n}}function $(n){0>j||(n.current=Z[j],Z[j]=null,j--)}function R(n,i){j++,Z[j]=n.current,n.current=i}var te=z(null),ue=z(null),fe=z(null),de=z(null);function le(n,i){switch(R(fe,i),R(ue,n),R(te,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?fx(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=fx(i),n=dx(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}$(te),R(te,n)}function pe(){$(te),$(ue),$(fe)}function we(n){n.memoizedState!==null&&R(de,n);var i=te.current,s=dx(i,n.type);i!==s&&(R(ue,n),R(te,s))}function Ee(n){ue.current===n&&($(te),$(ue)),de.current===n&&($(de),ys._currentValue=X)}var ve,Ce;function ce(n){if(ve===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ve=i&&i[1]||"",Ce=-1<s.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ve+n+Ce}var ge=!1;function be(n,i){if(!n||ge)return"";ge=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(re){var ne=re}Reflect.construct(n,[],se)}else{try{se.call()}catch(re){ne=re}n.call(se.prototype)}}else{try{throw Error()}catch(re){ne=re}(se=n())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(re){if(re&&ne&&typeof re.stack=="string")return[re.stack,ne.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),E=x[0],D=x[1];if(E&&D){var G=E.split(`
4
- `),ee=D.split(`
5
- `);for(m=c=0;c<G.length&&!G[c].includes("DetermineComponentFrameRoot");)c++;for(;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;if(c===G.length||m===ee.length)for(c=G.length-1,m=ee.length-1;1<=c&&0<=m&&G[c]!==ee[m];)m--;for(;1<=c&&0<=m;c--,m--)if(G[c]!==ee[m]){if(c!==1||m!==1)do if(c--,m--,0>m||G[c]!==ee[m]){var ae=`
6
- `+G[c].replace(" at new "," at ");return n.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",n.displayName)),ae}while(1<=c&&0<=m);break}}}finally{ge=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?ce(s):""}function De(n,i){switch(n.tag){case 26:case 27:case 5:return ce(n.type);case 16:return ce("Lazy");case 13:return n.child!==i&&i!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return be(n.type,!1);case 11:return be(n.type.render,!1);case 1:return be(n.type,!0);case 31:return ce("Activity");default:return""}}function qe(n){try{var i="",s=null;do i+=De(n,s),s=n,n=n.return;while(n);return i}catch(c){return`
7
- Error generating stack: `+c.message+`
8
- `+c.stack}}var Fe=Object.prototype.hasOwnProperty,_t=e.unstable_scheduleCallback,Ot=e.unstable_cancelCallback,on=e.unstable_shouldYield,wn=e.unstable_requestPaint,Te=e.unstable_now,ct=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,ze=e.unstable_LowPriority,Ue=e.unstable_IdlePriority,Ht=e.log,jn=e.unstable_setDisableYieldValue,kt=null,ht=null;function Dt(n){if(typeof Ht=="function"&&jn(n),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(kt,n)}catch{}}var Qe=Math.clz32?Math.clz32:ff,Vn=Math.log,sn=Math.LN2;function ff(n){return n>>>=0,n===0?32:31-(Vn(n)/sn|0)|0}var ua=256,ca=262144,fa=4194304;function rr(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function da(n,i,s){var c=n.pendingLanes;if(c===0)return 0;var m=0,x=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var D=c&134217727;return D!==0?(c=D&~x,c!==0?m=rr(c):(E&=D,E!==0?m=rr(E):s||(s=D&~n,s!==0&&(m=rr(s))))):(D=c&~x,D!==0?m=rr(D):E!==0?m=rr(E):s||(s=c&~n,s!==0&&(m=rr(s)))),m===0?0:i!==0&&i!==m&&(i&x)===0&&(x=m&-m,s=i&-i,x>=s||x===32&&(s&4194048)!==0)?i:m}function xi(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function df(n,i){switch(n){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 Sl(){var n=fa;return fa<<=1,(fa&62914560)===0&&(fa=4194304),n}function Mo(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function vi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function hf(n,i,s,c,m,x){var E=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var D=n.entanglements,G=n.expirationTimes,ee=n.hiddenUpdates;for(s=E&~s;0<s;){var ae=31-Qe(s),se=1<<ae;D[ae]=0,G[ae]=-1;var ne=ee[ae];if(ne!==null)for(ee[ae]=null,ae=0;ae<ne.length;ae++){var re=ne[ae];re!==null&&(re.lane&=-536870913)}s&=~se}c!==0&&El(n,c,0),x!==0&&m===0&&n.tag!==0&&(n.suspendedLanes|=x&~(E&~i))}function El(n,i,s){n.pendingLanes|=i,n.suspendedLanes&=~i;var c=31-Qe(i);n.entangledLanes|=i,n.entanglements[c]=n.entanglements[c]|1073741824|s&261930}function Cl(n,i){var s=n.entangledLanes|=i;for(n=n.entanglements;s;){var c=31-Qe(s),m=1<<c;m&i|n[c]&i&&(n[c]|=i),s&=~m}}function _l(n,i){var s=i&-i;return s=(s&42)!==0?1:To(s),(s&(n.suspendedLanes|i))!==0?0:s}function To(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Ao(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Nl(){var n=q.p;return n!==0?n:(n=window.event,n===void 0?32:zx(n.type))}function kl(n,i){var s=q.p;try{return q.p=n,i()}finally{q.p=s}}var qn=Math.random().toString(36).slice(2),Et="__reactFiber$"+qn,zt="__reactProps$"+qn,ir="__reactContainer$"+qn,ha="__reactEvents$"+qn,Ml="__reactListeners$"+qn,pf="__reactHandles$"+qn,Tl="__reactResources$"+qn,bi="__reactMarker$"+qn;function Ro(n){delete n[Et],delete n[zt],delete n[ha],delete n[Ml],delete n[pf]}function Rr(n){var i=n[Et];if(i)return i;for(var s=n.parentNode;s;){if(i=s[ir]||s[Et]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(n=vx(n);n!==null;){if(s=n[Et])return s;n=vx(n)}return i}n=s,s=n.parentNode}return null}function jr(n){if(n=n[Et]||n[ir]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function Or(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Dr(n){var i=n[Tl];return i||(i=n[Tl]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function gt(n){n[bi]=!0}var Al=new Set,Rl={};function ar(n,i){zr(n,i),zr(n+"Capture",i)}function zr(n,i){for(Rl[n]=i,n=0;n<i.length;n++)Al.add(i[n])}var mf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),jo={},jl={};function gf(n){return Fe.call(jl,n)?!0:Fe.call(jo,n)?!1:mf.test(n)?jl[n]=!0:(jo[n]=!0,!1)}function pa(n,i,s){if(gf(i))if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+s)}}function ma(n,i,s){if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+s)}}function On(n,i,s,c){if(c===null)n.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(i,s,""+c)}}function qt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ol(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function yf(n,i,s){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,x=c.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return m.call(this)},set:function(E){s=""+E,x.call(this,E)}}),Object.defineProperty(n,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function ga(n){if(!n._valueTracker){var i=Ol(n)?"checked":"value";n._valueTracker=yf(n,i,""+n[i])}}function Dl(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return n&&(c=Ol(n)?n.checked?"true":"false":n.value),n=c,n!==s?(i.setValue(n),!0):!1}function wi(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var xf=/[\n"\\]/g;function Ft(n){return n.replace(xf,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Si(n,i,s,c,m,x,E,D){n.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?n.type=E:n.removeAttribute("type"),i!=null?E==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+qt(i)):n.value!==""+qt(i)&&(n.value=""+qt(i)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),i!=null?Oo(n,E,qt(i)):s!=null?Oo(n,E,qt(s)):c!=null&&n.removeAttribute("value"),m==null&&x!=null&&(n.defaultChecked=!!x),m!=null&&(n.checked=m&&typeof m!="function"&&typeof m!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?n.name=""+qt(D):n.removeAttribute("name")}function zl(n,i,s,c,m,x,E,D){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),i!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){ga(n);return}s=s!=null?""+qt(s):"",i=i!=null?""+qt(i):s,D||i===n.value||(n.value=i),n.defaultValue=i}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=D?n.checked:!!c,n.defaultChecked=!!c,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),ga(n)}function Oo(n,i,s){i==="number"&&wi(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function or(n,i,s,c){if(n=n.options,i){i={};for(var m=0;m<s.length;m++)i["$"+s[m]]=!0;for(s=0;s<n.length;s++)m=i.hasOwnProperty("$"+n[s].value),n[s].selected!==m&&(n[s].selected=m),m&&c&&(n[s].defaultSelected=!0)}else{for(s=""+qt(s),i=null,m=0;m<n.length;m++){if(n[m].value===s){n[m].selected=!0,c&&(n[m].defaultSelected=!0);return}i!==null||n[m].disabled||(i=n[m])}i!==null&&(i.selected=!0)}}function og(n,i,s){if(i!=null&&(i=""+qt(i),i!==n.value&&(n.value=i),s==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=s!=null?""+qt(s):""}function sg(n,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(V(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=qt(i),n.defaultValue=s,c=n.textContent,c===s&&c!==""&&c!==null&&(n.value=c),ga(n)}function ya(n,i){if(i){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=i;return}}n.textContent=i}var dC=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 lg(n,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":c?n.setProperty(i,s):typeof s!="number"||s===0||dC.has(i)?i==="float"?n.cssFloat=s:n[i]=(""+s).trim():n[i]=s+"px"}function ug(n,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var m in i)c=i[m],i.hasOwnProperty(m)&&s[m]!==c&&lg(n,m,c)}else for(var x in i)i.hasOwnProperty(x)&&lg(n,x,i[x])}function vf(n){if(n.indexOf("-")===-1)return!1;switch(n){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 hC=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"]]),pC=/^[\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 Ll(n){return pC.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function sr(){}var bf=null;function wf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var xa=null,va=null;function cg(n){var i=jr(n);if(i&&(n=i.stateNode)){var s=n[zt]||null;e:switch(n=i.stateNode,i.type){case"input":if(Si(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ft(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==n&&c.form===n.form){var m=c[zt]||null;if(!m)throw Error(a(90));Si(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===n.form&&Dl(c)}break e;case"textarea":og(n,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&or(n,!!s.multiple,i,!1)}}}var Sf=!1;function fg(n,i,s){if(Sf)return n(i,s);Sf=!0;try{var c=n(i);return c}finally{if(Sf=!1,(xa!==null||va!==null)&&(Eu(),xa&&(i=xa,n=va,va=xa=null,cg(i),n)))for(i=0;i<n.length;i++)cg(n[i])}}function Do(n,i){var s=n.stateNode;if(s===null)return null;var c=s[zt]||null;if(c===null)return null;s=c[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":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ef=!1;if(lr)try{var zo={};Object.defineProperty(zo,"passive",{get:function(){Ef=!0}}),window.addEventListener("test",zo,zo),window.removeEventListener("test",zo,zo)}catch{Ef=!1}var Lr=null,Cf=null,Il=null;function dg(){if(Il)return Il;var n,i=Cf,s=i.length,c,m="value"in Lr?Lr.value:Lr.textContent,x=m.length;for(n=0;n<s&&i[n]===m[n];n++);var E=s-n;for(c=1;c<=E&&i[s-c]===m[x-c];c++);return Il=m.slice(n,1<c?1-c:void 0)}function Bl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Hl(){return!0}function hg(){return!1}function Yt(n){function i(s,c,m,x,E){this._reactName=s,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var D in n)n.hasOwnProperty(D)&&(s=n[D],this[D]=s?s(x):x[D]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Hl:hg,this.isPropagationStopped=hg,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),i}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pl=Yt(Ei),Lo=g({},Ei,{view:0,detail:0}),mC=Yt(Lo),_f,Nf,Io,Ul=g({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Io&&(Io&&n.type==="mousemove"?(_f=n.screenX-Io.screenX,Nf=n.screenY-Io.screenY):Nf=_f=0,Io=n),_f)},movementY:function(n){return"movementY"in n?n.movementY:Nf}}),pg=Yt(Ul),gC=g({},Ul,{dataTransfer:0}),yC=Yt(gC),xC=g({},Lo,{relatedTarget:0}),kf=Yt(xC),vC=g({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),bC=Yt(vC),wC=g({},Ei,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),SC=Yt(wC),EC=g({},Ei,{data:0}),mg=Yt(EC),CC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_C={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"},NC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kC(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=NC[n])?!!i[n]:!1}function Mf(){return kC}var MC=g({},Lo,{key:function(n){if(n.key){var i=CC[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Bl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?_C[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mf,charCode:function(n){return n.type==="keypress"?Bl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Bl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),TC=Yt(MC),AC=g({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gg=Yt(AC),RC=g({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mf}),jC=Yt(RC),OC=g({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),DC=Yt(OC),zC=g({},Ul,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),LC=Yt(zC),IC=g({},Ei,{newState:0,oldState:0}),BC=Yt(IC),HC=[9,13,27,32],Tf=lr&&"CompositionEvent"in window,Bo=null;lr&&"documentMode"in document&&(Bo=document.documentMode);var PC=lr&&"TextEvent"in window&&!Bo,yg=lr&&(!Tf||Bo&&8<Bo&&11>=Bo),xg=" ",vg=!1;function bg(n,i){switch(n){case"keyup":return HC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ba=!1;function UC(n,i){switch(n){case"compositionend":return wg(i);case"keypress":return i.which!==32?null:(vg=!0,xg);case"textInput":return n=i.data,n===xg&&vg?null:n;default:return null}}function VC(n,i){if(ba)return n==="compositionend"||!Tf&&bg(n,i)?(n=dg(),Il=Cf=Lr=null,ba=!1,n):null;switch(n){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 yg&&i.locale!=="ko"?null:i.data;default:return null}}var qC={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 Sg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!qC[n.type]:i==="textarea"}function Eg(n,i,s,c){xa?va?va.push(c):va=[c]:xa=c,i=Au(i,"onChange"),0<i.length&&(s=new Pl("onChange","change",null,s,c),n.push({event:s,listeners:i}))}var Ho=null,Po=null;function FC(n){ax(n,0)}function Vl(n){var i=Or(n);if(Dl(i))return n}function Cg(n,i){if(n==="change")return i}var _g=!1;if(lr){var Af;if(lr){var Rf="oninput"in document;if(!Rf){var Ng=document.createElement("div");Ng.setAttribute("oninput","return;"),Rf=typeof Ng.oninput=="function"}Af=Rf}else Af=!1;_g=Af&&(!document.documentMode||9<document.documentMode)}function kg(){Ho&&(Ho.detachEvent("onpropertychange",Mg),Po=Ho=null)}function Mg(n){if(n.propertyName==="value"&&Vl(Po)){var i=[];Eg(i,Po,n,wf(n)),fg(FC,i)}}function YC(n,i,s){n==="focusin"?(kg(),Ho=i,Po=s,Ho.attachEvent("onpropertychange",Mg)):n==="focusout"&&kg()}function $C(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Vl(Po)}function GC(n,i){if(n==="click")return Vl(i)}function XC(n,i){if(n==="input"||n==="change")return Vl(i)}function QC(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var ln=typeof Object.is=="function"?Object.is:QC;function Uo(n,i){if(ln(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var s=Object.keys(n),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var m=s[c];if(!Fe.call(i,m)||!ln(n[m],i[m]))return!1}return!0}function Tg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Ag(n,i){var s=Tg(n);n=0;for(var c;s;){if(s.nodeType===3){if(c=n+s.textContent.length,n<=i&&c>=i)return{node:s,offset:i-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Tg(s)}}function Rg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Rg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function jg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wi(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=wi(n.document)}return i}function jf(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var KC=lr&&"documentMode"in document&&11>=document.documentMode,wa=null,Of=null,Vo=null,Df=!1;function Og(n,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Df||wa==null||wa!==wi(c)||(c=wa,"selectionStart"in c&&jf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Vo&&Uo(Vo,c)||(Vo=c,c=Au(Of,"onSelect"),0<c.length&&(i=new Pl("onSelect","select",null,i,s),n.push({event:i,listeners:c}),i.target=wa)))}function Ci(n,i){var s={};return s[n.toLowerCase()]=i.toLowerCase(),s["Webkit"+n]="webkit"+i,s["Moz"+n]="moz"+i,s}var Sa={animationend:Ci("Animation","AnimationEnd"),animationiteration:Ci("Animation","AnimationIteration"),animationstart:Ci("Animation","AnimationStart"),transitionrun:Ci("Transition","TransitionRun"),transitionstart:Ci("Transition","TransitionStart"),transitioncancel:Ci("Transition","TransitionCancel"),transitionend:Ci("Transition","TransitionEnd")},zf={},Dg={};lr&&(Dg=document.createElement("div").style,"AnimationEvent"in window||(delete Sa.animationend.animation,delete Sa.animationiteration.animation,delete Sa.animationstart.animation),"TransitionEvent"in window||delete Sa.transitionend.transition);function _i(n){if(zf[n])return zf[n];if(!Sa[n])return n;var i=Sa[n],s;for(s in i)if(i.hasOwnProperty(s)&&s in Dg)return zf[n]=i[s];return n}var zg=_i("animationend"),Lg=_i("animationiteration"),Ig=_i("animationstart"),ZC=_i("transitionrun"),WC=_i("transitionstart"),JC=_i("transitioncancel"),Bg=_i("transitionend"),Hg=new Map,Lf="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(" ");Lf.push("scrollEnd");function Dn(n,i){Hg.set(n,i),ar(i,[n])}var ql=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Sn=[],Ea=0,If=0;function Fl(){for(var n=Ea,i=If=Ea=0;i<n;){var s=Sn[i];Sn[i++]=null;var c=Sn[i];Sn[i++]=null;var m=Sn[i];Sn[i++]=null;var x=Sn[i];if(Sn[i++]=null,c!==null&&m!==null){var E=c.pending;E===null?m.next=m:(m.next=E.next,E.next=m),c.pending=m}x!==0&&Pg(s,m,x)}}function Yl(n,i,s,c){Sn[Ea++]=n,Sn[Ea++]=i,Sn[Ea++]=s,Sn[Ea++]=c,If|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Bf(n,i,s,c){return Yl(n,i,s,c),$l(n)}function Ni(n,i){return Yl(n,null,null,i),$l(n)}function Pg(n,i,s){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s);for(var m=!1,x=n.return;x!==null;)x.childLanes|=s,c=x.alternate,c!==null&&(c.childLanes|=s),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(m=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,m&&i!==null&&(m=31-Qe(s),n=x.hiddenUpdates,c=n[m],c===null?n[m]=[i]:c.push(i),i.lane=s|536870912),x):null}function $l(n){if(50<cs)throw cs=0,Gd=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ca={};function e2(n,i,s,c){this.tag=n,this.key=s,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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function un(n,i,s,c){return new e2(n,i,s,c)}function Hf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ur(n,i){var s=n.alternate;return s===null?(s=un(n.tag,i,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=i,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,i=n.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function Ug(n,i){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,i=s.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Gl(n,i,s,c,m,x){var E=0;if(c=n,typeof n=="function")Hf(n)&&(E=1);else if(typeof n=="string")E=a_(n,s,te.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=un(31,s,i,m),n.elementType=P,n.lanes=x,n;case C:return ki(s.children,m,x,i);case N:E=8,m|=24;break;case S:return n=un(12,s,i,m|2),n.elementType=S,n.lanes=x,n;case B:return n=un(13,s,i,m),n.elementType=B,n.lanes=x,n;case T:return n=un(19,s,i,m),n.elementType=T,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case _:E=10;break e;case A:E=9;break e;case k:E=11;break e;case O:E=14;break e;case U:E=16,c=null;break e}E=29,s=Error(a(130,n===null?"null":typeof n,"")),c=null}return i=un(E,s,i,m),i.elementType=n,i.type=c,i.lanes=x,i}function ki(n,i,s,c){return n=un(7,n,c,i),n.lanes=s,n}function Pf(n,i,s){return n=un(6,n,null,i),n.lanes=s,n}function Vg(n){var i=un(18,null,null,0);return i.stateNode=n,i}function Uf(n,i,s){return i=un(4,n.children!==null?n.children:[],n.key,i),i.lanes=s,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var qg=new WeakMap;function En(n,i){if(typeof n=="object"&&n!==null){var s=qg.get(n);return s!==void 0?s:(i={value:n,source:i,stack:qe(i)},qg.set(n,i),i)}return{value:n,source:i,stack:qe(i)}}var _a=[],Na=0,Xl=null,qo=0,Cn=[],_n=0,Ir=null,Fn=1,Yn="";function cr(n,i){_a[Na++]=qo,_a[Na++]=Xl,Xl=n,qo=i}function Fg(n,i,s){Cn[_n++]=Fn,Cn[_n++]=Yn,Cn[_n++]=Ir,Ir=n;var c=Fn;n=Yn;var m=32-Qe(c)-1;c&=~(1<<m),s+=1;var x=32-Qe(i)+m;if(30<x){var E=m-m%5;x=(c&(1<<E)-1).toString(32),c>>=E,m-=E,Fn=1<<32-Qe(i)+m|s<<m|c,Yn=x+n}else Fn=1<<x|s<<m|c,Yn=n}function Vf(n){n.return!==null&&(cr(n,1),Fg(n,1,0))}function qf(n){for(;n===Xl;)Xl=_a[--Na],_a[Na]=null,qo=_a[--Na],_a[Na]=null;for(;n===Ir;)Ir=Cn[--_n],Cn[_n]=null,Yn=Cn[--_n],Cn[_n]=null,Fn=Cn[--_n],Cn[_n]=null}function Yg(n,i){Cn[_n++]=Fn,Cn[_n++]=Yn,Cn[_n++]=Ir,Fn=i.id,Yn=i.overflow,Ir=n}var Mt=null,it=null,Pe=!1,Br=null,Nn=!1,Ff=Error(a(519));function Hr(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fo(En(i,n)),Ff}function $g(n){var i=n.stateNode,s=n.type,c=n.memoizedProps;switch(i[Et]=n,i[zt]=c,s){case"dialog":Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":case"embed":Ie("load",i);break;case"video":case"audio":for(s=0;s<ds.length;s++)Ie(ds[s],i);break;case"source":Ie("error",i);break;case"img":case"image":case"link":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"input":Ie("invalid",i),zl(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),sg(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||ux(i.textContent,s)?(c.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),c.onScroll!=null&&Ie("scroll",i),c.onScrollEnd!=null&&Ie("scrollend",i),c.onClick!=null&&(i.onclick=sr),i=!0):i=!1,i||Hr(n,!0)}function Gg(n){for(Mt=n.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Mt=Mt.return}}function ka(n){if(n!==Mt)return!1;if(!Pe)return Gg(n),Pe=!0,!1;var i=n.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||lh(n.type,n.memoizedProps)),s=!s),s&&it&&Hr(n),Gg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));it=xx(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));it=xx(n)}else i===27?(i=it,Jr(n.type)?(n=hh,hh=null,it=n):it=i):it=Mt?Mn(n.stateNode.nextSibling):null;return!0}function Mi(){it=Mt=null,Pe=!1}function Yf(){var n=Br;return n!==null&&(Qt===null?Qt=n:Qt.push.apply(Qt,n),Br=null),n}function Fo(n){Br===null?Br=[n]:Br.push(n)}var $f=z(null),Ti=null,fr=null;function Pr(n,i,s){R($f,i._currentValue),i._currentValue=s}function dr(n){n._currentValue=$f.current,$($f)}function Gf(n,i,s){for(;n!==null;){var c=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),n===s)break;n=n.return}}function Xf(n,i,s,c){var m=n.child;for(m!==null&&(m.return=n);m!==null;){var x=m.dependencies;if(x!==null){var E=m.child;x=x.firstContext;e:for(;x!==null;){var D=x;x=m;for(var G=0;G<i.length;G++)if(D.context===i[G]){x.lanes|=s,D=x.alternate,D!==null&&(D.lanes|=s),Gf(x.return,s,n),c||(E=null);break e}x=D.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(a(341));E.lanes|=s,x=E.alternate,x!==null&&(x.lanes|=s),Gf(E,s,n),E=null}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===n){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function Ma(n,i,s,c){n=null;for(var m=i,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var D=m.type;ln(m.pendingProps.value,E.value)||(n!==null?n.push(D):n=[D])}}else if(m===de.current){if(E=m.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(n!==null?n.push(ys):n=[ys])}m=m.return}n!==null&&Xf(i,n,s,c),i.flags|=262144}function Ql(n){for(n=n.firstContext;n!==null;){if(!ln(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ai(n){Ti=n,fr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Tt(n){return Xg(Ti,n)}function Kl(n,i){return Ti===null&&Ai(n),Xg(n,i)}function Xg(n,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},fr===null){if(n===null)throw Error(a(308));fr=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else fr=fr.next=i;return s}var t2=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(s,c){n.push(c)}};this.abort=function(){i.aborted=!0,n.forEach(function(s){return s()})}},n2=e.unstable_scheduleCallback,r2=e.unstable_NormalPriority,yt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qf(){return{controller:new t2,data:new Map,refCount:0}}function Yo(n){n.refCount--,n.refCount===0&&n2(r2,function(){n.controller.abort()})}var $o=null,Kf=0,Ta=0,Aa=null;function i2(n,i){if($o===null){var s=$o=[];Kf=0,Ta=Jd(),Aa={status:"pending",value:void 0,then:function(c){s.push(c)}}}return Kf++,i.then(Qg,Qg),i}function Qg(){if(--Kf===0&&$o!==null){Aa!==null&&(Aa.status="fulfilled");var n=$o;$o=null,Ta=0,Aa=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function a2(n,i){var s=[],c={status:"pending",value:null,reason:null,then:function(m){s.push(m)}};return n.then(function(){c.status="fulfilled",c.value=i;for(var m=0;m<s.length;m++)(0,s[m])(i)},function(m){for(c.status="rejected",c.reason=m,m=0;m<s.length;m++)(0,s[m])(void 0)}),c}var Kg=M.S;M.S=function(n,i){O0=Te(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i2(n,i),Kg!==null&&Kg(n,i)};var Ri=z(null);function Zf(){var n=Ri.current;return n!==null?n:tt.pooledCache}function Zl(n,i){i===null?R(Ri,Ri.current):R(Ri,i.pool)}function Zg(){var n=Zf();return n===null?null:{parent:yt._currentValue,pool:n}}var Ra=Error(a(460)),Wf=Error(a(474)),Wl=Error(a(542)),Jl={then:function(){}};function Wg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Jg(n,i,s){switch(s=n[s],s===void 0?n.push(i):s!==i&&(i.then(sr,sr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ty(n),n;default:if(typeof i.status=="string")i.then(sr,sr);else{if(n=tt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(c){if(i.status==="pending"){var m=i;m.status="fulfilled",m.value=c}},function(c){if(i.status==="pending"){var m=i;m.status="rejected",m.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ty(n),n}throw Oi=i,Ra}}function ji(n){try{var i=n._init;return i(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Oi=s,Ra):s}}var Oi=null;function ey(){if(Oi===null)throw Error(a(459));var n=Oi;return Oi=null,n}function ty(n){if(n===Ra||n===Wl)throw Error(a(483))}var ja=null,Go=0;function eu(n){var i=Go;return Go+=1,ja===null&&(ja=[]),Jg(ja,n,i)}function Xo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function tu(n,i){throw i.$$typeof===y?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ny(n){function i(W,K){if(n){var J=W.deletions;J===null?(W.deletions=[K],W.flags|=16):J.push(K)}}function s(W,K){if(!n)return null;for(;K!==null;)i(W,K),K=K.sibling;return null}function c(W){for(var K=new Map;W!==null;)W.key!==null?K.set(W.key,W):K.set(W.index,W),W=W.sibling;return K}function m(W,K){return W=ur(W,K),W.index=0,W.sibling=null,W}function x(W,K,J){return W.index=J,n?(J=W.alternate,J!==null?(J=J.index,J<K?(W.flags|=67108866,K):J):(W.flags|=67108866,K)):(W.flags|=1048576,K)}function E(W){return n&&W.alternate===null&&(W.flags|=67108866),W}function D(W,K,J,oe){return K===null||K.tag!==6?(K=Pf(J,W.mode,oe),K.return=W,K):(K=m(K,J),K.return=W,K)}function G(W,K,J,oe){var Se=J.type;return Se===C?ae(W,K,J.props.children,oe,J.key):K!==null&&(K.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===U&&ji(Se)===K.type)?(K=m(K,J.props),Xo(K,J),K.return=W,K):(K=Gl(J.type,J.key,J.props,null,W.mode,oe),Xo(K,J),K.return=W,K)}function ee(W,K,J,oe){return K===null||K.tag!==4||K.stateNode.containerInfo!==J.containerInfo||K.stateNode.implementation!==J.implementation?(K=Uf(J,W.mode,oe),K.return=W,K):(K=m(K,J.children||[]),K.return=W,K)}function ae(W,K,J,oe,Se){return K===null||K.tag!==7?(K=ki(J,W.mode,oe,Se),K.return=W,K):(K=m(K,J),K.return=W,K)}function se(W,K,J){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Pf(""+K,W.mode,J),K.return=W,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case v:return J=Gl(K.type,K.key,K.props,null,W.mode,J),Xo(J,K),J.return=W,J;case w:return K=Uf(K,W.mode,J),K.return=W,K;case U:return K=ji(K),se(W,K,J)}if(V(K)||Y(K))return K=ki(K,W.mode,J,null),K.return=W,K;if(typeof K.then=="function")return se(W,eu(K),J);if(K.$$typeof===_)return se(W,Kl(W,K),J);tu(W,K)}return null}function ne(W,K,J,oe){var Se=K!==null?K.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Se!==null?null:D(W,K,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===Se?G(W,K,J,oe):null;case w:return J.key===Se?ee(W,K,J,oe):null;case U:return J=ji(J),ne(W,K,J,oe)}if(V(J)||Y(J))return Se!==null?null:ae(W,K,J,oe,null);if(typeof J.then=="function")return ne(W,K,eu(J),oe);if(J.$$typeof===_)return ne(W,K,Kl(W,J),oe);tu(W,J)}return null}function re(W,K,J,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return W=W.get(J)||null,D(K,W,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return W=W.get(oe.key===null?J:oe.key)||null,G(K,W,oe,Se);case w:return W=W.get(oe.key===null?J:oe.key)||null,ee(K,W,oe,Se);case U:return oe=ji(oe),re(W,K,J,oe,Se)}if(V(oe)||Y(oe))return W=W.get(J)||null,ae(K,W,oe,Se,null);if(typeof oe.then=="function")return re(W,K,J,eu(oe),Se);if(oe.$$typeof===_)return re(W,K,J,Kl(K,oe),Se);tu(K,oe)}return null}function ye(W,K,J,oe){for(var Se=null,Ye=null,xe=K,je=K=0,He=null;xe!==null&&je<J.length;je++){xe.index>je?(He=xe,xe=null):He=xe.sibling;var $e=ne(W,xe,J[je],oe);if($e===null){xe===null&&(xe=He);break}n&&xe&&$e.alternate===null&&i(W,xe),K=x($e,K,je),Ye===null?Se=$e:Ye.sibling=$e,Ye=$e,xe=He}if(je===J.length)return s(W,xe),Pe&&cr(W,je),Se;if(xe===null){for(;je<J.length;je++)xe=se(W,J[je],oe),xe!==null&&(K=x(xe,K,je),Ye===null?Se=xe:Ye.sibling=xe,Ye=xe);return Pe&&cr(W,je),Se}for(xe=c(xe);je<J.length;je++)He=re(xe,W,je,J[je],oe),He!==null&&(n&&He.alternate!==null&&xe.delete(He.key===null?je:He.key),K=x(He,K,je),Ye===null?Se=He:Ye.sibling=He,Ye=He);return n&&xe.forEach(function(ii){return i(W,ii)}),Pe&&cr(W,je),Se}function ke(W,K,J,oe){if(J==null)throw Error(a(151));for(var Se=null,Ye=null,xe=K,je=K=0,He=null,$e=J.next();xe!==null&&!$e.done;je++,$e=J.next()){xe.index>je?(He=xe,xe=null):He=xe.sibling;var ii=ne(W,xe,$e.value,oe);if(ii===null){xe===null&&(xe=He);break}n&&xe&&ii.alternate===null&&i(W,xe),K=x(ii,K,je),Ye===null?Se=ii:Ye.sibling=ii,Ye=ii,xe=He}if($e.done)return s(W,xe),Pe&&cr(W,je),Se;if(xe===null){for(;!$e.done;je++,$e=J.next())$e=se(W,$e.value,oe),$e!==null&&(K=x($e,K,je),Ye===null?Se=$e:Ye.sibling=$e,Ye=$e);return Pe&&cr(W,je),Se}for(xe=c(xe);!$e.done;je++,$e=J.next())$e=re(xe,W,je,$e.value,oe),$e!==null&&(n&&$e.alternate!==null&&xe.delete($e.key===null?je:$e.key),K=x($e,K,je),Ye===null?Se=$e:Ye.sibling=$e,Ye=$e);return n&&xe.forEach(function(g_){return i(W,g_)}),Pe&&cr(W,je),Se}function et(W,K,J,oe){if(typeof J=="object"&&J!==null&&J.type===C&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case v:e:{for(var Se=J.key;K!==null;){if(K.key===Se){if(Se=J.type,Se===C){if(K.tag===7){s(W,K.sibling),oe=m(K,J.props.children),oe.return=W,W=oe;break e}}else if(K.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===U&&ji(Se)===K.type){s(W,K.sibling),oe=m(K,J.props),Xo(oe,J),oe.return=W,W=oe;break e}s(W,K);break}else i(W,K);K=K.sibling}J.type===C?(oe=ki(J.props.children,W.mode,oe,J.key),oe.return=W,W=oe):(oe=Gl(J.type,J.key,J.props,null,W.mode,oe),Xo(oe,J),oe.return=W,W=oe)}return E(W);case w:e:{for(Se=J.key;K!==null;){if(K.key===Se)if(K.tag===4&&K.stateNode.containerInfo===J.containerInfo&&K.stateNode.implementation===J.implementation){s(W,K.sibling),oe=m(K,J.children||[]),oe.return=W,W=oe;break e}else{s(W,K);break}else i(W,K);K=K.sibling}oe=Uf(J,W.mode,oe),oe.return=W,W=oe}return E(W);case U:return J=ji(J),et(W,K,J,oe)}if(V(J))return ye(W,K,J,oe);if(Y(J)){if(Se=Y(J),typeof Se!="function")throw Error(a(150));return J=Se.call(J),ke(W,K,J,oe)}if(typeof J.then=="function")return et(W,K,eu(J),oe);if(J.$$typeof===_)return et(W,K,Kl(W,J),oe);tu(W,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,K!==null&&K.tag===6?(s(W,K.sibling),oe=m(K,J),oe.return=W,W=oe):(s(W,K),oe=Pf(J,W.mode,oe),oe.return=W,W=oe),E(W)):s(W,K)}return function(W,K,J,oe){try{Go=0;var Se=et(W,K,J,oe);return ja=null,Se}catch(xe){if(xe===Ra||xe===Wl)throw xe;var Ye=un(29,xe,null,W.mode);return Ye.lanes=oe,Ye.return=W,Ye}}}var Di=ny(!0),ry=ny(!1),Ur=!1;function Jf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ed(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Vr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function qr(n,i,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Ge&2)!==0){var m=c.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),c.pending=i,i=$l(n),Pg(n,null,s),i}return Yl(n,c,i,s),$l(n)}function Qo(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,Cl(n,s)}}function td(n,i){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var E={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?m=x=E:x=x.next=E,s=s.next}while(s!==null);x===null?m=x=i:x=x.next=i}else m=x=i;s={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var nd=!1;function Ko(){if(nd){var n=Aa;if(n!==null)throw n}}function Zo(n,i,s,c){nd=!1;var m=n.updateQueue;Ur=!1;var x=m.firstBaseUpdate,E=m.lastBaseUpdate,D=m.shared.pending;if(D!==null){m.shared.pending=null;var G=D,ee=G.next;G.next=null,E===null?x=ee:E.next=ee,E=G;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,D=ae.lastBaseUpdate,D!==E&&(D===null?ae.firstBaseUpdate=ee:D.next=ee,ae.lastBaseUpdate=G))}if(x!==null){var se=m.baseState;E=0,ae=ee=G=null,D=x;do{var ne=D.lane&-536870913,re=ne!==D.lane;if(re?(Be&ne)===ne:(c&ne)===ne){ne!==0&&ne===Ta&&(nd=!0),ae!==null&&(ae=ae.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ye=n,ke=D;ne=i;var et=s;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){se=ye.call(et,se,ne);break e}se=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ne=typeof ye=="function"?ye.call(et,se,ne):ye,ne==null)break e;se=g({},se,ne);break e;case 2:Ur=!0}}ne=D.callback,ne!==null&&(n.flags|=64,re&&(n.flags|=8192),re=m.callbacks,re===null?m.callbacks=[ne]:re.push(ne))}else re={lane:ne,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ae===null?(ee=ae=re,G=se):ae=ae.next=re,E|=ne;if(D=D.next,D===null){if(D=m.shared.pending,D===null)break;re=D,D=re.next,re.next=null,m.lastBaseUpdate=re,m.shared.pending=null}}while(!0);ae===null&&(G=se),m.baseState=G,m.firstBaseUpdate=ee,m.lastBaseUpdate=ae,x===null&&(m.shared.lanes=0),Xr|=E,n.lanes=E,n.memoizedState=se}}function iy(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function ay(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)iy(s[n],i)}var Oa=z(null),nu=z(0);function oy(n,i){n=wr,R(nu,n),R(Oa,i),wr=n|i.baseLanes}function rd(){R(nu,wr),R(Oa,Oa.current)}function id(){wr=nu.current,$(Oa),$(nu)}var cn=z(null),kn=null;function Fr(n){var i=n.alternate;R(pt,pt.current&1),R(cn,n),kn===null&&(i===null||Oa.current!==null||i.memoizedState!==null)&&(kn=n)}function ad(n){R(pt,pt.current),R(cn,n),kn===null&&(kn=n)}function sy(n){n.tag===22?(R(pt,pt.current),R(cn,n),kn===null&&(kn=n)):Yr()}function Yr(){R(pt,pt.current),R(cn,cn.current)}function fn(n){$(cn),kn===n&&(kn=null),$(pt)}var pt=z(0);function ru(n){for(var i=n;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||fh(s)||dh(s)))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===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var hr=0,Re=null,We=null,xt=null,iu=!1,Da=!1,zi=!1,au=0,Wo=0,za=null,o2=0;function ft(){throw Error(a(321))}function od(n,i){if(i===null)return!1;for(var s=0;s<i.length&&s<n.length;s++)if(!ln(n[s],i[s]))return!1;return!0}function sd(n,i,s,c,m,x){return hr=x,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,M.H=n===null||n.memoizedState===null?Fy:Sd,zi=!1,x=s(c,m),zi=!1,Da&&(x=uy(i,s,c,m)),ly(n),x}function ly(n){M.H=ts;var i=We!==null&&We.next!==null;if(hr=0,xt=We=Re=null,iu=!1,Wo=0,za=null,i)throw Error(a(300));n===null||vt||(n=n.dependencies,n!==null&&Ql(n)&&(vt=!0))}function uy(n,i,s,c){Re=n;var m=0;do{if(Da&&(za=null),Wo=0,Da=!1,25<=m)throw Error(a(301));if(m+=1,xt=We=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}M.H=Yy,x=i(s,c)}while(Da);return x}function s2(){var n=M.H,i=n.useState()[0];return i=typeof i.then=="function"?Jo(i):i,n=n.useState()[0],(We!==null?We.memoizedState:null)!==n&&(Re.flags|=1024),i}function ld(){var n=au!==0;return au=0,n}function ud(n,i,s){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~s}function cd(n){if(iu){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}iu=!1}hr=0,xt=We=Re=null,Da=!1,Wo=au=0,za=null}function Pt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Re.memoizedState=xt=n:xt=xt.next=n,xt}function mt(){if(We===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=We.next;var i=xt===null?Re.memoizedState:xt.next;if(i!==null)xt=i,We=n;else{if(n===null)throw Re.alternate===null?Error(a(467)):Error(a(310));We=n,n={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},xt===null?Re.memoizedState=xt=n:xt=xt.next=n}return xt}function ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(n){var i=Wo;return Wo+=1,za===null&&(za=[]),n=Jg(za,n,i),i=Re,(xt===null?i.memoizedState:xt.next)===null&&(i=i.alternate,M.H=i===null||i.memoizedState===null?Fy:Sd),n}function su(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Jo(n);if(n.$$typeof===_)return Tt(n)}throw Error(a(438,String(n)))}function fd(n){var i=null,s=Re.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=Re.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(m){return m.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=ou(),Re.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(n),c=0;c<n;c++)s[c]=F;return i.index++,s}function pr(n,i){return typeof i=="function"?i(n):i}function lu(n){var i=mt();return dd(i,We,n)}function dd(n,i,s){var c=n.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var m=n.baseQueue,x=c.pending;if(x!==null){if(m!==null){var E=m.next;m.next=x.next,x.next=E}i.baseQueue=m=x,c.pending=null}if(x=n.baseState,m===null)n.memoizedState=x;else{i=m.next;var D=E=null,G=null,ee=i,ae=!1;do{var se=ee.lane&-536870913;if(se!==ee.lane?(Be&se)===se:(hr&se)===se){var ne=ee.revertLane;if(ne===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),se===Ta&&(ae=!0);else if((hr&ne)===ne){ee=ee.next,ne===Ta&&(ae=!0);continue}else se={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(D=G=se,E=x):G=G.next=se,Re.lanes|=ne,Xr|=ne;se=ee.action,zi&&s(x,se),x=ee.hasEagerState?ee.eagerState:s(x,se)}else ne={lane:se,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(D=G=ne,E=x):G=G.next=ne,Re.lanes|=se,Xr|=se;ee=ee.next}while(ee!==null&&ee!==i);if(G===null?E=x:G.next=D,!ln(x,n.memoizedState)&&(vt=!0,ae&&(s=Aa,s!==null)))throw s;n.memoizedState=x,n.baseState=E,n.baseQueue=G,c.lastRenderedState=x}return m===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function hd(n){var i=mt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=n;var c=s.dispatch,m=s.pending,x=i.memoizedState;if(m!==null){s.pending=null;var E=m=m.next;do x=n(x,E.action),E=E.next;while(E!==m);ln(x,i.memoizedState)||(vt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),s.lastRenderedState=x}return[x,c]}function cy(n,i,s){var c=Re,m=mt(),x=Pe;if(x){if(s===void 0)throw Error(a(407));s=s()}else s=i();var E=!ln((We||m).memoizedState,s);if(E&&(m.memoizedState=s,vt=!0),m=m.queue,gd(hy.bind(null,c,m,n),[n]),m.getSnapshot!==i||E||xt!==null&&xt.memoizedState.tag&1){if(c.flags|=2048,La(9,{destroy:void 0},dy.bind(null,c,m,s,i),null),tt===null)throw Error(a(349));x||(hr&127)!==0||fy(c,i,s)}return s}function fy(n,i,s){n.flags|=16384,n={getSnapshot:i,value:s},i=Re.updateQueue,i===null?(i=ou(),Re.updateQueue=i,i.stores=[n]):(s=i.stores,s===null?i.stores=[n]:s.push(n))}function dy(n,i,s,c){i.value=s,i.getSnapshot=c,py(i)&&my(n)}function hy(n,i,s){return s(function(){py(i)&&my(n)})}function py(n){var i=n.getSnapshot;n=n.value;try{var s=i();return!ln(n,s)}catch{return!0}}function my(n){var i=Ni(n,2);i!==null&&Kt(i,n,2)}function pd(n){var i=Pt();if(typeof n=="function"){var s=n;if(n=s(),zi){Dt(!0);try{s()}finally{Dt(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:n},i}function gy(n,i,s,c){return n.baseState=s,dd(n,We,typeof c=="function"?c:pr)}function l2(n,i,s,c,m){if(fu(n))throw Error(a(485));if(n=i.action,n!==null){var x={payload:m,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};M.T!==null?s(!0):x.isTransition=!1,c(x),s=i.pending,s===null?(x.next=i.pending=x,yy(i,x)):(x.next=s.next,i.pending=s.next=x)}}function yy(n,i){var s=i.action,c=i.payload,m=n.state;if(i.isTransition){var x=M.T,E={};M.T=E;try{var D=s(m,c),G=M.S;G!==null&&G(E,D),xy(n,i,D)}catch(ee){md(n,i,ee)}finally{x!==null&&E.types!==null&&(x.types=E.types),M.T=x}}else try{x=s(m,c),xy(n,i,x)}catch(ee){md(n,i,ee)}}function xy(n,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){vy(n,i,c)},function(c){return md(n,i,c)}):vy(n,i,s)}function vy(n,i,s){i.status="fulfilled",i.value=s,by(i),n.state=s,i=n.pending,i!==null&&(s=i.next,s===i?n.pending=null:(s=s.next,i.next=s,yy(n,s)))}function md(n,i,s){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,by(i),i=i.next;while(i!==c)}n.action=null}function by(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function wy(n,i){return i}function Sy(n,i){if(Pe){var s=tt.formState;if(s!==null){e:{var c=Re;if(Pe){if(it){t:{for(var m=it,x=Nn;m.nodeType!==8;){if(!x){m=null;break t}if(m=Mn(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){it=Mn(m.nextSibling),c=m.data==="F!";break e}}Hr(c)}c=!1}c&&(i=s[0])}}return s=Pt(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wy,lastRenderedState:i},s.queue=c,s=Uy.bind(null,Re,c),c.dispatch=s,c=pd(!1),x=wd.bind(null,Re,!1,c.queue),c=Pt(),m={state:i,dispatch:null,action:n,pending:null},c.queue=m,s=l2.bind(null,Re,m,x,s),m.dispatch=s,c.memoizedState=n,[i,s,!1]}function Ey(n){var i=mt();return Cy(i,We,n)}function Cy(n,i,s){if(i=dd(n,i,wy)[0],n=lu(pr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Jo(i)}catch(E){throw E===Ra?Wl:E}else c=i;i=mt();var m=i.queue,x=m.dispatch;return s!==i.memoizedState&&(Re.flags|=2048,La(9,{destroy:void 0},u2.bind(null,m,s),null)),[c,x,n]}function u2(n,i){n.action=i}function _y(n){var i=mt(),s=We;if(s!==null)return Cy(i,s,n);mt(),i=i.memoizedState,s=mt();var c=s.queue.dispatch;return s.memoizedState=n,[i,c,!1]}function La(n,i,s,c){return n={tag:n,create:s,deps:c,inst:i,next:null},i=Re.updateQueue,i===null&&(i=ou(),Re.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=n.next=n:(c=s.next,s.next=n,n.next=c,i.lastEffect=n),n}function Ny(){return mt().memoizedState}function uu(n,i,s,c){var m=Pt();Re.flags|=n,m.memoizedState=La(1|i,{destroy:void 0},s,c===void 0?null:c)}function cu(n,i,s,c){var m=mt();c=c===void 0?null:c;var x=m.memoizedState.inst;We!==null&&c!==null&&od(c,We.memoizedState.deps)?m.memoizedState=La(i,x,s,c):(Re.flags|=n,m.memoizedState=La(1|i,x,s,c))}function ky(n,i){uu(8390656,8,n,i)}function gd(n,i){cu(2048,8,n,i)}function c2(n){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=ou(),Re.updateQueue=i,i.events=[n];else{var s=i.events;s===null?i.events=[n]:s.push(n)}}function My(n){var i=mt().memoizedState;return c2({ref:i,nextImpl:n}),function(){if((Ge&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Ty(n,i){return cu(4,2,n,i)}function Ay(n,i){return cu(4,4,n,i)}function Ry(n,i){if(typeof i=="function"){n=n();var s=i(n);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function jy(n,i,s){s=s!=null?s.concat([n]):null,cu(4,4,Ry.bind(null,i,n),s)}function yd(){}function Oy(n,i){var s=mt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&od(i,c[1])?c[0]:(s.memoizedState=[n,i],n)}function Dy(n,i){var s=mt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&od(i,c[1]))return c[0];if(c=n(),zi){Dt(!0);try{n()}finally{Dt(!1)}}return s.memoizedState=[c,i],c}function xd(n,i,s){return s===void 0||(hr&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=s,n=z0(),Re.lanes|=n,Xr|=n,s)}function zy(n,i,s,c){return ln(s,i)?s:Oa.current!==null?(n=xd(n,s,c),ln(n,i)||(vt=!0),n):(hr&42)===0||(hr&1073741824)!==0&&(Be&261930)===0?(vt=!0,n.memoizedState=s):(n=z0(),Re.lanes|=n,Xr|=n,i)}function Ly(n,i,s,c,m){var x=q.p;q.p=x!==0&&8>x?x:8;var E=M.T,D={};M.T=D,wd(n,!1,i,s);try{var G=m(),ee=M.S;if(ee!==null&&ee(D,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ae=a2(G,c);es(n,i,ae,pn(n))}else es(n,i,c,pn(n))}catch(se){es(n,i,{then:function(){},status:"rejected",reason:se},pn())}finally{q.p=x,E!==null&&D.types!==null&&(E.types=D.types),M.T=E}}function f2(){}function vd(n,i,s,c){if(n.tag!==5)throw Error(a(476));var m=Iy(n).queue;Ly(n,m,i,X,s===null?f2:function(){return By(n),s(c)})}function Iy(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:X},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function By(n){var i=Iy(n);i.next===null&&(i=n.alternate.memoizedState),es(n,i.next.queue,{},pn())}function bd(){return Tt(ys)}function Hy(){return mt().memoizedState}function Py(){return mt().memoizedState}function d2(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=pn();n=Vr(s);var c=qr(i,n,s);c!==null&&(Kt(c,i,s),Qo(c,i,s)),i={cache:Qf()},n.payload=i;return}i=i.return}}function h2(n,i,s){var c=pn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},fu(n)?Vy(i,s):(s=Bf(n,i,s,c),s!==null&&(Kt(s,n,c),qy(s,i,c)))}function Uy(n,i,s){var c=pn();es(n,i,s,c)}function es(n,i,s,c){var m={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(fu(n))Vy(i,m);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var E=i.lastRenderedState,D=x(E,s);if(m.hasEagerState=!0,m.eagerState=D,ln(D,E))return Yl(n,i,m,0),tt===null&&Fl(),!1}catch{}if(s=Bf(n,i,m,c),s!==null)return Kt(s,n,c),qy(s,i,c),!0}return!1}function wd(n,i,s,c){if(c={lane:2,revertLane:Jd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},fu(n)){if(i)throw Error(a(479))}else i=Bf(n,s,c,2),i!==null&&Kt(i,n,2)}function fu(n){var i=n.alternate;return n===Re||i!==null&&i===Re}function Vy(n,i){Da=iu=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function qy(n,i,s){if((s&4194048)!==0){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,Cl(n,s)}}var ts={readContext:Tt,use:su,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};ts.useEffectEvent=ft;var Fy={readContext:Tt,use:su,useCallback:function(n,i){return Pt().memoizedState=[n,i===void 0?null:i],n},useContext:Tt,useEffect:ky,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,uu(4194308,4,Ry.bind(null,i,n),s)},useLayoutEffect:function(n,i){return uu(4194308,4,n,i)},useInsertionEffect:function(n,i){uu(4,2,n,i)},useMemo:function(n,i){var s=Pt();i=i===void 0?null:i;var c=n();if(zi){Dt(!0);try{n()}finally{Dt(!1)}}return s.memoizedState=[c,i],c},useReducer:function(n,i,s){var c=Pt();if(s!==void 0){var m=s(i);if(zi){Dt(!0);try{s(i)}finally{Dt(!1)}}}else m=i;return c.memoizedState=c.baseState=m,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:m},c.queue=n,n=n.dispatch=h2.bind(null,Re,n),[c.memoizedState,n]},useRef:function(n){var i=Pt();return n={current:n},i.memoizedState=n},useState:function(n){n=pd(n);var i=n.queue,s=Uy.bind(null,Re,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:yd,useDeferredValue:function(n,i){var s=Pt();return xd(s,n,i)},useTransition:function(){var n=pd(!1);return n=Ly.bind(null,Re,n.queue,!0,!1),Pt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var c=Re,m=Pt();if(Pe){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),tt===null)throw Error(a(349));(Be&127)!==0||fy(c,i,s)}m.memoizedState=s;var x={value:s,getSnapshot:i};return m.queue=x,ky(hy.bind(null,c,x,n),[n]),c.flags|=2048,La(9,{destroy:void 0},dy.bind(null,c,x,s,i),null),s},useId:function(){var n=Pt(),i=tt.identifierPrefix;if(Pe){var s=Yn,c=Fn;s=(c&~(1<<32-Qe(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=au++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=o2++,i="_"+i+"r_"+s.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:bd,useFormState:Sy,useActionState:Sy,useOptimistic:function(n){var i=Pt();i.memoizedState=i.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=wd.bind(null,Re,!0,s),s.dispatch=i,[n,i]},useMemoCache:fd,useCacheRefresh:function(){return Pt().memoizedState=d2.bind(null,Re)},useEffectEvent:function(n){var i=Pt(),s={impl:n};return i.memoizedState=s,function(){if((Ge&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Sd={readContext:Tt,use:su,useCallback:Oy,useContext:Tt,useEffect:gd,useImperativeHandle:jy,useInsertionEffect:Ty,useLayoutEffect:Ay,useMemo:Dy,useReducer:lu,useRef:Ny,useState:function(){return lu(pr)},useDebugValue:yd,useDeferredValue:function(n,i){var s=mt();return zy(s,We.memoizedState,n,i)},useTransition:function(){var n=lu(pr)[0],i=mt().memoizedState;return[typeof n=="boolean"?n:Jo(n),i]},useSyncExternalStore:cy,useId:Hy,useHostTransitionStatus:bd,useFormState:Ey,useActionState:Ey,useOptimistic:function(n,i){var s=mt();return gy(s,We,n,i)},useMemoCache:fd,useCacheRefresh:Py};Sd.useEffectEvent=My;var Yy={readContext:Tt,use:su,useCallback:Oy,useContext:Tt,useEffect:gd,useImperativeHandle:jy,useInsertionEffect:Ty,useLayoutEffect:Ay,useMemo:Dy,useReducer:hd,useRef:Ny,useState:function(){return hd(pr)},useDebugValue:yd,useDeferredValue:function(n,i){var s=mt();return We===null?xd(s,n,i):zy(s,We.memoizedState,n,i)},useTransition:function(){var n=hd(pr)[0],i=mt().memoizedState;return[typeof n=="boolean"?n:Jo(n),i]},useSyncExternalStore:cy,useId:Hy,useHostTransitionStatus:bd,useFormState:_y,useActionState:_y,useOptimistic:function(n,i){var s=mt();return We!==null?gy(s,We,n,i):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:fd,useCacheRefresh:Py};Yy.useEffectEvent=My;function Ed(n,i,s,c){i=n.memoizedState,s=s(c,i),s=s==null?i:g({},i,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Cd={enqueueSetState:function(n,i,s){n=n._reactInternals;var c=pn(),m=Vr(c);m.payload=i,s!=null&&(m.callback=s),i=qr(n,m,c),i!==null&&(Kt(i,n,c),Qo(i,n,c))},enqueueReplaceState:function(n,i,s){n=n._reactInternals;var c=pn(),m=Vr(c);m.tag=1,m.payload=i,s!=null&&(m.callback=s),i=qr(n,m,c),i!==null&&(Kt(i,n,c),Qo(i,n,c))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var s=pn(),c=Vr(s);c.tag=2,i!=null&&(c.callback=i),i=qr(n,c,s),i!==null&&(Kt(i,n,s),Qo(i,n,s))}};function $y(n,i,s,c,m,x,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,x,E):i.prototype&&i.prototype.isPureReactComponent?!Uo(s,c)||!Uo(m,x):!0}function Gy(n,i,s,c){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==n&&Cd.enqueueReplaceState(i,i.state,null)}function Li(n,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}if(n=n.defaultProps){s===i&&(s=g({},s));for(var m in n)s[m]===void 0&&(s[m]=n[m])}return s}function Xy(n){ql(n)}function Qy(n){console.error(n)}function Ky(n){ql(n)}function du(n,i){try{var s=n.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function Zy(n,i,s){try{var c=n.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function _d(n,i,s){return s=Vr(s),s.tag=3,s.payload={element:null},s.callback=function(){du(n,i)},s}function Wy(n){return n=Vr(n),n.tag=3,n}function Jy(n,i,s,c){var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;n.payload=function(){return m(x)},n.callback=function(){Zy(i,s,c)}}var E=s.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){Zy(i,s,c),typeof m!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})})}function p2(n,i,s,c,m){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Ma(i,s,m,!0),s=cn.current,s!==null){switch(s.tag){case 31:case 13:return kn===null?Cu():s.alternate===null&&dt===0&&(dt=3),s.flags&=-257,s.flags|=65536,s.lanes=m,c===Jl?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),Kd(n,c,m)),!1;case 22:return s.flags|=65536,c===Jl?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),Kd(n,c,m)),!1}throw Error(a(435,s.tag))}return Kd(n,c,m),Cu(),!1}if(Pe)return i=cn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=m,c!==Ff&&(n=Error(a(422),{cause:c}),Fo(En(n,s)))):(c!==Ff&&(i=Error(a(423),{cause:c}),Fo(En(i,s))),n=n.current.alternate,n.flags|=65536,m&=-m,n.lanes|=m,c=En(c,s),m=_d(n.stateNode,c,m),td(n,m),dt!==4&&(dt=2)),!1;var x=Error(a(520),{cause:c});if(x=En(x,s),us===null?us=[x]:us.push(x),dt!==4&&(dt=2),i===null)return!0;c=En(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,n=m&-m,s.lanes|=n,n=_d(s.stateNode,c,n),td(s,n),!1;case 1:if(i=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Qr===null||!Qr.has(x))))return s.flags|=65536,m&=-m,s.lanes|=m,m=Wy(m),Jy(m,n,s,c),td(s,m),!1}s=s.return}while(s!==null);return!1}var Nd=Error(a(461)),vt=!1;function At(n,i,s,c){i.child=n===null?ry(i,null,s,c):Di(i,n.child,s,c)}function e0(n,i,s,c,m){s=s.render;var x=i.ref;if("ref"in c){var E={};for(var D in c)D!=="ref"&&(E[D]=c[D])}else E=c;return Ai(i),c=sd(n,i,s,E,x,m),D=ld(),n!==null&&!vt?(ud(n,i,m),mr(n,i,m)):(Pe&&D&&Vf(i),i.flags|=1,At(n,i,c,m),i.child)}function t0(n,i,s,c,m){if(n===null){var x=s.type;return typeof x=="function"&&!Hf(x)&&x.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=x,n0(n,i,x,c,m)):(n=Gl(s.type,null,c,i,i.mode,m),n.ref=i.ref,n.return=i,i.child=n)}if(x=n.child,!Dd(n,m)){var E=x.memoizedProps;if(s=s.compare,s=s!==null?s:Uo,s(E,c)&&n.ref===i.ref)return mr(n,i,m)}return i.flags|=1,n=ur(x,c),n.ref=i.ref,n.return=i,i.child=n}function n0(n,i,s,c,m){if(n!==null){var x=n.memoizedProps;if(Uo(x,c)&&n.ref===i.ref)if(vt=!1,i.pendingProps=c=x,Dd(n,m))(n.flags&131072)!==0&&(vt=!0);else return i.lanes=n.lanes,mr(n,i,m)}return kd(n,i,s,c,m)}function r0(n,i,s,c){var m=c.children,x=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,n!==null){for(c=i.child=n.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~x}else c=0,i.child=null;return i0(n,i,x,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Zl(i,x!==null?x.cachePool:null),x!==null?oy(i,x):rd(),sy(i);else return c=i.lanes=536870912,i0(n,i,x!==null?x.baseLanes|s:s,s,c)}else x!==null?(Zl(i,x.cachePool),oy(i,x),Yr(),i.memoizedState=null):(n!==null&&Zl(i,null),rd(),Yr());return At(n,i,m,s),i.child}function ns(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function i0(n,i,s,c,m){var x=Zf();return x=x===null?null:{parent:yt._currentValue,pool:x},i.memoizedState={baseLanes:s,cachePool:x},n!==null&&Zl(i,null),rd(),sy(i),n!==null&&Ma(n,i,c,!0),i.childLanes=m,null}function hu(n,i){return i=mu({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function a0(n,i,s){return Di(i,n.child,null,s),n=hu(i,i.pendingProps),n.flags|=2,fn(i),i.memoizedState=null,n}function m2(n,i,s){var c=i.pendingProps,m=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Pe){if(c.mode==="hidden")return n=hu(i,c),i.lanes=536870912,ns(null,n);if(ad(i),(n=it)?(n=yx(n,Nn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ir!==null?{id:Fn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},s=Vg(n),s.return=i,i.child=s,Mt=i,it=null)):n=null,n===null)throw Hr(i);return i.lanes=536870912,null}return hu(i,c)}var x=n.memoizedState;if(x!==null){var E=x.dehydrated;if(ad(i),m)if(i.flags&256)i.flags&=-257,i=a0(n,i,s);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(vt||Ma(n,i,s,!1),m=(s&n.childLanes)!==0,vt||m){if(c=tt,c!==null&&(E=_l(c,s),E!==0&&E!==x.retryLane))throw x.retryLane=E,Ni(n,E),Kt(c,n,E),Nd;Cu(),i=a0(n,i,s)}else n=x.treeContext,it=Mn(E.nextSibling),Mt=i,Pe=!0,Br=null,Nn=!1,n!==null&&Yg(i,n),i=hu(i,c),i.flags|=4096;return i}return n=ur(n.child,{mode:c.mode,children:c.children}),n.ref=i.ref,i.child=n,n.return=i,n}function pu(n,i){var s=i.ref;if(s===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(n===null||n.ref!==s)&&(i.flags|=4194816)}}function kd(n,i,s,c,m){return Ai(i),s=sd(n,i,s,c,void 0,m),c=ld(),n!==null&&!vt?(ud(n,i,m),mr(n,i,m)):(Pe&&c&&Vf(i),i.flags|=1,At(n,i,s,m),i.child)}function o0(n,i,s,c,m,x){return Ai(i),i.updateQueue=null,s=uy(i,c,s,m),ly(n),c=ld(),n!==null&&!vt?(ud(n,i,x),mr(n,i,x)):(Pe&&c&&Vf(i),i.flags|=1,At(n,i,s,x),i.child)}function s0(n,i,s,c,m){if(Ai(i),i.stateNode===null){var x=Ca,E=s.contextType;typeof E=="object"&&E!==null&&(x=Tt(E)),x=new s(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Cd,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},Jf(i),E=s.contextType,x.context=typeof E=="object"&&E!==null?Tt(E):Ca,x.state=i.memoizedState,E=s.getDerivedStateFromProps,typeof E=="function"&&(Ed(i,s,E,c),x.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&Cd.enqueueReplaceState(x,x.state,null),Zo(i,c,x,m),Ko(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(n===null){x=i.stateNode;var D=i.memoizedProps,G=Li(s,D);x.props=G;var ee=x.context,ae=s.contextType;E=Ca,typeof ae=="object"&&ae!==null&&(E=Tt(ae));var se=s.getDerivedStateFromProps;ae=typeof se=="function"||typeof x.getSnapshotBeforeUpdate=="function",D=i.pendingProps!==D,ae||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(D||ee!==E)&&Gy(i,x,c,E),Ur=!1;var ne=i.memoizedState;x.state=ne,Zo(i,c,x,m),Ko(),ee=i.memoizedState,D||ne!==ee||Ur?(typeof se=="function"&&(Ed(i,s,se,c),ee=i.memoizedState),(G=Ur||$y(i,s,G,c,ne,ee,E))?(ae||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=ee),x.props=c,x.state=ee,x.context=E,c=G):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,ed(n,i),E=i.memoizedProps,ae=Li(s,E),x.props=ae,se=i.pendingProps,ne=x.context,ee=s.contextType,G=Ca,typeof ee=="object"&&ee!==null&&(G=Tt(ee)),D=s.getDerivedStateFromProps,(ee=typeof D=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==se||ne!==G)&&Gy(i,x,c,G),Ur=!1,ne=i.memoizedState,x.state=ne,Zo(i,c,x,m),Ko();var re=i.memoizedState;E!==se||ne!==re||Ur||n!==null&&n.dependencies!==null&&Ql(n.dependencies)?(typeof D=="function"&&(Ed(i,s,D,c),re=i.memoizedState),(ae=Ur||$y(i,s,ae,c,ne,re,G)||n!==null&&n.dependencies!==null&&Ql(n.dependencies))?(ee||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,re,G),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,re,G)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=re),x.props=c,x.state=re,x.context=G,c=ae):(typeof x.componentDidUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),c=!1)}return x=c,pu(n,i),c=(i.flags&128)!==0,x||c?(x=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,n!==null&&c?(i.child=Di(i,n.child,null,m),i.child=Di(i,null,s,m)):At(n,i,s,m),i.memoizedState=x.state,n=i.child):n=mr(n,i,m),n}function l0(n,i,s,c){return Mi(),i.flags|=256,At(n,i,s,c),i.child}var Md={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Td(n){return{baseLanes:n,cachePool:Zg()}}function Ad(n,i,s){return n=n!==null?n.childLanes&~s:0,i&&(n|=hn),n}function u0(n,i,s){var c=i.pendingProps,m=!1,x=(i.flags&128)!==0,E;if((E=x)||(E=n!==null&&n.memoizedState===null?!1:(pt.current&2)!==0),E&&(m=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,n===null){if(Pe){if(m?Fr(i):Yr(),(n=it)?(n=yx(n,Nn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ir!==null?{id:Fn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},s=Vg(n),s.return=i,i.child=s,Mt=i,it=null)):n=null,n===null)throw Hr(i);return dh(n)?i.lanes=32:i.lanes=536870912,null}var D=c.children;return c=c.fallback,m?(Yr(),m=i.mode,D=mu({mode:"hidden",children:D},m),c=ki(c,m,s,null),D.return=i,c.return=i,D.sibling=c,i.child=D,c=i.child,c.memoizedState=Td(s),c.childLanes=Ad(n,E,s),i.memoizedState=Md,ns(null,c)):(Fr(i),Rd(i,D))}var G=n.memoizedState;if(G!==null&&(D=G.dehydrated,D!==null)){if(x)i.flags&256?(Fr(i),i.flags&=-257,i=jd(n,i,s)):i.memoizedState!==null?(Yr(),i.child=n.child,i.flags|=128,i=null):(Yr(),D=c.fallback,m=i.mode,c=mu({mode:"visible",children:c.children},m),D=ki(D,m,s,null),D.flags|=2,c.return=i,D.return=i,c.sibling=D,i.child=c,Di(i,n.child,null,s),c=i.child,c.memoizedState=Td(s),c.childLanes=Ad(n,E,s),i.memoizedState=Md,i=ns(null,c));else if(Fr(i),dh(D)){if(E=D.nextSibling&&D.nextSibling.dataset,E)var ee=E.dgst;E=ee,c=Error(a(419)),c.stack="",c.digest=E,Fo({value:c,source:null,stack:null}),i=jd(n,i,s)}else if(vt||Ma(n,i,s,!1),E=(s&n.childLanes)!==0,vt||E){if(E=tt,E!==null&&(c=_l(E,s),c!==0&&c!==G.retryLane))throw G.retryLane=c,Ni(n,c),Kt(E,n,c),Nd;fh(D)||Cu(),i=jd(n,i,s)}else fh(D)?(i.flags|=192,i.child=n.child,i=null):(n=G.treeContext,it=Mn(D.nextSibling),Mt=i,Pe=!0,Br=null,Nn=!1,n!==null&&Yg(i,n),i=Rd(i,c.children),i.flags|=4096);return i}return m?(Yr(),D=c.fallback,m=i.mode,G=n.child,ee=G.sibling,c=ur(G,{mode:"hidden",children:c.children}),c.subtreeFlags=G.subtreeFlags&65011712,ee!==null?D=ur(ee,D):(D=ki(D,m,s,null),D.flags|=2),D.return=i,c.return=i,c.sibling=D,i.child=c,ns(null,c),c=i.child,D=n.child.memoizedState,D===null?D=Td(s):(m=D.cachePool,m!==null?(G=yt._currentValue,m=m.parent!==G?{parent:G,pool:G}:m):m=Zg(),D={baseLanes:D.baseLanes|s,cachePool:m}),c.memoizedState=D,c.childLanes=Ad(n,E,s),i.memoizedState=Md,ns(n.child,c)):(Fr(i),s=n.child,n=s.sibling,s=ur(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,n!==null&&(E=i.deletions,E===null?(i.deletions=[n],i.flags|=16):E.push(n)),i.child=s,i.memoizedState=null,s)}function Rd(n,i){return i=mu({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function mu(n,i){return n=un(22,n,null,i),n.lanes=0,n}function jd(n,i,s){return Di(i,n.child,null,s),n=Rd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function c0(n,i,s){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i),Gf(n.return,i,s)}function Od(n,i,s,c,m,x){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:m,treeForkCount:x}:(E.isBackwards=i,E.rendering=null,E.renderingStartTime=0,E.last=c,E.tail=s,E.tailMode=m,E.treeForkCount=x)}function f0(n,i,s){var c=i.pendingProps,m=c.revealOrder,x=c.tail;c=c.children;var E=pt.current,D=(E&2)!==0;if(D?(E=E&1|2,i.flags|=128):E&=1,R(pt,E),At(n,i,c,s),c=Pe?qo:0,!D&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&c0(n,s,i);else if(n.tag===19)c0(n,s,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(m){case"forwards":for(s=i.child,m=null;s!==null;)n=s.alternate,n!==null&&ru(n)===null&&(m=s),s=s.sibling;s=m,s===null?(m=i.child,i.child=null):(m=s.sibling,s.sibling=null),Od(i,!1,m,s,x,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,m=i.child,i.child=null;m!==null;){if(n=m.alternate,n!==null&&ru(n)===null){i.child=m;break}n=m.sibling,m.sibling=s,s=m,m=n}Od(i,!0,s,null,x,c);break;case"together":Od(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function mr(n,i,s){if(n!==null&&(i.dependencies=n.dependencies),Xr|=i.lanes,(s&i.childLanes)===0)if(n!==null){if(Ma(n,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,s=ur(n,n.pendingProps),i.child=s,s.return=i;n.sibling!==null;)n=n.sibling,s=s.sibling=ur(n,n.pendingProps),s.return=i;s.sibling=null}return i.child}function Dd(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Ql(n)))}function g2(n,i,s){switch(i.tag){case 3:le(i,i.stateNode.containerInfo),Pr(i,yt,n.memoizedState.cache),Mi();break;case 27:case 5:we(i);break;case 4:le(i,i.stateNode.containerInfo);break;case 10:Pr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ad(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Fr(i),i.flags|=128,null):(s&i.child.childLanes)!==0?u0(n,i,s):(Fr(i),n=mr(n,i,s),n!==null?n.sibling:null);Fr(i);break;case 19:var m=(n.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Ma(n,i,s,!1),c=(s&i.childLanes)!==0),m){if(c)return f0(n,i,s);i.flags|=128}if(m=i.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),R(pt,pt.current),c)break;return null;case 22:return i.lanes=0,r0(n,i,s,i.pendingProps);case 24:Pr(i,yt,n.memoizedState.cache)}return mr(n,i,s)}function d0(n,i,s){if(n!==null)if(n.memoizedProps!==i.pendingProps)vt=!0;else{if(!Dd(n,s)&&(i.flags&128)===0)return vt=!1,g2(n,i,s);vt=(n.flags&131072)!==0}else vt=!1,Pe&&(i.flags&1048576)!==0&&Fg(i,qo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(n=ji(i.elementType),i.type=n,typeof n=="function")Hf(n)?(c=Li(n,c),i.tag=1,i=s0(null,i,n,c,s)):(i.tag=0,i=kd(null,i,n,c,s));else{if(n!=null){var m=n.$$typeof;if(m===k){i.tag=11,i=e0(null,i,n,c,s);break e}else if(m===O){i.tag=14,i=t0(null,i,n,c,s);break e}}throw i=L(n)||n,Error(a(306,i,""))}}return i;case 0:return kd(n,i,i.type,i.pendingProps,s);case 1:return c=i.type,m=Li(c,i.pendingProps),s0(n,i,c,m,s);case 3:e:{if(le(i,i.stateNode.containerInfo),n===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;m=x.element,ed(n,i),Zo(i,c,null,s);var E=i.memoizedState;if(c=E.cache,Pr(i,yt,c),c!==x.cache&&Xf(i,[yt],s,!0),Ko(),c=E.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=l0(n,i,c,s);break e}else if(c!==m){m=En(Error(a(424)),i),Fo(m),i=l0(n,i,c,s);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,it=Mn(n.firstChild),Mt=i,Pe=!0,Br=null,Nn=!0,s=ry(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Mi(),c===m){i=mr(n,i,s);break e}At(n,i,c,s)}i=i.child}return i;case 26:return pu(n,i),n===null?(s=Ex(i.type,null,i.pendingProps,null))?i.memoizedState=s:Pe||(s=i.type,n=i.pendingProps,c=Ru(fe.current).createElement(s),c[Et]=i,c[zt]=n,Rt(c,s,n),gt(c),i.stateNode=c):i.memoizedState=Ex(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return we(i),n===null&&Pe&&(c=i.stateNode=bx(i.type,i.pendingProps,fe.current),Mt=i,Nn=!0,m=it,Jr(i.type)?(hh=m,it=Mn(c.firstChild)):it=m),At(n,i,i.pendingProps.children,s),pu(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Pe&&((m=c=it)&&(c=$2(c,i.type,i.pendingProps,Nn),c!==null?(i.stateNode=c,Mt=i,it=Mn(c.firstChild),Nn=!1,m=!0):m=!1),m||Hr(i)),we(i),m=i.type,x=i.pendingProps,E=n!==null?n.memoizedProps:null,c=x.children,lh(m,x)?c=null:E!==null&&lh(m,E)&&(i.flags|=32),i.memoizedState!==null&&(m=sd(n,i,s2,null,null,s),ys._currentValue=m),pu(n,i),At(n,i,c,s),i.child;case 6:return n===null&&Pe&&((n=s=it)&&(s=G2(s,i.pendingProps,Nn),s!==null?(i.stateNode=s,Mt=i,it=null,n=!0):n=!1),n||Hr(i)),null;case 13:return u0(n,i,s);case 4:return le(i,i.stateNode.containerInfo),c=i.pendingProps,n===null?i.child=Di(i,null,c,s):At(n,i,c,s),i.child;case 11:return e0(n,i,i.type,i.pendingProps,s);case 7:return At(n,i,i.pendingProps,s),i.child;case 8:return At(n,i,i.pendingProps.children,s),i.child;case 12:return At(n,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,Pr(i,i.type,c.value),At(n,i,c.children,s),i.child;case 9:return m=i.type._context,c=i.pendingProps.children,Ai(i),m=Tt(m),c=c(m),i.flags|=1,At(n,i,c,s),i.child;case 14:return t0(n,i,i.type,i.pendingProps,s);case 15:return n0(n,i,i.type,i.pendingProps,s);case 19:return f0(n,i,s);case 31:return m2(n,i,s);case 22:return r0(n,i,s,i.pendingProps);case 24:return Ai(i),c=Tt(yt),n===null?(m=Zf(),m===null&&(m=tt,x=Qf(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=s),m=x),i.memoizedState={parent:c,cache:m},Jf(i),Pr(i,yt,m)):((n.lanes&s)!==0&&(ed(n,i),Zo(i,null,null,s),Ko()),m=n.memoizedState,x=i.memoizedState,m.parent!==c?(m={parent:c,cache:c},i.memoizedState=m,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=m),Pr(i,yt,c)):(c=x.cache,Pr(i,yt,c),c!==m.cache&&Xf(i,[yt],s,!0))),At(n,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function gr(n){n.flags|=4}function zd(n,i,s,c,m){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(m&335544128)===m)if(n.stateNode.complete)n.flags|=8192;else if(H0())n.flags|=8192;else throw Oi=Jl,Wf}else n.flags&=-16777217}function h0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Mx(i))if(H0())n.flags|=8192;else throw Oi=Jl,Wf}function gu(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?Sl():536870912,n.lanes|=i,Pa|=i)}function rs(n,i){if(!Pe)switch(n.tailMode){case"hidden":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function at(n){var i=n.alternate!==null&&n.alternate.child===n.child,s=0,c=0;if(i)for(var m=n.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=n,m=m.sibling;else for(m=n.child;m!==null;)s|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=n,m=m.sibling;return n.subtreeFlags|=c,n.childLanes=s,i}function y2(n,i,s){var c=i.pendingProps;switch(qf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(i),null;case 1:return at(i),null;case 3:return s=i.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),dr(yt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(ka(i)?gr(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Yf())),at(i),null;case 26:var m=i.type,x=i.memoizedState;return n===null?(gr(i),x!==null?(at(i),h0(i,x)):(at(i),zd(i,m,null,c,s))):x?x!==n.memoizedState?(gr(i),at(i),h0(i,x)):(at(i),i.flags&=-16777217):(n=n.memoizedProps,n!==c&&gr(i),at(i),zd(i,m,n,c,s)),null;case 27:if(Ee(i),s=fe.current,m=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&gr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return at(i),null}n=te.current,ka(i)?$g(i):(n=bx(m,c,s),i.stateNode=n,gr(i))}return at(i),null;case 5:if(Ee(i),m=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&gr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return at(i),null}if(x=te.current,ka(i))$g(i);else{var E=Ru(fe.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?E.createElement("select",{is:c.is}):E.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?E.createElement(m,{is:c.is}):E.createElement(m)}}x[Et]=i,x[zt]=c;e:for(E=i.child;E!==null;){if(E.tag===5||E.tag===6)x.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===i)break e;for(;E.sibling===null;){if(E.return===null||E.return===i)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}i.stateNode=x;e:switch(Rt(x,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&gr(i)}}return at(i),zd(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==c&&gr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(n=fe.current,ka(i)){if(n=i.stateNode,s=i.memoizedProps,c=null,m=Mt,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}n[Et]=i,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||ux(n.nodeValue,s)),n||Hr(i,!0)}else n=Ru(n).createTextNode(c),n[Et]=i,i.stateNode=n}return at(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(c=ka(i),s!==null){if(n===null){if(!c)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;at(i),n=!1}else s=Yf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(fn(i),i):(fn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return at(i),null;case 13:if(c=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(m=ka(i),c!==null&&c.dehydrated!==null){if(n===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[Et]=i}else Mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;at(i),m=!1}else m=Yf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(fn(i),i):(fn(i),null)}return fn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,n=n!==null&&n.memoizedState!==null,s&&(c=i.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),gu(i,i.updateQueue),at(i),null);case 4:return pe(),n===null&&rh(i.stateNode.containerInfo),at(i),null;case 10:return dr(i.type),at(i),null;case 19:if($(pt),c=i.memoizedState,c===null)return at(i),null;if(m=(i.flags&128)!==0,x=c.rendering,x===null)if(m)rs(c,!1);else{if(dt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(x=ru(n),x!==null){for(i.flags|=128,rs(c,!1),n=x.updateQueue,i.updateQueue=n,gu(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)Ug(s,n),s=s.sibling;return R(pt,pt.current&1|2),Pe&&cr(i,c.treeForkCount),i.child}n=n.sibling}c.tail!==null&&Te()>wu&&(i.flags|=128,m=!0,rs(c,!1),i.lanes=4194304)}else{if(!m)if(n=ru(x),n!==null){if(i.flags|=128,m=!0,n=n.updateQueue,i.updateQueue=n,gu(i,n),rs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Pe)return at(i),null}else 2*Te()-c.renderingStartTime>wu&&s!==536870912&&(i.flags|=128,m=!0,rs(c,!1),i.lanes=4194304);c.isBackwards?(x.sibling=i.child,i.child=x):(n=c.last,n!==null?n.sibling=x:i.child=x,c.last=x)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=Te(),n.sibling=null,s=pt.current,R(pt,m?s&1|2:s&1),Pe&&cr(i,c.treeForkCount),n):(at(i),null);case 22:case 23:return fn(i),id(),c=i.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(at(i),i.subtreeFlags&6&&(i.flags|=8192)):at(i),s=i.updateQueue,s!==null&&gu(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),n!==null&&$(Ri),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),dr(yt),at(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function x2(n,i){switch(qf(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return dr(yt),pe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Ee(i),null;case 31:if(i.memoizedState!==null){if(fn(i),i.alternate===null)throw Error(a(340));Mi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(fn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Mi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return $(pt),null;case 4:return pe(),null;case 10:return dr(i.type),null;case 22:case 23:return fn(i),id(),n!==null&&$(Ri),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return dr(yt),null;case 25:return null;default:return null}}function p0(n,i){switch(qf(i),i.tag){case 3:dr(yt),pe();break;case 26:case 27:case 5:Ee(i);break;case 4:pe();break;case 31:i.memoizedState!==null&&fn(i);break;case 13:fn(i);break;case 19:$(pt);break;case 10:dr(i.type);break;case 22:case 23:fn(i),id(),n!==null&&$(Ri);break;case 24:dr(yt)}}function is(n,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var m=c.next;s=m;do{if((s.tag&n)===n){c=void 0;var x=s.create,E=s.inst;c=x(),E.destroy=c}s=s.next}while(s!==m)}}catch(D){Ze(i,i.return,D)}}function $r(n,i,s){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&n)===n){var E=c.inst,D=E.destroy;if(D!==void 0){E.destroy=void 0,m=i;var G=s,ee=D;try{ee()}catch(ae){Ze(m,G,ae)}}}c=c.next}while(c!==x)}}catch(ae){Ze(i,i.return,ae)}}function m0(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{ay(i,s)}catch(c){Ze(n,n.return,c)}}}function g0(n,i,s){s.props=Li(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){Ze(n,i,c)}}function as(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(m){Ze(n,i,m)}}function $n(n,i){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(m){Ze(n,i,m)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(m){Ze(n,i,m)}else s.current=null}function y0(n){var i=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(m){Ze(n,n.return,m)}}function Ld(n,i,s){try{var c=n.stateNode;P2(c,n.type,s,i),c[zt]=i}catch(m){Ze(n,n.return,m)}}function x0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Jr(n.type)||n.tag===4}function Id(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||x0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Jr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Bd(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=sr));else if(c!==4&&(c===27&&Jr(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(Bd(n,i,s),n=n.sibling;n!==null;)Bd(n,i,s),n=n.sibling}function yu(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(c!==4&&(c===27&&Jr(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(yu(n,i,s),n=n.sibling;n!==null;)yu(n,i,s),n=n.sibling}function v0(n){var i=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Rt(i,c,s),i[Et]=n,i[zt]=s}catch(x){Ze(n,n.return,x)}}var yr=!1,bt=!1,Hd=!1,b0=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function v2(n,i){if(n=n.containerInfo,oh=Bu,n=jg(n),jf(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var E=0,D=-1,G=-1,ee=0,ae=0,se=n,ne=null;t:for(;;){for(var re;se!==s||m!==0&&se.nodeType!==3||(D=E+m),se!==x||c!==0&&se.nodeType!==3||(G=E+c),se.nodeType===3&&(E+=se.nodeValue.length),(re=se.firstChild)!==null;)ne=se,se=re;for(;;){if(se===n)break t;if(ne===s&&++ee===m&&(D=E),ne===x&&++ae===c&&(G=E),(re=se.nextSibling)!==null)break;se=ne,ne=se.parentNode}se=re}s=D===-1||G===-1?null:{start:D,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(sh={focusedElem:n,selectionRange:s},Bu=!1,Nt=i;Nt!==null;)if(i=Nt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Nt=n;else for(;Nt!==null;){switch(i=Nt,x=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)m=n[s],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,s=i,m=x.memoizedProps,x=x.memoizedState,c=s.stateNode;try{var ye=Li(s.type,m);n=c.getSnapshotBeforeUpdate(ye,x),c.__reactInternalSnapshotBeforeUpdate=n}catch(ke){Ze(s,s.return,ke)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,s=n.nodeType,s===9)ch(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ch(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Nt=n;break}Nt=i.return}}function w0(n,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:vr(n,s),c&4&&is(5,s);break;case 1:if(vr(n,s),c&4)if(n=s.stateNode,i===null)try{n.componentDidMount()}catch(E){Ze(s,s.return,E)}else{var m=Li(s.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(m,i,n.__reactInternalSnapshotBeforeUpdate)}catch(E){Ze(s,s.return,E)}}c&64&&m0(s),c&512&&as(s,s.return);break;case 3:if(vr(n,s),c&64&&(n=s.updateQueue,n!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{ay(n,i)}catch(E){Ze(s,s.return,E)}}break;case 27:i===null&&c&4&&v0(s);case 26:case 5:vr(n,s),i===null&&c&4&&y0(s),c&512&&as(s,s.return);break;case 12:vr(n,s);break;case 31:vr(n,s),c&4&&C0(n,s);break;case 13:vr(n,s),c&4&&_0(n,s),c&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=M2.bind(null,s),X2(n,s))));break;case 22:if(c=s.memoizedState!==null||yr,!c){i=i!==null&&i.memoizedState!==null||bt,m=yr;var x=bt;yr=c,(bt=i)&&!x?br(n,s,(s.subtreeFlags&8772)!==0):vr(n,s),yr=m,bt=x}break;case 30:break;default:vr(n,s)}}function S0(n){var i=n.alternate;i!==null&&(n.alternate=null,S0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Ro(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ot=null,$t=!1;function xr(n,i,s){for(s=s.child;s!==null;)E0(n,i,s),s=s.sibling}function E0(n,i,s){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(kt,s)}catch{}switch(s.tag){case 26:bt||$n(s,i),xr(n,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:bt||$n(s,i);var c=ot,m=$t;Jr(s.type)&&(ot=s.stateNode,$t=!1),xr(n,i,s),ps(s.stateNode),ot=c,$t=m;break;case 5:bt||$n(s,i);case 6:if(c=ot,m=$t,ot=null,xr(n,i,s),ot=c,$t=m,ot!==null)if($t)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(s.stateNode)}catch(x){Ze(s,i,x)}else try{ot.removeChild(s.stateNode)}catch(x){Ze(s,i,x)}break;case 18:ot!==null&&($t?(n=ot,mx(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),Xa(n)):mx(ot,s.stateNode));break;case 4:c=ot,m=$t,ot=s.stateNode.containerInfo,$t=!0,xr(n,i,s),ot=c,$t=m;break;case 0:case 11:case 14:case 15:$r(2,s,i),bt||$r(4,s,i),xr(n,i,s);break;case 1:bt||($n(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&g0(s,i,c)),xr(n,i,s);break;case 21:xr(n,i,s);break;case 22:bt=(c=bt)||s.memoizedState!==null,xr(n,i,s),bt=c;break;default:xr(n,i,s)}}function C0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Xa(n)}catch(s){Ze(i,i.return,s)}}}function _0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Xa(n)}catch(s){Ze(i,i.return,s)}}function b2(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new b0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new b0),i;default:throw Error(a(435,n.tag))}}function xu(n,i){var s=b2(n);i.forEach(function(c){if(!s.has(c)){s.add(c);var m=T2.bind(null,n,c);c.then(m,m)}})}function Gt(n,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var m=s[c],x=n,E=i,D=E;e:for(;D!==null;){switch(D.tag){case 27:if(Jr(D.type)){ot=D.stateNode,$t=!1;break e}break;case 5:ot=D.stateNode,$t=!1;break e;case 3:case 4:ot=D.stateNode.containerInfo,$t=!0;break e}D=D.return}if(ot===null)throw Error(a(160));E0(x,E,m),ot=null,$t=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)N0(i,n),i=i.sibling}var zn=null;function N0(n,i){var s=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Gt(i,n),Xt(n),c&4&&($r(3,n,n.return),is(3,n),$r(5,n,n.return));break;case 1:Gt(i,n),Xt(n),c&512&&(bt||s===null||$n(s,s.return)),c&64&&yr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var m=zn;if(Gt(i,n),Xt(n),c&512&&(bt||s===null||$n(s,s.return)),c&4){var x=s!==null?s.memoizedState:null;if(c=n.memoizedState,s===null)if(c===null)if(n.stateNode===null){e:{c=n.type,s=n.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[bi]||x[Et]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),Rt(x,c,s),x[Et]=n,gt(x),c=x;break e;case"link":var E=Nx("link","href",m).get(c+(s.href||""));if(E){for(var D=0;D<E.length;D++)if(x=E[D],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){E.splice(D,1);break t}}x=m.createElement(c),Rt(x,c,s),m.head.appendChild(x);break;case"meta":if(E=Nx("meta","content",m).get(c+(s.content||""))){for(D=0;D<E.length;D++)if(x=E[D],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){E.splice(D,1);break t}}x=m.createElement(c),Rt(x,c,s),m.head.appendChild(x);break;default:throw Error(a(468,c))}x[Et]=n,gt(x),c=x}n.stateNode=c}else kx(m,n.type,n.stateNode);else n.stateNode=_x(m,c,n.memoizedProps);else x!==c?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,c===null?kx(m,n.type,n.stateNode):_x(m,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Ld(n,n.memoizedProps,s.memoizedProps)}break;case 27:Gt(i,n),Xt(n),c&512&&(bt||s===null||$n(s,s.return)),s!==null&&c&4&&Ld(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Gt(i,n),Xt(n),c&512&&(bt||s===null||$n(s,s.return)),n.flags&32){m=n.stateNode;try{ya(m,"")}catch(ye){Ze(n,n.return,ye)}}c&4&&n.stateNode!=null&&(m=n.memoizedProps,Ld(n,m,s!==null?s.memoizedProps:m)),c&1024&&(Hd=!0);break;case 6:if(Gt(i,n),Xt(n),c&4){if(n.stateNode===null)throw Error(a(162));c=n.memoizedProps,s=n.stateNode;try{s.nodeValue=c}catch(ye){Ze(n,n.return,ye)}}break;case 3:if(Du=null,m=zn,zn=ju(i.containerInfo),Gt(i,n),zn=m,Xt(n),c&4&&s!==null&&s.memoizedState.isDehydrated)try{Xa(i.containerInfo)}catch(ye){Ze(n,n.return,ye)}Hd&&(Hd=!1,k0(n));break;case 4:c=zn,zn=ju(n.stateNode.containerInfo),Gt(i,n),Xt(n),zn=c;break;case 12:Gt(i,n),Xt(n);break;case 31:Gt(i,n),Xt(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,xu(n,c)));break;case 13:Gt(i,n),Xt(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(bu=Te()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,xu(n,c)));break;case 22:m=n.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,ee=yr,ae=bt;if(yr=ee||m,bt=ae||G,Gt(i,n),bt=ae,yr=ee,Xt(n),c&8192)e:for(i=n.stateNode,i._visibility=m?i._visibility&-2:i._visibility|1,m&&(s===null||G||yr||bt||Ii(n)),s=null,i=n;;){if(i.tag===5||i.tag===26){if(s===null){G=s=i;try{if(x=G.stateNode,m)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{D=G.stateNode;var se=G.memoizedProps.style,ne=se!=null&&se.hasOwnProperty("display")?se.display:null;D.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(ye){Ze(G,G.return,ye)}}}else if(i.tag===6){if(s===null){G=i;try{G.stateNode.nodeValue=m?"":G.memoizedProps}catch(ye){Ze(G,G.return,ye)}}}else if(i.tag===18){if(s===null){G=i;try{var re=G.stateNode;m?gx(re,!0):gx(G.stateNode,!1)}catch(ye){Ze(G,G.return,ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=n.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,xu(n,s))));break;case 19:Gt(i,n),Xt(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,xu(n,c)));break;case 30:break;case 21:break;default:Gt(i,n),Xt(n)}}function Xt(n){var i=n.flags;if(i&2){try{for(var s,c=n.return;c!==null;){if(x0(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var m=s.stateNode,x=Id(n);yu(n,x,m);break;case 5:var E=s.stateNode;s.flags&32&&(ya(E,""),s.flags&=-33);var D=Id(n);yu(n,D,E);break;case 3:case 4:var G=s.stateNode.containerInfo,ee=Id(n);Bd(n,ee,G);break;default:throw Error(a(161))}}catch(ae){Ze(n,n.return,ae)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function k0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;k0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function vr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)w0(n,i.alternate,i),i=i.sibling}function Ii(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:$r(4,i,i.return),Ii(i);break;case 1:$n(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&g0(i,i.return,s),Ii(i);break;case 27:ps(i.stateNode);case 26:case 5:$n(i,i.return),Ii(i);break;case 22:i.memoizedState===null&&Ii(i);break;case 30:Ii(i);break;default:Ii(i)}n=n.sibling}}function br(n,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,m=n,x=i,E=x.flags;switch(x.tag){case 0:case 11:case 15:br(m,x,s),is(4,x);break;case 1:if(br(m,x,s),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ee){Ze(c,c.return,ee)}if(c=x,m=c.updateQueue,m!==null){var D=c.stateNode;try{var G=m.shared.hiddenCallbacks;if(G!==null)for(m.shared.hiddenCallbacks=null,m=0;m<G.length;m++)iy(G[m],D)}catch(ee){Ze(c,c.return,ee)}}s&&E&64&&m0(x),as(x,x.return);break;case 27:v0(x);case 26:case 5:br(m,x,s),s&&c===null&&E&4&&y0(x),as(x,x.return);break;case 12:br(m,x,s);break;case 31:br(m,x,s),s&&E&4&&C0(m,x);break;case 13:br(m,x,s),s&&E&4&&_0(m,x);break;case 22:x.memoizedState===null&&br(m,x,s),as(x,x.return);break;case 30:break;default:br(m,x,s)}i=i.sibling}}function Pd(n,i){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&Yo(s))}function Ud(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Yo(n))}function Ln(n,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)M0(n,i,s,c),i=i.sibling}function M0(n,i,s,c){var m=i.flags;switch(i.tag){case 0:case 11:case 15:Ln(n,i,s,c),m&2048&&is(9,i);break;case 1:Ln(n,i,s,c);break;case 3:Ln(n,i,s,c),m&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Yo(n)));break;case 12:if(m&2048){Ln(n,i,s,c),n=i.stateNode;try{var x=i.memoizedProps,E=x.id,D=x.onPostCommit;typeof D=="function"&&D(E,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(G){Ze(i,i.return,G)}}else Ln(n,i,s,c);break;case 31:Ln(n,i,s,c);break;case 13:Ln(n,i,s,c);break;case 23:break;case 22:x=i.stateNode,E=i.alternate,i.memoizedState!==null?x._visibility&2?Ln(n,i,s,c):os(n,i):x._visibility&2?Ln(n,i,s,c):(x._visibility|=2,Ia(n,i,s,c,(i.subtreeFlags&10256)!==0||!1)),m&2048&&Pd(E,i);break;case 24:Ln(n,i,s,c),m&2048&&Ud(i.alternate,i);break;default:Ln(n,i,s,c)}}function Ia(n,i,s,c,m){for(m=m&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=n,E=i,D=s,G=c,ee=E.flags;switch(E.tag){case 0:case 11:case 15:Ia(x,E,D,G,m),is(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?Ia(x,E,D,G,m):os(x,E):(ae._visibility|=2,Ia(x,E,D,G,m)),m&&ee&2048&&Pd(E.alternate,E);break;case 24:Ia(x,E,D,G,m),m&&ee&2048&&Ud(E.alternate,E);break;default:Ia(x,E,D,G,m)}i=i.sibling}}function os(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=n,c=i,m=c.flags;switch(c.tag){case 22:os(s,c),m&2048&&Pd(c.alternate,c);break;case 24:os(s,c),m&2048&&Ud(c.alternate,c);break;default:os(s,c)}i=i.sibling}}var ss=8192;function Ba(n,i,s){if(n.subtreeFlags&ss)for(n=n.child;n!==null;)T0(n,i,s),n=n.sibling}function T0(n,i,s){switch(n.tag){case 26:Ba(n,i,s),n.flags&ss&&n.memoizedState!==null&&o_(s,zn,n.memoizedState,n.memoizedProps);break;case 5:Ba(n,i,s);break;case 3:case 4:var c=zn;zn=ju(n.stateNode.containerInfo),Ba(n,i,s),zn=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=ss,ss=16777216,Ba(n,i,s),ss=c):Ba(n,i,s));break;default:Ba(n,i,s)}}function A0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function ls(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Nt=c,j0(c,n)}A0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)R0(n),n=n.sibling}function R0(n){switch(n.tag){case 0:case 11:case 15:ls(n),n.flags&2048&&$r(9,n,n.return);break;case 3:ls(n);break;case 12:ls(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,vu(n)):ls(n);break;default:ls(n)}}function vu(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];Nt=c,j0(c,n)}A0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:$r(8,i,i.return),vu(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,vu(i));break;default:vu(i)}n=n.sibling}}function j0(n,i){for(;Nt!==null;){var s=Nt;switch(s.tag){case 0:case 11:case 15:$r(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Yo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Nt=c;else e:for(s=n;Nt!==null;){c=Nt;var m=c.sibling,x=c.return;if(S0(c),c===s){Nt=null;break e}if(m!==null){m.return=x,Nt=m;break e}Nt=x}}}var w2={getCacheForType:function(n){var i=Tt(yt),s=i.data.get(n);return s===void 0&&(s=n(),i.data.set(n,s)),s},cacheSignal:function(){return Tt(yt).controller.signal}},S2=typeof WeakMap=="function"?WeakMap:Map,Ge=0,tt=null,Le=null,Be=0,Ke=0,dn=null,Gr=!1,Ha=!1,Vd=!1,wr=0,dt=0,Xr=0,Bi=0,qd=0,hn=0,Pa=0,us=null,Qt=null,Fd=!1,bu=0,O0=0,wu=1/0,Su=null,Qr=null,Ct=0,Kr=null,Ua=null,Sr=0,Yd=0,$d=null,D0=null,cs=0,Gd=null;function pn(){return(Ge&2)!==0&&Be!==0?Be&-Be:M.T!==null?Jd():Nl()}function z0(){if(hn===0)if((Be&536870912)===0||Pe){var n=ca;ca<<=1,(ca&3932160)===0&&(ca=262144),hn=n}else hn=536870912;return n=cn.current,n!==null&&(n.flags|=32),hn}function Kt(n,i,s){(n===tt&&(Ke===2||Ke===9)||n.cancelPendingCommit!==null)&&(Va(n,0),Zr(n,Be,hn,!1)),vi(n,s),((Ge&2)===0||n!==tt)&&(n===tt&&((Ge&2)===0&&(Bi|=s),dt===4&&Zr(n,Be,hn,!1)),Gn(n))}function L0(n,i,s){if((Ge&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&n.expiredLanes)===0||xi(n,i),m=c?_2(n,i):Qd(n,i,!0),x=c;do{if(m===0){Ha&&!c&&Zr(n,i,0,!1);break}else{if(s=n.current.alternate,x&&!E2(s)){m=Qd(n,i,!1),x=!1;continue}if(m===2){if(x=i,n.errorRecoveryDisabledLanes&x)var E=0;else E=n.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){i=E;e:{var D=n;m=us;var G=D.current.memoizedState.isDehydrated;if(G&&(Va(D,E).flags|=256),E=Qd(D,E,!1),E!==2){if(Vd&&!G){D.errorRecoveryDisabledLanes|=x,Bi|=x,m=4;break e}x=Qt,Qt=m,x!==null&&(Qt===null?Qt=x:Qt.push.apply(Qt,x))}m=E}if(x=!1,m!==2)continue}}if(m===1){Va(n,0),Zr(n,i,0,!0);break}e:{switch(c=n,x=m,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Zr(c,i,hn,!Gr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(m=bu+300-Te(),10<m)){if(Zr(c,i,hn,!Gr),da(c,0,!0)!==0)break e;Sr=i,c.timeoutHandle=hx(I0.bind(null,c,s,Qt,Su,Fd,i,hn,Bi,Pa,Gr,x,"Throttled",-0,0),m);break e}I0(c,s,Qt,Su,Fd,i,hn,Bi,Pa,Gr,x,null,-0,0)}}break}while(!0);Gn(n)}function I0(n,i,s,c,m,x,E,D,G,ee,ae,se,ne,re){if(n.timeoutHandle=-1,se=i.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sr},T0(i,x,se);var ye=(x&62914560)===x?bu-Te():(x&4194048)===x?O0-Te():0;if(ye=s_(se,ye),ye!==null){Sr=x,n.cancelPendingCommit=ye(Y0.bind(null,n,i,x,s,c,m,E,D,G,ae,se,null,ne,re)),Zr(n,x,E,!ee);return}}Y0(n,i,x,s,c,m,E,D,G)}function E2(n){for(var i=n;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var m=s[c],x=m.getSnapshot;m=m.value;try{if(!ln(x(),m))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Zr(n,i,s,c){i&=~qd,i&=~Bi,n.suspendedLanes|=i,n.pingedLanes&=~i,c&&(n.warmLanes|=i),c=n.expirationTimes;for(var m=i;0<m;){var x=31-Qe(m),E=1<<x;c[x]=-1,m&=~E}s!==0&&El(n,s,i)}function Eu(){return(Ge&6)===0?(fs(0),!1):!0}function Xd(){if(Le!==null){if(Ke===0)var n=Le.return;else n=Le,fr=Ti=null,cd(n),ja=null,Go=0,n=Le;for(;n!==null;)p0(n.alternate,n),n=n.return;Le=null}}function Va(n,i){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,q2(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Sr=0,Xd(),tt=n,Le=s=ur(n.current,null),Be=i,Ke=0,dn=null,Gr=!1,Ha=xi(n,i),Vd=!1,Pa=hn=qd=Bi=Xr=dt=0,Qt=us=null,Fd=!1,(i&8)!==0&&(i|=i&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=i;0<c;){var m=31-Qe(c),x=1<<m;i|=n[m],c&=~x}return wr=i,Fl(),s}function B0(n,i){Re=null,M.H=ts,i===Ra||i===Wl?(i=ey(),Ke=3):i===Wf?(i=ey(),Ke=4):Ke=i===Nd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,dn=i,Le===null&&(dt=1,du(n,En(i,n.current)))}function H0(){var n=cn.current;return n===null?!0:(Be&4194048)===Be?kn===null:(Be&62914560)===Be||(Be&536870912)!==0?n===kn:!1}function P0(){var n=M.H;return M.H=ts,n===null?ts:n}function U0(){var n=M.A;return M.A=w2,n}function Cu(){dt=4,Gr||(Be&4194048)!==Be&&cn.current!==null||(Ha=!0),(Xr&134217727)===0&&(Bi&134217727)===0||tt===null||Zr(tt,Be,hn,!1)}function Qd(n,i,s){var c=Ge;Ge|=2;var m=P0(),x=U0();(tt!==n||Be!==i)&&(Su=null,Va(n,i)),i=!1;var E=dt;e:do try{if(Ke!==0&&Le!==null){var D=Le,G=dn;switch(Ke){case 8:Xd(),E=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(i=!0);var ee=Ke;if(Ke=0,dn=null,qa(n,D,G,ee),s&&Ha){E=0;break e}break;default:ee=Ke,Ke=0,dn=null,qa(n,D,G,ee)}}C2(),E=dt;break}catch(ae){B0(n,ae)}while(!0);return i&&n.shellSuspendCounter++,fr=Ti=null,Ge=c,M.H=m,M.A=x,Le===null&&(tt=null,Be=0,Fl()),E}function C2(){for(;Le!==null;)V0(Le)}function _2(n,i){var s=Ge;Ge|=2;var c=P0(),m=U0();tt!==n||Be!==i?(Su=null,wu=Te()+500,Va(n,i)):Ha=xi(n,i);e:do try{if(Ke!==0&&Le!==null){i=Le;var x=dn;t:switch(Ke){case 1:Ke=0,dn=null,qa(n,i,x,1);break;case 2:case 9:if(Wg(x)){Ke=0,dn=null,q0(i);break}i=function(){Ke!==2&&Ke!==9||tt!==n||(Ke=7),Gn(n)},x.then(i,i);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:Wg(x)?(Ke=0,dn=null,q0(i)):(Ke=0,dn=null,qa(n,i,x,7));break;case 5:var E=null;switch(Le.tag){case 26:E=Le.memoizedState;case 5:case 27:var D=Le;if(E?Mx(E):D.stateNode.complete){Ke=0,dn=null;var G=D.sibling;if(G!==null)Le=G;else{var ee=D.return;ee!==null?(Le=ee,_u(ee)):Le=null}break t}}Ke=0,dn=null,qa(n,i,x,5);break;case 6:Ke=0,dn=null,qa(n,i,x,6);break;case 8:Xd(),dt=6;break e;default:throw Error(a(462))}}N2();break}catch(ae){B0(n,ae)}while(!0);return fr=Ti=null,M.H=c,M.A=m,Ge=s,Le!==null?0:(tt=null,Be=0,Fl(),dt)}function N2(){for(;Le!==null&&!on();)V0(Le)}function V0(n){var i=d0(n.alternate,n,wr);n.memoizedProps=n.pendingProps,i===null?_u(n):Le=i}function q0(n){var i=n,s=i.alternate;switch(i.tag){case 15:case 0:i=o0(s,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=o0(s,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:cd(i);default:p0(s,i),i=Le=Ug(i,wr),i=d0(s,i,wr)}n.memoizedProps=n.pendingProps,i===null?_u(n):Le=i}function qa(n,i,s,c){fr=Ti=null,cd(i),ja=null,Go=0;var m=i.return;try{if(p2(n,m,i,s,Be)){dt=1,du(n,En(s,n.current)),Le=null;return}}catch(x){if(m!==null)throw Le=m,x;dt=1,du(n,En(s,n.current)),Le=null;return}i.flags&32768?(Pe||c===1?n=!0:Ha||(Be&536870912)!==0?n=!1:(Gr=n=!0,(c===2||c===9||c===3||c===6)&&(c=cn.current,c!==null&&c.tag===13&&(c.flags|=16384))),F0(i,n)):_u(i)}function _u(n){var i=n;do{if((i.flags&32768)!==0){F0(i,Gr);return}n=i.return;var s=y2(i.alternate,i,wr);if(s!==null){Le=s;return}if(i=i.sibling,i!==null){Le=i;return}Le=i=n}while(i!==null);dt===0&&(dt=5)}function F0(n,i){do{var s=x2(n.alternate,n);if(s!==null){s.flags&=32767,Le=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(n=n.sibling,n!==null)){Le=n;return}Le=n=s}while(n!==null);dt=6,Le=null}function Y0(n,i,s,c,m,x,E,D,G){n.cancelPendingCommit=null;do Nu();while(Ct!==0);if((Ge&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=If,hf(n,s,x,E,D,G),n===tt&&(Le=tt=null,Be=0),Ua=i,Kr=n,Sr=s,Yd=x,$d=m,D0=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,A2(Ne,function(){return K0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=M.T,M.T=null,m=q.p,q.p=2,E=Ge,Ge|=4;try{v2(n,i,s)}finally{Ge=E,q.p=m,M.T=c}}Ct=1,$0(),G0(),X0()}}function $0(){if(Ct===1){Ct=0;var n=Kr,i=Ua,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=M.T,M.T=null;var c=q.p;q.p=2;var m=Ge;Ge|=4;try{N0(i,n);var x=sh,E=jg(n.containerInfo),D=x.focusedElem,G=x.selectionRange;if(E!==D&&D&&D.ownerDocument&&Rg(D.ownerDocument.documentElement,D)){if(G!==null&&jf(D)){var ee=G.start,ae=G.end;if(ae===void 0&&(ae=ee),"selectionStart"in D)D.selectionStart=ee,D.selectionEnd=Math.min(ae,D.value.length);else{var se=D.ownerDocument||document,ne=se&&se.defaultView||window;if(ne.getSelection){var re=ne.getSelection(),ye=D.textContent.length,ke=Math.min(G.start,ye),et=G.end===void 0?ke:Math.min(G.end,ye);!re.extend&&ke>et&&(E=et,et=ke,ke=E);var W=Ag(D,ke),K=Ag(D,et);if(W&&K&&(re.rangeCount!==1||re.anchorNode!==W.node||re.anchorOffset!==W.offset||re.focusNode!==K.node||re.focusOffset!==K.offset)){var J=se.createRange();J.setStart(W.node,W.offset),re.removeAllRanges(),ke>et?(re.addRange(J),re.extend(K.node,K.offset)):(J.setEnd(K.node,K.offset),re.addRange(J))}}}}for(se=[],re=D;re=re.parentNode;)re.nodeType===1&&se.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<se.length;D++){var oe=se[D];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Bu=!!oh,sh=oh=null}finally{Ge=m,q.p=c,M.T=s}}n.current=i,Ct=2}}function G0(){if(Ct===2){Ct=0;var n=Kr,i=Ua,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=M.T,M.T=null;var c=q.p;q.p=2;var m=Ge;Ge|=4;try{w0(n,i.alternate,i)}finally{Ge=m,q.p=c,M.T=s}}Ct=3}}function X0(){if(Ct===4||Ct===3){Ct=0,wn();var n=Kr,i=Ua,s=Sr,c=D0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ct=5:(Ct=0,Ua=Kr=null,Q0(n,n.pendingLanes));var m=n.pendingLanes;if(m===0&&(Qr=null),Ao(s),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(kt,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=M.T,m=q.p,q.p=2,M.T=null;try{for(var x=n.onRecoverableError,E=0;E<c.length;E++){var D=c[E];x(D.value,{componentStack:D.stack})}}finally{M.T=i,q.p=m}}(Sr&3)!==0&&Nu(),Gn(n),m=n.pendingLanes,(s&261930)!==0&&(m&42)!==0?n===Gd?cs++:(cs=0,Gd=n):cs=0,fs(0)}}function Q0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Yo(i)))}function Nu(){return $0(),G0(),X0(),K0()}function K0(){if(Ct!==5)return!1;var n=Kr,i=Yd;Yd=0;var s=Ao(Sr),c=M.T,m=q.p;try{q.p=32>s?32:s,M.T=null,s=$d,$d=null;var x=Kr,E=Sr;if(Ct=0,Ua=Kr=null,Sr=0,(Ge&6)!==0)throw Error(a(331));var D=Ge;if(Ge|=4,R0(x.current),M0(x,x.current,E,s),Ge=D,fs(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(kt,x)}catch{}return!0}finally{q.p=m,M.T=c,Q0(n,i)}}function Z0(n,i,s){i=En(s,i),i=_d(n.stateNode,i,2),n=qr(n,i,2),n!==null&&(vi(n,2),Gn(n))}function Ze(n,i,s){if(n.tag===3)Z0(n,n,s);else for(;i!==null;){if(i.tag===3){Z0(i,n,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Qr===null||!Qr.has(c))){n=En(s,n),s=Wy(2),c=qr(i,s,2),c!==null&&(Jy(s,c,i,n),vi(c,2),Gn(c));break}}i=i.return}}function Kd(n,i,s){var c=n.pingCache;if(c===null){c=n.pingCache=new S2;var m=new Set;c.set(i,m)}else m=c.get(i),m===void 0&&(m=new Set,c.set(i,m));m.has(s)||(Vd=!0,m.add(s),n=k2.bind(null,n,i,s),i.then(n,n))}function k2(n,i,s){var c=n.pingCache;c!==null&&c.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,tt===n&&(Be&s)===s&&(dt===4||dt===3&&(Be&62914560)===Be&&300>Te()-bu?(Ge&2)===0&&Va(n,0):qd|=s,Pa===Be&&(Pa=0)),Gn(n)}function W0(n,i){i===0&&(i=Sl()),n=Ni(n,i),n!==null&&(vi(n,i),Gn(n))}function M2(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),W0(n,s)}function T2(n,i){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,m=n.memoizedState;m!==null&&(s=m.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),W0(n,s)}function A2(n,i){return _t(n,i)}var ku=null,Fa=null,Zd=!1,Mu=!1,Wd=!1,Wr=0;function Gn(n){n!==Fa&&n.next===null&&(Fa===null?ku=Fa=n:Fa=Fa.next=n),Mu=!0,Zd||(Zd=!0,j2())}function fs(n,i){if(!Wd&&Mu){Wd=!0;do for(var s=!1,c=ku;c!==null;){if(n!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var E=c.suspendedLanes,D=c.pingedLanes;x=(1<<31-Qe(42|n)+1)-1,x&=m&~(E&~D),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,nx(c,x))}else x=Be,x=da(c,c===tt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||xi(c,x)||(s=!0,nx(c,x));c=c.next}while(s);Wd=!1}}function R2(){J0()}function J0(){Mu=Zd=!1;var n=0;Wr!==0&&V2()&&(n=Wr);for(var i=Te(),s=null,c=ku;c!==null;){var m=c.next,x=ex(c,i);x===0?(c.next=null,s===null?ku=m:s.next=m,m===null&&(Fa=s)):(s=c,(n!==0||(x&3)!==0)&&(Mu=!0)),c=m}Ct!==0&&Ct!==5||fs(n),Wr!==0&&(Wr=0)}function ex(n,i){for(var s=n.suspendedLanes,c=n.pingedLanes,m=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var E=31-Qe(x),D=1<<E,G=m[E];G===-1?((D&s)===0||(D&c)!==0)&&(m[E]=df(D,i)):G<=i&&(n.expiredLanes|=D),x&=~D}if(i=tt,s=Be,s=da(n,n===i?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,s===0||n===i&&(Ke===2||Ke===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&Ot(c),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||xi(n,s)){if(i=s&-s,i===n.callbackPriority)return i;switch(c!==null&&Ot(c),Ao(s)){case 2:case 8:s=me;break;case 32:s=Ne;break;case 268435456:s=Ue;break;default:s=Ne}return c=tx.bind(null,n),s=_t(s,c),n.callbackPriority=i,n.callbackNode=s,i}return c!==null&&c!==null&&Ot(c),n.callbackPriority=2,n.callbackNode=null,2}function tx(n,i){if(Ct!==0&&Ct!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(Nu()&&n.callbackNode!==s)return null;var c=Be;return c=da(n,n===tt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(L0(n,c,i),ex(n,Te()),n.callbackNode!=null&&n.callbackNode===s?tx.bind(null,n):null)}function nx(n,i){if(Nu())return null;L0(n,i,!0)}function j2(){F2(function(){(Ge&6)!==0?_t(ie,R2):J0()})}function Jd(){if(Wr===0){var n=Ta;n===0&&(n=ua,ua<<=1,(ua&261888)===0&&(ua=256)),Wr=n}return Wr}function rx(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ll(""+n)}function ix(n,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,n.id&&s.setAttribute("form",n.id),i.parentNode.insertBefore(s,i),n=new FormData(n),s.parentNode.removeChild(s),n}function O2(n,i,s,c,m){if(i==="submit"&&s&&s.stateNode===m){var x=rx((m[zt]||null).action),E=c.submitter;E&&(i=(i=E[zt]||null)?rx(i.formAction):E.getAttribute("formAction"),i!==null&&(x=i,E=null));var D=new Pl("action","action",null,c,m);n.push({event:D,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Wr!==0){var G=E?ix(m,E):new FormData(m);vd(s,{pending:!0,data:G,method:m.method,action:x},null,G)}}else typeof x=="function"&&(D.preventDefault(),G=E?ix(m,E):new FormData(m),vd(s,{pending:!0,data:G,method:m.method,action:x},x,G))},currentTarget:m}]})}}for(var eh=0;eh<Lf.length;eh++){var th=Lf[eh],D2=th.toLowerCase(),z2=th[0].toUpperCase()+th.slice(1);Dn(D2,"on"+z2)}Dn(zg,"onAnimationEnd"),Dn(Lg,"onAnimationIteration"),Dn(Ig,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(ZC,"onTransitionRun"),Dn(WC,"onTransitionStart"),Dn(JC,"onTransitionCancel"),Dn(Bg,"onTransitionEnd"),zr("onMouseEnter",["mouseout","mouseover"]),zr("onMouseLeave",["mouseout","mouseover"]),zr("onPointerEnter",["pointerout","pointerover"]),zr("onPointerLeave",["pointerout","pointerover"]),ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ar("onBeforeInput",["compositionend","keypress","textInput","paste"]),ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ds="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(" "),L2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ds));function ax(n,i){i=(i&4)!==0;for(var s=0;s<n.length;s++){var c=n[s],m=c.event;c=c.listeners;e:{var x=void 0;if(i)for(var E=c.length-1;0<=E;E--){var D=c[E],G=D.instance,ee=D.currentTarget;if(D=D.listener,G!==x&&m.isPropagationStopped())break e;x=D,m.currentTarget=ee;try{x(m)}catch(ae){ql(ae)}m.currentTarget=null,x=G}else for(E=0;E<c.length;E++){if(D=c[E],G=D.instance,ee=D.currentTarget,D=D.listener,G!==x&&m.isPropagationStopped())break e;x=D,m.currentTarget=ee;try{x(m)}catch(ae){ql(ae)}m.currentTarget=null,x=G}}}}function Ie(n,i){var s=i[ha];s===void 0&&(s=i[ha]=new Set);var c=n+"__bubble";s.has(c)||(ox(i,n,2,!1),s.add(c))}function nh(n,i,s){var c=0;i&&(c|=4),ox(s,n,c,i)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function rh(n){if(!n[Tu]){n[Tu]=!0,Al.forEach(function(s){s!=="selectionchange"&&(L2.has(s)||nh(s,!1,n),nh(s,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Tu]||(i[Tu]=!0,nh("selectionchange",!1,i))}}function ox(n,i,s,c){switch(zx(i)){case 2:var m=c_;break;case 8:m=f_;break;default:m=xh}s=m.bind(null,i,s,n),m=void 0,!Ef||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(m=!0),c?m!==void 0?n.addEventListener(i,s,{capture:!0,passive:m}):n.addEventListener(i,s,!0):m!==void 0?n.addEventListener(i,s,{passive:m}):n.addEventListener(i,s,!1)}function ih(n,i,s,c,m){var x=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var E=c.tag;if(E===3||E===4){var D=c.stateNode.containerInfo;if(D===m)break;if(E===4)for(E=c.return;E!==null;){var G=E.tag;if((G===3||G===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;D!==null;){if(E=Rr(D),E===null)return;if(G=E.tag,G===5||G===6||G===26||G===27){c=x=E;continue e}D=D.parentNode}}c=c.return}fg(function(){var ee=x,ae=wf(s),se=[];e:{var ne=Hg.get(n);if(ne!==void 0){var re=Pl,ye=n;switch(n){case"keypress":if(Bl(s)===0)break e;case"keydown":case"keyup":re=TC;break;case"focusin":ye="focus",re=kf;break;case"focusout":ye="blur",re=kf;break;case"beforeblur":case"afterblur":re=kf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=pg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=yC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=jC;break;case zg:case Lg:case Ig:re=bC;break;case Bg:re=DC;break;case"scroll":case"scrollend":re=mC;break;case"wheel":re=LC;break;case"copy":case"cut":case"paste":re=SC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=gg;break;case"toggle":case"beforetoggle":re=BC}var ke=(i&4)!==0,et=!ke&&(n==="scroll"||n==="scrollend"),W=ke?ne!==null?ne+"Capture":null:ne;ke=[];for(var K=ee,J;K!==null;){var oe=K;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||W===null||(oe=Do(K,W),oe!=null&&ke.push(hs(K,oe,J))),et)break;K=K.return}0<ke.length&&(ne=new re(ne,ye,null,s,ae),se.push({event:ne,listeners:ke}))}}if((i&7)===0){e:{if(ne=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",ne&&s!==bf&&(ye=s.relatedTarget||s.fromElement)&&(Rr(ye)||ye[ir]))break e;if((re||ne)&&(ne=ae.window===ae?ae:(ne=ae.ownerDocument)?ne.defaultView||ne.parentWindow:window,re?(ye=s.relatedTarget||s.toElement,re=ee,ye=ye?Rr(ye):null,ye!==null&&(et=l(ye),ke=ye.tag,ye!==et||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=ee),re!==ye)){if(ke=pg,oe="onMouseLeave",W="onMouseEnter",K="mouse",(n==="pointerout"||n==="pointerover")&&(ke=gg,oe="onPointerLeave",W="onPointerEnter",K="pointer"),et=re==null?ne:Or(re),J=ye==null?ne:Or(ye),ne=new ke(oe,K+"leave",re,s,ae),ne.target=et,ne.relatedTarget=J,oe=null,Rr(ae)===ee&&(ke=new ke(W,K+"enter",ye,s,ae),ke.target=J,ke.relatedTarget=et,oe=ke),et=oe,re&&ye)t:{for(ke=I2,W=re,K=ye,J=0,oe=W;oe;oe=ke(oe))J++;oe=0;for(var Se=K;Se;Se=ke(Se))oe++;for(;0<J-oe;)W=ke(W),J--;for(;0<oe-J;)K=ke(K),oe--;for(;J--;){if(W===K||K!==null&&W===K.alternate){ke=W;break t}W=ke(W),K=ke(K)}ke=null}else ke=null;re!==null&&sx(se,ne,re,ke,!1),ye!==null&&et!==null&&sx(se,et,ye,ke,!0)}}e:{if(ne=ee?Or(ee):window,re=ne.nodeName&&ne.nodeName.toLowerCase(),re==="select"||re==="input"&&ne.type==="file")var Ye=Cg;else if(Sg(ne))if(_g)Ye=XC;else{Ye=$C;var xe=YC}else re=ne.nodeName,!re||re.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&vf(ee.elementType)&&(Ye=Cg):Ye=GC;if(Ye&&(Ye=Ye(n,ee))){Eg(se,Ye,s,ae);break e}xe&&xe(n,ne,ee),n==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Oo(ne,"number",ne.value)}switch(xe=ee?Or(ee):window,n){case"focusin":(Sg(xe)||xe.contentEditable==="true")&&(wa=xe,Of=ee,Vo=null);break;case"focusout":Vo=Of=wa=null;break;case"mousedown":Df=!0;break;case"contextmenu":case"mouseup":case"dragend":Df=!1,Og(se,s,ae);break;case"selectionchange":if(KC)break;case"keydown":case"keyup":Og(se,s,ae)}var je;if(Tf)e:{switch(n){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else ba?bg(n,s)&&(He="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(He="onCompositionStart");He&&(yg&&s.locale!=="ko"&&(ba||He!=="onCompositionStart"?He==="onCompositionEnd"&&ba&&(je=dg()):(Lr=ae,Cf="value"in Lr?Lr.value:Lr.textContent,ba=!0)),xe=Au(ee,He),0<xe.length&&(He=new mg(He,n,null,s,ae),se.push({event:He,listeners:xe}),je?He.data=je:(je=wg(s),je!==null&&(He.data=je)))),(je=PC?UC(n,s):VC(n,s))&&(He=Au(ee,"onBeforeInput"),0<He.length&&(xe=new mg("onBeforeInput","beforeinput",null,s,ae),se.push({event:xe,listeners:He}),xe.data=je)),O2(se,n,ee,s,ae)}ax(se,i)})}function hs(n,i,s){return{instance:n,listener:i,currentTarget:s}}function Au(n,i){for(var s=i+"Capture",c=[];n!==null;){var m=n,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=Do(n,s),m!=null&&c.unshift(hs(n,m,x)),m=Do(n,i),m!=null&&c.push(hs(n,m,x))),n.tag===3)return c;n=n.return}return[]}function I2(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function sx(n,i,s,c,m){for(var x=i._reactName,E=[];s!==null&&s!==c;){var D=s,G=D.alternate,ee=D.stateNode;if(D=D.tag,G!==null&&G===c)break;D!==5&&D!==26&&D!==27||ee===null||(G=ee,m?(ee=Do(s,x),ee!=null&&E.unshift(hs(s,ee,G))):m||(ee=Do(s,x),ee!=null&&E.push(hs(s,ee,G)))),s=s.return}E.length!==0&&n.push({event:i,listeners:E})}var B2=/\r\n?/g,H2=/\u0000|\uFFFD/g;function lx(n){return(typeof n=="string"?n:""+n).replace(B2,`
9
- `).replace(H2,"")}function ux(n,i){return i=lx(i),lx(n)===i}function Je(n,i,s,c,m,x){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||ya(n,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&ya(n,""+c);break;case"className":ma(n,"class",c);break;case"tabIndex":ma(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ma(n,s,c);break;case"style":ug(n,c,x);break;case"data":if(i!=="object"){ma(n,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){n.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Ll(""+c),n.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(s,"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 x=="function"&&(s==="formAction"?(i!=="input"&&Je(n,i,"name",m.name,m,null),Je(n,i,"formEncType",m.formEncType,m,null),Je(n,i,"formMethod",m.formMethod,m,null),Je(n,i,"formTarget",m.formTarget,m,null)):(Je(n,i,"encType",m.encType,m,null),Je(n,i,"method",m.method,m,null),Je(n,i,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(s);break}c=Ll(""+c),n.setAttribute(s,c);break;case"onClick":c!=null&&(n.onclick=sr);break;case"onScroll":c!=null&&Ie("scroll",n);break;case"onScrollEnd":c!=null&&Ie("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}s=Ll(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""+c):n.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":c===!0?n.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(s,c):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(s,c):n.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(s):n.setAttribute(s,c);break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),pa(n,"popover",c);break;case"xlinkActuate":On(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":On(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":On(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":On(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":On(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":On(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":On(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":On(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":On(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":pa(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=hC.get(s)||s,pa(n,s,c))}}function ah(n,i,s,c,m,x){switch(s){case"style":ug(n,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(m.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"children":typeof c=="string"?ya(n,c):(typeof c=="number"||typeof c=="bigint")&&ya(n,""+c);break;case"onScroll":c!=null&&Ie("scroll",n);break;case"onScrollEnd":c!=null&&Ie("scrollend",n);break;case"onClick":c!=null&&(n.onclick=sr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rl.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(m=s.endsWith("Capture"),i=s.slice(2,m?s.length-7:void 0),x=n[zt]||null,x=x!=null?x[s]:null,typeof x=="function"&&n.removeEventListener(i,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(i,c,m);break e}s in n?n[s]=c:c===!0?n.setAttribute(s,""):pa(n,s,c)}}}function Rt(n,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",n),Ie("load",n);var c=!1,m=!1,x;for(x in s)if(s.hasOwnProperty(x)){var E=s[x];if(E!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Je(n,i,x,E,s,null)}}m&&Je(n,i,"srcSet",s.srcSet,s,null),c&&Je(n,i,"src",s.src,s,null);return;case"input":Ie("invalid",n);var D=x=E=m=null,G=null,ee=null;for(c in s)if(s.hasOwnProperty(c)){var ae=s[c];if(ae!=null)switch(c){case"name":m=ae;break;case"type":E=ae;break;case"checked":G=ae;break;case"defaultChecked":ee=ae;break;case"value":x=ae;break;case"defaultValue":D=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:Je(n,i,c,ae,s,null)}}zl(n,x,D,G,ee,E,m,!1);return;case"select":Ie("invalid",n),c=E=x=null;for(m in s)if(s.hasOwnProperty(m)&&(D=s[m],D!=null))switch(m){case"value":x=D;break;case"defaultValue":E=D;break;case"multiple":c=D;default:Je(n,i,m,D,s,null)}i=x,s=E,n.multiple=!!c,i!=null?or(n,!!c,i,!1):s!=null&&or(n,!!c,s,!0);return;case"textarea":Ie("invalid",n),x=m=c=null;for(E in s)if(s.hasOwnProperty(E)&&(D=s[E],D!=null))switch(E){case"value":c=D;break;case"defaultValue":m=D;break;case"children":x=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(a(91));break;default:Je(n,i,E,D,s,null)}sg(n,c,m,x);return;case"option":for(G in s)s.hasOwnProperty(G)&&(c=s[G],c!=null)&&(G==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":Je(n,i,G,c,s,null));return;case"dialog":Ie("beforetoggle",n),Ie("toggle",n),Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(c=0;c<ds.length;c++)Ie(ds[c],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in s)if(s.hasOwnProperty(ee)&&(c=s[ee],c!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Je(n,i,ee,c,s,null)}return;default:if(vf(i)){for(ae in s)s.hasOwnProperty(ae)&&(c=s[ae],c!==void 0&&ah(n,i,ae,c,s,void 0));return}}for(D in s)s.hasOwnProperty(D)&&(c=s[D],c!=null&&Je(n,i,D,c,s,null))}function P2(n,i,s,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,E=null,D=null,G=null,ee=null,ae=null;for(re in s){var se=s[re];if(s.hasOwnProperty(re)&&se!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":G=se;default:c.hasOwnProperty(re)||Je(n,i,re,null,c,se)}}for(var ne in c){var re=c[ne];if(se=s[ne],c.hasOwnProperty(ne)&&(re!=null||se!=null))switch(ne){case"type":x=re;break;case"name":m=re;break;case"checked":ee=re;break;case"defaultChecked":ae=re;break;case"value":E=re;break;case"defaultValue":D=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:re!==se&&Je(n,i,ne,re,c,se)}}Si(n,E,D,G,ee,ae,x,m);return;case"select":re=E=D=ne=null;for(x in s)if(G=s[x],s.hasOwnProperty(x)&&G!=null)switch(x){case"value":break;case"multiple":re=G;default:c.hasOwnProperty(x)||Je(n,i,x,null,c,G)}for(m in c)if(x=c[m],G=s[m],c.hasOwnProperty(m)&&(x!=null||G!=null))switch(m){case"value":ne=x;break;case"defaultValue":D=x;break;case"multiple":E=x;default:x!==G&&Je(n,i,m,x,c,G)}i=D,s=E,c=re,ne!=null?or(n,!!s,ne,!1):!!c!=!!s&&(i!=null?or(n,!!s,i,!0):or(n,!!s,s?[]:"",!1));return;case"textarea":re=ne=null;for(D in s)if(m=s[D],s.hasOwnProperty(D)&&m!=null&&!c.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Je(n,i,D,null,c,m)}for(E in c)if(m=c[E],x=s[E],c.hasOwnProperty(E)&&(m!=null||x!=null))switch(E){case"value":ne=m;break;case"defaultValue":re=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(a(91));break;default:m!==x&&Je(n,i,E,m,c,x)}og(n,ne,re);return;case"option":for(var ye in s)ne=s[ye],s.hasOwnProperty(ye)&&ne!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?n.selected=!1:Je(n,i,ye,null,c,ne));for(G in c)ne=c[G],re=s[G],c.hasOwnProperty(G)&&ne!==re&&(ne!=null||re!=null)&&(G==="selected"?n.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Je(n,i,G,ne,c,re));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 ke in s)ne=s[ke],s.hasOwnProperty(ke)&&ne!=null&&!c.hasOwnProperty(ke)&&Je(n,i,ke,null,c,ne);for(ee in c)if(ne=c[ee],re=s[ee],c.hasOwnProperty(ee)&&ne!==re&&(ne!=null||re!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:Je(n,i,ee,ne,c,re)}return;default:if(vf(i)){for(var et in s)ne=s[et],s.hasOwnProperty(et)&&ne!==void 0&&!c.hasOwnProperty(et)&&ah(n,i,et,void 0,c,ne);for(ae in c)ne=c[ae],re=s[ae],!c.hasOwnProperty(ae)||ne===re||ne===void 0&&re===void 0||ah(n,i,ae,ne,c,re);return}}for(var W in s)ne=s[W],s.hasOwnProperty(W)&&ne!=null&&!c.hasOwnProperty(W)&&Je(n,i,W,null,c,ne);for(se in c)ne=c[se],re=s[se],!c.hasOwnProperty(se)||ne===re||ne==null&&re==null||Je(n,i,se,ne,c,re)}function cx(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function U2(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var m=s[c],x=m.transferSize,E=m.initiatorType,D=m.duration;if(x&&D&&cx(E)){for(E=0,D=m.responseEnd,c+=1;c<s.length;c++){var G=s[c],ee=G.startTime;if(ee>D)break;var ae=G.transferSize,se=G.initiatorType;ae&&cx(se)&&(G=G.responseEnd,E+=ae*(G<D?1:(D-ee)/(G-ee)))}if(--c,i+=8*(x+E)/(m.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var oh=null,sh=null;function Ru(n){return n.nodeType===9?n:n.ownerDocument}function fx(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dx(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function lh(n,i){return n==="textarea"||n==="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 uh=null;function V2(){var n=window.event;return n&&n.type==="popstate"?n===uh?!1:(uh=n,!0):(uh=null,!1)}var hx=typeof setTimeout=="function"?setTimeout:void 0,q2=typeof clearTimeout=="function"?clearTimeout:void 0,px=typeof Promise=="function"?Promise:void 0,F2=typeof queueMicrotask=="function"?queueMicrotask:typeof px<"u"?function(n){return px.resolve(null).then(n).catch(Y2)}:hx;function Y2(n){setTimeout(function(){throw n})}function Jr(n){return n==="head"}function mx(n,i){var s=i,c=0;do{var m=s.nextSibling;if(n.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"||s==="/&"){if(c===0){n.removeChild(m),Xa(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")ps(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,ps(s);for(var x=s.firstChild;x;){var E=x.nextSibling,D=x.nodeName;x[bi]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=E}}else s==="body"&&ps(n.ownerDocument.body);s=m}while(s);Xa(i)}function gx(n,i){var s=n;n=0;do{var c=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=c}while(s)}function ch(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ch(s),Ro(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function $2(n,i,s,c){for(;n.nodeType===1;){var m=s;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[bi])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==m.rel||n.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||n.getAttribute("title")!==(m.title==null?null:m.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(m.src==null?null:m.src)||n.getAttribute("type")!==(m.type==null?null:m.type)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=Mn(n.nextSibling),n===null)break}return null}function G2(n,i,s){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=Mn(n.nextSibling),n===null))return null;return n}function yx(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Mn(n.nextSibling),n===null))return null;return n}function fh(n){return n.data==="$?"||n.data==="$~"}function dh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function X2(n,i){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Mn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var hh=null;function xx(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(i===0)return Mn(n.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}n=n.nextSibling}return null}function vx(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return n;i--}else s!=="/$"&&s!=="/&"||i++}n=n.previousSibling}return null}function bx(n,i,s){switch(i=Ru(s),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function ps(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Ro(n)}var Tn=new Map,wx=new Set;function ju(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Er=q.d;q.d={f:Q2,r:K2,D:Z2,C:W2,L:J2,m:e_,X:n_,S:t_,M:r_};function Q2(){var n=Er.f(),i=Eu();return n||i}function K2(n){var i=jr(n);i!==null&&i.tag===5&&i.type==="form"?By(i):Er.r(n)}var Ya=typeof document>"u"?null:document;function Sx(n,i,s){var c=Ya;if(c&&typeof i=="string"&&i){var m=Ft(i);m='link[rel="'+n+'"][href="'+m+'"]',typeof s=="string"&&(m+='[crossorigin="'+s+'"]'),wx.has(m)||(wx.add(m),n={rel:n,crossOrigin:s,href:i},c.querySelector(m)===null&&(i=c.createElement("link"),Rt(i,"link",n),gt(i),c.head.appendChild(i)))}}function Z2(n){Er.D(n),Sx("dns-prefetch",n,null)}function W2(n,i){Er.C(n,i),Sx("preconnect",n,i)}function J2(n,i,s){Er.L(n,i,s);var c=Ya;if(c&&n&&i){var m='link[rel="preload"][as="'+Ft(i)+'"]';i==="image"&&s&&s.imageSrcSet?(m+='[imagesrcset="'+Ft(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(m+='[imagesizes="'+Ft(s.imageSizes)+'"]')):m+='[href="'+Ft(n)+'"]';var x=m;switch(i){case"style":x=$a(n);break;case"script":x=Ga(n)}Tn.has(x)||(n=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),Tn.set(x,n),c.querySelector(m)!==null||i==="style"&&c.querySelector(ms(x))||i==="script"&&c.querySelector(gs(x))||(i=c.createElement("link"),Rt(i,"link",n),gt(i),c.head.appendChild(i)))}}function e_(n,i){Er.m(n,i);var s=Ya;if(s&&n){var c=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Ft(c)+'"][href="'+Ft(n)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ga(n)}if(!Tn.has(x)&&(n=g({rel:"modulepreload",href:n},i),Tn.set(x,n),s.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(gs(x)))return}c=s.createElement("link"),Rt(c,"link",n),gt(c),s.head.appendChild(c)}}}function t_(n,i,s){Er.S(n,i,s);var c=Ya;if(c&&n){var m=Dr(c).hoistableStyles,x=$a(n);i=i||"default";var E=m.get(x);if(!E){var D={loading:0,preload:null};if(E=c.querySelector(ms(x)))D.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":i},s),(s=Tn.get(x))&&ph(n,s);var G=E=c.createElement("link");gt(G),Rt(G,"link",n),G._p=new Promise(function(ee,ae){G.onload=ee,G.onerror=ae}),G.addEventListener("load",function(){D.loading|=1}),G.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Ou(E,i,c)}E={type:"stylesheet",instance:E,count:1,state:D},m.set(x,E)}}}function n_(n,i){Er.X(n,i);var s=Ya;if(s&&n){var c=Dr(s).hoistableScripts,m=Ga(n),x=c.get(m);x||(x=s.querySelector(gs(m)),x||(n=g({src:n,async:!0},i),(i=Tn.get(m))&&mh(n,i),x=s.createElement("script"),gt(x),Rt(x,"link",n),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function r_(n,i){Er.M(n,i);var s=Ya;if(s&&n){var c=Dr(s).hoistableScripts,m=Ga(n),x=c.get(m);x||(x=s.querySelector(gs(m)),x||(n=g({src:n,async:!0,type:"module"},i),(i=Tn.get(m))&&mh(n,i),x=s.createElement("script"),gt(x),Rt(x,"link",n),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function Ex(n,i,s,c){var m=(m=fe.current)?ju(m):null;if(!m)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=$a(s.href),s=Dr(m).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=$a(s.href);var x=Dr(m).hoistableStyles,E=x.get(n);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,E),(x=m.querySelector(ms(n)))&&!x._p&&(E.instance=x,E.state.loading=5),Tn.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Tn.set(n,s),x||i_(m,n,s,E.state))),i&&c===null)throw Error(a(528,""));return E}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ga(s),s=Dr(m).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function $a(n){return'href="'+Ft(n)+'"'}function ms(n){return'link[rel="stylesheet"]['+n+"]"}function Cx(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function i_(n,i,s,c){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=n.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),Rt(i,"link",s),gt(i),n.head.appendChild(i))}function Ga(n){return'[src="'+Ft(n)+'"]'}function gs(n){return"script[async]"+n}function _x(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=n.querySelector('style[data-href~="'+Ft(s.href)+'"]');if(c)return i.instance=c,gt(c),c;var m=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),gt(c),Rt(c,"style",m),Ou(c,s.precedence,n),i.instance=c;case"stylesheet":m=$a(s.href);var x=n.querySelector(ms(m));if(x)return i.state.loading|=4,i.instance=x,gt(x),x;c=Cx(s),(m=Tn.get(m))&&ph(c,m),x=(n.ownerDocument||n).createElement("link"),gt(x);var E=x;return E._p=new Promise(function(D,G){E.onload=D,E.onerror=G}),Rt(x,"link",c),i.state.loading|=4,Ou(x,s.precedence,n),i.instance=x;case"script":return x=Ga(s.src),(m=n.querySelector(gs(x)))?(i.instance=m,gt(m),m):(c=s,(m=Tn.get(x))&&(c=g({},s),mh(c,m)),n=n.ownerDocument||n,m=n.createElement("script"),gt(m),Rt(m,"link",c),n.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Ou(c,s.precedence,n));return i.instance}function Ou(n,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,E=0;E<c.length;E++){var D=c[E];if(D.dataset.precedence===i)x=D;else if(x!==m)break}x?x.parentNode.insertBefore(n,x.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(n,i.firstChild))}function ph(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function mh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Du=null;function Nx(n,i,s){if(Du===null){var c=new Map,m=Du=new Map;m.set(s,c)}else m=Du,c=m.get(s),c||(c=new Map,m.set(s,c));if(c.has(n))return c;for(c.set(n,null),s=s.getElementsByTagName(n),m=0;m<s.length;m++){var x=s[m];if(!(x[bi]||x[Et]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(i)||"";E=n+E;var D=c.get(E);D?D.push(x):c.set(E,[x])}}return c}function kx(n,i,s){n=n.ownerDocument||n,n.head.insertBefore(s,i==="title"?n.querySelector("head > title"):null)}function a_(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){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"?(n=i.disabled,typeof i.precedence=="string"&&n==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 Mx(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function o_(n,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var m=$a(c.href),x=i.querySelector(ms(m));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=zu.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=x,gt(x);return}x=i.ownerDocument||i,c=Cx(c),(m=Tn.get(m))&&ph(c,m),x=x.createElement("link"),gt(x);var E=x;E._p=new Promise(function(D,G){E.onload=D,E.onerror=G}),Rt(x,"link",c),s.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=zu.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var gh=0;function s_(n,i){return n.stylesheets&&n.count===0&&Iu(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var c=setTimeout(function(){if(n.stylesheets&&Iu(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+i);0<n.imgBytes&&gh===0&&(gh=62500*U2());var m=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Iu(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>gh?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function zu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Iu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Lu=null;function Iu(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Lu=new Map,i.forEach(l_,n),Lu=null,zu.call(n))}function l_(n,i){if(!(i.state.loading&4)){var s=Lu.get(n);if(s)var c=s.get(null);else{s=new Map,Lu.set(n,s);for(var m=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var E=m[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(s.set(E.dataset.precedence,E),c=E)}c&&s.set(null,c)}m=i.instance,E=m.getAttribute("data-precedence"),x=s.get(E)||c,x===c&&s.set(null,m),s.set(E,m),this.count++,c=zu.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(m,n.firstChild)),i.state.loading|=4}}var ys={$$typeof:_,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function u_(n,i,s,c,m,x,E,D,G){this.tag=1,this.containerInfo=n,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=Mo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mo(0),this.hiddenUpdates=Mo(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function Tx(n,i,s,c,m,x,E,D,G,ee,ae,se){return n=new u_(n,i,s,E,G,ee,ae,se,D),i=1,x===!0&&(i|=24),x=un(3,null,null,i),n.current=x,x.stateNode=n,i=Qf(),i.refCount++,n.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:s,cache:i},Jf(x),n}function Ax(n){return n?(n=Ca,n):Ca}function Rx(n,i,s,c,m,x){m=Ax(m),c.context===null?c.context=m:c.pendingContext=m,c=Vr(i),c.payload={element:s},x=x===void 0?null:x,x!==null&&(c.callback=x),s=qr(n,c,i),s!==null&&(Kt(s,n,i),Qo(s,n,i))}function jx(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<i?s:i}}function yh(n,i){jx(n,i),(n=n.alternate)&&jx(n,i)}function Ox(n){if(n.tag===13||n.tag===31){var i=Ni(n,67108864);i!==null&&Kt(i,n,67108864),yh(n,67108864)}}function Dx(n){if(n.tag===13||n.tag===31){var i=pn();i=To(i);var s=Ni(n,i);s!==null&&Kt(s,n,i),yh(n,i)}}var Bu=!0;function c_(n,i,s,c){var m=M.T;M.T=null;var x=q.p;try{q.p=2,xh(n,i,s,c)}finally{q.p=x,M.T=m}}function f_(n,i,s,c){var m=M.T;M.T=null;var x=q.p;try{q.p=8,xh(n,i,s,c)}finally{q.p=x,M.T=m}}function xh(n,i,s,c){if(Bu){var m=vh(c);if(m===null)ih(n,i,c,Hu,s),Lx(n,c);else if(h_(m,n,i,s,c))c.stopPropagation();else if(Lx(n,c),i&4&&-1<d_.indexOf(n)){for(;m!==null;){var x=jr(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=rr(x.pendingLanes);if(E!==0){var D=x;for(D.pendingLanes|=2,D.entangledLanes|=2;E;){var G=1<<31-Qe(E);D.entanglements[1]|=G,E&=~G}Gn(x),(Ge&6)===0&&(wu=Te()+500,fs(0))}}break;case 31:case 13:D=Ni(x,2),D!==null&&Kt(D,x,2),Eu(),yh(x,2)}if(x=vh(c),x===null&&ih(n,i,c,Hu,s),x===m)break;m=x}m!==null&&c.stopPropagation()}else ih(n,i,c,null,s)}}function vh(n){return n=wf(n),bh(n)}var Hu=null;function bh(n){if(Hu=null,n=Rr(n),n!==null){var i=l(n);if(i===null)n=null;else{var s=i.tag;if(s===13){if(n=u(i),n!==null)return n;n=null}else if(s===31){if(n=f(i),n!==null)return n;n=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Hu=n,null}function zx(n){switch(n){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(ct()){case ie:return 2;case me:return 8;case Ne:case ze:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var wh=!1,ei=null,ti=null,ni=null,xs=new Map,vs=new Map,ri=[],d_="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 Lx(n,i){switch(n){case"focusin":case"focusout":ei=null;break;case"dragenter":case"dragleave":ti=null;break;case"mouseover":case"mouseout":ni=null;break;case"pointerover":case"pointerout":xs.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(i.pointerId)}}function bs(n,i,s,c,m,x){return n===null||n.nativeEvent!==x?(n={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},i!==null&&(i=jr(i),i!==null&&Ox(i)),n):(n.eventSystemFlags|=c,i=n.targetContainers,m!==null&&i.indexOf(m)===-1&&i.push(m),n)}function h_(n,i,s,c,m){switch(i){case"focusin":return ei=bs(ei,n,i,s,c,m),!0;case"dragenter":return ti=bs(ti,n,i,s,c,m),!0;case"mouseover":return ni=bs(ni,n,i,s,c,m),!0;case"pointerover":var x=m.pointerId;return xs.set(x,bs(xs.get(x)||null,n,i,s,c,m)),!0;case"gotpointercapture":return x=m.pointerId,vs.set(x,bs(vs.get(x)||null,n,i,s,c,m)),!0}return!1}function Ix(n){var i=Rr(n.target);if(i!==null){var s=l(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){n.blockedOn=i,kl(n.priority,function(){Dx(s)});return}}else if(i===31){if(i=f(s),i!==null){n.blockedOn=i,kl(n.priority,function(){Dx(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Pu(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var s=vh(n.nativeEvent);if(s===null){s=n.nativeEvent;var c=new s.constructor(s.type,s);bf=c,s.target.dispatchEvent(c),bf=null}else return i=jr(s),i!==null&&Ox(i),n.blockedOn=s,!1;i.shift()}return!0}function Bx(n,i,s){Pu(n)&&s.delete(i)}function p_(){wh=!1,ei!==null&&Pu(ei)&&(ei=null),ti!==null&&Pu(ti)&&(ti=null),ni!==null&&Pu(ni)&&(ni=null),xs.forEach(Bx),vs.forEach(Bx)}function Uu(n,i){n.blockedOn===i&&(n.blockedOn=null,wh||(wh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,p_)))}var Vu=null;function Hx(n){Vu!==n&&(Vu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vu===n&&(Vu=null);for(var i=0;i<n.length;i+=3){var s=n[i],c=n[i+1],m=n[i+2];if(typeof c!="function"){if(bh(c||s)===null)continue;break}var x=jr(s);x!==null&&(n.splice(i,3),i-=3,vd(x,{pending:!0,data:m,method:s.method,action:c},c,m))}}))}function Xa(n){function i(G){return Uu(G,n)}ei!==null&&Uu(ei,n),ti!==null&&Uu(ti,n),ni!==null&&Uu(ni,n),xs.forEach(i),vs.forEach(i);for(var s=0;s<ri.length;s++){var c=ri[s];c.blockedOn===n&&(c.blockedOn=null)}for(;0<ri.length&&(s=ri[0],s.blockedOn===null);)Ix(s),s.blockedOn===null&&ri.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var m=s[c],x=s[c+1],E=m[zt]||null;if(typeof x=="function")E||Hx(s);else if(E){var D=null;if(x&&x.hasAttribute("formAction")){if(m=x,E=x[zt]||null)D=E.formAction;else if(bh(m)!==null)continue}else D=E.action;typeof D=="function"?s[c+1]=D:(s.splice(c,3),c-=3),Hx(s)}}}function Px(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function i(){m!==null&&(m(),m=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),m!==null&&(m(),m=null)}}}function Sh(n){this._internalRoot=n}qu.prototype.render=Sh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=pn();Rx(s,c,n,i,null,null)},qu.prototype.unmount=Sh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Rx(n.current,2,null,n,null,null),Eu(),i[ir]=null}};function qu(n){this._internalRoot=n}qu.prototype.unstable_scheduleHydration=function(n){if(n){var i=Nl();n={blockedOn:null,target:n,priority:i};for(var s=0;s<ri.length&&i!==0&&i<ri[s].priority;s++);ri.splice(s,0,n),s===0&&Ix(n)}};var Ux=t.version;if(Ux!=="19.2.4")throw Error(a(527,Ux,"19.2.4"));q.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=d(i),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var m_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fu.isDisabled&&Fu.supportsFiber)try{kt=Fu.inject(m_),ht=Fu}catch{}}return Ss.createRoot=function(n,i){if(!o(n))throw Error(a(299));var s=!1,c="",m=Xy,x=Qy,E=Ky;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError)),i=Tx(n,1,!1,null,null,s,c,null,m,x,E,Px),n[ir]=i.current,rh(n),new Sh(i)},Ss.hydrateRoot=function(n,i,s){if(!o(n))throw Error(a(299));var c=!1,m="",x=Xy,E=Qy,D=Ky,G=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(E=s.onCaughtError),s.onRecoverableError!==void 0&&(D=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),i=Tx(n,1,!0,i,s??null,c,m,G,x,E,D,Px),i.context=Ax(null),s=i.current,c=pn(),c=To(c),m=Vr(c),m.callback=null,qr(s,m,c),s=c,i.current.lanes=s,vi(i,s),Gn(i),n[ir]=i.current,rh(n),new qu(i)},Ss.version="19.2.4",Ss}var Zx;function C_(){if(Zx)return _h.exports;Zx=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(t){console.error(t)}}return e(),_h.exports=E_(),_h.exports}var __=C_(),dl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N_=class extends dl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},om=new N_,k_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},M_=class{#e=k_;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Vi=new M_;function T_(e){setTimeout(e,0)}var A_=typeof window>"u"||"Deno"in globalThis;function Wt(){}function R_(e,t){return typeof e=="function"?e(t):e}function mp(e){return typeof e=="number"&&e>=0&&e!==1/0}function V1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hi(e,t){return typeof e=="function"?e(t):e}function An(e,t){return typeof e=="function"?e(t):e}function Wx(e,t){const{type:r="all",exact:a,fetchStatus:o,predicate:l,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==sm(u,t.options))return!1}else if(!Ys(t.queryKey,u))return!1}if(r!=="all"){const h=t.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||l&&!l(t))}function Jx(e,t){const{exact:r,status:a,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(Fs(t.options.mutationKey)!==Fs(l))return!1}else if(!Ys(t.options.mutationKey,l))return!1}return!(a&&t.state.status!==a||o&&!o(t))}function sm(e,t){return(t?.queryKeyHashFn||Fs)(e)}function Fs(e){return JSON.stringify(e,(t,r)=>yp(r)?Object.keys(r).sort().reduce((a,o)=>(a[o]=r[o],a),{}):r)}function Ys(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ys(e[r],t[r])):!1}var j_=Object.prototype.hasOwnProperty;function q1(e,t,r=0){if(e===t)return e;if(r>500)return t;const a=ev(e)&&ev(t);if(!a&&!(yp(e)&&yp(t)))return t;const l=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,h=a?new Array(f):{};let d=0;for(let p=0;p<f;p++){const g=a?p:u[p],y=e[g],v=t[g];if(y===v){h[g]=y,(a?p<l:j_.call(e,g))&&d++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){h[g]=v;continue}const w=q1(y,v,r+1);h[g]=w,w===y&&d++}return l===f&&d===l?e:h}function gp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ev(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yp(e){if(!tv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!tv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tv(e){return Object.prototype.toString.call(e)==="[object Object]"}function O_(e){return new Promise(t=>{Vi.setTimeout(t,e)})}function xp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?q1(e,t):t}function D_(e,t,r=0){const a=[...e,t];return r&&a.length>r?a.slice(1):a}function z_(e,t,r=0){const a=[t,...e];return r&&a.length>r?a.slice(0,-1):a}var lm=Symbol();function F1(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===lm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Y1(e,t){return typeof e=="function"?e(...t):!!e}function L_(e,t,r){let a=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),a||(a=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var $s=(()=>{let e=()=>A_;return{isServer(){return e()},setIsServer(t){e=t}}})();function vp(){let e,t;const r=new Promise((o,l)=>{e=o,t=l});r.status="pending",r.catch(()=>{});function a(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{a({status:"fulfilled",value:o}),e(o)},r.reject=o=>{a({status:"rejected",reason:o}),t(o)},r}var I_=T_;function B_(){let e=[],t=0,r=f=>{f()},a=f=>{f()},o=I_;const l=f=>{t?e.push(f):o(()=>{r(f)})},u=()=>{const f=e;e=[],f.length&&o(()=>{a(()=>{f.forEach(h=>{r(h)})})})};return{batch:f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},batchCalls:f=>(...h)=>{l(()=>{f(...h)})},schedule:l,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{o=f}}}var jt=B_(),H_=class extends dl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},vc=new H_;function P_(e){return Math.min(1e3*2**e,3e4)}function $1(e){return(e??"online")==="online"?vc.isOnline():!0}var bp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function G1(e){let t=!1,r=0,a;const o=vp(),l=()=>o.status!=="pending",u=C=>{if(!l()){const N=new bp(C);y(N),e.onCancel?.(N)}},f=()=>{t=!0},h=()=>{t=!1},d=()=>om.isFocused()&&(e.networkMode==="always"||vc.isOnline())&&e.canRun(),p=()=>$1(e.networkMode)&&e.canRun(),g=C=>{l()||(a?.(),o.resolve(C))},y=C=>{l()||(a?.(),o.reject(C))},v=()=>new Promise(C=>{a=N=>{(l()||d())&&C(N)},e.onPause?.()}).then(()=>{a=void 0,l()||e.onContinue?.()}),w=()=>{if(l())return;let C;const N=r===0?e.initialPromise:void 0;try{C=N??e.fn()}catch(S){C=Promise.reject(S)}Promise.resolve(C).then(g).catch(S=>{if(l())return;const A=e.retry??($s.isServer()?0:3),_=e.retryDelay??P_,k=typeof _=="function"?_(r,S):_,B=A===!0||typeof A=="number"&&r<A||typeof A=="function"&&A(r,S);if(t||!B){y(S);return}r++,e.onFail?.(r,S),O_(k).then(()=>d()?void 0:v()).then(()=>{t?y(S):w()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(a?.(),o),cancelRetry:f,continueRetry:h,canStart:p,start:()=>(p()?w():v().then(w),o)}}var X1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mp(this.gcTime)&&(this.#e=Vi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($s.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Vi.clearTimeout(this.#e),this.#e=void 0)}},U_=class extends X1{#e;#t;#n;#i;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=rv(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=rv(this.options);t.data!==void 0&&(this.setState(nv(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=xp(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#l({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>An(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!V1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a||this.#s()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},o=()=>{const f=F1(this.options,t),d=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(p),p})();return this.#a=!1,this.options.persister?this.options.persister(f,d,this):f(d)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return a(f),f})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=G1({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof bp&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(f,h)=>{this.#l({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof bp){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#l({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Q1(r.data,this.options),fetchMeta:e.meta??null};case"success":const a={...r,...nv(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?a:void 0,a;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),jt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Q1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rv(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var V_=class extends dl{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#a=vp(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#o;#a;#s;#l;#h;#p;#c;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),iv(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof An(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!gp(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&av(this.#t,r,this.options,t)&&this.#d(),this.updateResult(),a&&(this.#t!==r||An(this.options.enabled,this.#t)!==An(t.enabled,this.#t)||hi(this.options.staleTime,this.#t)!==hi(t.staleTime,this.#t))&&this.#g();const o=this.#y();a&&(this.#t!==r||An(this.options.enabled,this.#t)!==An(t.enabled,this.#t)||o!==this.#u)&&this.#x(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return F_(this,r)&&(this.#i=r,this.#o=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(r,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Wt)),t}#g(){this.#b();const e=hi(this.options.staleTime,this.#t);if($s.isServer()||this.#i.isStale||!mp(e))return;const r=V1(this.#i.dataUpdatedAt,e)+1;this.#c=Vi.setTimeout(()=>{this.#i.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#x(e){this.#w(),this.#u=e,!($s.isServer()||An(this.options.enabled,this.#t)===!1||!mp(this.#u)||this.#u===0)&&(this.#f=Vi.setInterval(()=>{(this.options.refetchIntervalInBackground||om.isFocused())&&this.#d()},this.#u))}#v(){this.#g(),this.#x(this.#y())}#b(){this.#c&&(Vi.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#f&&(Vi.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,a=this.options,o=this.#i,l=this.#r,u=this.#o,h=e!==r?e.state:this.#n,{state:d}=e;let p={...d},g=!1,y;if(t._optimisticResults){const U=this.hasListeners(),P=!U&&iv(e,t),F=U&&av(e,r,t,a);(P||F)&&(p={...p,...Q1(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:C}=p;y=p.data;let N=!1;if(t.placeholderData!==void 0&&y===void 0&&C==="pending"){let U;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(U=o.data,N=!0):U=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,U!==void 0&&(C="success",y=xp(o?.data,U,t),g=!0)}if(t.select&&y!==void 0&&!N)if(o&&y===l?.data&&t.select===this.#l)y=this.#h;else try{this.#l=t.select,y=t.select(y),y=xp(o?.data,y,t),this.#h=y,this.#s=null}catch(U){this.#s=U}this.#s&&(v=this.#s,y=this.#h,w=Date.now(),C="error");const S=p.fetchStatus==="fetching",A=C==="pending",_=C==="error",k=A&&S,B=y!==void 0,O={status:C,fetchStatus:p.fetchStatus,isPending:A,isSuccess:C==="success",isError:_,isInitialLoading:k,isLoading:k,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:S,isRefetching:S&&!A,isLoadingError:_&&!B,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:_&&B,isStale:um(e,t),refetch:this.refetch,promise:this.#a,isEnabled:An(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const U=O.data!==void 0,P=O.status==="error"&&!U,F=Q=>{P?Q.reject(O.error):U&&Q.resolve(O.data)},I=()=>{const Q=this.#a=O.promise=vp();F(Q)},Y=this.#a;switch(Y.status){case"pending":e.queryHash===r.queryHash&&F(Y);break;case"fulfilled":(P||O.data!==Y.value)&&I();break;case"rejected":(!P||O.error!==Y.reason)&&I();break}}return O}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#p=this.#t),gp(t,e))return;this.#i=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#m.size)return!0;const l=new Set(o??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const f=u;return this.#i[f]!==e[f]&&l.has(f)})};this.#E({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#E(e){jt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function q_(e,t){return An(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function iv(e,t){return q_(e,t)||e.state.data!==void 0&&wp(e,t,t.refetchOnMount)}function wp(e,t,r){if(An(t.enabled,e)!==!1&&hi(t.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&um(e,t)}return!1}function av(e,t,r,a){return(e!==t||An(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&um(e,r)}function um(e,t){return An(t.enabled,e)!==!1&&e.isStaleByTime(hi(t.staleTime,e))}function F_(e,t){return!gp(e.getCurrentResult(),t)}function ov(e){return{onFetch:(t,r)=>{const a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const d=async()=>{let p=!1;const g=w=>{L_(w,()=>t.signal,()=>p=!0)},y=F1(t.options,t.fetchOptions),v=async(w,C,N)=>{if(p)return Promise.reject();if(C==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:C,direction:N?"backward":"forward",meta:t.options.meta};return g(T),T})(),_=await y(A),{maxPages:k}=t.options,B=N?z_:D_;return{pages:B(w.pages,_,k),pageParams:B(w.pageParams,C,k)}};if(o&&l.length){const w=o==="backward",C=w?Y_:sv,N={pages:l,pageParams:u},S=C(a,N);f=await v(N,S,w)}else{const w=e??l.length;do{const C=h===0?u[0]??a.initialPageParam:sv(a,f);if(h>0&&C==null)break;f=await v(f,C),h++}while(h<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d}}}function sv(e,{pages:t,pageParams:r}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}function Y_(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var $_=class extends X1{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||G_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=G1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",o=!this.#i.canStart();try{if(a)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#i.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#r({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#r(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),jt.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function G_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var X_=class extends dl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const a=new $_({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(a),a}add(e){this.#e.add(e);const t=Yu(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Yu(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Yu(e);if(typeof t=="string"){const a=this.#t.get(t)?.find(o=>o.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Yu(e);return typeof t=="string"?this.#t.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){jt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Jx(t,r))}findAll(e={}){return this.getAll().filter(t=>Jx(e,t))}notify(e){jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return jt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Wt))))}};function Yu(e){return e.options.scope?.id}var Q_=class extends dl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const a=t.queryKey,o=t.queryHash??sm(a,t);let l=this.get(o);return l||(l=new U_({client:e,queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Wx(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Wx(e,r)):t}notify(e){jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){jt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},K_=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new Q_,this.#t=e.mutationCache||new X_,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=om.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=vc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(hi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const a=r.data;return[t,a]})}setQueryData(e,t,r){const a=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(a.queryHash)?.state.data,u=R_(t,l);if(u!==void 0)return this.#e.build(this,a).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return jt.batch(()=>this.#e.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;jt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return jt.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},a=jt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(a).then(Wt).catch(Wt)}invalidateQueries(e,t={}){return jt.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},a=jt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,r);return r.throwOnError||(l=l.catch(Wt)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(a).then(Wt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(hi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wt).catch(Wt)}fetchInfiniteQuery(e){return e.behavior=ov(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wt).catch(Wt)}ensureInfiniteQueryData(e){return e.behavior=ov(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Fs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(a=>{Ys(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,t){this.#r.set(Fs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(a=>{Ys(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lm&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},K1=H.createContext(void 0),cm=e=>{const t=H.useContext(K1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Z_=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(K1.Provider,{value:e,children:t})),Z1=H.createContext(!1),W_=()=>H.useContext(Z1);Z1.Provider;function J_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eN=H.createContext(J_()),tN=()=>H.useContext(eN),nN=(e,t,r)=>{const a=r?.state.error&&typeof e.throwOnError=="function"?Y1(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},rN=e=>{H.useEffect(()=>{e.clearReset()},[e])},iN=({result:e,errorResetBoundary:t,throwOnError:r,query:a,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(o&&e.data===void 0||Y1(r,[e.error,a])),aN=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...o)=>r(a(...o)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oN=(e,t)=>e.isLoading&&e.isFetching&&!t,sN=(e,t)=>e?.suspense&&t.isPending,lv=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function lN(e,t,r){const a=W_(),o=tN(),l=cm(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=l.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",aN(u),nN(u,o,f),rN(o);const h=!l.getQueryCache().get(u.queryHash),[d]=H.useState(()=>new t(l,u)),p=d.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(H.useSyncExternalStore(H.useCallback(y=>{const v=g?d.subscribe(jt.batchCalls(y)):Wt;return d.updateResult(),v},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),H.useEffect(()=>{d.setOptions(u)},[u,d]),sN(u,p))throw lv(u,d,o);if(iN({result:p,errorResetBoundary:o,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw p.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,p),u.experimental_prefetchInRender&&!$s.isServer()&&oN(p,a)&&(h?lv(u,d,o):f?.promise)?.catch(Wt).finally(()=>{d.updateResult()}),u.notifyOnChangeProps?p:d.trackResult(p)}function So(e,t){return lN(e,V_)}var zs=typeof window<"u"?H.useLayoutEffect:H.useEffect;function Th(e){const t=H.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function uN(e,t,r={},a={}){H.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},r);return o.observe(e.current),()=>{o.disconnect()}},[t,r,a.disabled,e])}function cN(e){const t=H.useRef(null);return H.useImperativeHandle(e,()=>t.current,[]),t}var W1=!1;function Gs(e){return e[e.length-1]}function fN(e){return typeof e=="function"}function ci(e,t){return fN(e)?e(t):e}var dN=Object.prototype.hasOwnProperty,uv=Object.prototype.propertyIsEnumerable,hN=()=>Object.create(null),Hi=(e,t)=>qi(e,t,hN);function qi(e,t,r=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const o=t,l=dv(e)&&dv(o);if(!l&&!(fo(e)&&fo(o)))return o;const u=l?e:cv(e);if(!u)return o;const f=l?o:cv(o);if(!f)return o;const h=u.length,d=f.length,p=l?new Array(d):r();let g=0;for(let y=0;y<d;y++){const v=l?y:f[y],w=e[v],C=o[v];if(w===C){p[v]=w,(l?y<h:dN.call(e,v))&&g++;continue}if(w===null||C===null||typeof w!="object"||typeof C!="object"){p[v]=C;continue}const N=qi(w,C,r,a+1);p[v]=N,N===w&&g++}return h===d&&g===h?e:p}function cv(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!uv.call(e,o))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const a=t;for(const o of r){if(!uv.call(e,o))return!1;a.push(o)}return a}function fo(e){if(!fv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!fv(r)||!r.hasOwnProperty("isPrototypeOf"))}function fv(e){return Object.prototype.toString.call(e)==="[object Object]"}function dv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xi(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,o=e.length;a<o;a++)if(!Xi(e[a],t[a],r))return!1;return!0}if(fo(e)&&fo(t)){const a=r?.ignoreUndefined??!0;if(r?.partial){for(const u in t)if((!a||t[u]!==void 0)&&!Xi(e[u],t[u],r))return!1;return!0}let o=0;if(!a)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!a||t[u]!==void 0)&&(l++,l>o||!Xi(e[u],t[u],r)))return!1;return o===l}return!1}function ho(e){let t,r;const a=new Promise((o,l)=>{t=o,r=l});return a.status="pending",a.resolve=o=>{a.status="resolved",a.value=o,t(o),e?.(o)},a.reject=o=>{a.status="rejected",r(o)},a}function Xs(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function pN(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function hv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return pN(t)}var mN=["http:","https:","mailto:","tel:"];function bc(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function Es(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,a="",o;for(;(o=t.exec(e))!==null;)a+=hv(e.slice(r,o.index))+o[0],r=t.lastIndex;a=a+hv(r?e.slice(r):e);let l=!1;return a.startsWith("//")&&(l=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:l}}function gN(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function yN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Mr(){throw new Error("Invariant failed")}function Qs(e){const t=new Map;let r,a;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,a&&(a.next=l,l.prev=a)):(l.next.prev=void 0,r=l.next,l.next=void 0,a&&(l.prev=a,a.next=l)),a=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&r){const h=r;t.delete(h.key),h.next&&(r=h.next,h.next.prev=void 0),h===a&&(a=void 0)}const f=t.get(l);if(f)f.value=u,o(f);else{const h={key:l,value:u,prev:a};a&&(a.next=h),a=h,r||(r=h),t.set(l,h)}},clear(){t.clear(),r=void 0,a=void 0}}}var Fi=4,J1=5;function xN(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function fm(e,t,r=new Uint16Array(6)){const a=e.indexOf("/",t),o=a===-1?e.length:a,l=e.substring(t,o);if(!l||!l.includes("$"))return r[0]=0,r[1]=t,r[2]=t,r[3]=o,r[4]=o,r[5]=o,r;if(l==="$"){const f=e.length;return r[0]=2,r[1]=t,r[2]=t,r[3]=f,r[4]=f,r[5]=f,r}if(l.charCodeAt(0)===36)return r[0]=1,r[1]=t,r[2]=t+1,r[3]=o,r[4]=o,r[5]=o,r;const u=xN(l);if(u){const[f,h]=u,d=l.charCodeAt(f+1);if(d===45){if(f+2<l.length&&l.charCodeAt(f+2)===36){const p=f+3,g=h;if(p<g)return r[0]=3,r[1]=t+f,r[2]=t+p,r[3]=t+g,r[4]=t+h+1,r[5]=o,r}}else if(d===36){const p=f+1,g=f+2;return g===h?(r[0]=2,r[1]=t+f,r[2]=t+p,r[3]=t+g,r[4]=t+h+1,r[5]=e.length,r):(r[0]=1,r[1]=t+f,r[2]=t+g,r[3]=t+h,r[4]=t+h+1,r[5]=o,r)}}return r[0]=0,r[1]=t,r[2]=t,r[3]=o,r[4]=o,r[5]=o,r}function qc(e,t,r,a,o,l,u){u?.(r);let f=a;{const h=r.fullPath??r.from,d=h.length,p=r.options?.caseSensitive??e,g=!!(r.options?.params?.parse&&r.options?.skipRouteOnParseError?.params);for(;f<d;){const v=fm(h,f,t);let w;const C=f,N=v[5];switch(f=N+1,l++,v[0]){case 0:{const S=h.substring(v[2],v[3]);if(p){const A=o.static?.get(S);if(A)w=A;else{o.static??=new Map;const _=Yi(r.fullPath??r.from);_.parent=o,_.depth=l,w=_,o.static.set(S,_)}}else{const A=S.toLowerCase(),_=o.staticInsensitive?.get(A);if(_)w=_;else{o.staticInsensitive??=new Map;const k=Yi(r.fullPath??r.from);k.parent=o,k.depth=l,w=k,o.staticInsensitive.set(A,k)}}break}case 1:{const S=h.substring(C,v[1]),A=h.substring(v[4],N),_=p&&!!(S||A),k=S?_?S:S.toLowerCase():void 0,B=A?_?A:A.toLowerCase():void 0,T=!g&&o.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===_&&O.prefix===k&&O.suffix===B);if(T)w=T;else{const O=Rh(1,r.fullPath??r.from,_,k,B);w=O,O.depth=l,O.parent=o,o.dynamic??=[],o.dynamic.push(O)}break}case 3:{const S=h.substring(C,v[1]),A=h.substring(v[4],N),_=p&&!!(S||A),k=S?_?S:S.toLowerCase():void 0,B=A?_?A:A.toLowerCase():void 0,T=!g&&o.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===_&&O.prefix===k&&O.suffix===B);if(T)w=T;else{const O=Rh(3,r.fullPath??r.from,_,k,B);w=O,O.parent=o,O.depth=l,o.optional??=[],o.optional.push(O)}break}case 2:{const S=h.substring(C,v[1]),A=h.substring(v[4],N),_=p&&!!(S||A),k=S?_?S:S.toLowerCase():void 0,B=A?_?A:A.toLowerCase():void 0,T=Rh(2,r.fullPath??r.from,_,k,B);w=T,T.parent=o,T.depth=l,o.wildcard??=[],o.wildcard.push(T)}}o=w}if(g&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const v=Yi(r.fullPath??r.from);v.kind=J1,v.parent=o,l++,v.depth=l,o.pathless??=[],o.pathless.push(v),o=v}const y=(r.path||!r.children)&&!r.isRoot;if(y&&h.endsWith("/")){const v=Yi(r.fullPath??r.from);v.kind=Fi,v.parent=o,l++,v.depth=l,o.index=v,o=v}o.parse=r.options?.params?.parse??null,o.skipOnParamError=g,o.parsingPriority=r.options?.skipRouteOnParseError?.priority??0,y&&!o.route&&(o.route=r,o.fullPath=r.fullPath??r.from)}if(r.children)for(const h of r.children)qc(e,t,h,f,o,l,u)}function Ah(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function li(e){if(e.pathless)for(const t of e.pathless)li(t);if(e.static)for(const t of e.static.values())li(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())li(t);if(e.dynamic?.length){e.dynamic.sort(Ah);for(const t of e.dynamic)li(t)}if(e.optional?.length){e.optional.sort(Ah);for(const t of e.optional)li(t)}if(e.wildcard?.length){e.wildcard.sort(Ah);for(const t of e.wildcard)li(t)}}function Yi(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Rh(e,t,r,a,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:a,suffix:o}}function vN(e,t){const r=Yi("/"),a=new Uint16Array(6);for(const o of e)qc(!1,a,o,1,r,0);li(r),t.masksTree=r,t.flatCache=Qs(1e3)}function bN(e,t){e||="/";const r=t.flatCache.get(e);if(r)return r;const a=dm(e,t.masksTree);return t.flatCache.set(e,a),a}function wN(e,t,r,a,o){e||="/",a||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);return u||(u=Yi("/"),qc(t,new Uint16Array(6),{from:e},1,u,0),o.singleCache.set(l,u)),dm(a,u,r)}function SN(e,t,r=!1){const a=r?e:`nofuzz\0${e}`,o=t.matchCache.get(a);if(o!==void 0)return o;e||="/";let l;try{l=dm(e,t.segmentTree,r)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=_N(l.route)),t.matchCache.set(a,l),l}function EN(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function CN(e,t=!1,r){const a=Yi(e.fullPath),o=new Uint16Array(6),l={},u={};let f=0;return qc(t,o,e,1,a,0,h=>{if(r?.(h,f),h.id in l&&Mr(),l[h.id]=h,f!==0&&h.path){const d=EN(h.fullPath);(!u[d]||h.fullPath.endsWith("/"))&&(u[d]=h)}f++}),li(a),{processedTree:{segmentTree:a,singleCache:Qs(1e3),matchCache:Qs(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function dm(e,t,r=!1){const a=e.split("/"),o=kN(e,a,t,r);if(!o)return null;const[l]=ew(e,a,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function ew(e,t,r){const a=NN(r.node);let o=null;const l=Object.create(null);let u=r.extract?.part??0,f=r.extract?.node??0,h=r.extract?.path??0,d=r.extract?.segment??0;for(;f<a.length;u++,f++,h++,d++){const p=a[f];if(p.kind===Fi)break;if(p.kind===J1){d--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),p.kind===1){o??=r.node.fullPath.split("/");const v=o[d],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const C=p.suffix?.length??0,N=v.substring(w+2,v.length-C-1),S=g.substring(w,g.length-C);l[N]=decodeURIComponent(S)}else{const C=v.substring(1);l[C]=decodeURIComponent(g)}}else if(p.kind===3){if(r.skipped&1<<f){u--,h=y-1;continue}o??=r.node.fullPath.split("/");const v=o[d],w=p.prefix?.length??0,C=p.suffix?.length??0,N=v.substring(w+3,v.length-C-1),S=p.suffix||p.prefix?g.substring(w,g.length-C):g;S&&(l[N]=decodeURIComponent(S))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),C=decodeURIComponent(w);l["*"]=C,l._splat=C;break}}return r.rawParams&&Object.assign(l,r.rawParams),[l,{part:u,node:f,path:h,segment:d}]}function _N(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function NN(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function kN(e,t,r,a){if(e==="/"&&r.index)return{node:r.index,skipped:0};const o=!Gs(t),l=o&&e!=="/",u=t.length-(o?1:0),f=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,d=null,p=null;for(;f.length;){const g=f.pop(),{node:y,index:v,skipped:w,depth:C,statics:N,dynamics:S,optionals:A}=g;let{extract:_,rawParams:k,parsedParams:B}=g;if(y.skipOnParamError){if(!jh(e,t,g))continue;k=g.rawParams,_=g.extract,B=g.parsedParams}a&&y.route&&y.kind!==Fi&&Cs(d,g)&&(d=g);const T=v===u;if(T&&(y.route&&!l&&Cs(p,g)&&(p=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const O=T?void 0:t[v];let U;if(T&&y.index){const P={node:y.index,index:v,skipped:w,depth:C+1,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:B};let F=!0;if(y.index.skipOnParamError&&(jh(e,t,P)||(F=!1)),F){if(N===u&&!S&&!A&&!w)return P;Cs(p,P)&&(p=P)}}if(y.wildcard&&Cs(h,g))for(const P of y.wildcard){const{prefix:F,suffix:I}=P;if(F&&(T||!(P.caseSensitive?O:U??=O.toLowerCase()).startsWith(F)))continue;if(I){if(T)continue;const Q=t.slice(v).join("/").slice(-I.length);if((P.caseSensitive?Q:Q.toLowerCase())!==I)continue}const Y={node:P,index:u,skipped:w,depth:C,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:B};if(!(P.skipOnParamError&&!jh(e,t,Y))){h=Y;break}}if(y.optional){const P=w|1<<C,F=C+1;for(let I=y.optional.length-1;I>=0;I--){const Y=y.optional[I];f.push({node:Y,index:v,skipped:P,depth:F,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:B})}if(!T)for(let I=y.optional.length-1;I>=0;I--){const Y=y.optional[I],{prefix:Q,suffix:L}=Y;if(Q||L){const V=Y.caseSensitive?O:U??=O.toLowerCase();if(Q&&!V.startsWith(Q)||L&&!V.endsWith(L))continue}f.push({node:Y,index:v+1,skipped:w,depth:F,statics:N,dynamics:S,optionals:A+1,extract:_,rawParams:k,parsedParams:B})}}if(!T&&y.dynamic&&O)for(let P=y.dynamic.length-1;P>=0;P--){const F=y.dynamic[P],{prefix:I,suffix:Y}=F;if(I||Y){const Q=F.caseSensitive?O:U??=O.toLowerCase();if(I&&!Q.startsWith(I)||Y&&!Q.endsWith(Y))continue}f.push({node:F,index:v+1,skipped:w,depth:C+1,statics:N,dynamics:S+1,optionals:A,extract:_,rawParams:k,parsedParams:B})}if(!T&&y.staticInsensitive){const P=y.staticInsensitive.get(U??=O.toLowerCase());P&&f.push({node:P,index:v+1,skipped:w,depth:C+1,statics:N+1,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:B})}if(!T&&y.static){const P=y.static.get(O);P&&f.push({node:P,index:v+1,skipped:w,depth:C+1,statics:N+1,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:B})}if(y.pathless){const P=C+1;for(let F=y.pathless.length-1;F>=0;F--){const I=y.pathless[F];f.push({node:I,index:v,skipped:w,depth:P,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:B})}}}if(p&&h)return Cs(h,p)?p:h;if(p)return p;if(h)return h;if(a&&d){let g=d.index;for(let v=0;v<d.index;v++)g+=t[v].length;const y=g===e.length?"/":e.slice(g);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(y),d}return null}function jh(e,t,r){try{const[a,o]=ew(e,t,r);r.rawParams=a,r.extract=o;const l=r.node.parse(a);return r.parsedParams=Object.assign(Object.create(null),r.parsedParams,l),!0}catch{return null}}function Cs(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Fi)>(e.node.kind===Fi)||t.node.kind===Fi==(e.node.kind===Fi)&&t.depth>e.depth))):!0}function lc(e){return hm(e.filter(t=>t!==void 0).join("/"))}function hm(e){return e.replace(/\/{2,}/g,"/")}function tw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function pi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function nw(e){return pi(tw(e))}function wc(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function MN(e,t,r){return wc(e,r)===wc(t,r)}function TN({base:e,to:t,trailingSlash:r="never",cache:a}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(a){u=o?t:l?e:e+"\0"+t;const g=a.get(u);if(g)return g}let f;if(l)f=e.split("/");else if(o)f=t.split("/");else{for(f=e.split("/");f.length>1&&Gs(f)==="";)f.pop();const g=t.split("/");for(let y=0,v=g.length;y<v;y++){const w=g[y];w===""?y?y===v-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Gs(f)===""?r==="never"&&f.pop():r==="always"&&f.push(""));let h,d="";for(let g=0;g<f.length;g++){g>0&&(d+="/");const y=f[g];if(!y)continue;h=fm(y,0,h);const v=h[0];if(v===0){d+=y;continue}const w=h[5],C=y.substring(0,h[1]),N=y.substring(h[4],w),S=y.substring(h[2],h[3]);v===1?d+=C||N?`${C}{$${S}}${N}`:`$${S}`:v===2?d+=C||N?`${C}{$}${N}`:"$":d+=`${C}{-$${S}}${N}`}d=hm(d);const p=d||"/";return u&&a&&a.set(u,p),p}function AN(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),r=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(r,"g");return o=>o.replace(a,l=>t.get(l)??l)}function Oh(e,t,r){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(o=>mv(o,r)).join("/"):mv(a,r)}function pv({path:e,params:t,decoder:r,...a}){let o=!1;const l=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let f=0,h,d="";for(;f<u;){const p=f;h=fm(e,p,h);const g=h[5];if(f=g+1,p===g)continue;const y=h[0];if(y===0){d+="/"+e.substring(p,g);continue}if(y===2){const v=t._splat;l._splat=v,l["*"]=v;const w=e.substring(p,h[1]),C=e.substring(h[4],g);if(!v){o=!0,(w||C)&&(d+="/"+w+C);continue}const N=Oh("_splat",t,r);d+="/"+w+N+C;continue}if(y===1){const v=e.substring(h[2],h[3]);!o&&!(v in t)&&(o=!0),l[v]=t[v];const w=e.substring(p,h[1]),C=e.substring(h[4],g),N=Oh(v,t,r)??"undefined";d+="/"+w+N+C;continue}if(y===3){const v=e.substring(h[2],h[3]),w=t[v];if(w==null)continue;l[v]=w;const C=e.substring(p,h[1]),N=e.substring(h[4],g),S=Oh(v,t,r)??"";d+="/"+C+S+N;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:l,interpolatedPath:d||"/",isMissingParams:o}}function mv(e,t){const r=encodeURIComponent(e);return t?.(r)??r}function Ut(e){return!!e?.isNotFound}function RN(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}var jN="tsr-scroll-restoration-v1_3";function ON(){const e=RN();if(!e)return null;let t={};try{const a=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");fo(a)&&(t=a)}catch{}return{get state(){return t},set:a=>{t=ci(a,t)||t},persist:()=>{try{e.setItem(jN,JSON.stringify(t))}catch{}}}}var gv=ON(),DN=e=>e.state.__TSR_key||e.href;function zN(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}var $u=!1,_s="window",yv="data-scroll-restoration-id";function LN(e,t){if(!gv)return;const r=gv;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!r)return;e.isScrollRestorationSetup=!0,$u=!1;const a=e.options.getScrollRestorationKey||DN,o=new Map;window.history.scrollRestoration="manual";const l=f=>{if(!($u||!e.isScrollRestoring))if(f.target===document||f.target===window)o.set(_s,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const h=f.target;o.set(h,{scrollX:h.scrollLeft||0,scrollY:h.scrollTop||0})}},u=f=>{if(!e.isScrollRestoring||!f||o.size===0||!r)return;const h=r.state[f]||={};for(const[d,p]of o){let g;if(d===_s)g=_s;else if(d.isConnected){const y=d.getAttribute(yv);g=y?`[${yv}="${y}"]`:zN(d)}g&&(h[g]=p)}};document.addEventListener("scroll",l,!0),e.subscribe("onBeforeLoad",f=>{u(f.fromLocation?a(f.fromLocation):void 0),o.clear()}),window.addEventListener("pagehide",()=>{u(a(e.stores.resolvedLocation.state??e.stores.location.state)),r.persist()}),e.subscribe("onRendered",f=>{const h=a(f.toLocation),d=e.options.scrollRestorationBehavior,p=e.options.scrollToTopSelectors;if(o.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){$u=!0;try{const g=e.isScrollRestoring?r.state[h]:void 0;let y=!1;if(g)for(const v in g){const w=g[v];if(!fo(w))continue;const{scrollX:C,scrollY:N}=w;if(!(!Number.isFinite(C)||!Number.isFinite(N))){if(v===_s)window.scrollTo({top:N,left:C,behavior:d}),y=!0;else if(v){let S;try{S=document.querySelector(v)}catch{continue}S&&(S.scrollLeft=C,S.scrollTop=N,y=!0)}}}if(!y){const v=e.history.location.hash.slice(1);if(v){const w=window.history.state?.__hashScrollIntoViewOptions??!0;if(w){const C=document.getElementById(v);C&&C.scrollIntoView(w)}}else{const w={top:0,left:0,behavior:d};if(window.scrollTo(w),p)for(const C of p){if(C===_s)continue;const N=typeof C=="function"?C():document.querySelector(C);N&&N.scrollTo(w)}}}}finally{$u=!1}e.isScrollRestoring&&r.set(g=>(g[h]||={},g))}})}function IN(e,t=String){const r=new URLSearchParams;for(const a in e){const o=e[a];o!==void 0&&r.set(a,t(o))}return r.toString()}function Dh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function BN(e){const t=new URLSearchParams(e),r=Object.create(null);for(const[a,o]of t.entries()){const l=r[a];l==null?r[a]=Dh(o):Array.isArray(l)?l.push(Dh(o)):r[a]=[l,Dh(o)]}return r}var HN=UN(JSON.parse),PN=VN(JSON.stringify,JSON.parse);function UN(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=BN(t);for(const a in r){const o=r[a];if(typeof o=="string")try{r[a]=e(o)}catch{}}return r}}function VN(e,t){const r=typeof t=="function";function a(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(r&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=IN(o,a);return l?`?${l}`:""}}var Qi="__root__";function qN(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function en(e){return e instanceof Response&&!!e.options}function FN(e){return{input:({url:t})=>{for(const r of e)t=Sp(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=rw(e[r],t);return t}}}function YN(e){const t=nw(e.basepath),r=`/${t}`,a=`${r}/`,o=e.caseSensitive?r:r.toLowerCase(),l=e.caseSensitive?a:a.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===o?u.pathname="/":f.startsWith(l)&&(u.pathname=u.pathname.slice(r.length)),u},output:({url:u})=>(u.pathname=lc(["/",t,u.pathname]),u)}}function Sp(e,t){const r=e?.input?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function rw(e,t){const r=e?.output?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function $N(e,t){const{createMutableStore:r,createReadonlyStore:a,batch:o,init:l}=t,u=new Map,f=new Map,h=new Map,d=r(e.status),p=r(e.loadedAt),g=r(e.isLoading),y=r(e.isTransitioning),v=r(e.location),w=r(e.resolvedLocation),C=r(e.statusCode),N=r(e.redirect),S=r([]),A=r([]),_=r([]),k=a(()=>zh(u,S.state)),B=a(()=>zh(f,A.state)),T=a(()=>zh(h,_.state)),O=a(()=>S.state[0]),U=a(()=>S.state.some(q=>u.get(q)?.state.status==="pending")),P=a(()=>({locationHref:v.state.href,resolvedLocationHref:w.state?.href,status:d.state})),F=a(()=>({status:d.state,loadedAt:p.state,isLoading:g.state,isTransitioning:y.state,matches:k.state,location:v.state,resolvedLocation:w.state,statusCode:C.state,redirect:N.state})),I=Qs(64);function Y(q){let X=I.get(q);return X||(X=a(()=>{const Z=S.state;for(const j of Z){const z=u.get(j);if(z&&z.routeId===q)return z.state}}),I.set(q,X)),X}const Q={status:d,loadedAt:p,isLoading:g,isTransitioning:y,location:v,resolvedLocation:w,statusCode:C,redirect:N,matchesId:S,pendingMatchesId:A,cachedMatchesId:_,activeMatchesSnapshot:k,pendingMatchesSnapshot:B,cachedMatchesSnapshot:T,firstMatchId:O,hasPendingMatches:U,matchRouteReactivity:P,activeMatchStoresById:u,pendingMatchStoresById:f,cachedMatchStoresById:h,__store:F,getMatchStoreByRouteId:Y,setActiveMatches:L,setPendingMatches:V,setCachedMatches:M};L(e.matches),l?.(Q);function L(q){Lh(q,u,S,r,o)}function V(q){Lh(q,f,A,r,o)}function M(q){Lh(q,h,_,r,o)}return Q}function zh(e,t){const r=[];for(const a of t){const o=e.get(a);o&&r.push(o.state)}return r}function Lh(e,t,r,a,o){const l=e.map(f=>f.id),u=new Set(l);o(()=>{for(const f of t.keys())u.has(f)||t.delete(f);for(const f of e){const h=t.get(f.id);if(!h){const d=a(f);d.routeId=f.routeId,t.set(f.id,d);continue}h.routeId=f.routeId,h.state!==f&&h.setState(()=>f)}yN(r.state,l)||r.setState(()=>l)})}var Ep=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},GN=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),Fc=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),Ki=(e,t,r=!0)=>{const a={...e.router.options.context??{}},o=r?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},xv=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,a=e.matches.findIndex(u=>u.routeId===e.router.routeTree.id),o=a>=0?a:0;let l=r?e.matches.findIndex(u=>u.routeId===r):e.firstBadMatchIndex??e.matches.length-1;l<0&&(l=o);for(let u=l;u>=0;u--){const f=e.matches[u];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return u}return r?l:o},fi=(e,t,r)=>{if(!(!en(r)&&!Ut(r)))throw en(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:en(r)?"redirected":a.status==="pending"?"success":a.status,context:Ki(e,t.index),isFetching:!1,error:r})),Ut(r)&&!r.routeId&&(r.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),en(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},iw=(e,t)=>{const r=e.router.getMatch(t);return!!(!r||r._nonReactive.dehydrated)},vv=(e,t,r)=>{const a=Ki(e,r);e.updateMatch(t,o=>({...o,context:a}))},Ns=(e,t,r,a)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(r instanceof Promise)throw r;r.routerCode=a,e.firstBadMatchIndex??=t,fi(e,e.router.getMatch(o),r);try{u.options.onError?.(r)}catch(f){r=f,fi(e,e.router.getMatch(o),r)}e.updateMatch(o,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!en(r)&&!Ut(r)&&(e.serialError??=r)},aw=(e,t,r,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const o=r.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Fc(e,t)&&(r.options.loader||r.options.beforeLoad||sw(r))&&typeof o=="number"&&o!==1/0&&(r.options.pendingComponent??e.router.options?.defaultPendingComponent)){const l=setTimeout(()=>{Ep(e)},o);a._nonReactive.pendingTimeout=l}},XN=(e,t,r)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;aw(e,t,r,a);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&fi(e,l,l.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(o):o()},QN=(e,t,r,a)=>{const o=e.router.getMatch(t);let l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=ho(()=>{l?.resolve(),l=void 0});const{paramsError:u,searchError:f}=o;u&&Ns(e,r,u,"PARSE_PARAMS"),f&&Ns(e,r,f,"VALIDATE_SEARCH"),aw(e,t,a,o);const h=new AbortController;let d=!1;const p=()=>{d||(d=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,k=>({...k,isFetching:!1}))};if(!a.options.beforeLoad){e.router.batch(()=>{p(),g()});return}o._nonReactive.beforeLoadPromise=ho();const y={...Ki(e,r,!1),...o.__routeContext},{search:v,params:w,cause:C}=o,N=Fc(e,t),S={search:v,abortController:h,params:w,preload:N,context:y,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":C,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},A=k=>{if(k===void 0){e.router.batch(()=>{p(),g()});return}(en(k)||Ut(k))&&(p(),Ns(e,r,k,"BEFORE_LOAD")),e.router.batch(()=>{p(),e.updateMatch(t,B=>({...B,__beforeLoadContext:k})),g()})};let _;try{if(_=a.options.beforeLoad(S),Xs(_))return p(),_.catch(k=>{Ns(e,r,k,"BEFORE_LOAD")}).then(A)}catch(k){p(),Ns(e,r,k,"BEFORE_LOAD")}A(_)},KN=(e,t)=>{const{id:r,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a],l=()=>f(),u=()=>QN(e,r,t,o),f=()=>{if(iw(e,r))return;const h=XN(e,r,o);return Xs(h)?h.then(u):u()};return l()},ZN=(e,t,r)=>{const a=e.router.getMatch(t);if(!a||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([r.options.head?.(o),r.options.scripts?.(o),r.options.headers?.(o)]).then(([l,u,f])=>({meta:l?.meta,links:l?.links,headScripts:l?.scripts,headers:f,scripts:u,styles:l?.styles}))},ow=(e,t,r,a,o)=>{const l=t[a-1],{params:u,loaderDeps:f,abortController:h,cause:d}=e.router.getMatch(r),p=Ki(e,a),g=Fc(e,r);return{params:u,deps:f,preload:!!g,parentMatchPromise:l,abortController:h,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:o,...e.router.options.additionalContext}},bv=async(e,t,r,a,o)=>{try{const l=e.router.getMatch(r);try{(!(W1??e.router.isServer)||l.ssr===!0)&&Ks(o);const u=o.options.loader,f=typeof u=="function"?u:u?.handler,h=f?.(ow(e,t,r,a,o)),d=!!f&&Xs(h);if((d||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||l._nonReactive.minPendingPromise)&&e.updateMatch(r,g=>({...g,isFetching:"loader"})),f){const g=d?await h:h;fi(e,e.router.getMatch(r),g),g!==void 0&&e.updateMatch(r,y=>({...y,loaderData:g}))}o._lazyPromise&&await o._lazyPromise;const p=l._nonReactive.minPendingPromise;p&&await p,o._componentsPromise&&await o._componentsPromise,e.updateMatch(r,g=>({...g,error:void 0,context:Ki(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(u){let f=u;if(f?.name==="AbortError"){if(l.abortController.signal.aborted){l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:Ki(e,a)}));return}const h=l._nonReactive.minPendingPromise;h&&await h,Ut(u)&&await o.options.notFoundComponent?.preload?.(),fi(e,e.router.getMatch(r),u);try{o.options.onError?.(u)}catch(d){f=d,fi(e,e.router.getMatch(r),d)}!en(f)&&!Ut(f)&&await Ks(o,["errorComponent"]),e.updateMatch(r,d=>({...d,error:f,context:Ki(e,a),status:"error",isFetching:!1}))}}catch(l){const u=e.router.getMatch(r);u&&(u._nonReactive.loaderPromise=void 0),fi(e,u,l)}},WN=async(e,t,r)=>{async function a(v,w,C,N,S){const A=Date.now()-w.updatedAt,_=v?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,k=S.options.shouldReload,B=typeof k=="function"?k(ow(e,t,o,r,S)):k,{status:T,invalid:O}=N,U=A>=_&&(!!e.forceStaleReload||N.cause==="enter"||C!==void 0&&C!==N.id);u=T==="success"&&(O||(B??U)),v&&S.options.preload===!1||(u&&!e.sync&&p?(f=!0,(async()=>{try{await bv(e,t,o,r,S);const P=e.router.getMatch(o);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){en(P)&&await e.router.navigate(P.options)}})()):T!=="success"||u?await bv(e,t,o,r,S):vv(e,o,r))}const{id:o,routeId:l}=e.matches[r];let u=!1,f=!1;const h=e.router.looseRoutesById[l],d=h.options.loader,p=((typeof d=="function"?void 0:d?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(iw(e,o)){if(!e.router.getMatch(o))return e.matches[r];vv(e,o,r)}else{const v=e.router.getMatch(o),w=e.router.stores.matchesId.state[r],C=(w&&e.router.stores.activeMatchStoresById.get(w)||null)?.routeId===l?w:e.router.stores.activeMatchesSnapshot.state.find(S=>S.routeId===l)?.id,N=Fc(e,o);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const S=e.router.getMatch(o),A=S._nonReactive.error||S.error;A&&fi(e,S,A),S.status==="pending"&&await a(N,v,C,S,h)}else{const S=N&&!e.router.stores.activeMatchStoresById.has(o),A=e.router.getMatch(o);A._nonReactive.loaderPromise=ho(),S!==A.preload&&e.updateMatch(o,_=>({..._,preload:S})),await a(N,v,C,A,h)}}const g=e.router.getMatch(o);f||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,f||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const y=f?g.isFetching:!1;return y!==g.isFetching||g.invalid!==!1?(e.updateMatch(o,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(o)):g};async function wv(e){const t=e,r=[];GN(t.router)&&Ep(t);let a;for(let y=0;y<t.matches.length;y++){try{const v=KN(t,y);Xs(v)&&await v}catch(v){if(en(v))throw v;if(Ut(v))a=v;else if(!t.preload)throw v;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const o=t.firstBadMatchIndex??t.matches.length,l=a&&!t.preload?xv(t,a):void 0,u=a&&t.preload?0:l!==void 0?Math.min(l+1,o):o;let f,h;for(let y=0;y<u;y++)r.push(WN(t,r,y));try{await Promise.all(r)}catch{const y=await Promise.allSettled(r);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(en(w))throw w;Ut(w)?f??=w:h??=w}if(h!==void 0)throw h}const d=f??(a&&!t.preload?a:void 0);let p=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!d&&a&&t.preload)return t.matches;if(d){const y=xv(t,d);y===void 0&&Mr();const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],C=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&C&&(w.options.notFoundComponent=C),d.routeId=v.routeId;const N=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,S=>({...S,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),p=y,await Ks(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ks(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],C=t.router.looseRoutesById[w];try{const N=ZN(t,v,C);if(N){const S=await N;t.updateMatch(v,A=>({...A,...S}))}}catch(N){console.error(`Error executing head for route ${w}:`,N)}}const g=Ep(t);if(Xs(g)&&await g,d)throw d;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Sv(e,t){const r=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(r.length!==0)return Promise.all(r)}function Ks(e,t=uc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const r=()=>e._componentsLoaded?void 0:t===uc?(()=>{if(e._componentsPromise===void 0){const a=Sv(e,uc);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Sv(e,t);return e._lazyPromise?e._lazyPromise.then(r):r()}function sw(e){for(const t of uc)if(e.options[t]?.preload)return!0;return!1}var uc=["component","errorComponent","pendingComponent","notFoundComponent"],mi="__TSR_index",Ev="popstate",Cv="beforeunload";function JN(e){let t=e.getLocation();const r=new Set,a=u=>{t=e.getLocation(),r.forEach(f=>f({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?a(u):t=e.getLocation()},l=async({task:u,navigateOpts:f,...h})=>{if(f?.ignoreBlocker??!1){u();return}const d=e.getBlockers?.()??[],p=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&d.length&&p)for(const g of d){const y=Zs(h.path,h.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:u=>(r.add(u),()=>{r.delete(u)}),push:(u,f,h)=>{const d=t.state[mi];f=_v(d+1,f),l({task:()=>{e.pushState(u,f),a({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:f})},replace:(u,f,h)=>{const d=t.state[mi];f=_v(d,f),l({task:()=>{e.replaceState(u,f),a({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:f})},go:(u,f)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[mi]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(d=>d!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function _v(e,t){t||(t={});const r=pm();return{...t,key:r,__TSR_key:r,[mi]:e}}function lw(e){const t=e?.window??(typeof document<"u"?window:void 0),r=t.history.pushState,a=t.history.replaceState;let o=[];const l=()=>o,u=U=>o=U,f=e?.createHref??(U=>U),h=e?.parseLocation??(()=>Zs(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const U=pm();t.history.replaceState({[mi]:0,key:U,__TSR_key:U},"")}let d=h(),p,g=!1,y=!1,v=!1,w=!1;const C=()=>d;let N,S;const A=()=>{N&&(O._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),O._ignoreSubscribers=!1,N=void 0,S=void 0,p=void 0)},_=(U,P,F)=>{const I=f(P);S||(p=d),d=Zs(P,F),N={href:I,state:F,isPush:N?.isPush||U==="push"},S||(S=Promise.resolve().then(()=>A()))},k=U=>{d=h(),O.notify({type:U})},B=async()=>{if(y){y=!1;return}const U=h(),P=U.state[mi]-d.state[mi],F=P===1,I=P===-1,Y=!F&&!I||g;g=!1;const Q=Y?"GO":I?"BACK":"FORWARD",L=Y?{type:"GO",index:P}:{type:I?"BACK":"FORWARD"};if(v)v=!1;else{const V=l();if(typeof document<"u"&&V.length){for(const M of V)if(await M.blockerFn({currentLocation:d,nextLocation:U,action:Q})){y=!0,t.history.go(1),O.notify(L);return}}}d=h(),O.notify(L)},T=U=>{if(w){w=!1;return}let P=!1;const F=l();if(typeof document<"u"&&F.length)for(const I of F){const Y=I.enableBeforeUnload??!0;if(Y===!0){P=!0;break}if(typeof Y=="function"&&Y()===!0){P=!0;break}}if(P)return U.preventDefault(),U.returnValue=""},O=JN({getLocation:C,getLength:()=>t.history.length,pushState:(U,P)=>_("push",U,P),replaceState:(U,P)=>_("replace",U,P),back:U=>(U&&(v=!0),w=!0,t.history.back()),forward:U=>{U&&(v=!0),w=!0,t.history.forward()},go:U=>{g=!0,t.history.go(U)},createHref:U=>f(U),flush:A,destroy:()=>{t.history.pushState=r,t.history.replaceState=a,t.removeEventListener(Cv,T,{capture:!0}),t.removeEventListener(Ev,B)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(Cv,T,{capture:!0}),t.addEventListener(Ev,B),t.history.pushState=function(...U){const P=r.apply(t.history,U);return O._ignoreSubscribers||k("PUSH"),P},t.history.replaceState=function(...U){const P=a.apply(t.history,U);return O._ignoreSubscribers||k("REPLACE"),P},O}function ek(e){const t=typeof document<"u"?window:void 0;return lw({window:t,parseLocation:()=>{const r=t.location.hash.split("#").slice(1),a=r[0]??"/",o=t.location.search,l=r.slice(1);return Zs(`${a}${o}${l.length===0?"":`#${l.join("#")}`}`,t.history.state)},createHref:r=>`${t.location.pathname}${t.location.search}#${r}`})}function tk(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Zs(e,t){const r=tk(e),a=r.indexOf("#"),o=r.indexOf("?"),l=pm();return{href:r,pathname:r.substring(0,a>0?o>0?Math.min(a,o):a:o>0?o:r.length),hash:a>-1?r.substring(a):"",search:o>-1?r.slice(o,a===-1?void 0:a):"",state:t||{[mi]:0,key:l,__TSR_key:l}}}function pm(){return(Math.random()+1).toString(36).substring(7)}function io(e,t){const r=t,a=e;return{fromLocation:r,toLocation:a,pathChanged:r?.pathname!==a.pathname,hrefChanged:r?.href!==a.href,hashChanged:r?.hash!==a.hash}}var nk=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{const a=this.options,o=this.basepath??a?.basepath??"/",l=this.basepath===void 0,u=a?.rewrite;if(this.options={...a,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=AN(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lw()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=Qs(1e3),p=this.buildRouteTree(),this.setRoutes(p)}if(!this.stores&&this.latestLocation){const p=this.getStoreConfig(this);this.batch=p.batch,this.stores=$N(ik(this.latestLocation),p),LN(this)}let f=!1;const h=this.options.basepath??"/",d=this.options.rewrite;if(l||o!==h||u!==d){this.basepath=h;const p=[],g=nw(h);g&&g!=="/"&&p.push(YN({basepath:h})),d&&p.push(d),this.rewrite=p.length===0?void 0:p.length===1?p[0]:FN(p),this.history&&this.updateLatestLocation(),f=!0}f&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=CN(this.routeTree,this.options.caseSensitive,(a,o)=>{a.init({originalIndex:o})});return this.options.routeMasks&&vN(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,a)=>{const o={eventType:r,fn:a};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=r=>{this.subscribers.forEach(a=>{a.eventType===r.type&&a.fn(r)})},this.parseLocation=(r,a)=>{const o=({pathname:h,search:d,hash:p,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const S=this.options.parseSearch(d),A=this.options.stringifySearch(S);return{href:h+A+p,publicHref:h+A+p,pathname:Es(h).path,external:!1,searchStr:A,search:Hi(a?.search,S),hash:Es(p.slice(1)).path,state:qi(a?.state,y)}}const v=new URL(g,this.origin),w=Sp(this.rewrite,v),C=this.options.parseSearch(w.search),N=this.options.stringifySearch(C);return w.search=N,{href:w.href.replace(w.origin,""),publicHref:g,pathname:Es(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:N,search:Hi(a?.search,C),hash:Es(w.hash.slice(1)).path,state:qi(a?.state,y)}},l=o(r),{__tempLocation:u,__tempKey:f}=l.state;if(u&&(!f||f===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(r,a)=>TN({base:r,to:hm(a),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,a,o)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:a},o):this.matchRoutesInternal(r,a),this.getMatchedRoutes=r=>ak({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const a=this.getMatch(r);a&&(a.abortController.abort(),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(r=>{this.cancelMatch(r)}),this.stores.matchesId.state.forEach(r=>{if(this.stores.pendingMatchStoresById.has(r))return;const a=this.stores.activeMatchStoresById.get(r)?.state;a&&(a.status==="pending"||a.isFetching==="loader")&&this.cancelMatch(r)})},this.buildLocation=r=>{const a=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,d=this.resolvePathWithBase(h,"."),p=f.search,g=Object.assign(Object.create(null),f.params),y=l.to?this.resolvePathWithBase(d,`${l.to}`):this.resolvePathWithBase(d,"."),v=l.params===!1||l.params===null?Object.create(null):(l.params??!0)===!0?g:Object.assign(g,ci(l.params,g)),w=this.getMatchedRoutes(y);let C=w.matchedRoutes;if((!w.foundRoute||w.foundRoute.path!=="/"&&w.routeParams["**"])&&this.options.notFoundRoute&&(C=[...C,this.options.notFoundRoute]),Object.keys(v).length>0)for(const F of C){const I=F.options.params?.stringify??F.options.stringifyParams;if(I)try{Object.assign(v,I(v))}catch{}}const N=r.leaveParams?y:Es(pv({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let S=p;if(r._includeValidateSearch&&this.options.search?.strict){const F={};C.forEach(I=>{if(I.options.validateSearch)try{Object.assign(F,cc(I.options.validateSearch,{...F,...S}))}catch{}}),S=F}S=ok({search:S,dest:l,destRoutes:C,_includeValidateSearch:r._includeValidateSearch}),S=Hi(p,S);const A=this.options.stringifySearch(S),_=l.hash===!0?u.hash:l.hash?ci(l.hash,u.hash):void 0,k=_?`#${_}`:"";let B=l.state===!0?u.state:l.state?ci(l.state,u.state):{};B=qi(u.state,B);const T=`${N}${A}${k}`;let O,U,P=!1;if(this.rewrite){const F=new URL(T,this.origin),I=rw(this.rewrite,F);O=F.href.replace(F.origin,""),I.origin!==this.origin?(U=I.href,P=!0):U=I.pathname+I.search+I.hash}else O=gN(T),U=O;return{publicHref:U,href:O,pathname:N,search:S,searchStr:A,state:B,hash:_??"",external:P,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const f=a(l);let h=u?a(u):void 0;if(!h){const d=Object.create(null);if(this.options.routeMasks){const p=bN(f.pathname,this.processedTree);if(p){Object.assign(d,p.rawParams);const{from:g,params:y,...v}=p.route,w=y===!1||y===null?Object.create(null):(y??!0)===!0?d:Object.assign(d,ci(y,d));u={from:r.from,...v,params:w},h=a(u)}}}return h&&(f.maskedLocation=h),f};return r.mask?o(r,{from:r.from,...r.mask}):o(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:a,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const d=Xi(o.state,this.latestLocation.state);return h.forEach(p=>{delete o.state[p]}),d},u=pi(this.latestLocation.href)===pi(o.href);let f=this.commitLocationPromise;if(this.commitLocationPromise=ho(()=>{f?.resolve(),f=void 0}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:d,...p}=o;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[o.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:a})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:a,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:f,...h}={})=>{if(f){const g=this.history.location.state.__TSR_index,y=Zs(f,{__TSR_index:r?g:g+1}),v=new URL(y.pathname,this.origin);h.to=Sp(this.rewrite,v).pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const d=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:l,replace:r,resetScroll:a,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:r,reloadDocument:a,href:o,publicHref:l,...u})=>{let f=!1;if(o)try{new URL(`${o}`),f=!0}catch{}if(f&&!a&&(a=!0),a){if(r!==void 0||!o){const d=this.buildLocation({to:r,...u});o=o??d.publicHref,l=l??d.publicHref}const h=!f&&l?l:o;if(bc(h,this.protocolAllowlist))return Promise.resolve();if(!u.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const p of d)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation),a=this.stores.cachedMatchesSnapshot.state.filter(o=>!r.some(l=>l.id===o.id));this.batch(()=>{this.stores.status.setState(()=>"pending"),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(r),this.stores.setCachedMatches(a)})},this.load=async r=>{let a,o,l;const u=this.stores.resolvedLocation.state??this.stores.location.state;for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,p=this.stores.resolvedLocation.state,g=io(d,p);this.stores.redirect.state||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await wv({router:this,sync:r?.sync,forceStaleReload:u.href===d.href,matches:this.stores.pendingMatchesSnapshot.state,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=null,v=null,w=null,C=null;this.batch(()=>{const N=this.stores.pendingMatchesSnapshot.state,S=N.length,A=this.stores.activeMatchesSnapshot.state;y=S?A.filter(B=>!this.stores.pendingMatchStoresById.has(B.id)):null;const _=new Set;for(const B of this.stores.pendingMatchStoresById.values())B.routeId&&_.add(B.routeId);const k=new Set;for(const B of this.stores.activeMatchStoresById.values())B.routeId&&k.add(B.routeId);v=S?A.filter(B=>!_.has(B.routeId)):null,w=S?N.filter(B=>!k.has(B.routeId)):null,C=S?N.filter(B=>k.has(B.routeId)):A,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),S&&(this.stores.setActiveMatches(N),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...y.filter(B=>B.status!=="error"&&B.status!=="notFound"&&B.status!=="redirected")]),this.clearExpiredCache())});for(const[N,S]of[[v,"onLeave"],[w,"onEnter"],[C,"onStay"]])if(N)for(const A of N)this.looseRoutesById[A.routeId].options[S]?.(A)})})}})}catch(d){en(d)?(a=d,this.navigate({...a.options,replace:!0,ignoreBlocker:!0})):Ut(d)&&(o=d);const p=a?a.status:o?404:this.stores.activeMatchesSnapshot.state.some(g=>g.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>p),this.stores.redirect.setState(()=>a)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let f;this.hasNotFoundMatch()?f=404:this.stores.activeMatchesSnapshot.state.some(h=>h.status==="error")&&(f=500),f!==void 0&&this.stores.statusCode.setState(()=>f)},this.startViewTransition=r=>{const a=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,a&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof a=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.stores.resolvedLocation.state,f=typeof a.types=="function"?a.types(io(l,u)):a.types;if(f===!1){r();return}o={update:r,types:f}}else o=r;document.startViewTransition(o)}else r()},this.updateMatch=(r,a)=>{this.startTransition(()=>{const o=this.stores.pendingMatchStoresById.get(r);if(o){o.setState(a);return}const l=this.stores.activeMatchStoresById.get(r);if(l){l.setState(a);return}const u=this.stores.cachedMatchStoresById.get(r);if(u){const f=a(u.state);f.status==="redirected"?this.stores.cachedMatchStoresById.delete(r)&&this.stores.cachedMatchesId.setState(h=>h.filter(d=>d!==r)):u.setState(()=>f)}})},this.getMatch=r=>this.stores.cachedMatchStoresById.get(r)?.state??this.stores.pendingMatchStoresById.get(r)?.state??this.stores.activeMatchStoresById.get(r)?.state,this.invalidate=r=>{const a=o=>r?.filter?.(o)??!0?{...o,invalid:!0,...r?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(a)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(a)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(a))}),this.shouldViewTransition=!1,this.load({sync:r?.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const a=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const o=r.options._builtLocation??this.buildLocation(r.options),l=this.getParsedLocationHref(o);r.options.href=l,r.headers.set("Location",l)}else if(a)try{const o=new URL(a);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;r.options.href=l,r.headers.set("Location",l)}}catch{}if(r.options.href&&!r.options._builtLocation&&bc(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const a=r?.filter;a!==void 0?this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(o=>!a(o))):this.stores.setCachedMatches([])},this.clearExpiredCache=()=>{const r=Date.now(),a=o=>{const l=this.looseRoutesById[o.routeId];if(!l.options.loader)return!0;const u=(o.preload?l.options.preloadGcTime??this.options.defaultPreloadGcTime:l.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:r-o.updatedAt>=u};this.clearCache({filter:a})},this.loadRouteChunk=Ks,this.preloadRoute=async r=>{const a=r._builtLocation??this.buildLocation(r);let o=this.matchRoutes(a,{throwOnError:!0,preload:!0,dest:r});const l=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),u=new Set([...l,...this.stores.cachedMatchesId.state]),f=o.filter(h=>!u.has(h.id));if(f.length){const h=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...h,...f])}try{return o=await wv({router:this,matches:o,location:a,preload:!0,updateMatch:(h,d)=>{l.has(h)?o=o.map(p=>p.id===h?d(p):p):this.updateMatch(h,d)}}),o}catch(h){if(en(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:a});Ut(h)||console.error(h);return}},this.matchRoute=(r,a)=>{const o={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},l=this.buildLocation(o);if(a?.pending&&this.stores.status.state!=="pending")return!1;const u=(a?.pending===void 0?!this.stores.isLoading.state:a.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,f=wN(l.pathname,a?.caseSensitive??!1,a?.fuzzy??!1,u.pathname,this.processedTree);return!f||r.params&&!Xi(f.rawParams,r.params,{partial:!0})?!1:a?.includeSearch??!0?Xi(u.search,l.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(r=>r.status==="notFound"||r.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??PN,parseSearch:e.parseSearch??HN,protocolAllowlist:e.protocolAllowlist??mN}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:r}){this.routesById=e,this.routesByPath=t,this.processedTree=r;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const r=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:o,parsedParams:l}=r;let{matchedRoutes:u}=r,f=!1;(a?a.path!=="/"&&o["**"]:pi(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const h=f?lk(this.options.notFoundMode,u):void 0,d=new Array(u.length),p=new Map;for(const g of this.stores.activeMatchStoresById.values())g.routeId&&p.set(g.routeId,g.state);for(let g=0;g<u.length;g++){const y=u[g],v=d[g-1];let w,C,N;{const Q=v?.search??e.search,L=v?._strictSearch??void 0;try{const V=cc(y.options.validateSearch,{...Q})??void 0;w={...Q,...V},C={...L,...V},N=void 0}catch(V){let M=V;if(V instanceof Sc||(M=new Sc(V.message,{cause:V})),t?.throwOnError)throw M;w=Q,C={},N=M}}const S=y.options.loaderDeps?.({search:w})??"",A=S?JSON.stringify(S):"",{interpolatedPath:_,usedParams:k}=pv({path:y.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),B=y.id+_+A,T=this.getMatch(B),O=p.get(y.id),U=T?._strictParams??k;let P;if(!T)try{Nv(y,k,l,U)}catch(Q){if(Ut(Q)||en(Q)?P=Q:P=new rk(Q.message,{cause:Q}),t?.throwOnError)throw P}Object.assign(o,U);const F=O?"stay":"enter";let I;if(T)I={...T,cause:F,params:O?.params??o,_strictParams:U,search:Hi(O?O.search:T.search,w),_strictSearch:C};else{const Q=y.options.loader||y.options.beforeLoad||y.lazyFn||sw(y)?"pending":"success";I={id:B,ssr:y.options.ssr,index:g,routeId:y.id,params:O?.params??o,_strictParams:U,pathname:_,updatedAt:Date.now(),search:O?Hi(O.search,w):w,_strictSearch:C,searchError:void 0,status:Q,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:ho()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:O?qi(O.loaderDeps,S):S,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(I.globalNotFound=h===y.id),I.searchError=N;const Y=this.getParentContext(v);I.context={...Y,...I.__routeContext,...I.__beforeLoadContext},d[g]=I}for(let g=0;g<d.length;g++){const y=d[g],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),C=p.get(y.routeId);if(y.params=C?Hi(C.params,o):o,!w){const N=d[g-1],S=this.getParentContext(N);if(v.options.context){const A={deps:y.loaderDeps,params:y.params,context:S??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:d,routeId:v.id};y.__routeContext=v.options.context(A)??void 0}y.context={...S,...y.__routeContext,...y.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:r,parsedParams:a}=this.getMatchedRoutes(e.pathname),o=Gs(t),l={...e.search};for(const p of t)try{Object.assign(l,cc(p.options.validateSearch,l))}catch{}const u=Gs(this.stores.matchesId.state),f=u&&this.stores.activeMatchStoresById.get(u)?.state,h=f&&f.routeId===o.id&&f.pathname===e.pathname;let d;if(h)d=f.params;else{const p=Object.assign(Object.create(null),r);for(const g of t)try{Nv(g,r,a??{},p)}catch{}d=p}return{matchedRoutes:t,fullPath:o.fullPath,search:l,params:d}}},Sc=class extends Error{},rk=class extends Error{};function ik(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function cc(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Sc("Async validation not supported");if(r.issues)throw new Sc(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ak({pathname:e,routesById:t,processedTree:r}){const a=Object.create(null),o=pi(e);let l,u;const f=SN(o,r,!0);return f&&(l=f.route,Object.assign(a,f.rawParams),u=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:l,parsedParams:u}}function ok({search:e,dest:t,destRoutes:r,_includeValidateSearch:a}){return sk(r)(e,t,a??!1)}function sk(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:f})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((p,g)=>g(p),u));const d=f(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((p,g)=>g(p),d):d};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:f})=>{const h=f(u);if(!t._includeValidateSearch)return h;try{return{...h,...cc(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const r=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:ci(l.search,o):{}};t.middlewares.push(r);const a=(o,l,u)=>{if(o>=u.length)return l;const f=u[o];return f({search:l,next:d=>a(o+1,d,u)})};return function(l,u,f){return t.dest=u,t._includeValidateSearch=f,a(0,l,t.middlewares)}}function lk(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const a=t[r];if(a.children)return a.id}return Qi}function Nv(e,t,r,a){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in r&&(a[l]=r[l]);else{const l=o(a);Object.assign(a,l)}}var uk="Error preloading route! ☝️",uw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Qi:this.parentRoute||Mr();let o=a?Qi:r?.path;o&&o!=="/"&&(o=tw(o));const l=r?.id||o;let u=a?Qi:lc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,l]);o==="__root__"&&(o="/"),u!=="__root__"&&(u=lc(["/",u]));const f=u==="__root__"?"/":lc([this.parentRoute.fullPath,o]);this._path=o,this._id=u,this._fullPath=f,this._to=pi(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>qN({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},ck=class extends uw{constructor(e){super(e)}};function fk(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.state,r=t.state.__hashScrollIntoViewOptions??!0;if(r&&t.hash!==""){const a=document.getElementById(t.hash);a&&a.scrollIntoView(r)}}}function mm(e){const t=e.errorComponent??gm;return b.jsx(dk,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:a})=>r?H.createElement(t,{error:r,reset:a}):e.children})}var dk=class extends H.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function gm({error:e}){const[t,r]=H.useState(!1);return b.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[b.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),b.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(a=>!a),children:t?"Hide Error":"Show Error"})]}),b.jsx("div",{style:{height:".25rem"}}),t?b.jsx("div",{children:b.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?b.jsx("code",{children:e.message}):null})}):null]})}function hk({children:e,fallback:t=null}){return cw()?b.jsx(co.Fragment,{children:e}):b.jsx(co.Fragment,{children:t})}function cw(){return co.useSyncExternalStore(pk,()=>!0,()=>!1)}function pk(){return()=>{}}var fw=H.createContext(null);function rn(e){return H.useContext(fw)}var Yc=H.createContext(void 0),mk=H.createContext(void 0),st=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(st||{});function gk({update:e,notify:t,unwatched:r}){return{link:a,unlink:o,propagate:l,checkDirty:u,shallowPropagate:f};function a(d,p,g){const y=p.depsTail;if(y!==void 0&&y.dep===d)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===d){v.version=g,p.depsTail=v;return}const w=d.subsTail;if(w!==void 0&&w.version===g&&w.sub===p)return;const C=p.depsTail=d.subsTail={version:g,dep:d,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=C),y!==void 0?y.nextDep=C:p.deps=C,w!==void 0?w.nextSub=C:d.subs=C}function o(d,p=d.sub){const g=d.dep,y=d.prevDep,v=d.nextDep,w=d.nextSub,C=d.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=C:g.subsTail=C,C!==void 0?C.nextSub=w:(g.subs=w)===void 0&&r(g),v}function l(d){let p=d.nextSub,g;e:do{const y=d.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&h(d,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const C=(d=w).nextSub;C!==void 0&&(g={value:p,prev:g},p=C);continue}}if((d=p)!==void 0){p=d.nextSub;continue}for(;g!==void 0;)if(d=g.value,g=g.prev,d!==void 0){p=d.nextSub;continue e}break}while(!0)}function u(d,p){let g,y=0,v=!1;e:do{const w=d.dep,C=w.flags;if(p.flags&16)v=!0;else if((C&17)===17){if(e(w)){const N=w.subs;N.nextSub!==void 0&&f(N),v=!0}}else if((C&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(g={value:d,prev:g}),d=w.deps,p=w,++y;continue}if(!v){const N=d.nextDep;if(N!==void 0){d=N;continue}}for(;y--;){const N=p.subs,S=N.nextSub!==void 0;if(S?(d=g.value,g=g.prev):d=N,v){if(e(p)){S&&f(N),p=d.sub;continue}v=!1}else p.flags&=-33;p=d.sub;const A=d.nextDep;if(A!==void 0){d=A;continue e}}return v}while(!0)}function f(d){do{const p=d.sub,g=p.flags;(g&48)===32&&(p.flags=g|16,(g&6)===2&&t(p))}while((d=d.nextSub)!==void 0)}function h(d,p){let g=p.depsTail;for(;g!==void 0;){if(g===d)return!0;g=g.prevDep}return!1}}function ym(e,t,r){const a=typeof e=="object",o=a?e:void 0;return{next:(a?e.next:e)?.bind(o),error:(a?e.error:t)?.bind(o),complete:(a?e.complete:r)?.bind(o)}}const Cp=[];let fc=0;const{link:kv,unlink:yk,propagate:xk,checkDirty:dw,shallowPropagate:Mv}=gk({update(e){return e._update()},notify(e){Cp[_p++]=e,e.flags&=~st.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=st.Mutable|st.Dirty,Ec(e))}});let Gu=0,_p=0,Kn,Np=0;function hw(e){try{++Np,e()}finally{--Np||pw()}}function Ec(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=yk(r,e)}function pw(){if(!(Np>0)){for(;Gu<_p;){const e=Cp[Gu];Cp[Gu++]=void 0,e.notify()}Gu=0,_p=0}}function mw(e,t){const r=typeof e=="function",a=e,o={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?st.None:st.Mutable,get(){return Kn!==void 0&&kv(o,Kn,fc),o._snapshot},subscribe(l){const u=ym(l),f={current:!1},h=vk(()=>{o.get(),f.current?u.next?.(o._snapshot):f.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(l){const u=Kn,f=Object.is;if(r)Kn=o,++fc,o.depsTail=void 0;else if(l===void 0)return!1;r&&(o.flags=st.Mutable|st.RecursedCheck);try{const h=o._snapshot,d=typeof l=="function"?l(h):l===void 0&&r?a(h):l;return h===void 0||!f(h,d)?(o._snapshot=d,!0):!1}finally{Kn=u,r&&(o.flags&=~st.RecursedCheck),Ec(o)}}};return r?(o.flags=st.Mutable|st.Dirty,o.get=function(){const l=o.flags;if(l&st.Dirty||l&st.Pending&&dw(o.deps,o)){if(o._update()){const u=o.subs;u!==void 0&&Mv(u)}}else l&st.Pending&&(o.flags=l&~st.Pending);return Kn!==void 0&&kv(o,Kn,fc),o._snapshot}):o.set=function(l){if(o._update(l)){const u=o.subs;u!==void 0&&(xk(u),Mv(u),pw())}},o}function vk(e){const t=()=>{const a=Kn;Kn=r,++fc,r.depsTail=void 0,r.flags=st.Watching|st.RecursedCheck;try{return e()}finally{Kn=a,r.flags&=~st.RecursedCheck,Ec(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:st.Watching|st.RecursedCheck,notify(){const a=this.flags;a&st.Dirty||a&st.Pending&&dw(this.deps,this)?t():this.flags=st.Watching},stop(){this.flags=st.None,this.depsTail=void 0,Ec(this)}};return t(),r}class bk{constructor(t){this.atom=mw(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ym(t))}}class wk{constructor(t){this.atom=mw(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ym(t))}}function Tv(e){return typeof e=="function"?new wk(e):new bk(e)}var Ih={exports:{}},Bh={},Hh={exports:{}},Ph={};var Av;function Sk(){if(Av)return Ph;Av=1;var e=fl();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(g,y){var v=y(),w=a({inst:{value:v,getSnapshot:y}}),C=w[0].inst,N=w[1];return l(function(){C.value=v,C.getSnapshot=y,h(C)&&N({inst:C})},[g,v,y]),o(function(){return h(C)&&N({inst:C}),g(function(){h(C)&&N({inst:C})})},[g]),u(v),v}function h(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!r(g,v)}catch{return!0}}function d(g,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Ph.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ph}var Rv;function Ek(){return Rv||(Rv=1,Hh.exports=Sk()),Hh.exports}var jv;function Ck(){if(jv)return Bh;jv=1;var e=fl(),t=Ek();function r(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var a=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Bh.useSyncExternalStoreWithSelector=function(d,p,g,y,v){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=f(function(){function S(T){if(!A){if(A=!0,_=T,T=y(T),v!==void 0&&C.hasValue){var O=C.value;if(v(O,T))return k=O}return k=T}if(O=k,a(_,T))return O;var U=y(T);return v!==void 0&&v(O,U)?(_=T,O):(_=T,k=U)}var A=!1,_,k,B=g===void 0?null:g;return[function(){return S(p())},B===null?void 0:function(){return S(B())}]},[p,g,y,v]);var N=o(d,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=N},[N]),h(N),N},Bh}var Ov;function _k(){return Ov||(Ov=1,Ih.exports=Ck()),Ih.exports}var gw=_k();const Nk=Vc(gw);function kk(e,t){return e===t}function Vt(e,t,r=kk){const a=H.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),o=H.useCallback(()=>e?.get(),[e]);return gw.useSyncExternalStoreWithSelector(a,o,o,t,r)}var Mk={state:void 0,get:()=>{},subscribe:()=>()=>{}};function aa(e){const t=rn(),r=H.useContext(e.from?mk:Yc),a=e.from??r,o=a?e.from?t.stores.getMatchStoreByRouteId(a):t.stores.activeMatchStoresById.get(a):void 0,l=H.useRef(void 0);return Vt(o??Mk,u=>{if((e.shouldThrow??!0)&&!u&&Mr(),u===void 0)return;const f=e.select?e.select(u):u;if(e.structuralSharing??t.options.defaultStructuralSharing){const h=qi(l.current,f);return l.current=h,h}return f})}function yw(e){return aa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xw(e){const{select:t,...r}=e;return aa({...r,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function vw(e){return aa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function bw(e){return aa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function $c(e){const t=rn();return H.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}function ww(e){return aa({...e,select:t=>e.select?e.select(t.context):t.context})}var Tk=U1();function Ak(e,t){const r=rn(),a=cN(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:f,preload:h,preloadDelay:d,hashScrollIntoView:p,replace:g,startTransition:y,resetScroll:v,viewTransition:w,children:C,target:N,disabled:S,style:A,className:_,onClick:k,onBlur:B,onFocus:T,onMouseEnter:O,onMouseLeave:U,onTouchStart:P,ignoreBlocker:F,params:I,search:Y,hash:Q,state:L,mask:V,reloadDocument:M,unsafeRelative:q,from:X,_fromLocation:Z,...j}=e,z=cw(),$=H.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),R=Vt(r.stores.location,Te=>Te,(Te,ct)=>Te.href===ct.href),te=H.useMemo(()=>{const Te={_fromLocation:R,...$};return r.buildLocation(Te)},[r,R,$]),ue=te.maskedLocation?te.maskedLocation.publicHref:te.publicHref,fe=te.maskedLocation?te.maskedLocation.external:te.external,de=H.useMemo(()=>Lk(ue,fe,r.history,S),[S,fe,ue,r.history]),le=H.useMemo(()=>{if(de?.external)return bc(de.href,r.protocolAllowlist)?void 0:de.href;if(!Ik(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),bc(f,r.protocolAllowlist)?void 0:f}catch{}},[f,de,r.protocolAllowlist]),pe=H.useMemo(()=>{if(le)return!1;if(u?.exact){if(!MN(R.pathname,te.pathname,r.basepath))return!1}else{const Te=wc(R.pathname,r.basepath),ct=wc(te.pathname,r.basepath);if(!(Te.startsWith(ct)&&(Te.length===ct.length||Te[ct.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Xi(R.search,te.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?z&&R.hash===te.hash:!0},[u?.exact,u?.explicitUndefined,u?.includeHash,u?.includeSearch,R,le,z,te.hash,te.pathname,te.search,r.basepath]),we=pe?ci(o,{})??Rk:Uh,Ee=pe?Uh:ci(l,{})??Uh,ve=[_,we.className,Ee.className].filter(Boolean).join(" "),Ce=(A||we.style||Ee.style)&&{...A,...we.style,...Ee.style},[ce,ge]=H.useState(!1),be=H.useRef(!1),De=e.reloadDocument||le?!1:h??r.options.defaultPreload,qe=d??r.options.defaultPreloadDelay??0,Fe=H.useCallback(()=>{r.preloadRoute({...$,_builtLocation:te}).catch(Te=>{console.warn(Te),console.warn(uk)})},[r,$,te]);uN(a,H.useCallback(Te=>{Te?.isIntersecting&&Fe()},[Fe]),zk,{disabled:!!S||De!=="viewport"}),H.useEffect(()=>{be.current||!S&&De==="render"&&(Fe(),be.current=!0)},[S,Fe,De]);const _t=Te=>{const ct=Te.currentTarget.getAttribute("target"),ie=N!==void 0?N:ct;if(!S&&!Bk(Te)&&!Te.defaultPrevented&&(!ie||ie==="_self")&&Te.button===0){Te.preventDefault(),Tk.flushSync(()=>{ge(!0)});const me=r.subscribe("onResolved",()=>{me(),ge(!1)});r.navigate({...$,replace:g,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:F})}};if(le)return{...j,ref:a,href:le,...C&&{children:C},...N&&{target:N},...S&&{disabled:S},...A&&{style:A},..._&&{className:_},...k&&{onClick:k},...B&&{onBlur:B},...T&&{onFocus:T},...O&&{onMouseEnter:O},...U&&{onMouseLeave:U},...P&&{onTouchStart:P}};const Ot=Te=>{if(S||De!=="intent")return;if(!qe){Fe();return}const ct=Te.currentTarget;if(ks.has(ct))return;const ie=setTimeout(()=>{ks.delete(ct),Fe()},qe);ks.set(ct,ie)},on=Te=>{S||De!=="intent"||Fe()},wn=Te=>{if(S||!De||!qe)return;const ct=Te.currentTarget,ie=ks.get(ct);ie&&(clearTimeout(ie),ks.delete(ct))};return{...j,...we,...Ee,href:de?.href,ref:a,onClick:Qa([k,_t]),onBlur:Qa([B,wn]),onFocus:Qa([T,Ot]),onMouseEnter:Qa([O,Ot]),onMouseLeave:Qa([U,wn]),onTouchStart:Qa([P,on]),disabled:!!S,target:N,...Ce&&{style:Ce},...ve&&{className:ve},...S&&jk,...pe&&Ok,...z&&ce&&Dk}}var Uh={},Rk={className:"active"},jk={role:"link","aria-disabled":!0},Ok={"data-status":"active","aria-current":"page"},Dk={"data-transitioning":"transitioning"},ks=new WeakMap,zk={rootMargin:"100px"},Qa=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function Lk(e,t,r,a){if(!a)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Ik(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Sw=H.forwardRef((e,t)=>{const{_asChild:r,...a}=e,{type:o,...l}=Ak(a,t),u=typeof a.children=="function"?a.children({isActive:l["data-status"]==="active"}):a.children;if(!r){const{disabled:f,...h}=l;return H.createElement("a",h,u)}return H.createElement(r,l,u)});function Bk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Hk=class extends uw{constructor(e){super(e),this.useMatch=t=>aa({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ww({...t,from:this.id}),this.useSearch=t=>bw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>vw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>xw({...t,from:this.id}),this.useLoaderData=t=>yw({...t,from:this.id}),this.useNavigate=()=>$c({from:this.fullPath}),this.Link=co.forwardRef((t,r)=>b.jsx(Sw,{ref:r,from:this.fullPath,...t}))}};function hl(e){return new Hk(e)}var Pk=class extends ck{constructor(e){super(e),this.useMatch=t=>aa({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ww({...t,from:this.id}),this.useSearch=t=>bw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>vw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>xw({...t,from:this.id}),this.useLoaderData=t=>yw({...t,from:this.id}),this.useNavigate=()=>$c({from:this.fullPath}),this.Link=co.forwardRef((t,r)=>b.jsx(Sw,{ref:r,from:this.fullPath,...t}))}};function Uk(e){return new Pk(e)}function Vk(e){const t=rn(),r=`not-found-${Vt(t.stores.location,a=>a.pathname)}-${Vt(t.stores.status,a=>a)}`;return b.jsx(mm,{getResetKey:()=>r,onCatch:(a,o)=>{if(Ut(a))e.onCatch?.(a,o);else throw a},errorComponent:({error:a})=>{if(Ut(a))return e.fallback?.(a);throw a},children:e.children})}function qk(){return b.jsx("p",{children:"Not Found"})}function eo(e){return b.jsx(b.Fragment,{children:e.children})}function Ew(e,t,r){return t.options.notFoundComponent?b.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?b.jsx(e.options.defaultNotFoundComponent,{...r}):b.jsx(qk,{})}function Fk(e){return null}function Yk(){return Fk(rn()),null}var Cw=H.memo(function({matchId:t}){const r=rn(),a=r.stores.activeMatchStoresById.get(t);a||Mr();const o=Vt(r.stores.loadedAt,u=>u),l=Vt(a,u=>u);return b.jsx($k,{router:r,matchId:t,resetKey:o,matchState:H.useMemo(()=>{const u=l.routeId,f=r.routesById[u].parentRoute?.id;return{routeId:u,ssr:l.ssr,_displayPending:l._displayPending,parentRouteId:f}},[l._displayPending,l.routeId,l.ssr,r.routesById])})});function $k({router:e,matchId:t,resetKey:r,matchState:a}){const o=e.routesById[a.routeId],l=o.options.pendingComponent??e.options.defaultPendingComponent,u=l?b.jsx(l,{}):null,f=o.options.errorComponent??e.options.defaultErrorComponent,h=o.options.onCatch??e.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??e.options.notFoundRoute?.options.component:o.options.notFoundComponent,p=a.ssr===!1||a.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||p)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||p))?H.Suspense:eo,y=f?mm:eo,v=d?Vk:eo;return b.jsxs(o.isRoot?o.options.shellComponent??eo:eo,{children:[b.jsx(Yc.Provider,{value:t,children:b.jsx(g,{fallback:u,children:b.jsx(y,{getResetKey:()=>r,errorComponent:f||gm,onCatch:(w,C)=>{if(Ut(w))throw w.routeId??=a.routeId,w;h?.(w,C)},children:b.jsx(v,{fallback:w=>{if(w.routeId??=a.routeId,!d||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!o.isRoot)throw w;return H.createElement(d,w)},children:p||a._displayPending?b.jsx(hk,{fallback:u,children:b.jsx(Dv,{matchId:t})}):b.jsx(Dv,{matchId:t})})})})}),a.parentRouteId===Qi?b.jsxs(b.Fragment,{children:[b.jsx(Gk,{resetKey:r}),e.options.scrollRestoration&&W1?b.jsx(Yk,{}):null]}):null]})}function Gk({resetKey:e}){const t=rn(),r=H.useRef(void 0);return zs(()=>{const a=t.latestLocation.href;(r.current===void 0||r.current!==a)&&(t.emit({type:"onRendered",...io(t.stores.location.state,t.stores.resolvedLocation.state)}),r.current=a)},[t.latestLocation.state.__TSR_key,e,t]),null}var Dv=H.memo(function({matchId:t}){const r=rn(),a=r.stores.activeMatchStoresById.get(t);a||Mr();const o=Vt(a,d=>d),l=o.routeId,u=r.routesById[l],f=H.useMemo(()=>{const d=(r.routesById[l].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:l,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return d?JSON.stringify(d):void 0},[l,o.loaderDeps,o._strictParams,o._strictSearch,r.options.defaultRemountDeps,r.routesById]),h=H.useMemo(()=>{const d=u.options.component??r.options.defaultComponent;return d?b.jsx(d,{},f):b.jsx(Xk,{})},[f,u.options.component,r.options.defaultComponent]);if(o._displayPending)throw r.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw r.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const d=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(d){const p=r.getMatch(o.id);if(p&&!p._nonReactive.minPendingPromise){const g=ho();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw r.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return Ut(o.error)||Mr(),Ew(r,u,o.error);if(o.status==="redirected")throw en(o.error)||Mr(),r.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return h}),Xk=H.memo(function(){const t=rn(),r=H.useContext(Yc);let a,o=!1,l;{const d=r?t.stores.activeMatchStoresById.get(r):void 0;[a,o]=Vt(d,p=>[p?.routeId,p?.globalNotFound??!1]),l=Vt(t.stores.matchesId,p=>p[p.findIndex(g=>g===r)+1])}const u=a?t.routesById[a]:void 0,f=t.options.defaultPendingComponent?b.jsx(t.options.defaultPendingComponent,{}):null;if(o)return u||Mr(),Ew(t,u,void 0);if(!l)return null;const h=b.jsx(Cw,{matchId:l});return a===Qi?b.jsx(H.Suspense,{fallback:f,children:h}):h});function Qk(){const e=rn(),t=H.useRef({router:e,mounted:!1}),[r,a]=H.useState(!1),o=Vt(e.stores.isLoading,g=>g),l=Vt(e.stores.hasPendingMatches,g=>g),u=Th(o),f=o||r||l,h=Th(f),d=o||l,p=Th(d);return e.startTransition=g=>{a(!0),H.startTransition(()=>{g(),a(!1)})},H.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return pi(e.latestLocation.publicHref)!==pi(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),zs(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),zs(()=>{u&&!o&&e.emit({type:"onLoad",...io(e.stores.location.state,e.stores.resolvedLocation.state)})},[u,e,o]),zs(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...io(e.stores.location.state,e.stores.resolvedLocation.state)})},[d,p,e]),zs(()=>{if(h&&!f){const g=io(e.stores.location.state,e.stores.resolvedLocation.state);e.emit({type:"onResolved",...g}),hw(()=>{e.stores.status.setState(()=>"idle"),e.stores.resolvedLocation.setState(()=>e.stores.location.state)}),g.hrefChanged&&fk(e)}},[f,h,e]),null}function Kk(){const e=rn(),t=e.routesById[Qi].options.pendingComponent??e.options.defaultPendingComponent,r=t?b.jsx(t,{}):null,a=b.jsxs(typeof document<"u"&&e.ssr?eo:H.Suspense,{fallback:r,children:[b.jsx(Qk,{}),b.jsx(Zk,{})]});return e.options.InnerWrap?b.jsx(e.options.InnerWrap,{children:a}):a}function Zk(){const e=rn(),t=Vt(e.stores.firstMatchId,o=>o),r=Vt(e.stores.loadedAt,o=>o),a=t?b.jsx(Cw,{matchId:t}):null;return b.jsx(Yc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:b.jsx(mm,{getResetKey:()=>r,errorComponent:gm,onCatch:void 0,children:a})})}function Wk(){const e=rn();return Vt(e.stores.matchRouteReactivity,t=>t),H.useCallback(t=>{const{pending:r,caseSensitive:a,fuzzy:o,includeSearch:l,...u}=t;return e.matchRoute(u,{pending:r,caseSensitive:a,fuzzy:o,includeSearch:l})},[e])}var Jk=e=>({createMutableStore:Tv,createReadonlyStore:Tv,batch:hw}),eM=e=>new tM(e),tM=class extends nk{constructor(e){super(e,Jk)}};function nM({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const a=b.jsx(fw.Provider,{value:e,children:t});return e.options.Wrap?b.jsx(e.options.Wrap,{children:a}):a}function rM({router:e,...t}){return b.jsx(nM,{router:e,...t,children:b.jsx(Kk,{})})}function iM(e){const r=rn();return H.useRef(void 0),Vt(r.stores.__store,a=>a)}const kp=new Set,It=new WeakMap,ea=new WeakMap,xn=new WeakMap,Ws=new WeakMap,Vh=new WeakMap,Ls=new WeakMap,Zi=new WeakMap,di=new WeakMap,to=new WeakSet;let Jt,xm=0,vm=0;const Nr="__aa_tgt",Js="__aa_del",Cc="__aa_new",_w=e=>{const t=lM(e);t&&t.forEach(r=>uM(r))},aM=e=>{e.forEach(t=>{t.target===Jt&&oM(),It.has(t.target)&&oa(t.target)})};function Nw(e){const t=e.getBoundingClientRect(),r=Jt?.clientWidth||0,a=Jt?.clientHeight||0;return t.bottom<0||t.top>a||t.right<0||t.left>r}function bm(e){const t=Ws.get(e);t?.disconnect();let r=It.get(e),a=0;const o=5;r||(r=po(e),It.set(e,r));const{offsetWidth:l,offsetHeight:u}=Jt,h=[r.top-o,l-(r.left+o+r.width),u-(r.top+o+r.height),r.left-o].map(p=>`${-1*Math.floor(p)}px`).join(" "),d=new IntersectionObserver(()=>{++a>1&&oa(e)},{root:Jt,threshold:1,rootMargin:h});d.observe(e),Ws.set(e,d)}function oa(e,t=!0){clearTimeout(di.get(e));const r=Gc(e),a=t?el(r)?500:r.duration:0;di.set(e,setTimeout(async()=>{const o=xn.get(e);try{await o?.finished,It.set(e,po(e)),bm(e)}catch{}},a))}function oM(){clearTimeout(di.get(Jt)),di.set(Jt,setTimeout(()=>{kp.forEach(e=>dc(e,t=>kw(()=>oa(t))))},100))}function sM(e){setTimeout(()=>{Ls.set(e,setInterval(()=>kw(oa.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function kw(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let _r;const Mw=typeof window<"u"&&"ResizeObserver"in window;Mw&&(Jt=document.documentElement,new MutationObserver(_w),_r=new ResizeObserver(aM),window.addEventListener("scroll",()=>{vm=window.scrollY,xm=window.scrollX}),_r.observe(Jt));function lM(e){return e.reduce((a,o)=>[...a,...Array.from(o.addedNodes),...Array.from(o.removedNodes)],[]).every(a=>a.nodeName==="#comment")?!1:e.reduce((a,o)=>{if(a===!1)return!1;if(o.target instanceof Element){if(qh(o.target),!a.has(o.target)){a.add(o.target);for(let l=0;l<o.target.children.length;l++){const u=o.target.children.item(l);if(u){if(Js in u)return!1;qh(o.target,u),a.add(u)}}}if(o.removedNodes.length)for(let l=0;l<o.removedNodes.length;l++){const u=o.removedNodes[l];if(Js in u)return!1;u instanceof Element&&(a.add(u),qh(o.target,u),ea.set(u,[o.previousSibling,o.nextSibling]))}}return a},new Set)}function qh(e,t){!t&&!(Nr in e)?Object.defineProperty(e,Nr,{value:e}):t&&!(Nr in t)&&Object.defineProperty(t,Nr,{value:e})}function uM(e){var t,r;const a=e.isConnected,o=It.has(e);a&&ea.has(e)&&ea.delete(e),((t=xn.get(e))===null||t===void 0?void 0:t.playState)!=="finished"&&((r=xn.get(e))===null||r===void 0||r.cancel()),Cc in e?zv(e):o&&a?fM(e):o&&!a?dM(e):zv(e)}function Xn(e){return Number(e.replace(/[^0-9.\-]/g,""))}function cM(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function po(e){const t=e.getBoundingClientRect(),{x:r,y:a}=cM(e);return{top:t.top+a,left:t.left+r,width:t.width,height:t.height}}function Tw(e,t,r){let a=t.width,o=t.height,l=r.width,u=r.height;const f=getComputedStyle(e);if(f.getPropertyValue("box-sizing")==="content-box"){const d=Xn(f.paddingTop)+Xn(f.paddingBottom)+Xn(f.borderTopWidth)+Xn(f.borderBottomWidth),p=Xn(f.paddingLeft)+Xn(f.paddingRight)+Xn(f.borderRightWidth)+Xn(f.borderLeftWidth);a-=p,l-=p,o-=d,u-=d}return[a,l,o,u].map(Math.round)}function Gc(e){return Nr in e&&Zi.has(e[Nr])?Zi.get(e[Nr]):{duration:250,easing:"ease-in-out"}}function Aw(e){if(Nr in e)return e[Nr]}function wm(e){const t=Aw(e);return t?to.has(t):!1}function dc(e,...t){t.forEach(r=>r(e,Zi.has(e)));for(let r=0;r<e.children.length;r++){const a=e.children.item(r);a&&t.forEach(o=>o(a,Zi.has(a)))}}function Sm(e){return Array.isArray(e)?e:[e]}function el(e){return typeof e=="function"}function fM(e){const t=It.get(e),r=po(e);if(!wm(e))return It.set(e,r);if(Nw(e)){It.set(e,r),bm(e);return}let a;if(!t)return;const o=Gc(e);if(typeof o!="function"){let l=t.left-r.left,u=t.top-r.top;const f=t.left+t.width-(r.left+r.width);t.top+t.height-(r.top+r.height)==0&&(u=0),f==0&&(l=0);const[d,p,g,y]=Tw(e,t,r),v={transform:`translate(${l}px, ${u}px)`},w={transform:"translate(0, 0)"};d!==p&&(v.width=`${d}px`,w.width=`${p}px`),g!==y&&(v.height=`${g}px`,w.height=`${y}px`),a=e.animate([v,w],{duration:o.duration,easing:o.easing})}else{const[l]=Sm(o(e,"remain",t,r));a=new Animation(l),a.play()}xn.set(e,a),It.set(e,r),a.addEventListener("finish",oa.bind(null,e,!1),{once:!0})}function zv(e){Cc in e&&delete e[Cc];const t=po(e);It.set(e,t);const r=Gc(e);if(!wm(e))return;if(Nw(e)){bm(e);return}let a;if(typeof r!="function")a=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:r.duration*1.5,easing:"ease-in"});else{const[o]=Sm(r(e,"add",t));a=new Animation(o),a.play()}xn.set(e,a),a.addEventListener("finish",oa.bind(null,e,!1),{once:!0})}function Lv(e,t){var r;e.remove(),It.delete(e),ea.delete(e),xn.delete(e),(r=Ws.get(e))===null||r===void 0||r.disconnect(),setTimeout(()=>{if(Js in e&&delete e[Js],Object.defineProperty(e,Cc,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const a in t)e.style[a]=""},0)}function dM(e){var t;if(!ea.has(e)||!It.has(e))return;const[r,a]=ea.get(e);Object.defineProperty(e,Js,{value:!0,configurable:!0});const o=window.scrollX,l=window.scrollY;if(a&&a.parentNode&&a.parentNode instanceof Element?a.parentNode.insertBefore(e,a):r&&r.parentNode?r.parentNode.appendChild(e):(t=Aw(e))===null||t===void 0||t.appendChild(e),!wm(e))return Lv(e);const[u,f,h,d]=pM(e),p=Gc(e),g=It.get(e);(o!==xm||l!==vm)&&hM(e,o,l,p);let y,v={position:"absolute",top:`${u}px`,left:`${f}px`,width:`${h}px`,height:`${d}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!el(p))Object.assign(e.style,v),y=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:p.duration,easing:"ease-out"});else{const[w,C]=Sm(p(e,"remove",g));C?.styleReset!==!1&&(v=C?.styleReset||v,Object.assign(e.style,v)),y=new Animation(w),y.play()}xn.set(e,y),y.addEventListener("finish",()=>Lv(e,v),{once:!0})}function hM(e,t,r,a){const o=xm-t,l=vm-r,u=document.documentElement.style.scrollBehavior;if(getComputedStyle(Jt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+o,window.scrollY+l),!e.parentElement)return;const h=e.parentElement;let d=h.clientHeight,p=h.clientWidth;const g=performance.now();function y(){requestAnimationFrame(()=>{if(!el(a)){const v=d-h.clientHeight,w=p-h.clientWidth;g+a.duration>performance.now()?(window.scrollTo({left:window.scrollX-w,top:window.scrollY-v}),d=h.clientHeight,p=h.clientWidth,y()):document.documentElement.style.scrollBehavior=u}})}y()}function pM(e){var t;const r=It.get(e),[a,,o]=Tw(e,r,po(e));let l=e.parentElement;for(;l&&(getComputedStyle(l).position==="static"||l instanceof HTMLBodyElement);)l=l.parentElement;l||(l=document.body);const u=getComputedStyle(l),f=!xn.has(e)||((t=xn.get(e))===null||t===void 0?void 0:t.playState)==="finished"?po(l):It.get(l),h=Math.round(r.top-f.top)-Xn(u.borderTopWidth),d=Math.round(r.left-f.left)-Xn(u.borderLeftWidth);return[h,d,a,o]}function mM(e,t={}){if(Mw&&_r&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!el(t)&&!t.disrespectUserMotionPreference)){to.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),dc(e,oa,sM,u=>_r?.observe(u)),el(t)?Zi.set(e,t):Zi.set(e,{duration:250,easing:"ease-in-out",...t});const l=new MutationObserver(_w);l.observe(e,{childList:!0}),Vh.set(e,l),kp.add(e)}return Object.freeze({parent:e,enable:()=>{to.add(e)},disable:()=>{to.delete(e),dc(e,a=>{const o=xn.get(a);try{o?.cancel()}catch{}xn.delete(a);const l=di.get(a);l&&clearTimeout(l),di.delete(a);const u=Ls.get(a);u&&clearInterval(u),Ls.delete(a)})},isEnabled:()=>to.has(e),destroy:()=>{to.delete(e),kp.delete(e),Zi.delete(e);const a=Vh.get(e);a?.disconnect(),Vh.delete(e),dc(e,o=>{_r?.unobserve(o);const l=xn.get(o);try{l?.cancel()}catch{}xn.delete(o);const u=Ws.get(o);u?.disconnect(),Ws.delete(o);const f=Ls.get(o);f&&clearInterval(f),Ls.delete(o);const h=di.get(o);h&&clearTimeout(h),di.delete(o),It.delete(o),ea.delete(o)})}})}function gM(e){const[t,r]=H.useState(),a=H.useMemo(()=>e,[]),o=H.useCallback(u=>{u instanceof HTMLElement?r(mM(u,a)):r(void 0)},[a]),l=H.useCallback(u=>{t&&(u?t.enable():t.disable())},[t]);return H.useEffect(()=>()=>{var u;(u=t?.destroy)===null||u===void 0||u.call(t)},[t]),[o,l]}class Rw extends Error{constructor(t,r){super(`HTTP ${t}: ${r}`),this.status=t,this.name="HttpError"}}async function Eo(e){const t=await fetch(e);if(!t.ok)throw new Rw(t.status,t.statusText);const r=await t.json();if(!r.success||!r.data)throw new Error(r.error??"Unknown error");return r.data}function Em(){return So({queryKey:["sessions"],queryFn:()=>Eo("/api/v2/sessions"),refetchInterval:3e4,staleTime:25e3})}function yM(e){return So({queryKey:["session",e],queryFn:()=>Eo(`/api/v2/sessions/${e}`),enabled:!!e,refetchInterval:5e3,refetchIntervalInBackground:!1,staleTime:3e3})}function xM(e,t){return So({queryKey:["node",e,t],queryFn:()=>Eo(`/api/v2/sessions/${e}/nodes/${t}`),enabled:!!t})}function vM(){return So({queryKey:["worktrees"],queryFn:()=>Eo("/api/v2/worktrees"),refetchInterval:3e4,staleTime:2e4})}function bM(){return So({queryKey:["workflows"],queryFn:()=>Eo("/api/v2/workflows"),staleTime:1/0,refetchInterval:!1})}function wM(e){return So({queryKey:["workflow",e],queryFn:()=>Eo(`/api/v2/workflows/${e}`),enabled:e!==null,staleTime:1/0,refetchInterval:!1})}function SM(){const e=cm();H.useEffect(()=>{let t=null,r=null;function a(){t=new EventSource("/api/v2/workspace/events"),t.onmessage=o=>{try{const l=JSON.parse(o.data);l.type==="change"?e.invalidateQueries({queryKey:["sessions"]}):l.type==="worktrees-updated"&&e.invalidateQueries({queryKey:["worktrees"]})}catch{}},t.onerror=()=>{t?.close(),t=null,r=setTimeout(a,5e3)}}return a(),()=>{r!==null&&clearTimeout(r),t?.close()}},[e])}function _c({label:e,color:t,pulse:r=!1,className:a="",role:o,"aria-label":l}){return b.jsxs("span",{className:`font-mono text-[10px] font-bold uppercase tracking-[0.20em]${r?" badge-live":""}${a?` ${a}`:""}`,style:t?{color:t}:void 0,role:o,"aria-label":l,children:["[ ",e," ]"]})}const EM={in_progress:{label:"IN PROGRESS",pulse:!0},dormant:{label:"DORMANT",pulse:!1,color:"var(--text-muted)"},complete:{label:"COMPLETE",pulse:!1,color:"var(--success)"},complete_with_gaps:{label:"GAPS",pulse:!1,color:"var(--warning)"},blocked:{label:"BLOCKED",pulse:!1,color:"var(--blocked)"}};function Cm({status:e}){const{label:t,pulse:r,color:a}=EM[e];return b.jsx(_c,{label:t,pulse:r,color:a})}function jw({health:e}){return e==="healthy"?null:b.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:"var(--error)20",color:"var(--error)"},children:"Corrupt"})}function CM({children:e,variant:t="default",className:r=""}){const a="font-mono text-[10px] px-1.5 py-0.5 text-[var(--text-secondary)] inline-flex items-center",o=t==="outlined"?"border border-[var(--border)]":"bg-[var(--bg-secondary)]";return b.jsx("span",{className:`${a} ${o} ${r}`,children:e})}const _M=1;function Ow(e){return`polygon(${e}px 0, 100% 0, 100% 100%, 0 100%, 0 ${e}px)`}function Co({cut:e=12,borderColor:t="var(--border)",background:r="var(--bg-card)",dropShadow:a,backdropFilter:o,className:l,style:u,children:f}){const h=Ow(e);return b.jsxs("div",{className:l,style:{filter:a?`${a}`:void 0,...u},children:[b.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:t,clipPath:h,pointerEvents:"none"}}),b.jsx("div",{style:{position:"absolute",inset:_M,background:r,backdropFilter:o??void 0,WebkitBackdropFilter:o??void 0,clipPath:h,display:"flex",flexDirection:"column",overflow:"hidden"},children:f})]})}const _m=H.forwardRef(function({variant:t="list",onClick:r,onKeyDown:a,onFocus:o,tabIndex:l,className:u="",style:f,children:h,"aria-label":d,cut:p=10,borderColor:g},y){if(t==="hero")return b.jsx(Co,{cut:p,borderColor:g,className:`relative ${u}`,style:f,children:h});const v="energy-card group cursor-pointer bg-[var(--bg-card)] border border-[var(--border)] hover:border-[var(--accent)] transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",w={grid:"flex flex-col min-h-[160px]",list:"w-full text-left"}[t],C=`${v} ${w} ${u}`,N=t==="grid"&&b.jsx("div",{className:"h-[3px] w-full bg-[var(--accent)] opacity-60 group-hover:opacity-100 transition-opacity shrink-0"});return r?b.jsxs("button",{ref:y,type:"button",onClick:r,onKeyDown:a,onFocus:o,tabIndex:l,"aria-label":d,className:C,style:f,children:[N,h]}):b.jsxs("div",{"aria-label":d,className:C,style:f,children:[N,h]})});function Xc(e){const t=Date.now()-e;if(t<0)return"just now";const r=Math.floor(t/1e3);if(r<60)return"just now";const a=Math.floor(r/60);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);if(o<24)return`${o}h ago`;const l=Math.floor(o/24);if(l<7)return`${l}d ago`;const u=Math.floor(l/7);return u<5?`${u}w ago`:`${Math.floor(l/30)}mo ago`}function NM(e){if(e.size<2)return 1;const t=new Set;for(const o of e.values())t.add(Math.round(o.getBoundingClientRect().top));if(t.size<2){const o=Math.round(e.get(0)?.getBoundingClientRect().top??0);let l=0;for(const u of e.values())Math.round(u.getBoundingClientRect().top)===o&&l++;return Math.max(1,l)}const r=Math.round(e.get(0)?.getBoundingClientRect().top??0);let a=0;for(const o of e.values())Math.round(o.getBoundingClientRect().top)===r&&a++;return Math.max(1,a)}function Iv(e,t,r,a){if(r===0)return 0;const l=(e??(t>0?-1:r))+t;return a?(l%r+r)%r:Math.max(0,Math.min(r-1,l))}function Bv(e,t,r,a,o){if(r===0)return 0;const l=e??0,u=l%a,f=Math.floor(l/a),h=Math.ceil(r/a);let d=f+t;o?d=(d%h+h)%h:d=Math.max(0,Math.min(h-1,d));const p=d*a+u;return Math.min(p,r-1)}function Dw({count:e,cols:t="auto",onActivate:r,loop:a=!0}){const[o,l]=H.useState(null),u=H.useRef(new Map),f=H.useCallback(p=>{l(p),p!==null&&u.current.get(p)?.focus()},[]),h=H.useCallback(()=>t==="auto"?NM(u.current):Math.max(1,t),[t]),d=H.useCallback(p=>({tabIndex:o===null?p===0?0:-1:o===p?0:-1,onFocus:()=>{l(p)},onKeyDown:g=>{const y=h();let v=null;switch(g.key){case"ArrowRight":case"d":case"D":v=Iv(p,1,e,a);break;case"ArrowLeft":case"a":case"A":v=Iv(p,-1,e,a);break;case"ArrowDown":case"s":case"S":v=Bv(p,1,e,y,a);break;case"ArrowUp":case"w":case"W":v=Bv(p,-1,e,y,a);break;case"Home":v=0;break;case"End":v=e-1;break;case"Enter":case" ":g.preventDefault(),r?.(p);return;default:return}v!==null&&(g.preventDefault(),f(v))},ref:g=>{g?u.current.set(p,g):u.current.delete(p)}}),[o,e,a,h,r,f]);return{focusedIndex:o,setFocusedIndex:f,getItemProps:d,containerProps:{role:"grid"}}}const Nc={in_progress:0,blocked:1,dormant:2,complete_with_gaps:3,complete:4},Mp=[{value:"recent",label:"Recent",compareFn:(e,t)=>t.lastModifiedMs-e.lastModifiedMs},{value:"status",label:"Status",compareFn:(e,t)=>Nc[e.status]-Nc[t.status]||t.lastModifiedMs-e.lastModifiedMs},{value:"workflow",label:"Workflow",compareFn:(e,t)=>(e.workflowName??e.workflowId??"").localeCompare(t.workflowName??t.workflowId??"")||t.lastModifiedMs-e.lastModifiedMs},{value:"nodes",label:"Node count",compareFn:(e,t)=>t.nodeCount-e.nodeCount||t.lastModifiedMs-e.lastModifiedMs}],Tp=[{value:"none",label:"No grouping",keyFn:null},{value:"workflow",label:"Workflow",keyFn:e=>e.workflowName??e.workflowId??"Unknown workflow"},{value:"status",label:"Status",keyFn:e=>e.status,groupCompareFn:(e,t)=>(Nc[e]??99)-(Nc[t]??99)},{value:"branch",label:"Branch",keyFn:e=>e.gitBranch??"No branch"}],kM=[{value:"all",label:"All"},{value:"in_progress",label:"In Progress"},{value:"dormant",label:"Dormant"},{value:"complete",label:"Complete"},{value:"complete_with_gaps",label:"Gaps"},{value:"blocked",label:"Blocked"}],ao=25;function MM(e,t,r){let a=[...e];if(r!=="all"&&(a=a.filter(o=>o.status===r)),t.trim()){const o=t.toLowerCase();a=a.filter(l=>(l.sessionTitle??"").toLowerCase().includes(o)||(l.workflowName??"").toLowerCase().includes(o)||(l.workflowId??"").toLowerCase().includes(o)||l.sessionId.toLowerCase().includes(o)||(l.gitBranch??"").toLowerCase().includes(o))}return a}function TM(e,t){const r=Mp.find(a=>a.value===t)??Mp[0];return[...e].sort(r.compareFn)}function AM(e,t){const r=Tp.find(l=>l.value===t)??Tp[0];if(!r.keyFn)return[{label:"",sessions:e}];const a=new Map;for(const l of e){const u=r.keyFn(l),f=a.get(u)??[];f.push(l),a.set(u,f)}const o=r.groupCompareFn??((l,u)=>l.localeCompare(u));return Array.from(a.entries()).sort(([l],[u])=>o(l,u)).map(([l,u])=>({label:l,sessions:u}))}function RM(e,t){const[r,a]=H.useState(e),o=H.useRef(null);return H.useEffect(()=>(o.current!==null&&clearTimeout(o.current),o.current=setTimeout(()=>a(e),t),()=>{o.current!==null&&clearTimeout(o.current)}),[e,t]),r}function jM({onSelectSession:e,initialSearch:t=""}){const{data:r,isLoading:a,error:o}=Em(),[l,u]=H.useState(t),[f,h]=H.useState("recent"),[d,p]=H.useState("none"),[g,y]=H.useState("all"),[v,w]=H.useState(0),C=RM(l,200),N=H.useCallback(Q=>{u(Q),w(0)},[]),S=H.useCallback(Q=>{h(Q),w(0)},[]),A=H.useCallback(Q=>{p(Q),w(0)},[]),_=H.useCallback(Q=>{y(Q),w(0)},[]),k=H.useMemo(()=>{if(!r)return{groups:[],total:0,filtered:0};const Q=MM(r.sessions,C,g),L=TM(Q,f);return{groups:AM(L,d),total:r.sessions.length,filtered:Q.length}},[r,C,g,f,d]),B=H.useMemo(()=>{if(!r)return{};const Q={all:r.sessions.length};for(const L of r.sessions)Q[L.status]=(Q[L.status]??0)+1;return Q},[r]);if(a)return b.jsx("div",{className:"flex items-center justify-center py-20",children:b.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading sessions..."})});if(o)return b.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load sessions: ",o.message]});if(!r||r.sessions.length===0)return b.jsxs("div",{className:"text-center py-16",children:[b.jsx("p",{className:"text-[var(--text-secondary)] text-lg",children:"No v2 sessions found"}),b.jsx("p",{className:"text-[var(--text-muted)] text-sm mt-2",children:"Sessions will appear here when workflows are executed with v2 tools enabled."})]});const T=d!=="none",O=v*ao,U=O+ao,P=Math.ceil(k.filtered/ao),F=T?[]:k.groups[0]?.sessions.slice(O,U)??[],{getItemProps:I,containerProps:Y}=Dw({count:F.length,cols:1,onActivate:H.useCallback(Q=>{e(F[Q].sessionId)},[F,e])});return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"flex items-center justify-between",children:b.jsxs("h2",{className:"text-lg font-medium text-[var(--text-primary)]",children:["Sessions",b.jsx("span",{className:"text-[var(--text-muted)] font-normal ml-2 text-sm",children:k.filtered===k.total?k.total:`${k.filtered} / ${k.total}`})]})}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-[360px]",children:[b.jsx("input",{type:"text",value:l,onChange:Q=>N(Q.target.value),placeholder:"Search sessions...",className:"w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-1.5 text-sm text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)] transition-colors"}),l&&b.jsx("button",{onClick:()=>N(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-[var(--text-muted)] hover:text-[var(--text-primary)] text-xs",children:"clear"})]}),b.jsx(Hv,{label:"Sort",value:f,options:Mp,onChange:S}),b.jsx(Hv,{label:"Group",value:d,options:Tp,onChange:A})]}),b.jsx("div",{className:"flex flex-wrap gap-1.5",children:kM.map(Q=>{const L=B[Q.value]??0;if(Q.value!=="all"&&L===0)return null;const V=g===Q.value;return b.jsxs("button",{onClick:()=>_(Q.value),className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors cursor-pointer ${V?"bg-[var(--accent)] text-white":"bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-card)] hover:text-[var(--text-primary)]"}`,children:[Q.label,b.jsx("span",{className:"ml-1 opacity-70",children:L})]},Q.value)})}),k.filtered===0?b.jsx("div",{className:"text-center py-12 text-[var(--text-muted)] text-sm",children:"No sessions match the current filters"}):T?b.jsx("div",{className:"space-y-6",children:k.groups.map(Q=>b.jsx(OM,{label:Q.label,sessions:Q.sessions,sort:f,statusFilter:g,onSelectSession:e},Q.label+"-"+f+"-"+g))}):b.jsxs(b.Fragment,{children:[b.jsx("div",{...Y,className:"space-y-2",children:F.map((Q,L)=>b.jsx(Lw,{session:Q,onClick:()=>e(Q.sessionId),navProps:I(L)},Q.sessionId))}),P>1&&b.jsx(zw,{page:v,totalPages:P,onPageChange:w})]})]})}function Hv({label:e,value:t,options:r,onChange:a}){return b.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)]",children:[e,b.jsx("select",{value:t,onChange:o=>a(o.target.value),className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-2 py-1.5 text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)] cursor-pointer",children:r.map(o=>b.jsx("option",{value:o.value,children:o.label},o.value))})]})}function OM({label:e,sessions:t,sort:r,statusFilter:a,onSelectSession:o}){const[l,u]=H.useState(!1),[f,h]=H.useState(0);H.useEffect(()=>h(0),[t.length]);const d=Math.ceil(t.length/ao),p=f*ao,g=p+ao,y=t.slice(p,g);return b.jsxs("div",{children:[b.jsxs("button",{onClick:()=>u(!l),className:"flex items-center gap-2 mb-2 cursor-pointer group",children:[b.jsx("span",{className:"text-[var(--text-muted)] text-xs transition-transform duration-150",style:{transform:l?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),b.jsx("span",{className:"text-sm font-medium text-[var(--text-secondary)] group-hover:text-[var(--text-primary)] transition-colors",children:e}),b.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",t.length,")"]})]}),!l&&b.jsxs("div",{className:"ml-4",children:[b.jsx("div",{className:"space-y-2",children:y.map(v=>b.jsx(Lw,{session:v,onClick:()=>o(v.sessionId)},v.sessionId))}),d>1&&b.jsx("div",{className:"mt-2",children:b.jsx(zw,{page:f,totalPages:d,onPageChange:h})})]})]})}function zw({page:e,totalPages:t,onPageChange:r}){return b.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[b.jsx("button",{onClick:()=>r(e-1),disabled:e===0,className:"px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer",children:"Prev"}),b.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:[e+1," / ",t]}),b.jsx("button",{onClick:()=>r(e+1),disabled:e>=t-1,className:"px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer",children:"Next"})]})}function Lw({session:e,onClick:t,navProps:r}){const a=e.sessionTitle,o=e.workflowName??e.workflowId,l=Xc(e.lastModifiedMs);return b.jsxs(_m,{variant:"list",onClick:t,tabIndex:r?.tabIndex,onKeyDown:r?.onKeyDown,onFocus:r?.onFocus,ref:r?.ref,className:"rounded-lg px-4 py-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsx("div",{className:"min-w-0 flex-1",children:b.jsx("div",{className:"text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors",children:a??o??"Unnamed session"})}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums",children:l}),b.jsx(jw,{health:e.health}),b.jsx(Cm,{status:e.status})]})]}),b.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[a&&o&&b.jsx(Xu,{children:o}),e.gitBranch&&b.jsx(Xu,{icon:"branch",children:e.gitBranch}),b.jsxs(Xu,{icon:"graph",children:[e.nodeCount,"N / ",e.edgeCount,"E"]}),e.tipCount>1&&b.jsxs(Xu,{icon:"fork",children:[e.tipCount," tips"]}),e.hasUnresolvedGaps&&b.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--warning)]",children:"gaps"})]}),b.jsx("div",{className:"mt-1.5 font-mono text-[10px] text-[var(--text-muted)] opacity-60 group-hover:opacity-100 transition-opacity truncate",children:e.sessionId})]})}const DM={branch:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.5 2.5 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Z"})}),graph:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.5 2.5 0 0 1 2 11.5Z"})}),fork:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm2.122-.75a2.25 2.25 0 1 0-3.244 0A2.5 2.5 0 0 0 2 5v5.5A2.5 2.5 0 0 0 4.5 13h3.25a.75.75 0 0 0 0-1.5H4.5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v5.5a1 1 0 0 1-1 1H8.75Z"})})};function Xu({children:e,icon:t}){return b.jsxs(CM,{className:"gap-1 rounded text-[var(--text-muted)] max-w-[200px] truncate",children:[t&&DM[t],e]})}const zM=720*60*60*1e3,Pv={in_progress:0,dormant:0,blocked:1,complete_with_gaps:2,complete:3};function LM(e){if(e.length!==0)return[...e].sort((t,r)=>{const a=Pv[t.status]-Pv[r.status];return a!==0?a:r.lastModifiedMs-t.lastModifiedMs})[0]}function IM(e,t,r){const a=e.primarySession?.status;if(a==="in_progress"||a==="blocked")return"visible";const o=(e.worktree?.changedCount??0)>0,l=(e.worktree?.aheadCount??0)>0;return o||l?"visible":a==="dormant"?t==="all"?"visible":"hidden":r-e.activityMs<zM||t==="all"?"visible":"hidden"}function Uv(e){switch(e.primarySession?.status){case"in_progress":return 0;case"blocked":return 1;case"dormant":return 2;default:return(e.worktree?.changedCount??0)>0||(e.worktree?.aheadCount??0)>0?3:4}}function BM(e,t,r){return[...e].filter(a=>IM(a,t,r)==="visible").sort((a,o)=>{const l=Uv(a)-Uv(o);return l!==0?l:o.activityMs-a.activityMs})}function HM(e,t){const r=new Map;for(const f of t)for(const h of f.worktrees)h.branch!==null&&r.set(`${h.branch}\0${f.repoRoot}`,{wt:h,repoName:f.repoName,repoRoot:f.repoRoot});const a=new Map;for(const[f,h]of r){const[d]=f.split("\0"),p=a.get(d)??[];p.push(h),a.set(d,p)}const o=new Map;for(const f of e){if(f.gitBranch===null)continue;const h=a.get(f.gitBranch)??[];if(h.length===0){if(!f.repoRoot)continue;const d=`${f.gitBranch}\0${f.repoRoot}`,p=o.get(d);if(p?p.push(f):o.set(d,[f]),!r.has(d)){const g=f.repoRoot.split("/").at(-1)??f.repoRoot;r.set(d,{wt:void 0,repoName:g,repoRoot:f.repoRoot})}continue}for(const d of h){const p=`${f.gitBranch}\0${d.repoRoot}`,g=o.get(p);g?g.push(f):o.set(p,[f])}}const l=[],u=new Set;for(const[f,h]of o){const[d,p]=f.split("\0"),g=r.get(f),y=LM(h),v=Math.max(y?.lastModifiedMs??0,g?.wt?.headTimestampMs??0),w=g?.repoName??p.split("/").at(-1)??p;l.push({branch:d,repoRoot:p,repoName:w,worktree:g?.wt,primarySession:y,allSessions:h,activityMs:v}),u.add(f)}for(const[f,{wt:h,repoName:d,repoRoot:p}]of r){if(u.has(f))continue;const[g]=f.split("\0");l.push({branch:g,repoRoot:p,repoName:d,worktree:h,primarySession:void 0,allSessions:[],activityMs:h?.headTimestampMs??0})}return l}function Iw({children:e,className:t="",style:r}){return b.jsx("div",{className:`branch-tree-line ${t}`,style:r,children:e})}const Bw=[{workflow:"coding task workflow",task:"add a dark mode toggle to the settings page"},{workflow:"coding task workflow",task:"write tests for the authentication module"},{workflow:"coding task workflow",task:"refactor the data layer to use a repository pattern"},{workflow:"coding task workflow",task:"add pagination to the search results view"},{workflow:"bug investigation workflow",task:"find why the API returns 500 on logout"},{workflow:"bug investigation workflow",task:"trace why notifications stop sending after 24 hours"},{workflow:"bug investigation workflow",task:"figure out why the build is failing on CI but not locally"},{workflow:"MR review workflow",task:"review my latest changes on this branch"},{workflow:"MR review workflow",task:"review PR #123 before it merges"}],Fh=["The DAG view shows every node the agent created, including blocked attempts and alternative paths.","Dormant sessions have been idle for over an hour -- return to the original conversation to resume.","Gaps are open questions the agent flagged but could not resolve. Check them in the node detail panel.","The preferred tip node (highlighted in yellow in the DAG) is the most recent forward position.","Complete with gaps means the workflow finished but left critical follow-ups unresolved.","The tip count badge shows how many execution paths a session explored.","Use j and k to navigate between branches, Enter to expand, and / to open the full session archive."];function PM(e){return e[Math.floor(Math.random()*e.length)]}function UM({hidden:e=!1}){const t=$c(),{data:r,isLoading:a,error:o,refetch:l}=Em(),{data:u,isLoading:f}=vM();SM();const[h,d]=H.useState("active"),[p,g]=H.useState(-1),[y,v]=H.useState(null),w=H.useRef(0),C=H.useRef(!0),N=H.useRef(new Map),S=H.useCallback(O=>{w.current=window.scrollY,t({to:"/session/$sessionId",params:{sessionId:O}})},[t]);H.useEffect(()=>{if(C.current){C.current=!1;return}if(!e){const O=requestAnimationFrame(()=>{window.scrollTo({top:w.current})});return()=>cancelAnimationFrame(O)}},[e]);const{repoGroups:A,orderedItems:_,archiveRepos:k,dormantHiddenCount:B}=H.useMemo(()=>{const O=Date.now(),U={repoGroups:[],orderedItems:[],archiveRepos:[],dormantHiddenCount:0};if(!r)return U;const P=u?.repos??[],F=HM(r.sessions,P),I=new Map;for(const M of F)I.has(M.repoRoot)||I.set(M.repoRoot,M.repoName);const Y=new Map;for(const M of F){const q=Y.get(M.repoRoot)??[];q.push(M),Y.set(M.repoRoot,q)}const Q=[...Y.entries()].map(([M,q])=>({repoRoot:M,repoName:q[0].repoName,sortedItems:BM(q,h,O)})).filter(M=>M.sortedItems.length>0).sort((M,q)=>{const X=M.sortedItems.some(j=>j.primarySession?.status==="in_progress"||j.primarySession?.status==="blocked")?0:1,Z=q.sortedItems.some(j=>j.primarySession?.status==="in_progress"||j.primarySession?.status==="blocked")?0:1;return X!==Z?X-Z:M.repoName.localeCompare(q.repoName)}),L=Q.flatMap(M=>M.sortedItems),V=h==="active"?F.filter(M=>M.primarySession?.status==="dormant"&&(M.worktree?.changedCount??0)===0&&(M.worktree?.aheadCount??0)===0).length:0;return{repoGroups:Q,orderedItems:L,archiveRepos:[...I.entries()],dormantHiddenCount:V}},[r,u,h]);H.useEffect(()=>{g(-1)},[_.length]),WM({items:_,focusedIndex:p,setFocusedIndex:g,onSelectSession:S,scope:h,setScope:d,refetch:l,archive:y,setArchive:v,disabled:e});const T=(r?.totalCount??0)>0;return a?b.jsx("div",{className:`flex items-center justify-center py-32 ${e?"hidden":""}`,children:b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-muted)] uppercase tracking-[0.25em] motion-safe:animate-pulse",children:"// LOADING WORKSPACE..."})}):o?b.jsxs("div",{className:`p-4 ${e?"hidden":""}`,style:{borderLeft:"3px solid var(--error)"},children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--error)] block mb-1",children:"// ERROR"}),b.jsxs("span",{className:"text-sm text-[var(--text-secondary)]",children:["Failed to load workspace: ",o.message]})]}):y!==null?b.jsxs("div",{className:`space-y-4 ${e?"hidden":""}`,children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{onClick:()=>v(null),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:"// WORKSPACE ←"}),y.repoName&&b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)]",children:y.repoName})]}),b.jsx(jM,{onSelectSession:S})]}):b.jsxs("div",{className:`space-y-6 ${e?"hidden":""}`,children:[T?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex items-start justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("h1",{className:"font-mono text-2xl font-bold uppercase tracking-[0.12em] leading-none",style:{color:"var(--accent)",textShadow:"0 0 28px rgba(244,196,48,0.35)"},children:"Workspace"}),b.jsxs("p",{className:"font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mt-1.5",children:["// ",_.length," session",_.length!==1?"s":""]})]}),b.jsx(QM,{scope:h,onChange:d})]}),_.length===0?b.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)] text-center py-8",children:"// no sessions match current filter"}):b.jsx("div",{className:"space-y-6",children:A.map((O,U)=>{const P=A.slice(0,U).reduce((F,I)=>F+I.sortedItems.length,0);return b.jsx(VM,{group:O,showHeader:!0,focusedIndex:p,groupOffset:P,worktreesFetching:f,onSelectSession:S,expandStateRef:N},O.repoRoot)})}),B>0&&b.jsxs("button",{type:"button",onClick:()=>d("all"),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left",children:["// ",B," dormant session",B!==1?"s":""," hidden — show all"]}),b.jsx(KM,{repos:k,onOpen:O=>v({repoName:O})})]}):b.jsxs(b.Fragment,{children:[b.jsx(ZM,{prompt:PM(Bw)}),b.jsx(qv,{})]}),b.jsx(qv,{})]})}const Vv=12;function VM({group:e,showHeader:t,focusedIndex:r,groupOffset:a,worktreesFetching:o,onSelectSession:l,expandStateRef:u}){const[f,h]=H.useState(!1),d=f?e.sortedItems:e.sortedItems.slice(0,Vv),p=e.sortedItems.length-Vv,g=e.sortedItems.filter(y=>y.primarySession?.status==="in_progress"||y.primarySession?.status==="blocked").length;return b.jsxs("section",{children:[t&&b.jsx("div",{style:{position:"sticky",top:"var(--app-header-height)",zIndex:10},className:"mb-3",children:b.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",style:{background:"var(--bg-secondary)",borderLeft:"3px solid var(--accent)",borderBottom:"1px solid rgba(244,196,48,0.15)"},children:[b.jsx("span",{className:"font-mono text-[12px] font-bold uppercase tracking-[0.25em] text-[var(--text-primary)]",children:e.repoName}),g>0&&b.jsx(_c,{label:`${g} ACTIVE`,color:"var(--accent-strong)"}),b.jsx("div",{className:"flex-1 h-px",style:{background:"rgba(244,196,48,0.12)"}})]})}),b.jsxs("div",{className:"space-y-3",children:[d.map((y,v)=>{const w=a+v,C=r===w;if(y.allSessions.length===0)return b.jsx(YM,{item:y,isFocused:C,worktreesFetching:o,expandStateRef:u},`${y.branch}\0${y.repoRoot}`);if(y.allSessions.length>1)return b.jsx(FM,{item:y,isFocused:C,worktreesFetching:o,onSelectSession:l,expandStateRef:u},`${y.branch}\0${y.repoRoot}`);const N=y.allSessions[0];return b.jsxs(Iw,{style:C?{outline:"2px solid var(--accent)",outlineOffset:"2px"}:void 0,children:[b.jsx(Hw,{item:y,worktreesFetching:o,filesExpanded:!1,onToggleFiles:()=>{},unpushedExpanded:!1,onToggleUnpushed:()=>{}}),b.jsx("div",{className:"pl-3 mt-px",children:b.jsx(Ap,{session:N,item:y,showBranch:!1,onSelect:()=>l(N.sessionId)})})]},`${y.branch}\0${y.repoRoot}`)}),!f&&p>0&&b.jsxs("button",{type:"button",onClick:()=>h(!0),className:"w-full text-left px-3 py-2 font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:["+ ",p," more ",p===1?"branch":"branches"]})]})]})}const qM=(e,t)=>{const r=o=>o.status==="in_progress"||o.status==="dormant"?0:o.status==="blocked"?1:2,a=r(e)-r(t);return a!==0?a:t.lastModifiedMs-e.lastModifiedMs};function FM({item:e,isFocused:t,worktreesFetching:r,onSelectSession:a,expandStateRef:o}){const l=`${e.branch}\0${e.repoRoot}`,u=()=>o.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1},[f,h]=H.useState(!1),[d,p]=H.useState(()=>u().filesExpanded),[g,y]=H.useState(()=>u().unpushedExpanded),v=[...e.allSessions].sort(qM),w=H.useCallback(()=>{p(A=>{const _=!A,k=o.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return o.current?.set(l,{...k,filesExpanded:_}),_})},[l,o]),C=H.useCallback(()=>{y(A=>{const _=!A,k=o.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return o.current?.set(l,{...k,unpushedExpanded:_}),_})},[l,o]),N=v.filter(A=>A.status==="in_progress"||A.status==="blocked"||A.status==="dormant"),S=v.filter(A=>A.status!=="in_progress"&&A.status!=="blocked"&&A.status!=="dormant");return b.jsxs(Iw,{style:t?{outline:"2px solid var(--accent)",outlineOffset:"2px"}:void 0,children:[b.jsx(Hw,{item:e,worktreesFetching:r,filesExpanded:d,onToggleFiles:w,unpushedExpanded:g,onToggleUnpushed:C}),d&&e.worktree&&e.worktree.changedFiles.length>0&&b.jsx(Pw,{files:e.worktree.changedFiles}),g&&e.worktree&&b.jsx(Uw,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount}),b.jsxs("div",{className:"pl-3 mt-px space-y-px",children:[N.map(A=>b.jsx(Ap,{session:A,showBranch:!1,onSelect:()=>a(A.sessionId)},A.sessionId)),S.length>0&&b.jsxs(b.Fragment,{children:[f&&S.map(A=>b.jsx(Ap,{session:A,showBranch:!1,onSelect:()=>a(A.sessionId)},A.sessionId)),b.jsx("button",{type:"button",onClick:()=>h(A=>!A),className:"w-full text-left px-3 py-1.5 font-mono text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:f?"// hide history":`+ ${S.length} completed workflow${S.length!==1?"s":""}`})]})]})]})}function Hw({item:e,worktreesFetching:t,filesExpanded:r,onToggleFiles:a,unpushedExpanded:o,onToggleUnpushed:l}){const u=Xc(e.activityMs);return b.jsxs("div",{className:"flex items-center gap-2 py-1 pr-3",children:[b.jsx("span",{className:"font-mono text-[11px] font-medium text-[var(--text-secondary)] truncate flex-1",children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!=="main"&&b.jsx(Vw,{}),b.jsx(Nm,{item:e,fetching:t,compact:!0,filesExpanded:r,onToggleFiles:a,unpushedExpanded:o,onToggleUnpushed:l}),b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:u})]})}function Ap({session:e,item:t,showBranch:r=!0,onSelect:a}){const o=Xc(e.lastModifiedMs),l=e.sessionTitle?.trim()||e.workflowName||e.workflowId||e.sessionId.slice(0,8),u=e.workflowName??e.workflowId??null,f=e.status==="dormant",h=e.status==="in_progress"?"var(--accent-strong)":e.status==="blocked"?"var(--blocked)":f?"rgba(244, 196, 48, 0.55)":"rgba(244, 196, 48, 0.15)";return b.jsx(_m,{variant:"list",onClick:a,className:"px-4 py-3",style:{borderLeft:`3px solid ${h}`},children:b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[f&&b.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0 mt-[3px] bg-[var(--accent)]","aria-hidden":"true",title:"Dormant"}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("p",{className:"text-sm text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug line-clamp-1 mb-0.5",children:l}),b.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[r&&t&&b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] truncate max-w-[200px]",children:t.branch}),u&&e.sessionTitle&&b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] shrink-0",children:u}),r&&t?.worktree&&b.jsx(Nm,{item:t,fetching:!1,compact:!0})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.hasUnresolvedGaps&&b.jsx("span",{className:"text-[10px] text-[var(--warning)]",title:"Unresolved gaps",children:"⚠"}),b.jsx(Cm,{status:e.status}),b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] tabular-nums",children:o})]})]})})}function YM({item:e,isFocused:t,worktreesFetching:r,expandStateRef:a}){const o=`${e.branch}\0${e.repoRoot}`,l=()=>a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1},[u,f]=H.useState(()=>l().filesExpanded),[h,d]=H.useState(()=>l().unpushedExpanded),[p]=gM(),g=Xc(e.activityMs),y=H.useCallback(()=>{f(w=>{const C=!w,N=a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(o,{...N,filesExpanded:C}),C})},[o,a]),v=H.useCallback(()=>{d(w=>{const C=!w,N=a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(o,{...N,unpushedExpanded:C}),C})},[o,a]);return b.jsxs("div",{ref:p,children:[b.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded ${t?"ring-2 ring-[var(--accent)] ring-offset-1":""}`,children:[b.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--border)]",title:"No sessions"}),b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)] truncate flex-1",children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!=="main"&&b.jsx(Vw,{}),b.jsx(Nm,{item:e,fetching:r,compact:!0,filesExpanded:u,onToggleFiles:y,unpushedExpanded:h,onToggleUnpushed:v}),e.worktree?.headMessage&&b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] truncate hidden sm:block max-w-[200px] opacity-60",children:e.worktree.headMessage}),b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:g})]}),u&&e.worktree&&e.worktree.changedFiles.length>0&&b.jsx(Pw,{files:e.worktree.changedFiles}),h&&e.worktree&&b.jsx(Uw,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount})]})}function Nm({item:e,fetching:t,compact:r=!1,filesExpanded:a,onToggleFiles:o,unpushedExpanded:l,onToggleUnpushed:u}){if(t&&(e.worktree===void 0||e.worktree.enrichment===null))return b.jsx("span",{className:"flex gap-1",children:b.jsx(XM,{})});const f=e.worktree;if(!f)return null;const h=f.changedCount,d=f.aheadCount;if(h===0&&d===0)return null;const p=`text-xs px-1.5 py-0.5 rounded bg-orange-500/10 text-orange-400 border border-orange-500/20 tabular-nums${r?" text-[10px]":""}`;return b.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&(o?b.jsxs("button",{type:"button","aria-expanded":a??!1,"aria-label":`Show ${h} uncommitted file${h===1?"":"s"}`,title:`${h} file${h===1?"":"s"} edited but not yet committed — click to expand`,onClick:o,className:`${p} cursor-pointer hover:bg-orange-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1${a?" ring-1 ring-orange-500/40":""}`,children:[h," uncommitted"]}):b.jsxs("span",{title:`${h} file${h===1?"":"s"} edited but not yet committed`,className:p,children:[h," uncommitted"]})),d>0&&(u?b.jsxs("button",{type:"button","aria-expanded":l??!1,"aria-label":`Show ${d} unpushed commit${d===1?"":"s"}`,title:`${d} commit${d===1?"":"s"} not yet pushed -- click to expand`,onClick:u,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 cursor-pointer hover:bg-blue-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 tabular-nums${r?" text-[10px]":""}${l?" ring-1 ring-blue-500/40":""}`,children:[d," unpushed"]}):b.jsxs("span",{title:`${d} commit${d===1?"":"s"} not yet pushed`,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 tabular-nums${r?" text-[10px]":""}`,children:[d," unpushed"]}))]})}const $M={modified:"var(--warning)",added:"var(--success)",deleted:"var(--error)",untracked:"#a0a0a0",renamed:"var(--accent)",other:"#a0a0a0"},GM={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",other:"~"};function Pw({files:e}){return b.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:e.map((t,r)=>b.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[b.jsx("span",{className:"text-[10px] font-mono font-semibold w-3 shrink-0 tabular-nums",style:{color:$M[t.status]},title:t.status,children:GM[t.status]}),b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:t.path})]},r))})}function Uw({commits:e,count:t}){return e.length===0?b.jsx("div",{className:"mx-3 mb-1 px-2 py-1.5 rounded border border-[var(--border)] bg-[var(--bg-card)]",children:b.jsx("span",{className:"text-[11px] text-[var(--text-muted)] italic",children:t!==void 0&&t>0?`${t} commit${t===1?"":"s"} ahead -- details unavailable`:"No unpushed commits"})}):b.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:e.map((r,a)=>b.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] shrink-0 tabular-nums w-14",children:r.hash}),b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:r.message})]},a))})}function Vw(){return b.jsx("span",{title:"Merged into main",className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 shrink-0",children:"merged"})}function XM(){return b.jsx("span",{className:"inline-block h-5 w-20 rounded bg-[var(--bg-tertiary)] motion-safe:animate-pulse"})}function QM({scope:e,onChange:t}){return b.jsx("div",{className:"flex items-center gap-1",children:["active","all"].map(r=>b.jsx("button",{type:"button",onClick:()=>t(r),className:`font-mono text-[10px] uppercase tracking-[0.20em] px-2.5 py-1 transition-colors capitalize ${e===r?"border border-[var(--accent)] text-[var(--accent)] bg-transparent":"border border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r==="active"?"Active":"All"},r))})}function KM({repos:e,onOpen:t}){return b.jsxs("div",{className:"flex flex-col gap-1 pt-2 border-t border-[var(--border)]",children:[e.map(([r,a])=>b.jsx("button",{type:"button",onClick:()=>t(a),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left",children:"// SESSION ARCHIVE →"},r)),e.length>1&&b.jsx("button",{type:"button",onClick:()=>t(void 0),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left",children:"// ALL SESSIONS →"})]})}function ZM({prompt:e}){return b.jsxs("div",{className:"flex flex-col items-center gap-8 py-20 text-center",children:[b.jsxs("div",{children:[b.jsx("p",{className:"font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-muted)] mb-3",children:"// WORKSPACE READY"}),b.jsx("h2",{className:"text-xl font-semibold text-[var(--text-primary)] mb-3",children:"Ready when you are"}),b.jsx("p",{className:"text-sm text-[var(--text-muted)] max-w-sm leading-relaxed",children:"Sessions appear here when your agent runs a workflow. Start one by telling your agent:"})]}),b.jsx("div",{className:"relative h-[100px] max-w-lg w-full",children:b.jsx(Co,{cut:12,borderColor:"var(--border)",background:"var(--bg-card)",className:"absolute inset-0",children:b.jsxs("div",{className:"px-6 py-5 text-left",children:[b.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] mb-2",children:"Try this prompt"}),b.jsxs("p",{className:"text-[var(--text-primary)] text-sm leading-relaxed",children:['"Use the'," ",b.jsx("span",{className:"text-[var(--accent)] font-medium",children:e.workflow})," ","to ",e.task,'"']})]})})}),b.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)]",children:["// ",Bw.length," PROMPTS AVAILABLE"]})]})}function qv(){const[e,t]=H.useState(()=>Math.floor(Math.random()*Fh.length)),[r,a]=H.useState(!1);return H.useEffect(()=>{let o=null;const l=setInterval(()=>{a(!0),o=setTimeout(()=>{t(u=>(u+1)%Fh.length),a(!1),o=null},300)},6e4);return()=>{clearInterval(l),o!==null&&clearTimeout(o)}},[]),b.jsx("div",{className:"flex items-start gap-3 border border-[var(--border)] px-4 py-3",style:{borderLeft:"3px solid rgba(244, 196, 48, 0.4)"},children:b.jsxs("div",{style:{opacity:r?0:1,transition:"opacity 300ms"},children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--accent)]",children:"// TIP"}),b.jsx("p",{className:"text-sm text-[var(--text-secondary)] mt-1 leading-relaxed",children:Fh[e]})]})})}function WM({items:e,focusedIndex:t,setFocusedIndex:r,onSelectSession:a,scope:o,setScope:l,refetch:u,archive:f,setArchive:h,disabled:d}){const p=H.useRef(e);p.current=e;const g=H.useRef(a);g.current=a;const y=H.useRef(o);y.current=o;const v=H.useRef(t);v.current=t;const w=H.useRef(f);w.current=f;const C=H.useRef(d);C.current=d,H.useEffect(()=>{function N(S){if(C.current||S.metaKey||S.ctrlKey||S.altKey)return;const A=document.activeElement;if(A instanceof HTMLInputElement||A instanceof HTMLTextAreaElement||A instanceof HTMLSelectElement)return;if(S.key==="Escape"&&w.current!==null){h(null);return}const _=p.current,k=v.current;switch(S.key){case"j":case"ArrowDown":{S.preventDefault();const B=Math.min(k+1,_.length-1);r(B);break}case"k":case"ArrowUp":{S.preventDefault();const B=Math.max(k-1,0);r(B);break}case"Enter":case" ":{if(S.preventDefault(),k>=0&&k<_.length){const T=_[k].primarySession?.sessionId;T&&g.current(T)}break}case"Escape":break;case"/":{S.preventDefault(),h({repoName:void 0});break}case"r":{S.preventDefault(),u();break}case"a":{S.preventDefault(),l(y.current==="active"?"all":"active");break}}}return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[r,l,u,h])}function gn({children:e,color:t,className:r="",style:a}){return b.jsx("span",{className:`font-mono text-[10px] uppercase tracking-[0.30em] ${r}`,style:{color:t??"var(--text-muted)",...a},children:e})}function St(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,a;r<e.length;r++)(a=St(e[r]))!==""&&(t+=(t&&" ")+a);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var JM={value:()=>{}};function Qc(){for(var e=0,t=arguments.length,r={},a;e<t;++e){if(!(a=arguments[e]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new hc(r)}function hc(e){this._=e}function eT(e,t){return e.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}hc.prototype=Qc.prototype={constructor:hc,on:function(e,t){var r=this._,a=eT(e+"",r),o,l=-1,u=a.length;if(arguments.length<2){for(;++l<u;)if((o=(e=a[l]).type)&&(o=tT(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(o=(e=a[l]).type)r[o]=Fv(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Fv(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new hc(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,l;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],a=0,o=l.length;a<o;++a)l[a].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,l=a.length;o<l;++o)a[o].value.apply(t,r)}};function tT(e,t){for(var r=0,a=e.length,o;r<a;++r)if((o=e[r]).name===t)return o.value}function Fv(e,t,r){for(var a=0,o=e.length;a<o;++a)if(e[a].name===t){e[a]=JM,e=e.slice(0,a).concat(e.slice(a+1));break}return r!=null&&e.push({name:t,value:r}),e}var Rp="http://www.w3.org/1999/xhtml";const Yv={svg:"http://www.w3.org/2000/svg",xhtml:Rp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Kc(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Yv.hasOwnProperty(t)?{space:Yv[t],local:e}:e}function nT(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Rp&&t.documentElement.namespaceURI===Rp?t.createElement(e):t.createElementNS(r,e)}}function rT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qw(e){var t=Kc(e);return(t.local?rT:nT)(t)}function iT(){}function km(e){return e==null?iT:function(){return this.querySelector(e)}}function aT(e){typeof e!="function"&&(e=km(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=new Array(u),h,d,p=0;p<u;++p)(h=l[p])&&(d=e.call(h,h.__data__,p,l))&&("__data__"in h&&(d.__data__=h.__data__),f[p]=d);return new bn(a,this._parents)}function oT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function sT(){return[]}function Fw(e){return e==null?sT:function(){return this.querySelectorAll(e)}}function lT(e){return function(){return oT(e.apply(this,arguments))}}function uT(e){typeof e=="function"?e=lT(e):e=Fw(e);for(var t=this._groups,r=t.length,a=[],o=[],l=0;l<r;++l)for(var u=t[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),o.push(h));return new bn(a,o)}function Yw(e){return function(){return this.matches(e)}}function $w(e){return function(t){return t.matches(e)}}var cT=Array.prototype.find;function fT(e){return function(){return cT.call(this.children,e)}}function dT(){return this.firstElementChild}function hT(e){return this.select(e==null?dT:fT(typeof e=="function"?e:$w(e)))}var pT=Array.prototype.filter;function mT(){return Array.from(this.children)}function gT(e){return function(){return pT.call(this.children,e)}}function yT(e){return this.selectAll(e==null?mT:gT(typeof e=="function"?e:$w(e)))}function xT(e){typeof e!="function"&&(e=Yw(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new bn(a,this._parents)}function Gw(e){return new Array(e.length)}function vT(){return new bn(this._enter||this._groups.map(Gw),this._parents)}function kc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}kc.prototype={constructor:kc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function bT(e){return function(){return e}}function wT(e,t,r,a,o,l){for(var u=0,f,h=t.length,d=l.length;u<d;++u)(f=t[u])?(f.__data__=l[u],a[u]=f):r[u]=new kc(e,l[u]);for(;u<h;++u)(f=t[u])&&(o[u]=f)}function ST(e,t,r,a,o,l,u){var f,h,d=new Map,p=t.length,g=l.length,y=new Array(p),v;for(f=0;f<p;++f)(h=t[f])&&(y[f]=v=u.call(h,h.__data__,f,t)+"",d.has(v)?o[f]=h:d.set(v,h));for(f=0;f<g;++f)v=u.call(e,l[f],f,l)+"",(h=d.get(v))?(a[f]=h,h.__data__=l[f],d.delete(v)):r[f]=new kc(e,l[f]);for(f=0;f<p;++f)(h=t[f])&&d.get(y[f])===h&&(o[f]=h)}function ET(e){return e.__data__}function CT(e,t){if(!arguments.length)return Array.from(this,ET);var r=t?ST:wT,a=this._parents,o=this._groups;typeof e!="function"&&(e=bT(e));for(var l=o.length,u=new Array(l),f=new Array(l),h=new Array(l),d=0;d<l;++d){var p=a[d],g=o[d],y=g.length,v=_T(e.call(p,p&&p.__data__,d,a)),w=v.length,C=f[d]=new Array(w),N=u[d]=new Array(w),S=h[d]=new Array(y);r(p,g,C,N,S,v,t);for(var A=0,_=0,k,B;A<w;++A)if(k=C[A]){for(A>=_&&(_=A+1);!(B=N[_])&&++_<w;);k._next=B||null}}return u=new bn(u,a),u._enter=f,u._exit=h,u}function _T(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function NT(){return new bn(this._exit||this._groups.map(Gw),this._parents)}function kT(e,t,r){var a=this.enter(),o=this,l=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?l.remove():r(l),a&&o?a.merge(o).order():o}function MT(e){for(var t=e.selection?e.selection():e,r=this._groups,a=t._groups,o=r.length,l=a.length,u=Math.min(o,l),f=new Array(o),h=0;h<u;++h)for(var d=r[h],p=a[h],g=d.length,y=f[h]=new Array(g),v,w=0;w<g;++w)(v=d[w]||p[w])&&(y[w]=v);for(;h<o;++h)f[h]=r[h];return new bn(f,this._parents)}function TT(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var a=e[t],o=a.length-1,l=a[o],u;--o>=0;)(u=a[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function AT(e){e||(e=RT);function t(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var r=this._groups,a=r.length,o=new Array(a),l=0;l<a;++l){for(var u=r[l],f=u.length,h=o[l]=new Array(f),d,p=0;p<f;++p)(d=u[p])&&(h[p]=d);h.sort(t)}return new bn(o,this._parents).order()}function RT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function jT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function OT(){return Array.from(this)}function DT(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length;o<l;++o){var u=a[o];if(u)return u}return null}function zT(){let e=0;for(const t of this)++e;return e}function LT(){return!this.node()}function IT(e){for(var t=this._groups,r=0,a=t.length;r<a;++r)for(var o=t[r],l=0,u=o.length,f;l<u;++l)(f=o[l])&&e.call(f,f.__data__,l,o);return this}function BT(e){return function(){this.removeAttribute(e)}}function HT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PT(e,t){return function(){this.setAttribute(e,t)}}function UT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function VT(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function qT(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function FT(e,t){var r=Kc(e);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((t==null?r.local?HT:BT:typeof t=="function"?r.local?qT:VT:r.local?UT:PT)(r,t))}function Xw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function YT(e){return function(){this.style.removeProperty(e)}}function $T(e,t,r){return function(){this.style.setProperty(e,t,r)}}function GT(e,t,r){return function(){var a=t.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,r)}}function XT(e,t,r){return arguments.length>1?this.each((t==null?YT:typeof t=="function"?GT:$T)(e,t,r??"")):mo(this.node(),e)}function mo(e,t){return e.style.getPropertyValue(t)||Xw(e).getComputedStyle(e,null).getPropertyValue(t)}function QT(e){return function(){delete this[e]}}function KT(e,t){return function(){this[e]=t}}function ZT(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function WT(e,t){return arguments.length>1?this.each((t==null?QT:typeof t=="function"?ZT:KT)(e,t)):this.node()[e]}function Qw(e){return e.trim().split(/^|\s+/)}function Mm(e){return e.classList||new Kw(e)}function Kw(e){this._node=e,this._names=Qw(e.getAttribute("class")||"")}Kw.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Zw(e,t){for(var r=Mm(e),a=-1,o=t.length;++a<o;)r.add(t[a])}function Ww(e,t){for(var r=Mm(e),a=-1,o=t.length;++a<o;)r.remove(t[a])}function JT(e){return function(){Zw(this,e)}}function eA(e){return function(){Ww(this,e)}}function tA(e,t){return function(){(t.apply(this,arguments)?Zw:Ww)(this,e)}}function nA(e,t){var r=Qw(e+"");if(arguments.length<2){for(var a=Mm(this.node()),o=-1,l=r.length;++o<l;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?tA:t?JT:eA)(r,t))}function rA(){this.textContent=""}function iA(e){return function(){this.textContent=e}}function aA(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function oA(e){return arguments.length?this.each(e==null?rA:(typeof e=="function"?aA:iA)(e)):this.node().textContent}function sA(){this.innerHTML=""}function lA(e){return function(){this.innerHTML=e}}function uA(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function cA(e){return arguments.length?this.each(e==null?sA:(typeof e=="function"?uA:lA)(e)):this.node().innerHTML}function fA(){this.nextSibling&&this.parentNode.appendChild(this)}function dA(){return this.each(fA)}function hA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pA(){return this.each(hA)}function mA(e){var t=typeof e=="function"?e:qw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gA(){return null}function yA(e,t){var r=typeof e=="function"?e:qw(e),a=t==null?gA:typeof t=="function"?t:km(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function xA(){var e=this.parentNode;e&&e.removeChild(this)}function vA(){return this.each(xA)}function bA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SA(e){return this.select(e?wA:bA)}function EA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function CA(e){return function(t){e.call(this,t,this.__data__)}}function _A(e){return e.trim().split(/^|\s+/).map(function(t){var r="",a=t.indexOf(".");return a>=0&&(r=t.slice(a+1),t=t.slice(0,a)),{type:t,name:r}})}function NA(e){return function(){var t=this.__on;if(t){for(var r=0,a=-1,o=t.length,l;r<o;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++a]=l;++a?t.length=a:delete this.__on}}}function kA(e,t,r){return function(){var a=this.__on,o,l=CA(t);if(a){for(var u=0,f=a.length;u<f;++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=l,o.options=r),o.value=t;return}}this.addEventListener(e.type,l,r),o={type:e.type,name:e.name,value:t,listener:l,options:r},a?a.push(o):this.__on=[o]}}function MA(e,t,r){var a=_A(e+""),o,l=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,p;h<d;++h)for(o=0,p=f[h];o<l;++o)if((u=a[o]).type===p.type&&u.name===p.name)return p.value}return}for(f=t?kA:NA,o=0;o<l;++o)this.each(f(a[o],t,r));return this}function Jw(e,t,r){var a=Xw(e),o=a.CustomEvent;typeof o=="function"?o=new o(t,r):(o=a.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function TA(e,t){return function(){return Jw(this,e,t)}}function AA(e,t){return function(){return Jw(this,e,t.apply(this,arguments))}}function RA(e,t){return this.each((typeof t=="function"?AA:TA)(e,t))}function*jA(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],o=0,l=a.length,u;o<l;++o)(u=a[o])&&(yield u)}var eS=[null];function bn(e,t){this._groups=e,this._parents=t}function pl(){return new bn([[document.documentElement]],eS)}function OA(){return this}bn.prototype=pl.prototype={constructor:bn,select:aT,selectAll:uT,selectChild:hT,selectChildren:yT,filter:xT,data:CT,enter:vT,exit:NT,join:kT,merge:MT,selection:OA,order:TT,sort:AT,call:jT,nodes:OT,node:DT,size:zT,empty:LT,each:IT,attr:FT,style:XT,property:WT,classed:nA,text:oA,html:cA,raise:dA,lower:pA,append:mA,insert:yA,remove:vA,clone:SA,datum:EA,on:MA,dispatch:RA,[Symbol.iterator]:jA};function yn(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],eS)}function DA(e){let t;for(;t=e.sourceEvent;)e=t;return e}function In(e,t){if(e=DA(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const zA={passive:!1},tl={capture:!0,passive:!1};function Yh(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}function tS(e){var t=e.document.documentElement,r=yn(e).on("dragstart.drag",oo,tl);"onselectstart"in t?r.on("selectstart.drag",oo,tl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function nS(e,t){var r=e.document.documentElement,a=yn(e).on("dragstart.drag",null);t&&(a.on("click.drag",oo,tl),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Qu=e=>()=>e;function jp(e,{sourceEvent:t,subject:r,target:a,identifier:o,active:l,x:u,y:f,dx:h,dy:d,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}jp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function LA(e){return!e.ctrlKey&&!e.button}function IA(){return this.parentNode}function BA(e,t){return t??{x:e.x,y:e.y}}function HA(){return navigator.maxTouchPoints||"ontouchstart"in this}function rS(){var e=LA,t=IA,r=BA,a=HA,o={},l=Qc("start","drag","end"),u=0,f,h,d,p,g=0;function y(k){k.on("mousedown.drag",v).filter(a).on("touchstart.drag",N).on("touchmove.drag",S,zA).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(k,B){if(!(p||!e.call(this,k,B))){var T=_(this,t.call(this,k,B),k,B,"mouse");T&&(yn(k.view).on("mousemove.drag",w,tl).on("mouseup.drag",C,tl),tS(k.view),Yh(k),d=!1,f=k.clientX,h=k.clientY,T("start",k))}}function w(k){if(oo(k),!d){var B=k.clientX-f,T=k.clientY-h;d=B*B+T*T>g}o.mouse("drag",k)}function C(k){yn(k.view).on("mousemove.drag mouseup.drag",null),nS(k.view,d),oo(k),o.mouse("end",k)}function N(k,B){if(e.call(this,k,B)){var T=k.changedTouches,O=t.call(this,k,B),U=T.length,P,F;for(P=0;P<U;++P)(F=_(this,O,k,B,T[P].identifier,T[P]))&&(Yh(k),F("start",k,T[P]))}}function S(k){var B=k.changedTouches,T=B.length,O,U;for(O=0;O<T;++O)(U=o[B[O].identifier])&&(oo(k),U("drag",k,B[O]))}function A(k){var B=k.changedTouches,T=B.length,O,U;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),O=0;O<T;++O)(U=o[B[O].identifier])&&(Yh(k),U("end",k,B[O]))}function _(k,B,T,O,U,P){var F=l.copy(),I=In(P||T,B),Y,Q,L;if((L=r.call(k,new jp("beforestart",{sourceEvent:T,target:y,identifier:U,active:u,x:I[0],y:I[1],dx:0,dy:0,dispatch:F}),O))!=null)return Y=L.x-I[0]||0,Q=L.y-I[1]||0,function V(M,q,X){var Z=I,j;switch(M){case"start":o[U]=V,j=u++;break;case"end":delete o[U],--u;case"drag":I=In(X||q,B),j=u;break}F.call(M,k,new jp(M,{sourceEvent:q,subject:L,target:y,identifier:U,active:j,x:I[0]+Y,y:I[1]+Q,dx:I[0]-Z[0],dy:I[1]-Z[1],dispatch:F}),O)}}return y.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Qu(!!k),y):e},y.container=function(k){return arguments.length?(t=typeof k=="function"?k:Qu(k),y):t},y.subject=function(k){return arguments.length?(r=typeof k=="function"?k:Qu(k),y):r},y.touchable=function(k){return arguments.length?(a=typeof k=="function"?k:Qu(!!k),y):a},y.on=function(){var k=l.on.apply(l,arguments);return k===l?y:k},y.clickDistance=function(k){return arguments.length?(g=(k=+k)*k,y):Math.sqrt(g)},y}function Tm(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function iS(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function ml(){}var nl=.7,Mc=1/nl,so="\\s*([+-]?\\d+)\\s*",rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",PA=/^#([0-9a-f]{3,8})$/,UA=new RegExp(`^rgb\\(${so},${so},${so}\\)$`),VA=new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`),qA=new RegExp(`^rgba\\(${so},${so},${so},${rl}\\)$`),FA=new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${rl}\\)$`),YA=new RegExp(`^hsl\\(${rl},${Jn},${Jn}\\)$`),$A=new RegExp(`^hsla\\(${rl},${Jn},${Jn},${rl}\\)$`),$v={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};Tm(ml,ta,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gv,formatHex:Gv,formatHex8:GA,formatHsl:XA,formatRgb:Xv,toString:Xv});function Gv(){return this.rgb().formatHex()}function GA(){return this.rgb().formatHex8()}function XA(){return aS(this).formatHsl()}function Xv(){return this.rgb().formatRgb()}function ta(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=PA.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Qv(t):r===3?new tn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ku(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ku(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=UA.exec(e))?new tn(t[1],t[2],t[3],1):(t=VA.exec(e))?new tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=qA.exec(e))?Ku(t[1],t[2],t[3],t[4]):(t=FA.exec(e))?Ku(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=YA.exec(e))?Wv(t[1],t[2]/100,t[3]/100,1):(t=$A.exec(e))?Wv(t[1],t[2]/100,t[3]/100,t[4]):$v.hasOwnProperty(e)?Qv($v[e]):e==="transparent"?new tn(NaN,NaN,NaN,0):null}function Qv(e){return new tn(e>>16&255,e>>8&255,e&255,1)}function Ku(e,t,r,a){return a<=0&&(e=t=r=NaN),new tn(e,t,r,a)}function QA(e){return e instanceof ml||(e=ta(e)),e?(e=e.rgb(),new tn(e.r,e.g,e.b,e.opacity)):new tn}function Op(e,t,r,a){return arguments.length===1?QA(e):new tn(e,t,r,a??1)}function tn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}Tm(tn,Op,iS(ml,{brighter(e){return e=e==null?Mc:Math.pow(Mc,e),new tn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new tn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tn(Wi(this.r),Wi(this.g),Wi(this.b),Tc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Kv,formatHex:Kv,formatHex8:KA,formatRgb:Zv,toString:Zv}));function Kv(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function KA(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zv(){const e=Tc(this.opacity);return`${e===1?"rgb(":"rgba("}${Wi(this.r)}, ${Wi(this.g)}, ${Wi(this.b)}${e===1?")":`, ${e})`}`}function Tc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $i(e){return e=Wi(e),(e<16?"0":"")+e.toString(16)}function Wv(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Bn(e,t,r,a)}function aS(e){if(e instanceof Bn)return new Bn(e.h,e.s,e.l,e.opacity);if(e instanceof ml||(e=ta(e)),!e)return new Bn;if(e instanceof Bn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,o=Math.min(t,r,a),l=Math.max(t,r,a),u=NaN,f=l-o,h=(l+o)/2;return f?(t===l?u=(r-a)/f+(r<a)*6:r===l?u=(a-t)/f+2:u=(t-r)/f+4,f/=h<.5?l+o:2-l-o,u*=60):f=h>0&&h<1?0:u,new Bn(u,f,h,e.opacity)}function ZA(e,t,r,a){return arguments.length===1?aS(e):new Bn(e,t,r,a??1)}function Bn(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}Tm(Bn,ZA,iS(ml,{brighter(e){return e=e==null?Mc:Math.pow(Mc,e),new Bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new Bn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,o=2*r-a;return new tn($h(e>=240?e-240:e+120,o,a),$h(e,o,a),$h(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new Bn(Jv(this.h),Zu(this.s),Zu(this.l),Tc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Tc(this.opacity);return`${e===1?"hsl(":"hsla("}${Jv(this.h)}, ${Zu(this.s)*100}%, ${Zu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jv(e){return e=(e||0)%360,e<0?e+360:e}function Zu(e){return Math.max(0,Math.min(1,e||0))}function $h(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Am=e=>()=>e;function WA(e,t){return function(r){return e+r*t}}function JA(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function eR(e){return(e=+e)==1?oS:function(t,r){return r-t?JA(t,r,e):Am(isNaN(t)?r:t)}}function oS(e,t){var r=t-e;return r?WA(e,r):Am(isNaN(e)?t:e)}const Ac=(function e(t){var r=eR(t);function a(o,l){var u=r((o=Op(o)).r,(l=Op(l)).r),f=r(o.g,l.g),h=r(o.b,l.b),d=oS(o.opacity,l.opacity);return function(p){return o.r=u(p),o.g=f(p),o.b=h(p),o.opacity=d(p),o+""}}return a.gamma=e,a})(1);function tR(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),o;return function(l){for(o=0;o<r;++o)a[o]=e[o]*(1-l)+t[o]*l;return a}}function nR(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rR(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,o=new Array(a),l=new Array(r),u;for(u=0;u<a;++u)o[u]=Hs(e[u],t[u]);for(;u<r;++u)l[u]=t[u];return function(f){for(u=0;u<a;++u)l[u]=o[u](f);return l}}function iR(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function Zn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function aR(e,t){var r={},a={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?r[o]=Hs(e[o],t[o]):a[o]=t[o];return function(l){for(o in r)a[o]=r[o](l);return a}}var Dp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gh=new RegExp(Dp.source,"g");function oR(e){return function(){return e}}function sR(e){return function(t){return e(t)+""}}function sS(e,t){var r=Dp.lastIndex=Gh.lastIndex=0,a,o,l,u=-1,f=[],h=[];for(e=e+"",t=t+"";(a=Dp.exec(e))&&(o=Gh.exec(t));)(l=o.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(a=a[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:Zn(a,o)})),r=Gh.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?sR(h[0].x):oR(t):(t=h.length,function(d){for(var p=0,g;p<t;++p)f[(g=h[p]).i]=g.x(d);return f.join("")})}function Hs(e,t){var r=typeof t,a;return t==null||r==="boolean"?Am(t):(r==="number"?Zn:r==="string"?(a=ta(t))?(t=a,Ac):sS:t instanceof ta?Ac:t instanceof Date?iR:nR(t)?tR:Array.isArray(t)?rR:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?aR:Zn)(e,t)}var eb=180/Math.PI,zp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lS(e,t,r,a,o,l){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*a)&&(r-=e*h,a-=t*h),(f=Math.sqrt(r*r+a*a))&&(r/=f,a/=f,h/=f),e*a<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(t,e)*eb,skewX:Math.atan(h)*eb,scaleX:u,scaleY:f}}var Wu;function lR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zp:lS(t.a,t.b,t.c,t.d,t.e,t.f)}function uR(e){return e==null||(Wu||(Wu=document.createElementNS("http://www.w3.org/2000/svg","g")),Wu.setAttribute("transform",e),!(e=Wu.transform.baseVal.consolidate()))?zp:(e=e.matrix,lS(e.a,e.b,e.c,e.d,e.e,e.f))}function uS(e,t,r,a){function o(d){return d.length?d.pop()+" ":""}function l(d,p,g,y,v,w){if(d!==g||p!==y){var C=v.push("translate(",null,t,null,r);w.push({i:C-4,x:Zn(d,g)},{i:C-2,x:Zn(p,y)})}else(g||y)&&v.push("translate("+g+t+y+r)}function u(d,p,g,y){d!==p?(d-p>180?p+=360:p-d>180&&(d+=360),y.push({i:g.push(o(g)+"rotate(",null,a)-2,x:Zn(d,p)})):p&&g.push(o(g)+"rotate("+p+a)}function f(d,p,g,y){d!==p?y.push({i:g.push(o(g)+"skewX(",null,a)-2,x:Zn(d,p)}):p&&g.push(o(g)+"skewX("+p+a)}function h(d,p,g,y,v,w){if(d!==g||p!==y){var C=v.push(o(v)+"scale(",null,",",null,")");w.push({i:C-4,x:Zn(d,g)},{i:C-2,x:Zn(p,y)})}else(g!==1||y!==1)&&v.push(o(v)+"scale("+g+","+y+")")}return function(d,p){var g=[],y=[];return d=e(d),p=e(p),l(d.translateX,d.translateY,p.translateX,p.translateY,g,y),u(d.rotate,p.rotate,g,y),f(d.skewX,p.skewX,g,y),h(d.scaleX,d.scaleY,p.scaleX,p.scaleY,g,y),d=p=null,function(v){for(var w=-1,C=y.length,N;++w<C;)g[(N=y[w]).i]=N.x(v);return g.join("")}}}var cR=uS(lR,"px, ","px)","deg)"),fR=uS(uR,", ",")",")"),dR=1e-12;function tb(e){return((e=Math.exp(e))+1/e)/2}function hR(e){return((e=Math.exp(e))-1/e)/2}function pR(e){return((e=Math.exp(2*e))-1)/(e+1)}const pc=(function e(t,r,a){function o(l,u){var f=l[0],h=l[1],d=l[2],p=u[0],g=u[1],y=u[2],v=p-f,w=g-h,C=v*v+w*w,N,S;if(C<dR)S=Math.log(y/d)/t,N=function(O){return[f+O*v,h+O*w,d*Math.exp(t*O*S)]};else{var A=Math.sqrt(C),_=(y*y-d*d+a*C)/(2*d*r*A),k=(y*y-d*d-a*C)/(2*y*r*A),B=Math.log(Math.sqrt(_*_+1)-_),T=Math.log(Math.sqrt(k*k+1)-k);S=(T-B)/t,N=function(O){var U=O*S,P=tb(B),F=d/(r*A)*(P*pR(t*U+B)-hR(B));return[f+F*v,h+F*w,d*P/tb(t*U+B)]}}return N.duration=S*1e3*t/Math.SQRT2,N}return o.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return e(u,f,h)},o})(Math.SQRT2,2,4);var go=0,Is=0,Ms=0,cS=1e3,Rc,Bs,jc=0,na=0,Zc=0,il=typeof performance=="object"&&performance.now?performance:Date,fS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Rm(){return na||(fS(mR),na=il.now()+Zc)}function mR(){na=0}function Oc(){this._call=this._time=this._next=null}Oc.prototype=dS.prototype={constructor:Oc,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Rm():+r)+(t==null?0:+t),!this._next&&Bs!==this&&(Bs?Bs._next=this:Rc=this,Bs=this),this._call=e,this._time=r,Lp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lp())}};function dS(e,t,r){var a=new Oc;return a.restart(e,t,r),a}function gR(){Rm(),++go;for(var e=Rc,t;e;)(t=na-e._time)>=0&&e._call.call(void 0,t),e=e._next;--go}function nb(){na=(jc=il.now())+Zc,go=Is=0;try{gR()}finally{go=0,xR(),na=0}}function yR(){var e=il.now(),t=e-jc;t>cS&&(Zc-=t,jc=e)}function xR(){for(var e,t=Rc,r,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Rc=r);Bs=e,Lp(a)}function Lp(e){if(!go){Is&&(Is=clearTimeout(Is));var t=e-na;t>24?(e<1/0&&(Is=setTimeout(nb,e-il.now()-Zc)),Ms&&(Ms=clearInterval(Ms))):(Ms||(jc=il.now(),Ms=setInterval(yR,cS)),go=1,fS(nb))}}function rb(e,t,r){var a=new Oc;return t=t==null?0:+t,a.restart(o=>{a.stop(),e(o+t)},t,r),a}var vR=Qc("start","end","cancel","interrupt"),bR=[],hS=0,ib=1,Ip=2,mc=3,ab=4,Bp=5,gc=6;function Wc(e,t,r,a,o,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;wR(e,r,{name:t,index:a,group:o,on:vR,tween:bR,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:hS})}function jm(e,t){var r=Un(e,t);if(r.state>hS)throw new Error("too late; already scheduled");return r}function nr(e,t){var r=Un(e,t);if(r.state>mc)throw new Error("too late; already running");return r}function Un(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function wR(e,t,r){var a=e.__transition,o;a[t]=r,r.timer=dS(l,0,r.time);function l(d){r.state=ib,r.timer.restart(u,r.delay,r.time),r.delay<=d&&u(d-r.delay)}function u(d){var p,g,y,v;if(r.state!==ib)return h();for(p in a)if(v=a[p],v.name===r.name){if(v.state===mc)return rb(u);v.state===ab?(v.state=gc,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete a[p]):+p<t&&(v.state=gc,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete a[p])}if(rb(function(){r.state===mc&&(r.state=ab,r.timer.restart(f,r.delay,r.time),f(d))}),r.state=Ip,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Ip){for(r.state=mc,o=new Array(y=r.tween.length),p=0,g=-1;p<y;++p)(v=r.tween[p].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=v);o.length=g+1}}function f(d){for(var p=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(h),r.state=Bp,1),g=-1,y=o.length;++g<y;)o[g].call(e,p);r.state===Bp&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=gc,r.timer.stop(),delete a[t];for(var d in a)return;delete e.__transition}}function yc(e,t){var r=e.__transition,a,o,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((a=r[u]).name!==t){l=!1;continue}o=a.state>Ip&&a.state<Bp,a.state=gc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete r[u]}l&&delete e.__transition}}function SR(e){return this.each(function(){yc(this,e)})}function ER(e,t){var r,a;return function(){var o=nr(this,e),l=o.tween;if(l!==r){a=r=l;for(var u=0,f=a.length;u<f;++u)if(a[u].name===t){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function CR(e,t,r){var a,o;if(typeof r!="function")throw new Error;return function(){var l=nr(this,e),u=l.tween;if(u!==a){o=(a=u).slice();for(var f={name:t,value:r},h=0,d=o.length;h<d;++h)if(o[h].name===t){o[h]=f;break}h===d&&o.push(f)}l.tween=o}}function _R(e,t){var r=this._id;if(e+="",arguments.length<2){for(var a=Un(this.node(),r).tween,o=0,l=a.length,u;o<l;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((t==null?ER:CR)(r,e,t))}function Om(e,t,r){var a=e._id;return e.each(function(){var o=nr(this,a);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Un(o,a).value[t]}}function pS(e,t){var r;return(typeof t=="number"?Zn:t instanceof ta?Ac:(r=ta(t))?(t=r,Ac):sS)(e,t)}function NR(e){return function(){this.removeAttribute(e)}}function kR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function MR(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttribute(e);return u===o?null:u===a?l:l=t(a=u,r)}}function TR(e,t,r){var a,o=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?l:l=t(a=u,r)}}function AR(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function RR(e,t,r){var a,o,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f)))}}function jR(e,t){var r=Kc(e),a=r==="transform"?fR:pS;return this.attrTween(e,typeof t=="function"?(r.local?RR:AR)(r,a,Om(this,"attr."+e,t)):t==null?(r.local?kR:NR)(r):(r.local?TR:MR)(r,a,t))}function OR(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function DR(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function zR(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&DR(e,l)),r}return o._value=t,o}function LR(e,t){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&OR(e,l)),r}return o._value=t,o}function IR(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var a=Kc(e);return this.tween(r,(a.local?zR:LR)(a,t))}function BR(e,t){return function(){jm(this,e).delay=+t.apply(this,arguments)}}function HR(e,t){return t=+t,function(){jm(this,e).delay=t}}function PR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BR:HR)(t,e)):Un(this.node(),t).delay}function UR(e,t){return function(){nr(this,e).duration=+t.apply(this,arguments)}}function VR(e,t){return t=+t,function(){nr(this,e).duration=t}}function qR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?UR:VR)(t,e)):Un(this.node(),t).duration}function FR(e,t){if(typeof t!="function")throw new Error;return function(){nr(this,e).ease=t}}function YR(e){var t=this._id;return arguments.length?this.each(FR(t,e)):Un(this.node(),t).ease}function $R(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;nr(this,e).ease=r}}function GR(e){if(typeof e!="function")throw new Error;return this.each($R(this._id,e))}function XR(e){typeof e!="function"&&(e=Yw(e));for(var t=this._groups,r=t.length,a=new Array(r),o=0;o<r;++o)for(var l=t[o],u=l.length,f=a[o]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new Tr(a,this._parents,this._name,this._id)}function QR(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,a=t.length,o=r.length,l=Math.min(a,o),u=new Array(a),f=0;f<l;++f)for(var h=t[f],d=r[f],p=h.length,g=u[f]=new Array(p),y,v=0;v<p;++v)(y=h[v]||d[v])&&(g[v]=y);for(;f<a;++f)u[f]=t[f];return new Tr(u,this._parents,this._name,this._id)}function KR(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function ZR(e,t,r){var a,o,l=KR(t)?jm:nr;return function(){var u=l(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(t,r),u.on=o}}function WR(e,t){var r=this._id;return arguments.length<2?Un(this.node(),r).on.on(e):this.each(ZR(r,e,t))}function JR(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function e3(){return this.on("end.remove",JR(this._id))}function t3(e){var t=this._name,r=this._id;typeof e!="function"&&(e=km(e));for(var a=this._groups,o=a.length,l=new Array(o),u=0;u<o;++u)for(var f=a[u],h=f.length,d=l[u]=new Array(h),p,g,y=0;y<h;++y)(p=f[y])&&(g=e.call(p,p.__data__,y,f))&&("__data__"in p&&(g.__data__=p.__data__),d[y]=g,Wc(d[y],t,r,y,d,Un(p,r)));return new Tr(l,this._parents,t,r)}function n3(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Fw(e));for(var a=this._groups,o=a.length,l=[],u=[],f=0;f<o;++f)for(var h=a[f],d=h.length,p,g=0;g<d;++g)if(p=h[g]){for(var y=e.call(p,p.__data__,g,h),v,w=Un(p,r),C=0,N=y.length;C<N;++C)(v=y[C])&&Wc(v,t,r,C,y,w);l.push(y),u.push(p)}return new Tr(l,u,t,r)}var r3=pl.prototype.constructor;function i3(){return new r3(this._groups,this._parents)}function a3(e,t){var r,a,o;return function(){var l=mo(this,e),u=(this.style.removeProperty(e),mo(this,e));return l===u?null:l===r&&u===a?o:o=t(r=l,a=u)}}function mS(e){return function(){this.style.removeProperty(e)}}function o3(e,t,r){var a,o=r+"",l;return function(){var u=mo(this,e);return u===o?null:u===a?l:l=t(a=u,r)}}function s3(e,t,r){var a,o,l;return function(){var u=mo(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),mo(this,e))),u===h?null:u===a&&h===o?l:(o=h,l=t(a=u,f))}}function l3(e,t){var r,a,o,l="style."+t,u="end."+l,f;return function(){var h=nr(this,e),d=h.on,p=h.value[l]==null?f||(f=mS(t)):void 0;(d!==r||o!==p)&&(a=(r=d).copy()).on(u,o=p),h.on=a}}function u3(e,t,r){var a=(e+="")=="transform"?cR:pS;return t==null?this.styleTween(e,a3(e,a)).on("end.style."+e,mS(e)):typeof t=="function"?this.styleTween(e,s3(e,a,Om(this,"style."+e,t))).each(l3(this._id,e)):this.styleTween(e,o3(e,a,t),r).on("end.style."+e,null)}function c3(e,t,r){return function(a){this.style.setProperty(e,t.call(this,a),r)}}function f3(e,t,r){var a,o;function l(){var u=t.apply(this,arguments);return u!==o&&(a=(o=u)&&c3(e,u,r)),a}return l._value=t,l}function d3(e,t,r){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;return this.tween(a,f3(e,t,r??""))}function h3(e){return function(){this.textContent=e}}function p3(e){return function(){var t=e(this);this.textContent=t??""}}function m3(e){return this.tween("text",typeof e=="function"?p3(Om(this,"text",e)):h3(e==null?"":e+""))}function g3(e){return function(t){this.textContent=e.call(this,t)}}function y3(e){var t,r;function a(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&g3(o)),t}return a._value=e,a}function x3(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,y3(e))}function v3(){for(var e=this._name,t=this._id,r=gS(),a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var p=Un(h,t);Wc(h,e,r,d,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Tr(a,this._parents,e,r)}function b3(){var e,t,r=this,a=r._id,o=r.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--o===0&&l()}};r.each(function(){var d=nr(this,a),p=d.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),o===0&&l()})}var w3=0;function Tr(e,t,r,a){this._groups=e,this._parents=t,this._name=r,this._id=a}function gS(){return++w3}var Cr=pl.prototype;Tr.prototype={constructor:Tr,select:t3,selectAll:n3,selectChild:Cr.selectChild,selectChildren:Cr.selectChildren,filter:XR,merge:QR,selection:i3,transition:v3,call:Cr.call,nodes:Cr.nodes,node:Cr.node,size:Cr.size,empty:Cr.empty,each:Cr.each,on:WR,attr:jR,attrTween:IR,style:u3,styleTween:d3,text:m3,textTween:x3,remove:e3,tween:_R,delay:PR,duration:qR,ease:YR,easeVarying:GR,end:b3,[Symbol.iterator]:Cr[Symbol.iterator]};function S3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var E3={time:null,delay:0,duration:250,ease:S3};function C3(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function _3(e){var t,r;e instanceof Tr?(t=e._id,e=e._name):(t=gS(),(r=E3).time=Rm(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,l=0;l<o;++l)for(var u=a[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Wc(h,e,t,d,u,r||C3(h,t));return new Tr(a,this._parents,e,t)}pl.prototype.interrupt=SR;pl.prototype.transition=_3;const Ju=e=>()=>e;function N3(e,{sourceEvent:t,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function kr(e,t,r){this.k=e,this.x=t,this.y=r}kr.prototype={constructor:kr,scale:function(e){return e===1?this:new kr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new kr(this.k,this.x+this.k*e,this.y+this.k*t)},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 Jc=new kr(1,0,0);yS.prototype=kr.prototype;function yS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Jc;return e.__zoom}function Xh(e){e.stopImmediatePropagation()}function Ts(e){e.preventDefault(),e.stopImmediatePropagation()}function k3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function M3(){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 ob(){return this.__zoom||Jc}function T3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function A3(){return navigator.maxTouchPoints||"ontouchstart"in this}function R3(e,t,r){var a=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function xS(){var e=k3,t=M3,r=R3,a=T3,o=A3,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=pc,d=Qc("start","zoom","end"),p,g,y,v=500,w=150,C=0,N=10;function S(L){L.property("__zoom",ob).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(L,V,M,q){var X=L.selection?L.selection():L;X.property("__zoom",ob),L!==X?B(L,V,M,q):X.interrupt().each(function(){T(this,arguments).event(q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},S.scaleBy=function(L,V,M,q){S.scaleTo(L,function(){var X=this.__zoom.k,Z=typeof V=="function"?V.apply(this,arguments):V;return X*Z},M,q)},S.scaleTo=function(L,V,M,q){S.transform(L,function(){var X=t.apply(this,arguments),Z=this.__zoom,j=M==null?k(X):typeof M=="function"?M.apply(this,arguments):M,z=Z.invert(j),$=typeof V=="function"?V.apply(this,arguments):V;return r(_(A(Z,$),j,z),X,u)},M,q)},S.translateBy=function(L,V,M,q){S.transform(L,function(){return r(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),u)},null,q)},S.translateTo=function(L,V,M,q,X){S.transform(L,function(){var Z=t.apply(this,arguments),j=this.__zoom,z=q==null?k(Z):typeof q=="function"?q.apply(this,arguments):q;return r(Jc.translate(z[0],z[1]).scale(j.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof M=="function"?-M.apply(this,arguments):-M),Z,u)},q,X)};function A(L,V){return V=Math.max(l[0],Math.min(l[1],V)),V===L.k?L:new kr(V,L.x,L.y)}function _(L,V,M){var q=V[0]-M[0]*L.k,X=V[1]-M[1]*L.k;return q===L.x&&X===L.y?L:new kr(L.k,q,X)}function k(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function B(L,V,M,q){L.on("start.zoom",function(){T(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(q).end()}).tween("zoom",function(){var X=this,Z=arguments,j=T(X,Z).event(q),z=t.apply(X,Z),$=M==null?k(z):typeof M=="function"?M.apply(X,Z):M,R=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),te=X.__zoom,ue=typeof V=="function"?V.apply(X,Z):V,fe=h(te.invert($).concat(R/te.k),ue.invert($).concat(R/ue.k));return function(de){if(de===1)de=ue;else{var le=fe(de),pe=R/le[2];de=new kr(pe,$[0]-le[0]*pe,$[1]-le[1]*pe)}j.zoom(null,de)}})}function T(L,V,M){return!M&&L.__zooming||new O(L,V)}function O(L,V){this.that=L,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,V),this.taps=0}O.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,V){return this.mouse&&L!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var V=yn(this.that).datum();d.call(L,this.that,new N3(L,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:d}),V)}};function U(L,...V){if(!e.apply(this,arguments))return;var M=T(this,V).event(L),q=this.__zoom,X=Math.max(l[0],Math.min(l[1],q.k*Math.pow(2,a.apply(this,arguments)))),Z=In(L);if(M.wheel)(M.mouse[0][0]!==Z[0]||M.mouse[0][1]!==Z[1])&&(M.mouse[1]=q.invert(M.mouse[0]=Z)),clearTimeout(M.wheel);else{if(q.k===X)return;M.mouse=[Z,q.invert(Z)],yc(this),M.start()}Ts(L),M.wheel=setTimeout(j,w),M.zoom("mouse",r(_(A(q,X),M.mouse[0],M.mouse[1]),M.extent,u));function j(){M.wheel=null,M.end()}}function P(L,...V){if(y||!e.apply(this,arguments))return;var M=L.currentTarget,q=T(this,V,!0).event(L),X=yn(L.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",R,!0),Z=In(L,M),j=L.clientX,z=L.clientY;tS(L.view),Xh(L),q.mouse=[Z,this.__zoom.invert(Z)],yc(this),q.start();function $(te){if(Ts(te),!q.moved){var ue=te.clientX-j,fe=te.clientY-z;q.moved=ue*ue+fe*fe>C}q.event(te).zoom("mouse",r(_(q.that.__zoom,q.mouse[0]=In(te,M),q.mouse[1]),q.extent,u))}function R(te){X.on("mousemove.zoom mouseup.zoom",null),nS(te.view,q.moved),Ts(te),q.event(te).end()}}function F(L,...V){if(e.apply(this,arguments)){var M=this.__zoom,q=In(L.changedTouches?L.changedTouches[0]:L,this),X=M.invert(q),Z=M.k*(L.shiftKey?.5:2),j=r(_(A(M,Z),q,X),t.apply(this,V),u);Ts(L),f>0?yn(this).transition().duration(f).call(B,j,q,L):yn(this).call(S.transform,j,q,L)}}function I(L,...V){if(e.apply(this,arguments)){var M=L.touches,q=M.length,X=T(this,V,L.changedTouches.length===q).event(L),Z,j,z,$;for(Xh(L),j=0;j<q;++j)z=M[j],$=In(z,this),$=[$,this.__zoom.invert($),z.identifier],X.touch0?!X.touch1&&X.touch0[2]!==$[2]&&(X.touch1=$,X.taps=0):(X.touch0=$,Z=!0,X.taps=1+!!p);p&&(p=clearTimeout(p)),Z&&(X.taps<2&&(g=$[0],p=setTimeout(function(){p=null},v)),yc(this),X.start())}}function Y(L,...V){if(this.__zooming){var M=T(this,V).event(L),q=L.changedTouches,X=q.length,Z,j,z,$;for(Ts(L),Z=0;Z<X;++Z)j=q[Z],z=In(j,this),M.touch0&&M.touch0[2]===j.identifier?M.touch0[0]=z:M.touch1&&M.touch1[2]===j.identifier&&(M.touch1[0]=z);if(j=M.that.__zoom,M.touch1){var R=M.touch0[0],te=M.touch0[1],ue=M.touch1[0],fe=M.touch1[1],de=(de=ue[0]-R[0])*de+(de=ue[1]-R[1])*de,le=(le=fe[0]-te[0])*le+(le=fe[1]-te[1])*le;j=A(j,Math.sqrt(de/le)),z=[(R[0]+ue[0])/2,(R[1]+ue[1])/2],$=[(te[0]+fe[0])/2,(te[1]+fe[1])/2]}else if(M.touch0)z=M.touch0[0],$=M.touch0[1];else return;M.zoom("touch",r(_(j,z,$),M.extent,u))}}function Q(L,...V){if(this.__zooming){var M=T(this,V).event(L),q=L.changedTouches,X=q.length,Z,j;for(Xh(L),y&&clearTimeout(y),y=setTimeout(function(){y=null},v),Z=0;Z<X;++Z)j=q[Z],M.touch0&&M.touch0[2]===j.identifier?delete M.touch0:M.touch1&&M.touch1[2]===j.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(j=In(j,this),Math.hypot(g[0]-j[0],g[1]-j[1])<N)){var z=yn(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return S.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:Ju(+L),S):a},S.filter=function(L){return arguments.length?(e=typeof L=="function"?L:Ju(!!L),S):e},S.touchable=function(L){return arguments.length?(o=typeof L=="function"?L:Ju(!!L),S):o},S.extent=function(L){return arguments.length?(t=typeof L=="function"?L:Ju([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),S):t},S.scaleExtent=function(L){return arguments.length?(l[0]=+L[0],l[1]=+L[1],S):[l[0],l[1]]},S.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],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(L){return arguments.length?(r=L,S):r},S.duration=function(L){return arguments.length?(f=+L,S):f},S.interpolate=function(L){return arguments.length?(h=L,S):h},S.on=function(){var L=d.on.apply(d,arguments);return L===d?S:L},S.clickDistance=function(L){return arguments.length?(C=(L=+L)*L,S):Math.sqrt(C)},S.tapDistance=function(L){return arguments.length?(N=+L,S):N},S}const er={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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 React Flow 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:t,sourceHandle:r,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:a}", edge id: ${t}.`,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."},al=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vS=["Enter"," ","Escape"],bS={"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:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"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 yo;(function(e){e.Strict="strict",e.Loose="loose"})(yo||(yo={}));var Ji;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ji||(Ji={}));var ol;(function(e){e.Partial="partial",e.Full="full"})(ol||(ol={}));const wS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ui;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ui||(ui={}));var Dc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Dc||(Dc={}));var _e;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(_e||(_e={}));const sb={[_e.Left]:_e.Right,[_e.Right]:_e.Left,[_e.Top]:_e.Bottom,[_e.Bottom]:_e.Top};function SS(e){return e===null?null:e?"valid":"invalid"}const ES=e=>"id"in e&&"source"in e&&"target"in e,j3=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Dm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gl=(e,t=[0,0])=>{const{width:r,height:a}=Ar(e),o=e.origin??t,l=r*o[0],u=a*o[1];return{x:e.position.x-l,y:e.position.y-u}},O3=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((a,o)=>{const l=typeof o=="string";let u=!t.nodeLookup&&!l?o:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(o):Dm(o)?o:t.nodeLookup.get(o.id));const f=u?zc(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ef(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tf(r)},yl=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(r=ef(r,zc(o)),a=!0)}),a?tf(r):{x:0,y:0,width:0,height:0}},zm=(e,t,[r,a,o]=[0,0,1],l=!1,u=!1)=>{const f={...vl(t,[r,a,o]),width:t.width/o,height:t.height/o},h=[];for(const d of e.values()){const{measured:p,selectable:g=!0,hidden:y=!1}=d;if(u&&!g||y)continue;const v=p.width??d.width??d.initialWidth??null,w=p.height??d.height??d.initialHeight??null,C=sl(f,vo(d)),N=(v??0)*(w??0),S=l&&C>0;(!d.internals.handleBounds||S||C>=N||d.dragging)&&h.push(d)}return h},D3=(e,t)=>{const r=new Set;return e.forEach(a=>{r.add(a.id)}),t.filter(a=>r.has(a.source)||r.has(a.target))};function z3(e,t){const r=new Map,a=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(t?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&r.set(o.id,o)}),r}async function L3({nodes:e,width:t,height:r,panZoom:a,minZoom:o,maxZoom:l},u){if(e.size===0)return Promise.resolve(!0);const f=z3(e,u),h=yl(f),d=Lm(h,t,r,u?.minZoom??o,u?.maxZoom??l,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function CS({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:a=[0,0],nodeExtent:o,onError:l}){const u=r.get(e),f=u.parentId?r.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},p=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)l?.("005",er.error005());else{const v=f.measured.width,w=f.measured.height;v&&w&&(g=[[h,d],[h+v,d+w]])}else f&&bo(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const y=bo(g)?ra(t,g,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&l?.("015",er.error015()),{position:{x:y.x-h+(u.measured.width??0)*p[0],y:y.y-d+(u.measured.height??0)*p[1]},positionAbsolute:y}}async function I3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:a,onBeforeDelete:o}){const l=new Set(e.map(y=>y.id)),u=[];for(const y of r){if(y.deletable===!1)continue;const v=l.has(y.id),w=!v&&y.parentId&&u.find(C=>C.id===y.parentId);(v||w)&&u.push(y)}const f=new Set(t.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),p=D3(u,h);for(const y of h)f.has(y.id)&&!p.find(w=>w.id===y.id)&&p.push(y);if(!o)return{edges:p,nodes:u};const g=await o({nodes:u,edges:p});return typeof g=="boolean"?g?{edges:p,nodes:u}:{edges:[],nodes:[]}:g}const xo=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),ra=(e={x:0,y:0},t,r)=>({x:xo(e.x,t[0][0],t[1][0]-(r?.width??0)),y:xo(e.y,t[0][1],t[1][1]-(r?.height??0))});function _S(e,t,r){const{width:a,height:o}=Ar(r),{x:l,y:u}=r.internals.positionAbsolute;return ra(e,[[l,u],[l+a,u+o]],t)}const lb=(e,t,r)=>e<t?xo(Math.abs(e-t),1,t)/t:e>r?-xo(Math.abs(e-r),1,t)/t:0,NS=(e,t,r=15,a=40)=>{const o=lb(e.x,a,t.width-a)*r,l=lb(e.y,a,t.height-a)*r;return[o,l]},ef=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Hp=({x:e,y:t,width:r,height:a})=>({x:e,y:t,x2:e+r,y2:t+a}),tf=({x:e,y:t,x2:r,y2:a})=>({x:e,y:t,width:r-e,height:a-t}),vo=(e,t=[0,0])=>{const{x:r,y:a}=Dm(e)?e.internals.positionAbsolute:gl(e,t);return{x:r,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},zc=(e,t=[0,0])=>{const{x:r,y:a}=Dm(e)?e.internals.positionAbsolute:gl(e,t);return{x:r,y:a,x2:r+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},kS=(e,t)=>tf(ef(Hp(e),Hp(t))),sl=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),a=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*a)},ub=e=>Hn(e.width)&&Hn(e.height)&&Hn(e.x)&&Hn(e.y),Hn=e=>!isNaN(e)&&isFinite(e),B3=(e,t)=>{},xl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),vl=({x:e,y:t},[r,a,o],l=!1,u=[1,1])=>{const f={x:(e-r)/o,y:(t-a)/o};return l?xl(f,u):f},Lc=({x:e,y:t},[r,a,o])=>({x:e*o+r,y:t*o+a});function Ka(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function H3(e,t,r){if(typeof e=="string"||typeof e=="number"){const a=Ka(e,r),o=Ka(e,t);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Ka(e.top??e.y??0,r),o=Ka(e.bottom??e.y??0,r),l=Ka(e.left??e.x??0,t),u=Ka(e.right??e.x??0,t);return{top:a,right:u,bottom:o,left:l,x:l+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function P3(e,t,r,a,o,l){const{x:u,y:f}=Lc(e,[t,r,a]),{x:h,y:d}=Lc({x:e.x+e.width,y:e.y+e.height},[t,r,a]),p=o-h,g=l-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(p),bottom:Math.floor(g)}}const Lm=(e,t,r,a,o,l)=>{const u=H3(l,t,r),f=(t-u.x)/e.width,h=(r-u.y)/e.height,d=Math.min(f,h),p=xo(d,a,o),g=e.x+e.width/2,y=e.y+e.height/2,v=t/2-g*p,w=r/2-y*p,C=P3(e,v,w,p,t,r),N={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-N.left+N.right,y:w-N.top+N.bottom,zoom:p}},ll=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function bo(e){return e!=null&&e!=="parent"}function Ar(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function MS(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function TS(e,t={width:0,height:0},r,a,o){const l={...e},u=a.get(r);if(u){const f=u.origin||o;l.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return l}function cb(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function U3(){let e,t;return{promise:new Promise((a,o)=>{e=a,t=o}),resolve:e,reject:t}}function V3(e){return{...bS,...e||{}}}function Ps(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:a,containerBounds:o}){const{x:l,y:u}=Pn(e),f=vl({x:l-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:d}=r?xl(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const Im=e=>({width:e.offsetWidth,height:e.offsetHeight}),AS=e=>e?.getRootNode?.()||window?.document,q3=["INPUT","SELECT","TEXTAREA"];function RS(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:q3.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const jS=e=>"clientX"in e,Pn=(e,t)=>{const r=jS(e),a=r?e.clientX:e.touches?.[0].clientX,o=r?e.clientY:e.touches?.[0].clientY;return{x:a-(t?.left??0),y:o-(t?.top??0)}},fb=(e,t,r,a,o)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(f.left-r.left)/a,y:(f.top-r.top)/a,...Im(u)}})};function OS({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:f}){const h=e*.125+o*.375+u*.375+r*.125,d=t*.125+l*.375+f*.375+a*.125,p=Math.abs(h-e),g=Math.abs(d-t);return[h,d,p,g]}function ec(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function db({pos:e,x1:t,y1:r,x2:a,y2:o,c:l}){switch(e){case _e.Left:return[t-ec(t-a,l),r];case _e.Right:return[t+ec(a-t,l),r];case _e.Top:return[t,r-ec(r-o,l)];case _e.Bottom:return[t,r+ec(o-r,l)]}}function DS({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:a,targetY:o,targetPosition:l=_e.Top,curvature:u=.25}){const[f,h]=db({pos:r,x1:e,y1:t,x2:a,y2:o,c:u}),[d,p]=db({pos:l,x1:a,y1:o,x2:e,y2:t,c:u}),[g,y,v,w]=OS({sourceX:e,sourceY:t,targetX:a,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:p});return[`M${e},${t} C${f},${h} ${d},${p} ${a},${o}`,g,y,v,w]}function zS({sourceX:e,sourceY:t,targetX:r,targetY:a}){const o=Math.abs(r-e)/2,l=r<e?r+o:r-o,u=Math.abs(a-t)/2,f=a<t?a+u:a-u;return[l,f,o,u]}function F3({sourceNode:e,targetNode:t,selected:r=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:l="basic"}){if(l==="manual")return a;const u=o&&r?a+1e3:a,f=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return u+f}function Y3({sourceNode:e,targetNode:t,width:r,height:a,transform:o}){const l=ef(zc(e),zc(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:a/o[2]};return sl(u,tf(l))>0}const $3=({source:e,sourceHandle:t,target:r,targetHandle:a})=>`xy-edge__${e}${t||""}-${r}${a||""}`,G3=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),X3=(e,t,r={})=>{if(!e.source||!e.target)return t;const a=r.getEdgeId||$3;let o;return ES(e)?o={...e}:o={...e,id:a(e)},G3(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function LS({sourceX:e,sourceY:t,targetX:r,targetY:a}){const[o,l,u,f]=zS({sourceX:e,sourceY:t,targetX:r,targetY:a});return[`M ${e},${t}L ${r},${a}`,o,l,u,f]}const hb={[_e.Left]:{x:-1,y:0},[_e.Right]:{x:1,y:0},[_e.Top]:{x:0,y:-1},[_e.Bottom]:{x:0,y:1}},Q3=({source:e,sourcePosition:t=_e.Bottom,target:r})=>t===_e.Left||t===_e.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},pb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function K3({source:e,sourcePosition:t=_e.Bottom,target:r,targetPosition:a=_e.Top,center:o,offset:l,stepPosition:u}){const f=hb[t],h=hb[a],d={x:e.x+f.x*l,y:e.y+f.y*l},p={x:r.x+h.x*l,y:r.y+h.y*l},g=Q3({source:d,sourcePosition:t,target:p}),y=g.x!==0?"x":"y",v=g[y];let w=[],C,N;const S={x:0,y:0},A={x:0,y:0},[,,_,k]=zS({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[y]*h[y]===-1){y==="x"?(C=o.x??d.x+(p.x-d.x)*u,N=o.y??(d.y+p.y)/2):(C=o.x??(d.x+p.x)/2,N=o.y??d.y+(p.y-d.y)*u);const U=[{x:C,y:d.y},{x:C,y:p.y}],P=[{x:d.x,y:N},{x:p.x,y:N}];f[y]===v?w=y==="x"?U:P:w=y==="x"?P:U}else{const U=[{x:d.x,y:p.y}],P=[{x:p.x,y:d.y}];if(y==="x"?w=f.x===v?P:U:w=f.y===v?U:P,t===a){const L=Math.abs(e[y]-r[y]);if(L<=l){const V=Math.min(l-1,l-L);f[y]===v?S[y]=(d[y]>e[y]?-1:1)*V:A[y]=(p[y]>r[y]?-1:1)*V}}if(t!==a){const L=y==="x"?"y":"x",V=f[y]===h[L],M=d[L]>p[L],q=d[L]<p[L];(f[y]===1&&(!V&&M||V&&q)||f[y]!==1&&(!V&&q||V&&M))&&(w=y==="x"?U:P)}const F={x:d.x+S.x,y:d.y+S.y},I={x:p.x+A.x,y:p.y+A.y},Y=Math.max(Math.abs(F.x-w[0].x),Math.abs(I.x-w[0].x)),Q=Math.max(Math.abs(F.y-w[0].y),Math.abs(I.y-w[0].y));Y>=Q?(C=(F.x+I.x)/2,N=w[0].y):(C=w[0].x,N=(F.y+I.y)/2)}const B={x:d.x+S.x,y:d.y+S.y},T={x:p.x+A.x,y:p.y+A.y};return[[e,...B.x!==w[0].x||B.y!==w[0].y?[B]:[],...w,...T.x!==w[w.length-1].x||T.y!==w[w.length-1].y?[T]:[],r],C,N,_,k]}function Z3(e,t,r,a){const o=Math.min(pb(e,t)/2,pb(t,r)/2,a),{x:l,y:u}=t;if(e.x===l&&l===r.x||e.y===u&&u===r.y)return`L${l} ${u}`;if(e.y===u){const d=e.x<r.x?-1:1,p=e.y<r.y?1:-1;return`L ${l+o*d},${u}Q ${l},${u} ${l},${u+o*p}`}const f=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${l},${u+o*h}Q ${l},${u} ${l+o*f},${u}`}function Pp({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:a,targetY:o,targetPosition:l=_e.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:p=.5}){const[g,y,v,w,C]=K3({source:{x:e,y:t},sourcePosition:r,target:{x:a,y:o},targetPosition:l,center:{x:f,y:h},offset:d,stepPosition:p});let N=`M${g[0].x} ${g[0].y}`;for(let S=1;S<g.length-1;S++)N+=Z3(g[S-1],g[S],g[S+1],u);return N+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[N,y,v,w,C]}function mb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function W3(e){const{sourceNode:t,targetNode:r}=e;if(!mb(t)||!mb(r))return null;const a=t.internals.handleBounds||gb(t.handles),o=r.internals.handleBounds||gb(r.handles),l=yb(a?.source??[],e.sourceHandle),u=yb(e.connectionMode===yo.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!l||!u)return e.onError?.("008",er.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=l?.position||_e.Bottom,h=u?.position||_e.Top,d=ia(t,l,f),p=ia(r,u,h);return{sourceX:d.x,sourceY:d.y,targetX:p.x,targetY:p.y,sourcePosition:f,targetPosition:h}}function gb(e){if(!e)return null;const t=[],r=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?t.push(a):a.type==="target"&&r.push(a);return{source:t,target:r}}function ia(e,t,r=_e.Left,a=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,l=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??Ar(e);if(a)return{x:o+u/2,y:l+f/2};switch(t?.position??r){case _e.Top:return{x:o+u/2,y:l};case _e.Right:return{x:o+u,y:l+f/2};case _e.Bottom:return{x:o+u/2,y:l+f};case _e.Left:return{x:o,y:l+f/2}}}function yb(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function Up(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function J3(e,{id:t,defaultColor:r,defaultMarkerStart:a,defaultMarkerEnd:o}){const l=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const d=Up(h,t);l.has(d)||(u.push({id:d,color:h.color||r,...h}),l.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const IS=1e3,ej=10,Bm={nodeOrigin:[0,0],nodeExtent:al,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},tj={...Bm,checkEquality:!0};function Hm(e,t){const r={...e};for(const a in t)t[a]!==void 0&&(r[a]=t[a]);return r}function nj(e,t,r){const a=Hm(Bm,r);for(const o of e.values())if(o.parentId)Um(o,e,t,a);else{const l=gl(o,a.nodeOrigin),u=bo(o.extent)?o.extent:a.nodeExtent,f=ra(l,u,Ar(o));o.internals.positionAbsolute=f}}function rj(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const r=[],a=[];for(const o of e.handles){const l={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"?r.push(l):o.type==="target"&&a.push(l)}return{source:r,target:a}}function Pm(e){return e==="manual"}function Vp(e,t,r,a={}){const o=Hm(tj,a),l={i:0},u=new Map(t),f=o?.elevateNodesOnSelect&&!Pm(o.zIndexMode)?IS:0;let h=e.length>0,d=!1;t.clear(),r.clear();for(const p of e){let g=u.get(p.id);if(o.checkEquality&&p===g?.internals.userNode)t.set(p.id,g);else{const y=gl(p,o.nodeOrigin),v=bo(p.extent)?p.extent:o.nodeExtent,w=ra(y,v,Ar(p));g={...o.defaults,...p,measured:{width:p.measured?.width,height:p.measured?.height},internals:{positionAbsolute:w,handleBounds:rj(p,g),z:BS(p,f,o.zIndexMode),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),p.parentId&&Um(g,t,r,a,l),d||=p.selected??!1}return{nodesInitialized:h,hasSelectedNodes:d}}function ij(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Um(e,t,r,a,o){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Hm(Bm,a),d=e.parentId,p=t.get(d);if(!p){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ij(e,r),o&&!p.parentId&&p.internals.rootParentIndex===void 0&&h==="auto"&&(p.internals.rootParentIndex=++o.i,p.internals.z=p.internals.z+o.i*ej),o&&p.internals.rootParentIndex!==void 0&&(o.i=p.internals.rootParentIndex);const g=l&&!Pm(h)?IS:0,{x:y,y:v,z:w}=aj(e,p,u,f,g,h),{positionAbsolute:C}=e.internals,N=y!==C.x||v!==C.y;(N||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:y,y:v}:C,z:w}})}function BS(e,t,r){const a=Hn(e.zIndex)?e.zIndex:0;return Pm(r)?a:a+(e.selected?t:0)}function aj(e,t,r,a,o,l){const{x:u,y:f}=t.internals.positionAbsolute,h=Ar(e),d=gl(e,r),p=bo(e.extent)?ra(d,e.extent,h):d;let g=ra({x:u+p.x,y:f+p.y},a,h);e.extent==="parent"&&(g=_S(g,h,t));const y=BS(e,o,l),v=t.internals.z??0;return{x:g.x,y:g.y,z:v>=y?v+1:y}}function Vm(e,t,r,a=[0,0]){const o=[],l=new Map;for(const u of e){const f=t.get(u.parentId);if(!f)continue;const h=l.get(u.parentId)?.expandedRect??vo(f),d=kS(h,u.rect);l.set(u.parentId,{expandedRect:d,parent:f})}return l.size>0&&l.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,p=Ar(f),g=f.origin??a,y=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,v=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(p.width,Math.round(u.width)),C=Math.max(p.height,Math.round(u.height)),N=(w-p.width)*g[0],S=(C-p.height)*g[1];(y>0||v>0||N||S)&&(o.push({id:h,type:"position",position:{x:f.position.x-y+N,y:f.position.y-v+S}}),r.get(h)?.forEach(A=>{e.some(_=>_.id===A.id)||o.push({id:A.id,type:"position",position:{x:A.position.x+y,y:A.position.y+v}})})),(p.width<u.width||p.height<u.height||y||v)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?g[0]*y-N:0),height:C+(v?g[1]*v-S:0)}})}),o}function oj(e,t,r,a,o,l,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],p=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(p.transform),y=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const C=Im(v.nodeElement),N=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(N||!w.internals.handleBounds||v.force))){const A=v.nodeElement.getBoundingClientRect(),_=bo(w.extent)?w.extent:l;let{positionAbsolute:k}=w.internals;w.parentId&&w.extent==="parent"?k=_S(k,C,t.get(w.parentId)):_&&(k=ra(k,_,C));const B={...w,measured:C,internals:{...w.internals,positionAbsolute:k,handleBounds:{source:fb("source",v.nodeElement,A,g,w.id),target:fb("target",v.nodeElement,A,g,w.id)}}};t.set(w.id,B),w.parentId&&Um(B,t,r,{nodeOrigin:o,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&y.push({id:w.id,parentId:w.parentId,rect:vo(B,o)}))}}if(y.length>0){const v=Vm(y,t,r,o);d.push(...v)}return{changes:d,updatedInternals:h}}async function sj({delta:e,panZoom:t,transform:r,translateExtent:a,width:o,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[o,l]],a),f=!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2]);return Promise.resolve(f)}function xb(e,t,r,a,o,l){let u=o;const f=a.get(u)||new Map;a.set(u,f.set(r,t)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(r,t)),l){u=`${o}-${e}-${l}`;const d=a.get(u)||new Map;a.set(u,d.set(r,t))}}function HS(e,t,r){e.clear(),t.clear();for(const a of r){const{source:o,target:l,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:o,target:l,sourceHandle:u,targetHandle:f},d=`${o}-${u}--${l}-${f}`,p=`${l}-${f}--${o}-${u}`;xb("source",h,p,e,o,u),xb("target",h,d,e,l,f),t.set(a.id,a)}}function PS(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:PS(r,t):!1}function vb(e,t,r){let a=e;do{if(a?.matches?.(t))return!0;if(a===r)return!1;a=a?.parentElement}while(a);return!1}function lj(e,t,r,a){const o=new Map;for(const[l,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!PS(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const f=e.get(l);f&&o.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:r.x-f.internals.positionAbsolute.x,y:r.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return o}function Qh({nodeId:e,dragItems:t,nodeLookup:r,dragging:a=!0}){const o=[];for(const[u,f]of t){const h=r.get(u)?.internals.userNode;h&&o.push({...h,position:f.position,dragging:a})}if(!e)return[o[0],o];const l=r.get(e)?.internals.userNode;return[l?{...l,position:t.get(e)?.position||l.position,dragging:a}:o[0],o]}function uj({dragItems:e,snapGrid:t,x:r,y:a}){const o=e.values().next().value;if(!o)return null;const l={x:r-o.distance.x,y:a-o.distance.y},u=xl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function cj({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:a,onDragStop:o}){let l={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},p=null,g=!1,y=null,v=!1,w=!1,C=null;function N({noDragClassName:A,handleSelector:_,domNode:k,isSelectable:B,nodeId:T,nodeClickDistance:O=0}){y=yn(k);function U({x:Y,y:Q}){const{nodeLookup:L,nodeExtent:V,snapGrid:M,snapToGrid:q,nodeOrigin:X,onNodeDrag:Z,onSelectionDrag:j,onError:z,updateNodePositions:$}=t();l={x:Y,y:Q};let R=!1;const te=f.size>1,ue=te&&V?Hp(yl(f)):null,fe=te&&q?uj({dragItems:f,snapGrid:M,x:Y,y:Q}):null;for(const[de,le]of f){if(!L.has(de))continue;let pe={x:Y-le.distance.x,y:Q-le.distance.y};q&&(pe=fe?{x:Math.round(pe.x+fe.x),y:Math.round(pe.y+fe.y)}:xl(pe,M));let we=null;if(te&&V&&!le.extent&&ue){const{positionAbsolute:Ce}=le.internals,ce=Ce.x-ue.x+V[0][0],ge=Ce.x+le.measured.width-ue.x2+V[1][0],be=Ce.y-ue.y+V[0][1],De=Ce.y+le.measured.height-ue.y2+V[1][1];we=[[ce,be],[ge,De]]}const{position:Ee,positionAbsolute:ve}=CS({nodeId:de,nextPosition:pe,nodeLookup:L,nodeExtent:we||V,nodeOrigin:X,onError:z});R=R||le.position.x!==Ee.x||le.position.y!==Ee.y,le.position=Ee,le.internals.positionAbsolute=ve}if(w=w||R,!!R&&($(f,!0),C&&(a||Z||!T&&j))){const[de,le]=Qh({nodeId:T,dragItems:f,nodeLookup:L});a?.(C,f,de,le),Z?.(C,de,le),T||j?.(C,le)}}async function P(){if(!p)return;const{transform:Y,panBy:Q,autoPanSpeed:L,autoPanOnNodeDrag:V}=t();if(!V){h=!1,cancelAnimationFrame(u);return}const[M,q]=NS(d,p,L);(M!==0||q!==0)&&(l.x=(l.x??0)-M/Y[2],l.y=(l.y??0)-q/Y[2],await Q({x:M,y:q})&&U(l)),u=requestAnimationFrame(P)}function F(Y){const{nodeLookup:Q,multiSelectionActive:L,nodesDraggable:V,transform:M,snapGrid:q,snapToGrid:X,selectNodesOnDrag:Z,onNodeDragStart:j,onSelectionDragStart:z,unselectNodesAndEdges:$}=t();g=!0,(!Z||!B)&&!L&&T&&(Q.get(T)?.selected||$()),B&&Z&&T&&e?.(T);const R=Ps(Y.sourceEvent,{transform:M,snapGrid:q,snapToGrid:X,containerBounds:p});if(l=R,f=lj(Q,V,R,T),f.size>0&&(r||j||!T&&z)){const[te,ue]=Qh({nodeId:T,dragItems:f,nodeLookup:Q});r?.(Y.sourceEvent,f,te,ue),j?.(Y.sourceEvent,te,ue),T||z?.(Y.sourceEvent,ue)}}const I=rS().clickDistance(O).on("start",Y=>{const{domNode:Q,nodeDragThreshold:L,transform:V,snapGrid:M,snapToGrid:q}=t();p=Q?.getBoundingClientRect()||null,v=!1,w=!1,C=Y.sourceEvent,L===0&&F(Y),l=Ps(Y.sourceEvent,{transform:V,snapGrid:M,snapToGrid:q,containerBounds:p}),d=Pn(Y.sourceEvent,p)}).on("drag",Y=>{const{autoPanOnNodeDrag:Q,transform:L,snapGrid:V,snapToGrid:M,nodeDragThreshold:q,nodeLookup:X}=t(),Z=Ps(Y.sourceEvent,{transform:L,snapGrid:V,snapToGrid:M,containerBounds:p});if(C=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||T&&!X.has(T))&&(v=!0),!v){if(!h&&Q&&g&&(h=!0,P()),!g){const j=Pn(Y.sourceEvent,p),z=j.x-d.x,$=j.y-d.y;Math.sqrt(z*z+$*$)>q&&F(Y)}(l.x!==Z.xSnapped||l.y!==Z.ySnapped)&&f&&g&&(d=Pn(Y.sourceEvent,p),U(Z))}}).on("end",Y=>{if(!(!g||v)&&(h=!1,g=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:Q,updateNodePositions:L,onNodeDragStop:V,onSelectionDragStop:M}=t();if(w&&(L(f,!1),w=!1),o||V||!T&&M){const[q,X]=Qh({nodeId:T,dragItems:f,nodeLookup:Q,dragging:!1});o?.(Y.sourceEvent,f,q,X),V?.(Y.sourceEvent,q,X),T||M?.(Y.sourceEvent,X)}}}).filter(Y=>{const Q=Y.target;return!Y.button&&(!A||!vb(Q,`.${A}`,k))&&(!_||vb(Q,_,k))});y.call(I)}function S(){y?.on(".drag",null)}return{update:N,destroy:S}}function fj(e,t,r){const a=[],o={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const l of t.values())sl(o,vo(l))>0&&a.push(l);return a}const dj=250;function hj(e,t,r,a){let o=[],l=1/0;const u=fj(e,r,t+dj);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:p,y:g}=ia(f,d,d.position,!0),y=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(g-e.y,2));y>t||(y<l?(o=[{...d,x:p,y:g}],l=y):y===l&&o.push({...d,x:p,y:g}))}}if(!o.length)return null;if(o.length>1){const f=a.type==="source"?"target":"source";return o.find(h=>h.type===f)??o[0]}return o[0]}function US(e,t,r,a,o,l=!1){const u=a.get(e);if(!u)return null;const f=o==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(r?f?.find(d=>d.id===r):f?.[0])??null;return h&&l?{...h,...ia(u,h,h.position,!0)}:h}function VS(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function pj(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const qS=()=>!0;function mj(e,{connectionMode:t,connectionRadius:r,handleId:a,nodeId:o,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:p,flowId:g,panBy:y,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:N,isValidConnection:S=qS,onReconnectEnd:A,updateConnection:_,getTransform:k,getFromHandle:B,autoPanSpeed:T,dragThreshold:O=1,handleDomNode:U}){const P=AS(e.target);let F=0,I;const{x:Y,y:Q}=Pn(e),L=VS(l,U),V=f?.getBoundingClientRect();let M=!1;if(!V||!L)return;const q=US(o,L,a,h,t);if(!q)return;let X=Pn(e,V),Z=!1,j=null,z=!1,$=null;function R(){if(!p||!V)return;const[Ee,ve]=NS(X,V,T);y({x:Ee,y:ve}),F=requestAnimationFrame(R)}const te={...q,nodeId:o,type:L,position:q.position},ue=h.get(o);let de={inProgress:!0,isValid:null,from:ia(ue,te,_e.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:ue,to:X,toHandle:null,toPosition:sb[te.position],toNode:null,pointer:X};function le(){M=!0,_(de),w?.(e,{nodeId:o,handleId:a,handleType:L})}O===0&&le();function pe(Ee){if(!M){const{x:De,y:qe}=Pn(Ee),Fe=De-Y,_t=qe-Q;if(!(Fe*Fe+_t*_t>O*O))return;le()}if(!B()||!te){we(Ee);return}const ve=k();X=Pn(Ee,V),I=hj(vl(X,ve,!1,[1,1]),r,h,te),Z||(R(),Z=!0);const Ce=FS(Ee,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:S,doc:P,lib:d,flowId:g,nodeLookup:h});$=Ce.handleDomNode,j=Ce.connection,z=pj(!!I,Ce.isValid);const ce=h.get(o),ge=ce?ia(ce,te,_e.Left,!0):de.from,be={...de,from:ge,isValid:z,to:Ce.toHandle&&z?Lc({x:Ce.toHandle.x,y:Ce.toHandle.y},ve):X,toHandle:Ce.toHandle,toPosition:z&&Ce.toHandle?Ce.toHandle.position:sb[te.position],toNode:Ce.toHandle?h.get(Ce.toHandle.nodeId):null,pointer:X};_(be),de=be}function we(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(M){(I||$)&&j&&z&&C?.(j);const{inProgress:ve,...Ce}=de,ce={...Ce,toPosition:de.toHandle?de.toPosition:null};N?.(Ee,ce),l&&A?.(Ee,ce)}v(),cancelAnimationFrame(F),Z=!1,z=!1,j=null,$=null,P.removeEventListener("mousemove",pe),P.removeEventListener("mouseup",we),P.removeEventListener("touchmove",pe),P.removeEventListener("touchend",we)}}P.addEventListener("mousemove",pe),P.addEventListener("mouseup",we),P.addEventListener("touchmove",pe),P.addEventListener("touchend",we)}function FS(e,{handle:t,connectionMode:r,fromNodeId:a,fromHandleId:o,fromType:l,doc:u,lib:f,flowId:h,isValidConnection:d=qS,nodeLookup:p}){const g=l==="target",y=t?u.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:v,y:w}=Pn(e),C=u.elementFromPoint(v,w),N=C?.classList.contains(`${f}-flow__handle`)?C:y,S={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const A=VS(void 0,N),_=N.getAttribute("data-nodeid"),k=N.getAttribute("data-handleid"),B=N.classList.contains("connectable"),T=N.classList.contains("connectableend");if(!_||!A)return S;const O={source:g?_:a,sourceHandle:g?k:o,target:g?a:_,targetHandle:g?o:k};S.connection=O;const P=B&&T&&(r===yo.Strict?g&&A==="source"||!g&&A==="target":_!==a||k!==o);S.isValid=P&&d(O),S.toHandle=US(_,A,k,p,r,!0)}return S}const qp={onPointerDown:mj,isValid:FS};function gj({domNode:e,panZoom:t,getTransform:r,getViewScale:a}){const o=yn(e);function l({translateExtent:f,width:h,height:d,zoomStep:p=1,pannable:g=!0,zoomable:y=!0,inversePan:v=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const k=r(),B=_.sourceEvent.ctrlKey&&ll()?10:1,T=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*p,O=k[2]*Math.pow(2,T*B);t.scaleTo(O)};let C=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(C=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},S=_=>{const k=r();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const B=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],T=[B[0]-C[0],B[1]-C[1]];C=B;const O=a()*Math.max(k[2],Math.log(k[2]))*(v?-1:1),U={x:k[0]-T[0]*O,y:k[1]-T[1]*O},P=[[0,0],[h,d]];t.setViewportConstrained({x:U.x,y:U.y,zoom:k[2]},P,f)},A=xS().on("start",N).on("zoom",g?S:null).on("zoom.wheel",y?w:null);o.call(A,{})}function u(){o.on("zoom",null)}return{update:l,destroy:u,pointer:In}}const nf=e=>({x:e.x,y:e.y,zoom:e.k}),Kh=({x:e,y:t,zoom:r})=>Jc.translate(e,t).scale(r),no=(e,t)=>e.target.closest(`.${t}`),YS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),yj=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Zh=(e,t=0,r=yj,a=()=>{})=>{const o=typeof t=="number"&&t>0;return o||a(),o?e.transition().duration(t).ease(r).on("end",a):e},$S=e=>{const t=e.ctrlKey&&ll()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function xj({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return p=>{if(no(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const g=r.property("__zoom").k||1;if(p.ctrlKey&&u){const N=In(p),S=$S(p),A=g*Math.pow(2,S);a.scaleTo(r,A,N,p);return}const y=p.deltaMode===1?20:1;let v=o===Ji.Vertical?0:p.deltaX*y,w=o===Ji.Horizontal?0:p.deltaY*y;!ll()&&p.shiftKey&&o!==Ji.Vertical&&(v=p.deltaY*y,w=0),a.translateBy(r,-(v/g)*l,-(w/g)*l,{internal:!0});const C=nf(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(p,C),e.panScrollTimeout=setTimeout(()=>{d?.(p,C),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(p,C))}}function vj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(a,o){const l=a.type==="wheel",u=!t&&l&&!a.ctrlKey,f=no(a,e);if(a.ctrlKey&&l&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),r.call(this,a,o)}}function bj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return a=>{if(a.sourceEvent?.internal)return;const o=nf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&t(!0),r&&r?.(a.sourceEvent,o)}}function wj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:a,onPanZoom:o}){return l=>{e.usedRightMouseButton=!!(r&&YS(t,e.mouseButton??0)),l.sourceEvent?.sync||a([l.transform.x,l.transform.y,l.transform.k]),o&&!l.sourceEvent?.internal&&o?.(l.sourceEvent,nf(l.transform))}}function Sj({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:l}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&YS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const f=nf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,f)},r?150:0)}}}function Ej({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:p}){return g=>{const y=e||t,v=r&&g.ctrlKey,w=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(no(g,`${d}-flow__node`)||no(g,`${d}-flow__edge`)))return!0;if(!a&&!y&&!o&&!l&&!r||u||p&&!w||no(g,f)&&w||no(g,h)&&(!w||o&&w&&!e)||!r&&g.ctrlKey&&w)return!1;if(!r&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!o&&!v&&w||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const C=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||w)&&C}}function Cj({domNode:e,minZoom:t,maxZoom:r,translateExtent:a,viewport:o,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),g=xS().scaleExtent([t,r]).translateExtent(a),y=yn(e).call(g);A({x:o.x,y:o.y,zoom:xo(o.zoom,t,r)},[[0,0],[p.width,p.height]],a);const v=y.on("wheel.zoom"),w=y.on("dblclick.zoom");g.wheelDelta($S);function C(I,Y){return y?new Promise(Q=>{g?.interpolate(Y?.interpolate==="linear"?Hs:pc).transform(Zh(y,Y?.duration,Y?.ease,()=>Q(!0)),I)}):Promise.resolve(!1)}function N({noWheelClassName:I,noPanClassName:Y,onPaneContextMenu:Q,userSelectionActive:L,panOnScroll:V,panOnDrag:M,panOnScrollMode:q,panOnScrollSpeed:X,preventScrolling:Z,zoomOnPinch:j,zoomOnScroll:z,zoomOnDoubleClick:$,zoomActivationKeyPressed:R,lib:te,onTransformChange:ue,connectionInProgress:fe,paneClickDistance:de,selectionOnDrag:le}){L&&!d.isZoomingOrPanning&&S();const pe=V&&!R&&!L;g.clickDistance(le?1/0:!Hn(de)||de<0?0:de);const we=pe?xj({zoomPanValues:d,noWheelClassName:I,d3Selection:y,d3Zoom:g,panOnScrollMode:q,panOnScrollSpeed:X,zoomOnPinch:j,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):vj({noWheelClassName:I,preventScrolling:Z,d3ZoomHandler:v});if(y.on("wheel.zoom",we,{passive:!1}),!L){const ve=bj({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});g.on("start",ve);const Ce=wj({zoomPanValues:d,panOnDrag:M,onPaneContextMenu:!!Q,onPanZoom:l,onTransformChange:ue});g.on("zoom",Ce);const ce=Sj({zoomPanValues:d,panOnDrag:M,panOnScroll:V,onPaneContextMenu:Q,onPanZoomEnd:f,onDraggingChange:h});g.on("end",ce)}const Ee=Ej({zoomActivationKeyPressed:R,panOnDrag:M,zoomOnScroll:z,panOnScroll:V,zoomOnDoubleClick:$,zoomOnPinch:j,userSelectionActive:L,noPanClassName:Y,noWheelClassName:I,lib:te,connectionInProgress:fe});g.filter(Ee),$?y.on("dblclick.zoom",w):y.on("dblclick.zoom",null)}function S(){g.on("zoom",null)}async function A(I,Y,Q){const L=Kh(I),V=g?.constrain()(L,Y,Q);return V&&await C(V),new Promise(M=>M(V))}async function _(I,Y){const Q=Kh(I);return await C(Q,Y),new Promise(L=>L(Q))}function k(I){if(y){const Y=Kh(I),Q=y.property("__zoom");(Q.k!==I.zoom||Q.x!==I.x||Q.y!==I.y)&&g?.transform(y,Y,null,{sync:!0})}}function B(){const I=y?yS(y.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function T(I,Y){return y?new Promise(Q=>{g?.interpolate(Y?.interpolate==="linear"?Hs:pc).scaleTo(Zh(y,Y?.duration,Y?.ease,()=>Q(!0)),I)}):Promise.resolve(!1)}function O(I,Y){return y?new Promise(Q=>{g?.interpolate(Y?.interpolate==="linear"?Hs:pc).scaleBy(Zh(y,Y?.duration,Y?.ease,()=>Q(!0)),I)}):Promise.resolve(!1)}function U(I){g?.scaleExtent(I)}function P(I){g?.translateExtent(I)}function F(I){const Y=!Hn(I)||I<0?0:I;g?.clickDistance(Y)}return{update:N,destroy:S,setViewport:_,setViewportConstrained:A,getViewport:B,scaleTo:T,scaleBy:O,setScaleExtent:U,setTranslateExtent:P,syncViewport:k,setClickDistance:F}}var wo;(function(e){e.Line="line",e.Handle="handle"})(wo||(wo={}));function _j({width:e,prevWidth:t,height:r,prevHeight:a,affectsX:o,affectsY:l}){const u=e-t,f=r-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&o&&(h[0]=h[0]*-1),f&&l&&(h[1]=h[1]*-1),h}function bb(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:a,affectsY:o}}function ai(e,t){return Math.max(0,t-e)}function oi(e,t){return Math.max(0,e-t)}function tc(e,t,r){return Math.max(0,t-e,e-r)}function wb(e,t){return e?!t:t}function Nj(e,t,r,a,o,l,u,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:p,isVertical:g}=t,y=p&&g,{xSnapped:v,ySnapped:w}=r,{minWidth:C,maxWidth:N,minHeight:S,maxHeight:A}=a,{x:_,y:k,width:B,height:T,aspectRatio:O}=e;let U=Math.floor(p?v-e.pointerX:0),P=Math.floor(g?w-e.pointerY:0);const F=B+(h?-U:U),I=T+(d?-P:P),Y=-l[0]*B,Q=-l[1]*T;let L=tc(F,C,N),V=tc(I,S,A);if(u){let X=0,Z=0;h&&U<0?X=ai(_+U+Y,u[0][0]):!h&&U>0&&(X=oi(_+F+Y,u[1][0])),d&&P<0?Z=ai(k+P+Q,u[0][1]):!d&&P>0&&(Z=oi(k+I+Q,u[1][1])),L=Math.max(L,X),V=Math.max(V,Z)}if(f){let X=0,Z=0;h&&U>0?X=oi(_+U,f[0][0]):!h&&U<0&&(X=ai(_+F,f[1][0])),d&&P>0?Z=oi(k+P,f[0][1]):!d&&P<0&&(Z=ai(k+I,f[1][1])),L=Math.max(L,X),V=Math.max(V,Z)}if(o){if(p){const X=tc(F/O,S,A)*O;if(L=Math.max(L,X),u){let Z=0;!h&&!d||h&&!d&&y?Z=oi(k+Q+F/O,u[1][1])*O:Z=ai(k+Q+(h?U:-U)/O,u[0][1])*O,L=Math.max(L,Z)}if(f){let Z=0;!h&&!d||h&&!d&&y?Z=ai(k+F/O,f[1][1])*O:Z=oi(k+(h?U:-U)/O,f[0][1])*O,L=Math.max(L,Z)}}if(g){const X=tc(I*O,C,N)/O;if(V=Math.max(V,X),u){let Z=0;!h&&!d||d&&!h&&y?Z=oi(_+I*O+Y,u[1][0])/O:Z=ai(_+(d?P:-P)*O+Y,u[0][0])/O,V=Math.max(V,Z)}if(f){let Z=0;!h&&!d||d&&!h&&y?Z=ai(_+I*O,f[1][0])/O:Z=oi(_+(d?P:-P)*O,f[0][0])/O,V=Math.max(V,Z)}}}P=P+(P<0?V:-V),U=U+(U<0?L:-L),o&&(y?F>I*O?P=(wb(h,d)?-U:U)/O:U=(wb(h,d)?-P:P)*O:p?(P=U/O,d=h):(U=P*O,h=d));const M=h?_+U:_,q=d?k+P:k;return{width:B+(h?-U:U),height:T+(d?-P:P),x:l[0]*U*(h?-1:1)+M,y:l[1]*P*(d?-1:1)+q}}const GS={width:0,height:0,x:0,y:0},kj={...GS,pointerX:0,pointerY:0,aspectRatio:1};function Mj(e){return[[0,0],[e.measured.width,e.measured.height]]}function Tj(e,t,r){const a=t.position.x+e.position.x,o=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,f=r[0]*l,h=r[1]*u;return[[a-f,o-h],[a+l-f,o+u-h]]}function Aj({domNode:e,nodeId:t,getStoreItems:r,onChange:a,onEnd:o}){const l=yn(e);let u={controlDirection:bb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:p,keepAspectRatio:g,resizeDirection:y,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:N}){let S={...GS},A={...kj};u={boundaries:p,resizeDirection:y,keepAspectRatio:g,controlDirection:bb(d)};let _,k=null,B=[],T,O,U,P=!1;const F=rS().on("start",I=>{const{nodeLookup:Y,transform:Q,snapGrid:L,snapToGrid:V,nodeOrigin:M,paneDomNode:q}=r();if(_=Y.get(t),!_)return;k=q?.getBoundingClientRect()??null;const{xSnapped:X,ySnapped:Z}=Ps(I.sourceEvent,{transform:Q,snapGrid:L,snapToGrid:V,containerBounds:k});S={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},A={...S,pointerX:X,pointerY:Z,aspectRatio:S.width/S.height},T=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(T=Y.get(_.parentId),O=T&&_.extent==="parent"?Mj(T):void 0),B=[],U=void 0;for(const[j,z]of Y)if(z.parentId===t&&(B.push({id:j,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const $=Tj(z,_,z.origin??M);U?U=[[Math.min($[0][0],U[0][0]),Math.min($[0][1],U[0][1])],[Math.max($[1][0],U[1][0]),Math.max($[1][1],U[1][1])]]:U=$}v?.(I,{...S})}).on("drag",I=>{const{transform:Y,snapGrid:Q,snapToGrid:L,nodeOrigin:V}=r(),M=Ps(I.sourceEvent,{transform:Y,snapGrid:Q,snapToGrid:L,containerBounds:k}),q=[];if(!_)return;const{x:X,y:Z,width:j,height:z}=S,$={},R=_.origin??V,{width:te,height:ue,x:fe,y:de}=Nj(A,u.controlDirection,M,u.boundaries,u.keepAspectRatio,R,O,U),le=te!==j,pe=ue!==z,we=fe!==X&&le,Ee=de!==Z&&pe;if(!we&&!Ee&&!le&&!pe)return;if((we||Ee||R[0]===1||R[1]===1)&&($.x=we?fe:S.x,$.y=Ee?de:S.y,S.x=$.x,S.y=$.y,B.length>0)){const ge=fe-X,be=de-Z;for(const De of B)De.position={x:De.position.x-ge+R[0]*(te-j),y:De.position.y-be+R[1]*(ue-z)},q.push(De)}if((le||pe)&&($.width=le&&(!u.resizeDirection||u.resizeDirection==="horizontal")?te:S.width,$.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?ue:S.height,S.width=$.width,S.height=$.height),T&&_.expandParent){const ge=R[0]*($.width??0);$.x&&$.x<ge&&(S.x=ge,A.x=A.x-($.x-ge));const be=R[1]*($.height??0);$.y&&$.y<be&&(S.y=be,A.y=A.y-($.y-be))}const ve=_j({width:S.width,prevWidth:j,height:S.height,prevHeight:z,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ce={...S,direction:ve};N?.(I,Ce)!==!1&&(P=!0,w?.(I,Ce),a($,q))}).on("end",I=>{P&&(C?.(I,{...S}),o?.({...S}),P=!1)});l.call(F)}function h(){l.on(".drag",null)}return{update:f,destroy:h}}const Rj={},Sb=e=>{let t;const r=new Set,a=(p,g)=>{const y=typeof p=="function"?p(t):p;if(!Object.is(y,t)){const v=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),r.forEach(w=>w(t,v))}},o=()=>t,h={setState:a,getState:o,getInitialState:()=>d,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(Rj?"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."),r.clear()}},d=t=e(a,o,h);return h},jj=e=>e?Sb(e):Sb,{useDebugValue:Oj}=co,{useSyncExternalStoreWithSelector:Dj}=Nk,zj=e=>e;function XS(e,t=zj,r){const a=Dj(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Oj(a),a}const Eb=(e,t)=>{const r=jj(e),a=(o,l=t)=>XS(r,o,l);return Object.assign(a,r),a},Lj=(e,t)=>e?Eb(e,t):Eb;function lt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[a,o]of e)if(!Object.is(o,t.get(a)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const a of e)if(!t.has(a))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const a of r)if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return!1;return!0}const rf=H.createContext(null),Ij=rf.Provider,QS=er.error001();function Ve(e,t){const r=H.useContext(rf);if(r===null)throw new Error(QS);return XS(r,e,t)}function ut(){const e=H.useContext(rf);if(e===null)throw new Error(QS);return H.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Cb={display:"none"},Bj={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},KS="react-flow__node-desc",ZS="react-flow__edge-desc",Hj="react-flow__aria-live",Pj=e=>e.ariaLiveMessage,Uj=e=>e.ariaLabelConfig;function Vj({rfId:e}){const t=Ve(Pj);return b.jsx("div",{id:`${Hj}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Bj,children:t})}function qj({rfId:e,disableKeyboardA11y:t}){const r=Ve(Uj);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${KS}-${e}`,style:Cb,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${ZS}-${e}`,style:Cb,children:r["edge.a11yDescription.default"]}),!t&&b.jsx(Vj,{rfId:e})]})}const af=H.forwardRef(({position:e="top-left",children:t,className:r,style:a,...o},l)=>{const u=`${e}`.split("-");return b.jsx("div",{className:St(["react-flow__panel",r,...u]),style:a,ref:l,...o,children:t})});af.displayName="Panel";function Fj({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:b.jsx(af,{position:t,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 Yj=e=>{const t=[],r=[];for(const[,a]of e.nodeLookup)a.selected&&t.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&r.push(a);return{selectedNodes:t,selectedEdges:r}},nc=e=>e.id;function $j(e,t){return lt(e.selectedNodes.map(nc),t.selectedNodes.map(nc))&&lt(e.selectedEdges.map(nc),t.selectedEdges.map(nc))}function Gj({onSelectionChange:e}){const t=ut(),{selectedNodes:r,selectedEdges:a}=Ve(Yj,$j);return H.useEffect(()=>{const o={nodes:r,edges:a};e?.(o),t.getState().onSelectionChangeHandlers.forEach(l=>l(o))},[r,a,e]),null}const Xj=e=>!!e.onSelectionChangeHandlers;function Qj({onSelectionChange:e}){const t=Ve(Xj);return e||t?b.jsx(Gj,{onSelectionChange:e}):null}const Fp=typeof window<"u"?H.useLayoutEffect:H.useEffect,WS=[0,0],Kj={x:0,y:0,zoom:1},Zj=["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"],_b=[...Zj,"rfId"],Wj=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}),Nb={translateExtent:al,nodeOrigin:WS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Jj(e){const{setNodes:t,setEdges:r,setMinZoom:a,setMaxZoom:o,setTranslateExtent:l,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ve(Wj,lt),d=ut();Fp(()=>(h(e.defaultNodes,e.defaultEdges),()=>{p.current=Nb,f()}),[]);const p=H.useRef(Nb);return Fp(()=>{for(const g of _b){const y=e[g],v=p.current[g];y!==v&&(typeof e[g]>"u"||(g==="nodes"?t(y):g==="edges"?r(y):g==="minZoom"?a(y):g==="maxZoom"?o(y):g==="translateExtent"?l(y):g==="nodeExtent"?u(y):g==="ariaLabelConfig"?d.setState({ariaLabelConfig:V3(y)}):g==="fitView"?d.setState({fitViewQueued:y}):g==="fitViewOptions"?d.setState({fitViewOptions:y}):d.setState({[g]:y})))}p.current=e},_b.map(g=>e[g])),null}function kb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function eO(e){const[t,r]=H.useState(e==="system"?null:e);return H.useEffect(()=>{if(e!=="system"){r(e);return}const a=kb(),o=()=>r(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),t!==null?t:kb()?.matches?"dark":"light"}const Mb=typeof document<"u"?document:null;function ul(e=null,t={target:Mb,actInsideInputWithModifier:!0}){const[r,a]=H.useState(!1),o=H.useRef(!1),l=H.useRef(new Set([])),[u,f]=H.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
10
- `).replace(`
11
-
12
- `,`
13
- +`).split(`
14
- `)),p=d.reduce((g,y)=>g.concat(...y),[]);return[d,p]}return[[],[]]},[e]);return H.useEffect(()=>{const h=t?.target??Mb,d=t?.actInsideInputWithModifier??!0;if(e!==null){const p=v=>{if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!d)&&RS(v))return!1;const C=Ab(v.code,f);if(l.current.add(v[C]),Tb(u,l.current,!1)){const N=v.composedPath?.()?.[0]||v.target,S=N?.nodeName==="BUTTON"||N?.nodeName==="A";t.preventDefault!==!1&&(o.current||!S)&&v.preventDefault(),a(!0)}},g=v=>{const w=Ab(v.code,f);Tb(u,l.current,!0)?(a(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),o.current=!1},y=()=>{l.current.clear(),a(!1)};return h?.addEventListener("keydown",p),h?.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",p),h?.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,a]),r}function Tb(e,t,r){return e.filter(a=>r||a.length===t.size).some(a=>a.every(o=>t.has(o)))}function Ab(e,t){return t.includes(e)?"code":"key"}const tO=()=>{const e=ut();return H.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(t,r):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[a,o,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??a,y:t.y??o,zoom:t.zoom??l},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,a]=e.getState().transform;return{x:t,y:r,zoom:a}},setCenter:async(t,r,a)=>e.getState().setCenter(t,r,a),fitBounds:async(t,r)=>{const{width:a,height:o,minZoom:l,maxZoom:u,panZoom:f}=e.getState(),h=Lm(t,a,o,l,u,r?.padding??.1);return f?(await f.setViewport(h,{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:a,snapGrid:o,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:f,y:h}=u.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},p=r.snapGrid??o,g=r.snapToGrid??l;return vl(d,a,g,p)},flowToScreenPosition:t=>{const{transform:r,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),u=Lc(t,r);return{x:u.x+o,y:u.y+l}}}),[])};function JS(e,t){const r=[],a=new Map,o=[];for(const l of e)if(l.type==="add"){o.push(l);continue}else if(l.type==="remove"||l.type==="replace")a.set(l.id,[l]);else{const u=a.get(l.id);u?u.push(l):a.set(l.id,[l])}for(const l of t){const u=a.get(l.id);if(!u){r.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){r.push({...u[0].item});continue}const f={...l};for(const h of u)nO(h,f);r.push(f)}return o.length&&o.forEach(l=>{l.index!==void 0?r.splice(l.index,0,{...l.item}):r.push({...l.item})}),r}function nO(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function rO(e,t){return JS(e,t)}function iO(e,t){return JS(e,t)}function Ui(e,t){return{id:e,type:"select",selected:t}}function ro(e,t=new Set,r=!1){const a=[];for(const[o,l]of e){const u=t.has(o);!(l.selected===void 0&&!u)&&l.selected!==u&&(r&&(l.selected=u),a.push(Ui(l.id,u)))}return a}function Rb({items:e=[],lookup:t}){const r=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const u=t.get(l.id),f=u?.internals?.userNode??u;f!==void 0&&f!==l&&r.push({id:l.id,item:l,type:"replace"}),f===void 0&&r.push({item:l,type:"add",index:o})}for(const[o]of t)a.get(o)===void 0&&r.push({id:o,type:"remove"});return r}function jb(e){return{id:e.id,type:"remove"}}const Ob=e=>j3(e),aO=e=>ES(e);function eE(e){return H.forwardRef(e)}function Db(e){const[t,r]=H.useState(BigInt(0)),[a]=H.useState(()=>oO(()=>r(o=>o+BigInt(1))));return Fp(()=>{const o=a.get();o.length&&(e(o),a.reset())},[t]),a}function oO(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const tE=H.createContext(null);function sO({children:e}){const t=ut(),r=H.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:p,onNodesChange:g,nodeLookup:y,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let C=h;for(const S of f)C=typeof S=="function"?S(C):S;let N=Rb({items:C,lookup:y});for(const S of w.values())N=S(N);p&&d(C),N.length>0?g?.(N):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:A,setNodes:_}=t.getState();S&&_(A)})},[]),a=Db(r),o=H.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:p,onEdgesChange:g,edgeLookup:y}=t.getState();let v=h;for(const w of f)v=typeof w=="function"?w(v):w;p?d(v):g&&g(Rb({items:v,lookup:y}))},[]),l=Db(o),u=H.useMemo(()=>({nodeQueue:a,edgeQueue:l}),[]);return b.jsx(tE.Provider,{value:u,children:e})}function lO(){const e=H.useContext(tE);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const uO=e=>!!e.panZoom;function qm(){const e=tO(),t=ut(),r=lO(),a=Ve(uO),o=H.useMemo(()=>{const l=g=>t.getState().nodeLookup.get(g),u=g=>{r.nodeQueue.push(g)},f=g=>{r.edgeQueue.push(g)},h=g=>{const{nodeLookup:y,nodeOrigin:v}=t.getState(),w=Ob(g)?g:y.get(g.id),C=w.parentId?TS(w.position,w.measured,w.parentId,y,v):w.position,N={...w,position:C,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return vo(N)},d=(g,y,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===g){const N=typeof y=="function"?y(C):y;return v.replace&&Ob(N)?N:{...C,...N}}return C}))},p=(g,y,v={replace:!1})=>{f(w=>w.map(C=>{if(C.id===g){const N=typeof y=="function"?y(C):y;return v.replace&&aO(N)?N:{...C,...N}}return C}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>l(g)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(y=>({...y}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:u,setEdges:f,addNodes:g=>{const y=Array.isArray(g)?g:[g];r.nodeQueue.push(v=>[...v,...y])},addEdges:g=>{const y=Array.isArray(g)?g:[g];r.edgeQueue.push(v=>[...v,...y])},toObject:()=>{const{nodes:g=[],edges:y=[],transform:v}=t.getState(),[w,C,N]=v;return{nodes:g.map(S=>({...S})),edges:y.map(S=>({...S})),viewport:{x:w,y:C,zoom:N}}},deleteElements:async({nodes:g=[],edges:y=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:N,triggerNodeChanges:S,triggerEdgeChanges:A,onDelete:_,onBeforeDelete:k}=t.getState(),{nodes:B,edges:T}=await I3({nodesToRemove:g,edgesToRemove:y,nodes:v,edges:w,onBeforeDelete:k}),O=T.length>0,U=B.length>0;if(O){const P=T.map(jb);N?.(T),A(P)}if(U){const P=B.map(jb);C?.(B),S(P)}return(U||O)&&_?.({nodes:B,edges:T}),{deletedNodes:B,deletedEdges:T}},getIntersectingNodes:(g,y=!0,v)=>{const w=ub(g),C=w?g:h(g),N=v!==void 0;return C?(v||t.getState().nodes).filter(S=>{const A=t.getState().nodeLookup.get(S.id);if(A&&!w&&(S.id===g.id||!A.internals.positionAbsolute))return!1;const _=vo(N?S:A),k=sl(_,C);return y&&k>0||k>=_.width*_.height||k>=C.width*C.height}):[]},isNodeIntersecting:(g,y,v=!0)=>{const C=ub(g)?g:h(g);if(!C)return!1;const N=sl(C,y);return v&&N>0||N>=y.width*y.height||N>=C.width*C.height},updateNode:d,updateNodeData:(g,y,v={replace:!1})=>{d(g,w=>{const C=typeof y=="function"?y(w):y;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:p,updateEdgeData:(g,y,v={replace:!1})=>{p(g,w=>{const C=typeof y=="function"?y(w):y;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:g=>{const{nodeLookup:y,nodeOrigin:v}=t.getState();return O3(g,{nodeLookup:y,nodeOrigin:v})},getHandleConnections:({type:g,id:y,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}-${g}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:y,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}${g?y?`-${g}-${y}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const y=t.getState().fitViewResolver??U3();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:y}),r.nodeQueue.push(v=>[...v]),y.promise}}},[]);return H.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const zb=e=>e.selected,cO=typeof window<"u"?window:void 0;function fO({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=ut(),{deleteElements:a}=qm(),o=ul(e,{actInsideInputWithModifier:!1}),l=ul(t,{target:cO});H.useEffect(()=>{if(o){const{edges:u,nodes:f}=r.getState();a({nodes:f.filter(zb),edges:u.filter(zb)}),r.setState({nodesSelectionActive:!1})}},[o]),H.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])}function dO(e){const t=ut();H.useEffect(()=>{const r=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=Im(e.current);(a.height===0||a.width===0)&&t.getState().onError?.("004",er.error004()),t.setState({width:a.width||500,height:a.height||500})};if(e.current){r(),window.addEventListener("resize",r);const a=new ResizeObserver(()=>r());return a.observe(e.current),()=>{window.removeEventListener("resize",r),a&&e.current&&a.unobserve(e.current)}}},[])}const of={position:"absolute",width:"100%",height:"100%",top:0,left:0},hO=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function pO({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:l=Ji.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:p,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:N,onViewportChange:S,isControlledViewport:A,paneClickDistance:_,selectionOnDrag:k}){const B=ut(),T=H.useRef(null),{userSelectionActive:O,lib:U,connectionInProgress:P}=Ve(hO,lt),F=ul(y),I=H.useRef();dO(T);const Y=H.useCallback(Q=>{S?.({x:Q[0],y:Q[1],zoom:Q[2]}),A||B.setState({transform:Q})},[S,A]);return H.useEffect(()=>{if(T.current){I.current=Cj({domNode:T.current,minZoom:p,maxZoom:g,translateExtent:d,viewport:h,onDraggingChange:M=>B.setState(q=>q.paneDragging===M?q:{paneDragging:M}),onPanZoomStart:(M,q)=>{const{onViewportChangeStart:X,onMoveStart:Z}=B.getState();Z?.(M,q),X?.(q)},onPanZoom:(M,q)=>{const{onViewportChange:X,onMove:Z}=B.getState();Z?.(M,q),X?.(q)},onPanZoomEnd:(M,q)=>{const{onViewportChangeEnd:X,onMoveEnd:Z}=B.getState();Z?.(M,q),X?.(q)}});const{x:Q,y:L,zoom:V}=I.current.getViewport();return B.setState({panZoom:I.current,transform:[Q,L,V],domNode:T.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),H.useEffect(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:F,preventScrolling:v,noPanClassName:N,userSelectionActive:O,noWheelClassName:C,lib:U,onTransformChange:Y,connectionInProgress:P,selectionOnDrag:k,paneClickDistance:_})},[e,t,r,a,o,l,u,f,F,v,N,O,C,U,Y,P,k,_]),b.jsx("div",{className:"react-flow__renderer",ref:T,style:of,children:w})}const mO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function gO(){const{userSelectionActive:e,userSelectionRect:t}=Ve(mO,lt);return e&&t?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Wh=(e,t)=>r=>{r.target===t.current&&e?.(r)},yO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function xO({isSelecting:e,selectionKeyPressed:t,selectionMode:r=ol.Full,panOnDrag:a,paneClickDistance:o,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:p,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:v,children:w}){const C=ut(),{userSelectionActive:N,elementsSelectable:S,dragging:A,connectionInProgress:_}=Ve(yO,lt),k=S&&(e||N),B=H.useRef(null),T=H.useRef(),O=H.useRef(new Set),U=H.useRef(new Set),P=H.useRef(!1),F=X=>{if(P.current||_){P.current=!1;return}h?.(X),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},I=X=>{if(Array.isArray(a)&&a?.includes(2)){X.preventDefault();return}d?.(X)},Y=p?X=>p(X):void 0,Q=X=>{P.current&&(X.stopPropagation(),P.current=!1)},L=X=>{const{domNode:Z}=C.getState();if(T.current=Z?.getBoundingClientRect(),!T.current)return;const j=X.target===B.current;if(!j&&!!X.target.closest(".nokey")||!e||!(l&&j||t)||X.button!==0||!X.isPrimary)return;X.target?.setPointerCapture?.(X.pointerId),P.current=!1;const{x:R,y:te}=Pn(X.nativeEvent,T.current);C.setState({userSelectionRect:{width:0,height:0,startX:R,startY:te,x:R,y:te}}),j||(X.stopPropagation(),X.preventDefault())},V=X=>{const{userSelectionRect:Z,transform:j,nodeLookup:z,edgeLookup:$,connectionLookup:R,triggerNodeChanges:te,triggerEdgeChanges:ue,defaultEdgeOptions:fe,resetSelectedElements:de}=C.getState();if(!T.current||!Z)return;const{x:le,y:pe}=Pn(X.nativeEvent,T.current),{startX:we,startY:Ee}=Z;if(!P.current){const be=t?0:o;if(Math.hypot(le-we,pe-Ee)<=be)return;de(),u?.(X)}P.current=!0;const ve={startX:we,startY:Ee,x:le<we?le:we,y:pe<Ee?pe:Ee,width:Math.abs(le-we),height:Math.abs(pe-Ee)},Ce=O.current,ce=U.current;O.current=new Set(zm(z,ve,j,r===ol.Partial,!0).map(be=>be.id)),U.current=new Set;const ge=fe?.selectable??!0;for(const be of O.current){const De=R.get(be);if(De)for(const{edgeId:qe}of De.values()){const Fe=$.get(qe);Fe&&(Fe.selectable??ge)&&U.current.add(qe)}}if(!cb(Ce,O.current)){const be=ro(z,O.current,!0);te(be)}if(!cb(ce,U.current)){const be=ro($,U.current);ue(be)}C.setState({userSelectionRect:ve,userSelectionActive:!0,nodesSelectionActive:!1})},M=X=>{X.button===0&&(X.target?.releasePointerCapture?.(X.pointerId),!N&&X.target===B.current&&C.getState().userSelectionRect&&F?.(X),C.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(f?.(X),C.setState({nodesSelectionActive:O.current.size>0})))},q=a===!0||Array.isArray(a)&&a.includes(0);return b.jsxs("div",{className:St(["react-flow__pane",{draggable:q,dragging:A,selection:e}]),onClick:k?void 0:Wh(F,B),onContextMenu:Wh(I,B),onWheel:Wh(Y,B),onPointerEnter:k?void 0:g,onPointerMove:k?V:y,onPointerUp:k?M:void 0,onPointerDownCapture:k?L:void 0,onClickCapture:k?Q:void 0,onPointerLeave:v,ref:B,style:of,children:[w,b.jsx(gO,{})]})}function Yp({id:e,store:t,unselect:r=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",er.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&u)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function nE({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:a,nodeId:o,isSelectable:l,nodeClickDistance:u}){const f=ut(),[h,d]=H.useState(!1),p=H.useRef();return H.useEffect(()=>{p.current=cj({getStoreItems:()=>f.getState(),onNodeMouseDown:g=>{Yp({id:g,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),H.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:r,handleSelector:a,domNode:e.current,isSelectable:l,nodeId:o,nodeClickDistance:u}),()=>{p.current?.destroy()}},[r,a,t,l,e,o,u]),h}const vO=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function rE(){const e=ut();return H.useCallback(r=>{const{nodeExtent:a,snapToGrid:o,snapGrid:l,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:p}=e.getState(),g=new Map,y=vO(u),v=o?l[0]:5,w=o?l[1]:5,C=r.direction.x*v*r.factor,N=r.direction.y*w*r.factor;for(const[,S]of d){if(!y(S))continue;let A={x:S.internals.positionAbsolute.x+C,y:S.internals.positionAbsolute.y+N};o&&(A=xl(A,l));const{position:_,positionAbsolute:k}=CS({nodeId:S.id,nextPosition:A,nodeLookup:d,nodeExtent:a,nodeOrigin:p,onError:f});S.position=_,S.internals.positionAbsolute=k,g.set(S.id,S)}h(g)},[])}const Fm=H.createContext(null),bO=Fm.Provider;Fm.Consumer;const iE=()=>H.useContext(Fm),wO=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),SO=(e,t,r)=>a=>{const{connectionClickStartHandle:o,connectionMode:l,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,p=h?.nodeId===e&&h?.id===t&&h?.type===r;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===r,connectingTo:p,clickConnecting:o?.nodeId===e&&o?.id===t&&o?.type===r,isPossibleEndHandle:l===yo.Strict?f?.type!==r:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:p&&d}};function EO({type:e="source",position:t=_e.Top,isValidConnection:r,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:p,onTouchStart:g,...y},v){const w=u||null,C=e==="target",N=ut(),S=iE(),{connectOnClick:A,noPanClassName:_,rfId:k}=Ve(wO,lt),{connectingFrom:B,connectingTo:T,clickConnecting:O,isPossibleEndHandle:U,connectionInProcess:P,clickConnectionInProcess:F,valid:I}=Ve(SO(S,w,e),lt);S||N.getState().onError?.("010",er.error010());const Y=V=>{const{defaultEdgeOptions:M,onConnect:q,hasDefaultEdges:X}=N.getState(),Z={...M,...V};if(X){const{edges:j,setEdges:z}=N.getState();z(X3(Z,j))}q?.(Z),f?.(Z)},Q=V=>{if(!S)return;const M=jS(V.nativeEvent);if(o&&(M&&V.button===0||!M)){const q=N.getState();qp.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:C,handleId:w,nodeId:S,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:(...X)=>N.getState().onConnectEnd?.(...X),updateConnection:q.updateConnection,onConnect:Y,isValidConnection:r||((...X)=>N.getState().isValidConnection?.(...X)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}M?p?.(V):g?.(V)},L=V=>{const{onClickConnectStart:M,onClickConnectEnd:q,connectionClickStartHandle:X,connectionMode:Z,isValidConnection:j,lib:z,rfId:$,nodeLookup:R,connection:te}=N.getState();if(!S||!X&&!o)return;if(!X){M?.(V.nativeEvent,{nodeId:S,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:S,type:e,id:w}});return}const ue=AS(V.target),fe=r||j,{connection:de,isValid:le}=qp.isValid(V.nativeEvent,{handle:{nodeId:S,id:w,type:e},connectionMode:Z,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:fe,flowId:$,doc:ue,lib:z,nodeLookup:R});le&&de&&Y(de);const pe=structuredClone(te);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,q?.(V,pe),N.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":w,"data-nodeid":S,"data-handlepos":t,"data-id":`${k}-${S}-${w}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,d,{source:!C,target:C,connectable:a,connectablestart:o,connectableend:l,clickconnecting:O,connectingfrom:B,connectingto:T,valid:I,connectionindicator:a&&(!P||U)&&(P||F?l:o)}]),onMouseDown:Q,onTouchStart:Q,onClick:A?L:void 0,ref:v,...y,children:h})}const Ic=H.memo(eE(EO));function CO({data:e,isConnectable:t,sourcePosition:r=_e.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(Ic,{type:"source",position:r,isConnectable:t})]})}function _O({data:e,isConnectable:t,targetPosition:r=_e.Top,sourcePosition:a=_e.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Ic,{type:"target",position:r,isConnectable:t}),e?.label,b.jsx(Ic,{type:"source",position:a,isConnectable:t})]})}function NO(){return null}function kO({data:e,isConnectable:t,targetPosition:r=_e.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Ic,{type:"target",position:r,isConnectable:t}),e?.label]})}const Bc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Lb={input:CO,default:_O,output:kO,group:NO};function MO(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 TO=e=>{const{width:t,height:r,x:a,y:o}=yl(e.nodeLookup,{filter:l=>!!l.selected});return{width:Hn(t)?t:null,height:Hn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function AO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const a=ut(),{width:o,height:l,transformString:u,userSelectionActive:f}=Ve(TO,lt),h=rE(),d=H.useRef(null);H.useEffect(()=>{r||d.current?.focus({preventScroll:!0})},[r]);const p=!f&&o!==null&&l!==null;if(nE({nodeRef:d,disabled:!p}),!p)return null;const g=e?v=>{const w=a.getState().nodes.filter(C=>C.selected);e(v,w)}:void 0,y=v=>{Object.prototype.hasOwnProperty.call(Bc,v.key)&&(v.preventDefault(),h({direction:Bc[v.key],factor:v.shiftKey?4:1}))};return b.jsx("div",{className:St(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:b.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:r?void 0:-1,onKeyDown:r?void 0:y,style:{width:o,height:l}})})}const Ib=typeof window<"u"?window:void 0,RO=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function aE({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:p,selectionMode:g,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:S,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:k,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:O,panOnDrag:U,defaultViewport:P,translateExtent:F,minZoom:I,maxZoom:Y,preventScrolling:Q,onSelectionContextMenu:L,noWheelClassName:V,noPanClassName:M,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:Z}){const{nodesSelectionActive:j,userSelectionActive:z}=Ve(RO,lt),$=ul(d,{target:Ib}),R=ul(C,{target:Ib}),te=R||U,ue=R||k,fe=p&&te!==!0,de=$||z||fe;return fO({deleteKeyCode:h,multiSelectionKeyCode:w}),b.jsx(pO,{onPaneContextMenu:l,elementsSelectable:S,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:ue,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:O,panOnDrag:!$&&te,defaultViewport:P,translateExtent:F,minZoom:I,maxZoom:Y,zoomActivationKeyCode:N,preventScrolling:Q,noWheelClassName:V,noPanClassName:M,onViewportChange:X,isControlledViewport:Z,paneClickDistance:f,selectionOnDrag:fe,children:b.jsxs(xO,{onSelectionStart:y,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:te,isSelecting:!!de,selectionMode:g,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,j&&b.jsx(AO,{onSelectionContextMenu:L,noPanClassName:M,disableKeyboardA11y:q})]})})}aE.displayName="FlowRenderer";const jO=H.memo(aE),OO=e=>t=>e?zm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function DO(e){return Ve(H.useCallback(OO(e),[e]),lt)}const zO=e=>e.updateNodeInternals;function LO(){const e=Ve(zO),[t]=H.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const a=new Map;r.forEach(o=>{const l=o.target.getAttribute("data-id");a.set(l,{id:l,nodeElement:o.target,force:!0})}),e(a)}));return H.useEffect(()=>()=>{t?.disconnect()},[t]),t}function IO({node:e,nodeType:t,hasDimensions:r,resizeObserver:a}){const o=ut(),l=H.useRef(null),u=H.useRef(null),f=H.useRef(e.sourcePosition),h=H.useRef(e.targetPosition),d=H.useRef(t),p=r&&!!e.internals.handleBounds;return H.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&a?.unobserve(u.current),a?.observe(l.current),u.current=l.current)},[p,e.hidden]),H.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),H.useEffect(()=>{if(l.current){const g=d.current!==t,y=f.current!==e.sourcePosition,v=h.current!==e.targetPosition;(g||y||v)&&(d.current=t,f.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function BO({id:e,onClick:t,onMouseEnter:r,onMouseMove:a,onMouseLeave:o,onContextMenu:l,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:p,resizeObserver:g,noDragClassName:y,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:N,nodeClickDistance:S,onError:A}){const{node:_,internals:k,isParent:B}=Ve(le=>{const pe=le.nodeLookup.get(e),we=le.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:we}},lt);let T=_.type||"default",O=N?.[T]||Lb[T];O===void 0&&(A?.("003",er.error003(T)),T="default",O=N?.default||Lb.default);const U=!!(_.draggable||f&&typeof _.draggable>"u"),P=!!(_.selectable||h&&typeof _.selectable>"u"),F=!!(_.connectable||d&&typeof _.connectable>"u"),I=!!(_.focusable||p&&typeof _.focusable>"u"),Y=ut(),Q=MS(_),L=IO({node:_,nodeType:T,hasDimensions:Q,resizeObserver:g}),V=nE({nodeRef:L,disabled:_.hidden||!U,noDragClassName:y,handleSelector:_.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:S}),M=rE();if(_.hidden)return null;const q=Ar(_),X=MO(_),Z=P||U||t||r||a||o,j=r?le=>r(le,{...k.userNode}):void 0,z=a?le=>a(le,{...k.userNode}):void 0,$=o?le=>o(le,{...k.userNode}):void 0,R=l?le=>l(le,{...k.userNode}):void 0,te=u?le=>u(le,{...k.userNode}):void 0,ue=le=>{const{selectNodesOnDrag:pe,nodeDragThreshold:we}=Y.getState();P&&(!pe||!U||we>0)&&Yp({id:e,store:Y,nodeRef:L}),t&&t(le,{...k.userNode})},fe=le=>{if(!(RS(le.nativeEvent)||w)){if(vS.includes(le.key)&&P){const pe=le.key==="Escape";Yp({id:e,store:Y,unselect:pe,nodeRef:L})}else if(U&&_.selected&&Object.prototype.hasOwnProperty.call(Bc,le.key)){le.preventDefault();const{ariaLabelConfig:pe}=Y.getState();Y.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:le.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),M({direction:Bc[le.key],factor:le.shiftKey?4:1})}}},de=()=>{if(w||!L.current?.matches(":focus-visible"))return;const{transform:le,width:pe,height:we,autoPanOnNodeFocus:Ee,setCenter:ve}=Y.getState();if(!Ee)return;zm(new Map([[e,_]]),{x:0,y:0,width:pe,height:we},le,!0).length>0||ve(_.position.x+q.width/2,_.position.y+q.height/2,{zoom:le[2]})};return b.jsx("div",{className:St(["react-flow__node",`react-flow__node-${T}`,{[v]:U},_.className,{selected:_.selected,selectable:P,parent:B,draggable:U,dragging:V}]),ref:L,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:Q?"visible":"hidden",..._.style,...X},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:z,onMouseLeave:$,onContextMenu:R,onClick:ue,onDoubleClick:te,onKeyDown:I?fe:void 0,tabIndex:I?0:void 0,onFocus:I?de:void 0,role:_.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${KS}-${C}`,"aria-label":_.ariaLabel,..._.domAttributes,children:b.jsx(bO,{value:e,children:b.jsx(O,{id:e,data:_.data,type:T,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:_.selected??!1,selectable:P,draggable:U,deletable:_.deletable??!0,isConnectable:F,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:k.z,parentId:_.parentId,...q})})})}var HO=H.memo(BO);const PO=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function oE(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:a,elementsSelectable:o,onError:l}=Ve(PO,lt),u=DO(e.onlyRenderVisibleElements),f=LO();return b.jsx("div",{className:"react-flow__nodes",style:of,children:u.map(h=>b.jsx(HO,{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:f,nodesDraggable:t,nodesConnectable:r,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:l},h))})}oE.displayName="NodeRenderer";const UO=H.memo(oE);function VO(e){return Ve(H.useCallback(r=>{if(!e)return r.edges.map(o=>o.id);const a=[];if(r.width&&r.height)for(const o of r.edges){const l=r.nodeLookup.get(o.source),u=r.nodeLookup.get(o.target);l&&u&&Y3({sourceNode:l,targetNode:u,width:r.width,height:r.height,transform:r.transform})&&a.push(o.id)}return a},[e]),lt)}const qO=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},FO=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Bb={[Dc.Arrow]:qO,[Dc.ArrowClosed]:FO};function YO(e){const t=ut();return H.useMemo(()=>Object.prototype.hasOwnProperty.call(Bb,e)?Bb[e]:(t.getState().onError?.("009",er.error009(e)),null),[e])}const $O=({id:e,type:t,color:r,width:a=12.5,height:o=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=YO(t);return h?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:b.jsx(h,{color:r,strokeWidth:u})}):null},sE=({defaultColor:e,rfId:t})=>{const r=Ve(l=>l.edges),a=Ve(l=>l.defaultEdgeOptions),o=H.useMemo(()=>J3(r,{id:t,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[r,a,t,e]);return o.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:o.map(l=>b.jsx($O,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};sE.displayName="MarkerDefinitions";var GO=H.memo(sE);function lE({x:e,y:t,label:r,labelStyle:a,labelShowBg:o=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...p}){const[g,y]=H.useState({x:1,y:0,width:0,height:0}),v=St(["react-flow__edge-textwrapper",d]),w=H.useRef(null);return H.useEffect(()=>{if(w.current){const C=w.current.getBBox();y({x:C.x,y:C.y,width:C.width,height:C.height})}},[r]),r?b.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...p,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:l,rx:f,ry:f}),b.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:w,style:a,children:r}),h]}):null}lE.displayName="EdgeText";const XO=H.memo(lE);function sf({path:e,labelX:t,labelY:r,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...p}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...p,d:e,fill:"none",className:St(["react-flow__edge-path",p.className])}),d?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&Hn(t)&&Hn(r)?b.jsx(XO,{x:t,y:r,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function Hb({pos:e,x1:t,y1:r,x2:a,y2:o}){return e===_e.Left||e===_e.Right?[.5*(t+a),r]:[t,.5*(r+o)]}function uE({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:a,targetY:o,targetPosition:l=_e.Top}){const[u,f]=Hb({pos:r,x1:e,y1:t,x2:a,y2:o}),[h,d]=Hb({pos:l,x1:a,y1:o,x2:e,y2:t}),[p,g,y,v]=OS({sourceX:e,sourceY:t,targetX:a,targetY:o,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${u},${f} ${h},${d} ${a},${o}`,p,g,y,v]}function cE(e){return H.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,interactionWidth:S})=>{const[A,_,k]=uE({sourceX:r,sourceY:a,sourcePosition:u,targetX:o,targetY:l,targetPosition:f}),B=e.isInternal?void 0:t;return b.jsx(sf,{id:B,path:A,labelX:_,labelY:k,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,interactionWidth:S})})}const QO=cE({isInternal:!1}),fE=cE({isInternal:!0});QO.displayName="SimpleBezierEdge";fE.displayName="SimpleBezierEdgeInternal";function dE(e){return H.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,sourcePosition:v=_e.Bottom,targetPosition:w=_e.Top,markerEnd:C,markerStart:N,pathOptions:S,interactionWidth:A})=>{const[_,k,B]=Pp({sourceX:r,sourceY:a,sourcePosition:v,targetX:o,targetY:l,targetPosition:w,borderRadius:S?.borderRadius,offset:S?.offset,stepPosition:S?.stepPosition}),T=e.isInternal?void 0:t;return b.jsx(sf,{id:T,path:_,labelX:k,labelY:B,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,markerEnd:C,markerStart:N,interactionWidth:A})})}const hE=dE({isInternal:!1}),pE=dE({isInternal:!0});hE.displayName="SmoothStepEdge";pE.displayName="SmoothStepEdgeInternal";function mE(e){return H.memo(({id:t,...r})=>{const a=e.isInternal?void 0:t;return b.jsx(hE,{...r,id:a,pathOptions:H.useMemo(()=>({borderRadius:0,offset:r.pathOptions?.offset}),[r.pathOptions?.offset])})})}const KO=mE({isInternal:!1}),gE=mE({isInternal:!0});KO.displayName="StepEdge";gE.displayName="StepEdgeInternal";function yE(e){return H.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[N,S,A]=LS({sourceX:r,sourceY:a,targetX:o,targetY:l}),_=e.isInternal?void 0:t;return b.jsx(sf,{id:_,path:N,labelX:S,labelY:A,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:C})})}const ZO=yE({isInternal:!1}),xE=yE({isInternal:!0});ZO.displayName="StraightEdge";xE.displayName="StraightEdgeInternal";function vE(e){return H.memo(({id:t,sourceX:r,sourceY:a,targetX:o,targetY:l,sourcePosition:u=_e.Bottom,targetPosition:f=_e.Top,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,pathOptions:S,interactionWidth:A})=>{const[_,k,B]=DS({sourceX:r,sourceY:a,sourcePosition:u,targetX:o,targetY:l,targetPosition:f,curvature:S?.curvature}),T=e.isInternal?void 0:t;return b.jsx(sf,{id:T,path:_,labelX:k,labelY:B,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,interactionWidth:A})})}const WO=vE({isInternal:!1}),bE=vE({isInternal:!0});WO.displayName="BezierEdge";bE.displayName="BezierEdgeInternal";const Pb={default:bE,straight:xE,step:gE,smoothstep:pE,simplebezier:fE},Ub={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},JO=(e,t,r)=>r===_e.Left?e-t:r===_e.Right?e+t:e,e4=(e,t,r)=>r===_e.Top?e-t:r===_e.Bottom?e+t:e,Vb="react-flow__edgeupdater";function qb({position:e,centerX:t,centerY:r,radius:a=10,onMouseDown:o,onMouseEnter:l,onMouseOut:u,type:f}){return b.jsx("circle",{onMouseDown:o,onMouseEnter:l,onMouseOut:u,className:St([Vb,`${Vb}-${f}`]),cx:JO(t,a,e),cy:e4(r,a,e),r:a,stroke:"transparent",fill:"transparent"})}function t4({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:a,sourceY:o,targetX:l,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:p,onReconnectEnd:g,setReconnecting:y,setUpdateHover:v}){const w=ut(),C=(k,B)=>{if(k.button!==0)return;const{autoPanOnConnect:T,domNode:O,connectionMode:U,connectionRadius:P,lib:F,onConnectStart:I,cancelConnection:Y,nodeLookup:Q,rfId:L,panBy:V,updateConnection:M}=w.getState(),q=B.type==="target",X=(z,$)=>{y(!1),g?.(z,r,B.type,$)},Z=z=>d?.(r,z),j=(z,$)=>{y(!0),p?.(k,r,B.type),I?.(z,$)};qp.onPointerDown(k.nativeEvent,{autoPanOnConnect:T,connectionMode:U,connectionRadius:P,domNode:O,handleId:B.id,nodeId:B.nodeId,nodeLookup:Q,isTarget:q,edgeUpdaterType:B.type,lib:F,flowId:L,cancelConnection:Y,panBy:V,isValidConnection:(...z)=>w.getState().isValidConnection?.(...z)??!0,onConnect:Z,onConnectStart:j,onConnectEnd:(...z)=>w.getState().onConnectEnd?.(...z),onReconnectEnd:X,updateConnection:M,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},N=k=>C(k,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),S=k=>C(k,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),A=()=>v(!0),_=()=>v(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(qb,{position:f,centerX:a,centerY:o,radius:t,onMouseDown:N,onMouseEnter:A,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&b.jsx(qb,{position:h,centerX:l,centerY:u,radius:t,onMouseDown:S,onMouseEnter:A,onMouseOut:_,type:"target"})]})}function n4({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:a,onClick:o,onDoubleClick:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:p,onReconnect:g,onReconnectStart:y,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:N,onError:S,disableKeyboardA11y:A}){let _=Ve(ve=>ve.edgeLookup.get(e));const k=Ve(ve=>ve.defaultEdgeOptions);_=k?{...k,..._}:_;let B=_.type||"default",T=C?.[B]||Pb[B];T===void 0&&(S?.("011",er.error011(B)),B="default",T=C?.default||Pb.default);const O=!!(_.focusable||t&&typeof _.focusable>"u"),U=typeof g<"u"&&(_.reconnectable||r&&typeof _.reconnectable>"u"),P=!!(_.selectable||a&&typeof _.selectable>"u"),F=H.useRef(null),[I,Y]=H.useState(!1),[Q,L]=H.useState(!1),V=ut(),{zIndex:M,sourceX:q,sourceY:X,targetX:Z,targetY:j,sourcePosition:z,targetPosition:$}=Ve(H.useCallback(ve=>{const Ce=ve.nodeLookup.get(_.source),ce=ve.nodeLookup.get(_.target);if(!Ce||!ce)return{zIndex:_.zIndex,...Ub};const ge=W3({id:e,sourceNode:Ce,targetNode:ce,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ve.connectionMode,onError:S});return{zIndex:F3({selected:_.selected,zIndex:_.zIndex,sourceNode:Ce,targetNode:ce,elevateOnSelect:ve.elevateEdgesOnSelect,zIndexMode:ve.zIndexMode}),...ge||Ub}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),lt),R=H.useMemo(()=>_.markerStart?`url('#${Up(_.markerStart,w)}')`:void 0,[_.markerStart,w]),te=H.useMemo(()=>_.markerEnd?`url('#${Up(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||q===null||X===null||Z===null||j===null)return null;const ue=ve=>{const{addSelectedEdges:Ce,unselectNodesAndEdges:ce,multiSelectionActive:ge}=V.getState();P&&(V.setState({nodesSelectionActive:!1}),_.selected&&ge?(ce({nodes:[],edges:[_]}),F.current?.blur()):Ce([e])),o&&o(ve,_)},fe=l?ve=>{l(ve,{..._})}:void 0,de=u?ve=>{u(ve,{..._})}:void 0,le=f?ve=>{f(ve,{..._})}:void 0,pe=h?ve=>{h(ve,{..._})}:void 0,we=d?ve=>{d(ve,{..._})}:void 0,Ee=ve=>{if(!A&&vS.includes(ve.key)&&P){const{unselectNodesAndEdges:Ce,addSelectedEdges:ce}=V.getState();ve.key==="Escape"?(F.current?.blur(),Ce({edges:[_]})):ce([e])}};return b.jsx("svg",{style:{zIndex:M},children:b.jsxs("g",{className:St(["react-flow__edge",`react-flow__edge-${B}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!P&&!o,updating:I,selectable:P}]),onClick:ue,onDoubleClick:fe,onContextMenu:de,onMouseEnter:le,onMouseMove:pe,onMouseLeave:we,onKeyDown:O?Ee:void 0,tabIndex:O?0:void 0,role:_.ariaRole??(O?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":O?`${ZS}-${w}`:void 0,ref:F,..._.domAttributes,children:[!Q&&b.jsx(T,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:P,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:q,sourceY:X,targetX:Z,targetY:j,sourcePosition:z,targetPosition:$,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:R,markerEnd:te,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),U&&b.jsx(t4,{edge:_,isReconnectable:U,reconnectRadius:p,onReconnect:g,onReconnectStart:y,onReconnectEnd:v,sourceX:q,sourceY:X,targetX:Z,targetY:j,sourcePosition:z,targetPosition:$,setUpdateHover:Y,setReconnecting:L})]})})}var r4=H.memo(n4);const i4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function wE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:a,noPanClassName:o,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:p,reconnectRadius:g,onEdgeDoubleClick:y,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:N,edgesReconnectable:S,elementsSelectable:A,onError:_}=Ve(i4,lt),k=VO(t);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(GO,{defaultColor:e,rfId:r}),k.map(B=>b.jsx(r4,{id:B,edgesFocusable:N,edgesReconnectable:S,elementsSelectable:A,noPanClassName:o,onReconnect:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:p,reconnectRadius:g,onDoubleClick:y,onReconnectStart:v,onReconnectEnd:w,rfId:r,onError:_,edgeTypes:a,disableKeyboardA11y:C},B))]})}wE.displayName="EdgeRenderer";const a4=H.memo(wE),o4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function s4({children:e}){const t=Ve(o4);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function l4(e){const t=qm(),r=H.useRef(!1);H.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const u4=e=>e.panZoom?.syncViewport;function c4(e){const t=Ve(u4),r=ut();return H.useEffect(()=>{e&&(t?.(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function f4(e){return e.connection.inProgress?{...e.connection,to:vl(e.connection.to,e.transform)}:{...e.connection}}function d4(e){return f4}function h4(e){const t=d4();return Ve(t,lt)}const p4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function m4({containerStyle:e,style:t,type:r,component:a}){const{nodesConnectable:o,width:l,height:u,isValid:f,inProgress:h}=Ve(p4,lt);return!(l&&o&&h)?null:b.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:St(["react-flow__connection",SS(f)]),children:b.jsx(SE,{style:t,type:r,CustomComponent:a,isValid:f})})})}const SE=({style:e,type:t=ui.Bezier,CustomComponent:r,isValid:a})=>{const{inProgress:o,from:l,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:p,toHandle:g,toPosition:y,pointer:v}=h4();if(!o)return;if(r)return b.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:y,connectionStatus:SS(a),toNode:p,toHandle:g,pointer:v});let w="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:y};switch(t){case ui.Bezier:[w]=DS(C);break;case ui.SimpleBezier:[w]=uE(C);break;case ui.Step:[w]=Pp({...C,borderRadius:0});break;case ui.SmoothStep:[w]=Pp(C);break;default:[w]=LS(C)}return b.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};SE.displayName="ConnectionLine";const g4={};function Fb(e=g4){H.useRef(e),ut(),H.useEffect(()=>{},[e])}function y4(){ut(),H.useRef(!1),H.useEffect(()=>{},[])}function EE({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:N,connectionLineContainerStyle:S,selectionKeyCode:A,selectionOnDrag:_,selectionMode:k,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:O,deleteKeyCode:U,onlyRenderVisibleElements:P,elementsSelectable:F,defaultViewport:I,translateExtent:Y,minZoom:Q,maxZoom:L,preventScrolling:V,defaultMarkerColor:M,zoomOnScroll:q,zoomOnPinch:X,panOnScroll:Z,panOnScrollSpeed:j,panOnScrollMode:z,zoomOnDoubleClick:$,panOnDrag:R,onPaneClick:te,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:de,onPaneScroll:le,onPaneContextMenu:pe,paneClickDistance:we,nodeClickDistance:Ee,onEdgeContextMenu:ve,onEdgeMouseEnter:Ce,onEdgeMouseMove:ce,onEdgeMouseLeave:ge,reconnectRadius:be,onReconnect:De,onReconnectStart:qe,onReconnectEnd:Fe,noDragClassName:_t,noWheelClassName:Ot,noPanClassName:on,disableKeyboardA11y:wn,nodeExtent:Te,rfId:ct,viewport:ie,onViewportChange:me}){return Fb(e),Fb(t),y4(),l4(r),c4(ie),b.jsx(jO,{onPaneClick:te,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:de,onPaneContextMenu:pe,onPaneScroll:le,paneClickDistance:we,deleteKeyCode:U,selectionKeyCode:A,selectionOnDrag:_,selectionMode:k,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:O,elementsSelectable:F,zoomOnScroll:q,zoomOnPinch:X,zoomOnDoubleClick:$,panOnScroll:Z,panOnScrollSpeed:j,panOnScrollMode:z,panOnDrag:R,defaultViewport:I,translateExtent:Y,minZoom:Q,maxZoom:L,onSelectionContextMenu:g,preventScrolling:V,noDragClassName:_t,noWheelClassName:Ot,noPanClassName:on,disableKeyboardA11y:wn,onViewportChange:me,isControlledViewport:!!ie,children:b.jsxs(s4,{children:[b.jsx(a4,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:De,onReconnectStart:qe,onReconnectEnd:Fe,onlyRenderVisibleElements:P,onEdgeContextMenu:ve,onEdgeMouseEnter:Ce,onEdgeMouseMove:ce,onEdgeMouseLeave:ge,reconnectRadius:be,defaultMarkerColor:M,noPanClassName:on,disableKeyboardA11y:wn,rfId:ct}),b.jsx(m4,{style:C,type:w,component:N,containerStyle:S}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(UO,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:p,nodeClickDistance:Ee,onlyRenderVisibleElements:P,noPanClassName:on,noDragClassName:_t,disableKeyboardA11y:wn,nodeExtent:Te,rfId:ct}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}EE.displayName="GraphView";const x4=H.memo(EE),Yb=({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:p,nodeExtent:g,zIndexMode:y="basic"}={})=>{const v=new Map,w=new Map,C=new Map,N=new Map,S=a??t??[],A=r??e??[],_=p??[0,0],k=g??al;HS(C,N,S);const{nodesInitialized:B}=Vp(A,v,w,{nodeOrigin:_,nodeExtent:k,zIndexMode:y});let T=[0,0,1];if(u&&o&&l){const O=yl(v,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:U,y:P,zoom:F}=Lm(O,o,l,h,d,f?.padding??.1);T=[U,P,F]}return{rfId:"1",width:o??0,height:l??0,transform:T,nodes:A,nodesInitialized:B,nodeLookup:v,parentLookup:w,edges:S,edgeLookup:N,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:al,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...wS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:B3,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:bS,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},v4=({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:p,nodeExtent:g,zIndexMode:y})=>Lj((v,w)=>{async function C(){const{nodeLookup:N,panZoom:S,fitViewOptions:A,fitViewResolver:_,width:k,height:B,minZoom:T,maxZoom:O}=w();S&&(await L3({nodes:N,width:k,height:B,panZoom:S,minZoom:T,maxZoom:O},A),_?.resolve(!0),v({fitViewResolver:null}))}return{...Yb({nodes:e,edges:t,width:o,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:p,nodeExtent:g,defaultNodes:r,defaultEdges:a,zIndexMode:y}),setNodes:N=>{const{nodeLookup:S,parentLookup:A,nodeOrigin:_,elevateNodesOnSelect:k,fitViewQueued:B,zIndexMode:T,nodesSelectionActive:O}=w(),{nodesInitialized:U,hasSelectedNodes:P}=Vp(N,S,A,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:T}),F=O&&P;B&&U?(C(),v({nodes:N,nodesInitialized:U,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:F})):v({nodes:N,nodesInitialized:U,nodesSelectionActive:F})},setEdges:N=>{const{connectionLookup:S,edgeLookup:A}=w();HS(S,A,N),v({edges:N})},setDefaultNodesAndEdges:(N,S)=>{if(N){const{setNodes:A}=w();A(N),v({hasDefaultNodes:!0})}if(S){const{setEdges:A}=w();A(S),v({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:S,nodeLookup:A,parentLookup:_,domNode:k,nodeOrigin:B,nodeExtent:T,debug:O,fitViewQueued:U,zIndexMode:P}=w(),{changes:F,updatedInternals:I}=oj(N,A,_,k,B,T,P);I&&(nj(A,_,{nodeOrigin:B,nodeExtent:T,zIndexMode:P}),U?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),F?.length>0&&(O&&console.log("React Flow: trigger node changes",F),S?.(F)))},updateNodePositions:(N,S=!1)=>{const A=[];let _=[];const{nodeLookup:k,triggerNodeChanges:B,connection:T,updateConnection:O,onNodesChangeMiddlewareMap:U}=w();for(const[P,F]of N){const I=k.get(P),Y=!!(I?.expandParent&&I?.parentId&&F?.position),Q={id:P,type:"position",position:Y?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:S};if(I&&T.inProgress&&T.fromNode.id===I.id){const L=ia(I,T.fromHandle,_e.Left,!0);O({...T,from:L})}Y&&I.parentId&&A.push({id:P,parentId:I.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),_.push(Q)}if(A.length>0){const{parentLookup:P,nodeOrigin:F}=w(),I=Vm(A,k,P,F);_.push(...I)}for(const P of U.values())_=P(_);B(_)},triggerNodeChanges:N=>{const{onNodesChange:S,setNodes:A,nodes:_,hasDefaultNodes:k,debug:B}=w();if(N?.length){if(k){const T=rO(N,_);A(T)}B&&console.log("React Flow: trigger node changes",N),S?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:S,setEdges:A,edges:_,hasDefaultEdges:k,debug:B}=w();if(N?.length){if(k){const T=iO(N,_);A(T)}B&&console.log("React Flow: trigger edge changes",N),S?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:S,edgeLookup:A,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:B}=w();if(S){const T=N.map(O=>Ui(O,!0));k(T);return}k(ro(_,new Set([...N]),!0)),B(ro(A))},addSelectedEdges:N=>{const{multiSelectionActive:S,edgeLookup:A,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:B}=w();if(S){const T=N.map(O=>Ui(O,!0));B(T);return}B(ro(A,new Set([...N]))),k(ro(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:S}={})=>{const{edges:A,nodes:_,nodeLookup:k,triggerNodeChanges:B,triggerEdgeChanges:T}=w(),O=N||_,U=S||A,P=[];for(const I of O){if(!I.selected)continue;const Y=k.get(I.id);Y&&(Y.selected=!1),P.push(Ui(I.id,!1))}const F=[];for(const I of U)I.selected&&F.push(Ui(I.id,!1));B(P),T(F)},setMinZoom:N=>{const{panZoom:S,maxZoom:A}=w();S?.setScaleExtent([N,A]),v({minZoom:N})},setMaxZoom:N=>{const{panZoom:S,minZoom:A}=w();S?.setScaleExtent([A,N]),v({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),v({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:S,triggerNodeChanges:A,triggerEdgeChanges:_,elementsSelectable:k}=w();if(!k)return;const B=S.reduce((O,U)=>U.selected?[...O,Ui(U.id,!1)]:O,[]),T=N.reduce((O,U)=>U.selected?[...O,Ui(U.id,!1)]:O,[]);A(B),_(T)},setNodeExtent:N=>{const{nodes:S,nodeLookup:A,parentLookup:_,nodeOrigin:k,elevateNodesOnSelect:B,nodeExtent:T,zIndexMode:O}=w();N[0][0]===T[0][0]&&N[0][1]===T[0][1]&&N[1][0]===T[1][0]&&N[1][1]===T[1][1]||(Vp(S,A,_,{nodeOrigin:k,nodeExtent:N,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:O}),v({nodeExtent:N}))},panBy:N=>{const{transform:S,width:A,height:_,panZoom:k,translateExtent:B}=w();return sj({delta:N,panZoom:k,transform:S,translateExtent:B,width:A,height:_})},setCenter:async(N,S,A)=>{const{width:_,height:k,maxZoom:B,panZoom:T}=w();if(!T)return Promise.resolve(!1);const O=typeof A?.zoom<"u"?A.zoom:B;return await T.setViewport({x:_/2-N*O,y:k/2-S*O,zoom:O},{duration:A?.duration,ease:A?.ease,interpolate:A?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...wS}})},updateConnection:N=>{v({connection:N})},reset:()=>v({...Yb()})}},Object.is);function b4({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:a,initialWidth:o,initialHeight:l,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:p,nodeExtent:g,zIndexMode:y,children:v}){const[w]=H.useState(()=>v4({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:p,nodeExtent:g,zIndexMode:y}));return b.jsx(Ij,{value:w,children:b.jsx(sO,{children:v})})}function w4({children:e,nodes:t,edges:r,defaultNodes:a,defaultEdges:o,width:l,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:p,nodeOrigin:g,nodeExtent:y,zIndexMode:v}){return H.useContext(rf)?b.jsx(b.Fragment,{children:e}):b.jsx(b4,{initialNodes:t,initialEdges:r,defaultNodes:a,defaultEdges:o,initialWidth:l,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:p,nodeOrigin:g,nodeExtent:y,zIndexMode:v,children:e})}const S4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function E4({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,className:o,nodeTypes:l,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:p,onMoveStart:g,onMoveEnd:y,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:S,onNodeMouseEnter:A,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:B,onNodeDoubleClick:T,onNodeDragStart:O,onNodeDrag:U,onNodeDragStop:P,onNodesDelete:F,onEdgesDelete:I,onDelete:Y,onSelectionChange:Q,onSelectionDragStart:L,onSelectionDrag:V,onSelectionDragStop:M,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:Z,onBeforeDelete:j,connectionMode:z,connectionLineType:$=ui.Bezier,connectionLineStyle:R,connectionLineComponent:te,connectionLineContainerStyle:ue,deleteKeyCode:fe="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:le=!1,selectionMode:pe=ol.Full,panActivationKeyCode:we="Space",multiSelectionKeyCode:Ee=ll()?"Meta":"Control",zoomActivationKeyCode:ve=ll()?"Meta":"Control",snapToGrid:Ce,snapGrid:ce,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:be,nodesDraggable:De,autoPanOnNodeFocus:qe,nodesConnectable:Fe,nodesFocusable:_t,nodeOrigin:Ot=WS,edgesFocusable:on,edgesReconnectable:wn,elementsSelectable:Te=!0,defaultViewport:ct=Kj,minZoom:ie=.5,maxZoom:me=2,translateExtent:Ne=al,preventScrolling:ze=!0,nodeExtent:Ue,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:jn=!0,zoomOnPinch:kt=!0,panOnScroll:ht=!1,panOnScrollSpeed:Dt=.5,panOnScrollMode:Qe=Ji.Free,zoomOnDoubleClick:Vn=!0,panOnDrag:sn=!0,onPaneClick:ff,onPaneMouseEnter:ua,onPaneMouseMove:ca,onPaneMouseLeave:fa,onPaneScroll:rr,onPaneContextMenu:da,paneClickDistance:xi=1,nodeClickDistance:df=0,children:Sl,onReconnect:Mo,onReconnectStart:vi,onReconnectEnd:hf,onEdgeContextMenu:El,onEdgeDoubleClick:Cl,onEdgeMouseEnter:_l,onEdgeMouseMove:To,onEdgeMouseLeave:Ao,reconnectRadius:Nl=10,onNodesChange:kl,onEdgesChange:qn,noDragClassName:Et="nodrag",noWheelClassName:zt="nowheel",noPanClassName:ir="nopan",fitView:ha,fitViewOptions:Ml,connectOnClick:pf,attributionPosition:Tl,proOptions:bi,defaultEdgeOptions:Ro,elevateNodesOnSelect:Rr=!0,elevateEdgesOnSelect:jr=!1,disableKeyboardA11y:Or=!1,autoPanOnConnect:Dr,autoPanOnNodeDrag:gt,autoPanSpeed:Al,connectionRadius:Rl,isValidConnection:ar,onError:zr,style:mf,id:jo,nodeDragThreshold:jl,connectionDragThreshold:gf,viewport:pa,onViewportChange:ma,width:On,height:qt,colorMode:Ol="light",debug:yf,onScroll:ga,ariaLabelConfig:Dl,zIndexMode:wi="basic",...xf},Ft){const Si=jo||"1",zl=eO(Ol),Oo=H.useCallback(or=>{or.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ga?.(or)},[ga]);return b.jsx("div",{"data-testid":"rf__wrapper",...xf,onScroll:Oo,style:{...mf,...S4},ref:Ft,className:St(["react-flow",o,zl]),id:jo,role:"application",children:b.jsxs(w4,{nodes:e,edges:t,width:On,height:qt,fitView:ha,fitViewOptions:Ml,minZoom:ie,maxZoom:me,nodeOrigin:Ot,nodeExtent:Ue,zIndexMode:wi,children:[b.jsx(Jj,{nodes:e,edges:t,defaultNodes:r,defaultEdges:a,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:S,nodesDraggable:De,autoPanOnNodeFocus:qe,nodesConnectable:Fe,nodesFocusable:_t,edgesFocusable:on,edgesReconnectable:wn,elementsSelectable:Te,elevateNodesOnSelect:Rr,elevateEdgesOnSelect:jr,minZoom:ie,maxZoom:me,nodeExtent:Ue,onNodesChange:kl,onEdgesChange:qn,snapToGrid:Ce,snapGrid:ce,connectionMode:z,translateExtent:Ne,connectOnClick:pf,defaultEdgeOptions:Ro,fitView:ha,fitViewOptions:Ml,onNodesDelete:F,onEdgesDelete:I,onDelete:Y,onNodeDragStart:O,onNodeDrag:U,onNodeDragStop:P,onSelectionDrag:V,onSelectionDragStart:L,onSelectionDragStop:M,onMove:p,onMoveStart:g,onMoveEnd:y,noPanClassName:ir,nodeOrigin:Ot,rfId:Si,autoPanOnConnect:Dr,autoPanOnNodeDrag:gt,autoPanSpeed:Al,onError:zr,connectionRadius:Rl,isValidConnection:ar,selectNodesOnDrag:be,nodeDragThreshold:jl,connectionDragThreshold:gf,onBeforeDelete:j,debug:yf,ariaLabelConfig:Dl,zIndexMode:wi}),b.jsx(x4,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:A,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:B,onNodeDoubleClick:T,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:R,connectionLineComponent:te,connectionLineContainerStyle:ue,selectionKeyCode:de,selectionOnDrag:le,selectionMode:pe,deleteKeyCode:fe,multiSelectionKeyCode:Ee,panActivationKeyCode:we,zoomActivationKeyCode:ve,onlyRenderVisibleElements:ge,defaultViewport:ct,translateExtent:Ne,minZoom:ie,maxZoom:me,preventScrolling:ze,zoomOnScroll:jn,zoomOnPinch:kt,zoomOnDoubleClick:Vn,panOnScroll:ht,panOnScrollSpeed:Dt,panOnScrollMode:Qe,panOnDrag:sn,onPaneClick:ff,onPaneMouseEnter:ua,onPaneMouseMove:ca,onPaneMouseLeave:fa,onPaneScroll:rr,onPaneContextMenu:da,paneClickDistance:xi,nodeClickDistance:df,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:Z,onReconnect:Mo,onReconnectStart:vi,onReconnectEnd:hf,onEdgeContextMenu:El,onEdgeDoubleClick:Cl,onEdgeMouseEnter:_l,onEdgeMouseMove:To,onEdgeMouseLeave:Ao,reconnectRadius:Nl,defaultMarkerColor:Ht,noDragClassName:Et,noWheelClassName:zt,noPanClassName:ir,rfId:Si,disableKeyboardA11y:Or,nodeExtent:Ue,viewport:pa,onViewportChange:ma}),b.jsx(Qj,{onSelectionChange:Q}),Sl,b.jsx(Fj,{proOptions:bi,position:Tl}),b.jsx(qj,{rfId:Si,disableKeyboardA11y:Or})]})})}var C4=eE(E4);function _4({dimensions:e,lineWidth:t,variant:r,className:a}){return b.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:St(["react-flow__background-pattern",r,a])})}function N4({radius:e,className:t}){return b.jsx("circle",{cx:e,cy:e,r:e,className:St(["react-flow__background-pattern","dots",t])})}var gi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gi||(gi={}));const k4={[gi.Dots]:1,[gi.Lines]:1,[gi.Cross]:6},M4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function CE({id:e,variant:t=gi.Dots,gap:r=20,size:a,lineWidth:o=1,offset:l=0,color:u,bgColor:f,style:h,className:d,patternClassName:p}){const g=H.useRef(null),{transform:y,patternId:v}=Ve(M4,lt),w=a||k4[t],C=t===gi.Dots,N=t===gi.Cross,S=Array.isArray(r)?r:[r,r],A=[S[0]*y[2]||1,S[1]*y[2]||1],_=w*y[2],k=Array.isArray(l)?l:[l,l],B=N?[_,_]:A,T=[k[0]*y[2]||1+B[0]/2,k[1]*y[2]||1+B[1]/2],O=`${v}${e||""}`;return b.jsxs("svg",{className:St(["react-flow__background",d]),style:{...h,...of,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[b.jsx("pattern",{id:O,x:y[0]%A[0],y:y[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:C?b.jsx(N4,{radius:_/2,className:p}):b.jsx(_4,{dimensions:B,lineWidth:o,variant:t,className:p})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}CE.displayName="Background";H.memo(CE);function T4(){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 A4(){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 R4(){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 j4(){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 O4(){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 rc({children:e,className:t,...r}){return b.jsx("button",{type:"button",className:St(["react-flow__controls-button",t]),...r,children:e})}const D4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function _E({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:p,position:g="bottom-left",orientation:y="vertical","aria-label":v}){const w=ut(),{isInteractive:C,minZoomReached:N,maxZoomReached:S,ariaLabelConfig:A}=Ve(D4,lt),{zoomIn:_,zoomOut:k,fitView:B}=qm(),T=()=>{_(),l?.()},O=()=>{k(),u?.()},U=()=>{B(o),f?.()},P=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),h?.(!C)},F=y==="horizontal"?"horizontal":"vertical";return b.jsxs(af,{className:St(["react-flow__controls",F,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":v??A["controls.ariaLabel"],children:[t&&b.jsxs(b.Fragment,{children:[b.jsx(rc,{onClick:T,className:"react-flow__controls-zoomin",title:A["controls.zoomIn.ariaLabel"],"aria-label":A["controls.zoomIn.ariaLabel"],disabled:S,children:b.jsx(T4,{})}),b.jsx(rc,{onClick:O,className:"react-flow__controls-zoomout",title:A["controls.zoomOut.ariaLabel"],"aria-label":A["controls.zoomOut.ariaLabel"],disabled:N,children:b.jsx(A4,{})})]}),r&&b.jsx(rc,{className:"react-flow__controls-fitview",onClick:U,title:A["controls.fitView.ariaLabel"],"aria-label":A["controls.fitView.ariaLabel"],children:b.jsx(R4,{})}),a&&b.jsx(rc,{className:"react-flow__controls-interactive",onClick:P,title:A["controls.interactive.ariaLabel"],"aria-label":A["controls.interactive.ariaLabel"],children:C?b.jsx(O4,{}):b.jsx(j4,{})}),p]})}_E.displayName="Controls";H.memo(_E);function z4({id:e,x:t,y:r,width:a,height:o,style:l,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:p,shapeRendering:g,selected:y,onClick:v}){const{background:w,backgroundColor:C}=l||{},N=u||w||C;return b.jsx("rect",{className:St(["react-flow__minimap-node",{selected:y},d]),x:t,y:r,rx:p,ry:p,width:a,height:o,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:g,onClick:v?S=>v(S,e):void 0})}const L4=H.memo(z4),I4=e=>e.nodes.map(t=>t.id),Jh=e=>e instanceof Function?e:()=>e;function B4({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l=L4,onClick:u}){const f=Ve(I4,lt),h=Jh(t),d=Jh(e),p=Jh(r),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:f.map(y=>b.jsx(P4,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:p,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:l,onClick:u,shapeRendering:g},y))})}function H4({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:p,y:g,width:y,height:v}=Ve(w=>{const C=w.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const N=C.internals.userNode,{x:S,y:A}=C.internals.positionAbsolute,{width:_,height:k}=Ar(N);return{node:N,x:S,y:A,width:_,height:k}},lt);return!d||d.hidden||!MS(d)?null:b.jsx(f,{x:p,y:g,width:y,height:v,style:d.style,selected:!!d.selected,className:a(d),color:t(d),borderRadius:o,strokeColor:r(d),strokeWidth:l,shapeRendering:u,onClick:h,id:d.id})}const P4=H.memo(H4);var U4=H.memo(B4);const V4=200,q4=150,F4=e=>!e.hidden,Y4=e=>{const t={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:t,boundingRect:e.nodeLookup.size>0?kS(yl(e.nodeLookup,{filter:F4}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},$4="react-flow__minimap-desc";function NE({style:e,className:t,nodeStrokeColor:r,nodeColor:a,nodeClassName:o="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:p,maskStrokeWidth:g,position:y="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:N=!1,ariaLabel:S,inversePan:A,zoomStep:_=1,offsetScale:k=5}){const B=ut(),T=H.useRef(null),{boundingRect:O,viewBB:U,rfId:P,panZoom:F,translateExtent:I,flowWidth:Y,flowHeight:Q,ariaLabelConfig:L}=Ve(Y4,lt),V=e?.width??V4,M=e?.height??q4,q=O.width/V,X=O.height/M,Z=Math.max(q,X),j=Z*V,z=Z*M,$=k*Z,R=O.x-(j-O.width)/2-$,te=O.y-(z-O.height)/2-$,ue=j+$*2,fe=z+$*2,de=`${$4}-${P}`,le=H.useRef(0),pe=H.useRef();le.current=Z,H.useEffect(()=>{if(T.current&&F)return pe.current=gj({domNode:T.current,panZoom:F,getTransform:()=>B.getState().transform,getViewScale:()=>le.current}),()=>{pe.current?.destroy()}},[F]),H.useEffect(()=>{pe.current?.update({translateExtent:I,width:Y,height:Q,inversePan:A,pannable:C,zoomStep:_,zoomable:N})},[C,N,A,_,I,Y,Q]);const we=v?Ce=>{const[ce,ge]=pe.current?.pointer(Ce)||[0,0];v(Ce,{x:ce,y:ge})}:void 0,Ee=w?H.useCallback((Ce,ce)=>{const ge=B.getState().nodeLookup.get(ce).internals.userNode;w(Ce,ge)},[]):void 0,ve=S??L["minimap.ariaLabel"];return b.jsx(af,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Z:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:St(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:V,height:M,viewBox:`${R} ${te} ${ue} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:T,onClick:we,children:[ve&&b.jsx("title",{id:de,children:ve}),b.jsx(U4,{onClick:Ee,nodeColor:a,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:f}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${R-$},${te-$}h${ue+$*2}v${fe+$*2}h${-ue-$*2}z
15
- M${U.x},${U.y}h${U.width}v${U.height}h${-U.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}NE.displayName="MiniMap";H.memo(NE);const G4=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,X4={[wo.Line]:"right",[wo.Handle]:"bottom-right"};function Q4({nodeId:e,position:t,variant:r=wo.Handle,className:a,style:o=void 0,children:l,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:y,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:N,onResizeEnd:S}){const A=iE(),_=typeof e=="string"?e:A,k=ut(),B=H.useRef(null),T=r===wo.Handle,O=Ve(H.useCallback(G4(T&&v),[T,v]),lt),U=H.useRef(null),P=t??X4[r];H.useEffect(()=>{if(!(!B.current||!_))return U.current||(U.current=Aj({domNode:B.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:I,transform:Y,snapGrid:Q,snapToGrid:L,nodeOrigin:V,domNode:M}=k.getState();return{nodeLookup:I,transform:Y,snapGrid:Q,snapToGrid:L,nodeOrigin:V,paneDomNode:M}},onChange:(I,Y)=>{const{triggerNodeChanges:Q,nodeLookup:L,parentLookup:V,nodeOrigin:M}=k.getState(),q=[],X={x:I.x,y:I.y},Z=L.get(_);if(Z&&Z.expandParent&&Z.parentId){const j=Z.origin??M,z=I.width??Z.measured.width??0,$=I.height??Z.measured.height??0,R={id:Z.id,parentId:Z.parentId,rect:{width:z,height:$,...TS({x:I.x??Z.position.x,y:I.y??Z.position.y},{width:z,height:$},Z.parentId,L,j)}},te=Vm([R],L,V,M);q.push(...te),X.x=I.x?Math.max(j[0]*z,I.x):void 0,X.y=I.y?Math.max(j[1]*$,I.y):void 0}if(X.x!==void 0&&X.y!==void 0){const j={id:_,type:"position",position:{...X}};q.push(j)}if(I.width!==void 0&&I.height!==void 0){const z={id:_,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};q.push(z)}for(const j of Y){const z={...j,type:"position"};q.push(z)}Q(q)},onEnd:({width:I,height:Y})=>{const Q={id:_,type:"dimensions",resizing:!1,dimensions:{width:I,height:Y}};k.getState().triggerNodeChanges([Q])}})),U.current.update({controlPosition:P,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:p},keepAspectRatio:g,resizeDirection:y,onResizeStart:C,onResize:N,onResizeEnd:S,shouldResize:w}),()=>{U.current?.destroy()}},[P,f,h,d,p,g,C,N,S,w]);const F=P.split("-");return b.jsx("div",{className:St(["react-flow__resize-control","nodrag",...F,r,a]),ref:B,style:{...o,scale:O,...u&&{[T?"backgroundColor":"borderColor"]:u}},children:l})}H.memo(Q4);const $b=268,Gb=112,Za=56,$p=220,Xb=172,Gp=124,Qb=104,Kb=600;function K4(e){if(e.nodes.length===0)return{nodes:[],edges:[],graphWidth:Za*2,graphHeight:Za*2,currentNodeId:null,startNodeId:null,latestBranchNodeId:null,summary:{currentNodeLabel:"No active node",lineageNodeCount:0,sideNodeCount:0,alternateBranchCount:0,blockedAttemptCount:0}};const t=new Map(e.nodes.map(F=>[F.nodeId,F])),r=new Map;for(const F of e.nodes){if(!F.parentNodeId)continue;const I=r.get(F.parentNodeId)??[];I.push(F),r.set(F.parentNodeId,I)}for(const F of r.values())F.sort((I,Y)=>I.createdAtEventIndex-Y.createdAtEventIndex);const a=Z4(e),o=a?W4(a,t):new Set,l=J4(e.nodes,t),u=new Map,f=new Map,h=new Map,d=new Set,p=new Set;let g=0,y=0;const v=()=>{g+=1;const F=Math.ceil(g/2);return g%2===1?-F:F},w=(F,I,Y,Q)=>{if(u.has(F))return;u.set(F,I),f.set(F,Y),h.set(F,Q);const L=r.get(F)??[];if(L.length===0)return;const[V,...M]=L;V&&w(V.nodeId,I,Y,Q);let q=1;for(const X of M){const Z=I<0?I-q:I+q;w(X.nodeId,Z,Y,Q),q+=1}},C=[...o].sort((F,I)=>(l.get(F)??0)-(l.get(I)??0));for(const F of C){u.set(F,0),f.set(F,"active"),h.set(F,null);const I=r.get(F)??[];for(const Y of I){if(o.has(Y.nodeId))continue;y+=1;const Q=Y.nodeKind==="blocked_attempt"?"blocked":"alternate";Q==="blocked"?p.add(Y.nodeId):d.add(Y.nodeId),w(Y.nodeId,v(),Q,y)}}const N=e.nodes.filter(F=>!F.parentNodeId||!t.has(F.parentNodeId)).sort((F,I)=>F.createdAtEventIndex-I.createdAtEventIndex);for(const F of N)if(!u.has(F.nodeId)){if(!o.has(F.nodeId)){y+=1;const I=F.nodeKind==="blocked_attempt"?"blocked":"alternate";I==="blocked"?p.add(F.nodeId):d.add(F.nodeId),w(F.nodeId,v(),I,y);continue}u.set(F.nodeId,0),f.set(F.nodeId,"active"),h.set(F.nodeId,null)}for(const F of e.nodes)if(!u.has(F.nodeId)){y+=1;const I=F.nodeKind==="blocked_attempt"?"blocked":"alternate";I==="blocked"?p.add(F.nodeId):d.add(F.nodeId),w(F.nodeId,v(),I,y)}const S=Math.min(...u.values()),A=Math.max(...u.values()),_=eD(e.nodes,l,t,o),k=e.nodes.map(F=>{const I=o.has(F.nodeId),Y=_.get(F.nodeId)??0;return{node:F,depth:Y,lane:u.get(F.nodeId)??0,x:Kb+Za+Y*$b,y:Za+((u.get(F.nodeId)??0)-S)*Gb,isActiveLineage:I,isCurrent:F.nodeId===a,branchKind:f.get(F.nodeId)??"alternate",branchIndex:h.get(F.nodeId)??null}}),B=k.reduce((F,I)=>Math.max(F,I.depth),0),T=a?t.get(a)??null:null,O=[...d,...p].map(F=>t.get(F)).filter(F=>!!F).sort((F,I)=>I.createdAtEventIndex-F.createdAtEventIndex)[0]??null,U={currentNodeLabel:T?.stepLabel??(T?Ym(T.nodeId):"No active node"),lineageNodeCount:o.size,sideNodeCount:e.nodes.length-o.size,alternateBranchCount:d.size,blockedAttemptCount:e.nodes.filter(F=>F.nodeKind==="blocked_attempt").length},P=new Set(k.map(F=>F.node.nodeId));return{nodes:k,edges:e.edges.filter(F=>P.has(F.fromNodeId)&&P.has(F.toNodeId)),graphWidth:Kb*2+Za*2+B*$b+$p,graphHeight:Za*2+(A-S)*Gb+Gp,currentNodeId:a,startNodeId:C[0]??N[0]?.nodeId??null,latestBranchNodeId:O?.nodeId??null,summary:U}}function Z4(e){if(e.preferredTipNodeId)return e.preferredTipNodeId;const t=e.nodes.find(a=>a.isPreferredTip);if(t)return t.nodeId;const r=e.nodes.filter(a=>a.isTip).sort((a,o)=>o.createdAtEventIndex-a.createdAtEventIndex)[0];return r?r.nodeId:[...e.nodes].sort((a,o)=>o.createdAtEventIndex-a.createdAtEventIndex)[0]?.nodeId??null}function W4(e,t){const r=new Set;let a=e;for(;a&&!r.has(a);){r.add(a);const o=t.get(a)?.parentNodeId??null;a=o&&t.has(o)?o:null}return r}function J4(e,t){const r=new Map,a=new Set,o=l=>{const u=r.get(l);if(u!==void 0)return u;if(a.has(l))return r.set(l,0),0;a.add(l);const h=t.get(l)?.parentNodeId??null;if(!h||!t.has(h))return r.set(l,0),a.delete(l),0;const d=o(h)+1;return r.set(l,d),a.delete(l),d};for(const l of e)o(l.nodeId);return r}function Ym(e){return e.slice(-8)}function eD(e,t,r,a){const o=new Map;for(const f of a)o.set(f,t.get(f)??0);const l=new Set,u=f=>{const h=o.get(f);if(h!==void 0)return h;if(l.has(f)){const v=t.get(f)??0;return o.set(f,v),v}l.add(f);const p=r.get(f)?.parentNodeId??null;if(!p||!r.has(p)){const v=t.get(f)??0;return o.set(f,v),l.delete(f),v}const y=u(p)+1;return o.set(f,y),l.delete(f),y};for(const f of e)o.has(f.nodeId)||u(f.nodeId);return o}function tD({run:e,selectedNodeId:t=null,onNodeClick:r}){const a=H.useRef(null),o=H.useRef(null),l=H.useRef(!1),[u,f]=H.useState(null),[h,d]=H.useState(null),p=H.useRef(null),g=H.useMemo(()=>K4(e),[e]),y=H.useMemo(()=>new Map(g.nodes.map(k=>[k.node.nodeId,k])),[g.nodes]),v=e.status==="in_progress",w=H.useCallback((k,B="smooth")=>{if(!k)return;const T=o.current,O=y.get(k);if(!T||!O)return;a.current?.scrollIntoView({behavior:B,block:"nearest"});const U=O.isActiveLineage?$p:Xb,P=O.isActiveLineage?Gp:Qb;T.scrollTo({left:Math.max(0,O.x-T.clientWidth/2+U/2),top:Math.max(0,O.y-T.clientHeight/2+P/2),behavior:B})},[y]);H.useEffect(()=>{l.current||g.currentNodeId&&(l.current=!0,w(g.currentNodeId,"auto"))},[]);const{nodes:C,edges:N}=H.useMemo(()=>{const k=g.currentNodeId?g.edges.find(O=>O.toNodeId===g.currentNodeId)?.fromNodeId??null:null,B=g.nodes.map(O=>{const{node:U,isActiveLineage:P,isCurrent:F}=O,I=U.nodeId===t,Y=P?$p:Xb,Q=P?Gp:Qb,L=oD(U,P,F,I),V=iD(U,P),M=kE(U,O.branchKind,O.branchIndex);return{id:U.nodeId,position:{x:O.x,y:O.y},data:{label:b.jsx(nD,{node:U,isActiveLineage:P,isCurrent:F,isSelected:I,isLiveRun:v,branchKind:O.branchKind,branchIndex:O.branchIndex,displayLabel:M,stepNumber:P?O.depth+1:null,totalSteps:P?g.summary.lineageNodeCount:null})},style:{width:Y,height:Q,padding:0,borderRadius:0,border:`1px solid ${L}`,background:V,color:"var(--text-primary)",boxShadow:I?"0 0 0 1px rgba(244, 179, 65, 0.7), 0 0 18px rgba(244, 179, 65, 0.16)":F?"0 0 0 1px rgba(0, 240, 255, 0.65), 0 0 24px rgba(0, 240, 255, 0.18)":P?"0 0 16px rgba(0, 240, 255, 0.1)":"none",opacity:P?1:.72,cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch"}}}),T=g.edges.map((O,U)=>{const P=y.get(O.fromNodeId),F=y.get(O.toNodeId),I=!!(P?.isActiveLineage&&F?.isActiveLineage),Y=v&&!!g.currentNodeId&&O.toNodeId===g.currentNodeId&&O.fromNodeId===k;return{id:`lineage-edge-${U}`,source:O.fromNodeId,target:O.toNodeId,type:"smoothstep",animated:Y,className:Y?"workrail-current-lineage-edge":void 0,style:{stroke:Y?"var(--accent-strong)":I?O.edgeKind==="checkpoint"?"var(--success)":"var(--accent-strong)":"rgba(123, 141, 167, 0.45)",strokeWidth:Y?2.6:I?2.2:1.5,opacity:I?1:.72}}});return{nodes:B,edges:T}},[v,g.currentNodeId,g.edges,g.nodes,y,t]),S=H.useCallback((k,B)=>{r?.(B.id)},[r]),A=H.useCallback((k,B)=>{const T=y.get(B.id)?.node.stepLabel??null;if(!T||T.length<=35)return;const O=o.current?.getBoundingClientRect();if(!O)return;const U=k.clientX-O.left+12,P=k.clientY-O.top+16,F=Math.min(U,(o.current?.clientWidth??9999)-272);p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{f(T),d({x:F,y:P})},300)},[y]),_=H.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),f(null),d(null)},[]);return b.jsxs("div",{ref:a,className:"h-full flex flex-col bg-[var(--bg-primary)]",children:[b.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 console-blueprint-grid",children:[b.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx(Pi,{label:"Current",value:g.summary.currentNodeLabel,emphasis:!0}),b.jsx(Pi,{label:"Status",value:fD(e.status)}),b.jsx(Pi,{label:"Active lineage",value:`${g.summary.lineageNodeCount} nodes`}),b.jsx(Pi,{label:"Alternate branches",value:`${g.summary.alternateBranchCount}`}),b.jsx(Pi,{label:"Historical nodes",value:`${g.summary.sideNodeCount}`}),b.jsx(Pi,{label:"Blocked attempts",value:`${g.summary.blockedAttemptCount}`}),b.jsx(Pi,{label:"Critical gaps",value:e.hasUnresolvedCriticalGaps?"Present":"None"})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(ep,{onClick:()=>w(g.startNodeId),children:"Start"}),b.jsx(ep,{onClick:()=>w(g.currentNodeId),children:"Current"}),b.jsx(ep,{onClick:()=>w(g.latestBranchNodeId),children:"Latest branch"})]})]}),b.jsx(rD,{model:g,selectedNodeId:t,onNavigateToNode:w})]}),b.jsxs("div",{ref:o,className:"relative flex-1 overflow-auto lineage-scroll-surface",children:[b.jsx("div",{style:{width:Math.max(g.graphWidth,960),height:Math.max(g.graphHeight,360)},children:b.jsx(C4,{nodes:C,edges:N,fitView:!1,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,colorMode:"dark",onNodeClick:S,onNodeMouseEnter:A,onNodeMouseLeave:_,style:{background:"transparent"}})}),u&&h&&b.jsx("div",{style:{position:"absolute",left:h.x,top:h.y,pointerEvents:"none",zIndex:50,maxWidth:260,background:"rgba(10, 12, 20, 0.96)",border:"1px solid rgba(123, 141, 167, 0.35)",padding:"6px 10px",fontSize:12,lineHeight:1.5,color:"var(--text-primary)",wordWrap:"break-word",boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:u})]})]})}function nD({node:e,isActiveLineage:t,isCurrent:r,isSelected:a,isLiveRun:o,branchKind:l,branchIndex:u,displayLabel:f,stepNumber:h,totalSteps:d}){const p=lD(e);return b.jsxs("div",{className:`relative flex h-full w-full flex-col text-left overflow-hidden ${r&&o?"workrail-current-lineage-node":""} ${a?"workrail-selected-lineage-node":""}`,children:[p&&b.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:3,background:p,pointerEvents:"none"}}),b.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-3 py-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-2",children:[b.jsx(gn,{color:aD(l,t),children:cD(e.nodeKind,l,u)}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[a&&b.jsx(gn,{color:"var(--warning)",children:"Selected"}),r&&b.jsx(gn,{color:o?"var(--accent-strong)":"var(--text-secondary)",children:"Current"})]})]}),b.jsx("div",{className:t?"text-sm font-medium leading-snug":"text-[13px] leading-snug",style:{color:"var(--text-primary)",display:"-webkit-box",WebkitLineClamp:t?4:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:f})]}),b.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-[rgba(255,255,255,0.06)] bg-[rgba(0,0,0,0.18)] px-3 py-2",children:[b.jsx(gn,{color:"var(--text-secondary)",className:"min-w-0 truncate text-[11px]",children:h!==null&&d!==null?`${h} / ${d}`:`evt ${e.createdAtEventIndex}`}),e.isTip?b.jsx(gn,{className:"shrink-0",color:e.isPreferredTip?"var(--warning)":"var(--text-muted)",children:e.isPreferredTip?"Preferred tip":"Tip"}):b.jsx(gn,{className:"shrink-0",color:"transparent",children:"spacer"})]})]})}function rD({model:e,selectedNodeId:t,onNavigateToNode:r}){const a=e.nodes.filter(l=>l.isActiveLineage),o=e.nodes.filter(l=>!l.isActiveLineage).slice(-8);return b.jsx("div",{className:"mt-3 border border-[var(--border)] bg-[rgba(10,10,10,0.38)] px-3 py-2 corner-brackets",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx(gn,{children:"Lineage rail"}),a.map(l=>b.jsx(Zb,{label:l.node.stepLabel??Ym(l.node.nodeId),isCurrent:l.isCurrent,isSelected:l.node.nodeId===t,tone:"active",onClick:()=>r(l.node.nodeId)},l.node.nodeId)),o.length>0&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"mx-1 h-px w-6 bg-[var(--border)]"}),o.map(l=>b.jsx(Zb,{label:kE(l.node,l.branchKind,l.branchIndex),isCurrent:!1,isSelected:l.node.nodeId===t,tone:l.branchKind==="blocked"?"blocked":"side",onClick:()=>r(l.node.nodeId)},l.node.nodeId))]})]})})}function Pi({label:e,value:t,emphasis:r=!1}){return b.jsxs("div",{className:"min-w-[120px] border px-3 py-2",style:{borderColor:r?"rgba(0, 240, 255, 0.42)":"var(--border)",background:r?"rgba(0, 240, 255, 0.08)":"rgba(15, 19, 31, 0.78)"},children:[b.jsx(gn,{children:e}),b.jsx("div",{className:"mt-1 text-sm text-[var(--text-primary)]",children:t})]})}function ep({children:e,onClick:t}){return b.jsx("button",{type:"button",onClick:t,className:"border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-secondary)] transition-colors hover:border-[var(--accent-strong)] hover:text-[var(--text-primary)]",children:e})}function Zb({label:e,isCurrent:t,isSelected:r,tone:a,onClick:o}){const l=r?"rgba(244, 179, 65, 0.16)":a==="active"?t?"rgba(0, 240, 255, 0.2)":"rgba(0, 240, 255, 0.08)":a==="blocked"?"rgba(239, 68, 68, 0.12)":"rgba(125, 136, 156, 0.12)",u=r?"rgba(244, 179, 65, 0.48)":a==="active"?t?"rgba(0, 240, 255, 0.6)":"rgba(0, 240, 255, 0.32)":a==="blocked"?"rgba(239, 68, 68, 0.34)":"rgba(125, 136, 156, 0.3)";return b.jsx("button",{type:"button",title:e,onClick:o,className:"border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.16em] text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",style:{background:l,borderColor:u},children:dD(e)})}function iD(e,t){return e.nodeKind==="blocked_attempt"?t?"rgba(80, 24, 31, 0.92)":"rgba(52, 24, 30, 0.82)":e.nodeKind==="checkpoint"?t?"rgba(18, 61, 51, 0.92)":"rgba(18, 43, 38, 0.82)":t?"rgba(27, 31, 44, 0.96)":"rgba(24, 28, 39, 0.82)"}function aD(e,t){return e==="blocked"?"var(--error)":e==="alternate"?t?"var(--accent-strong)":"rgba(186, 197, 219, 0.72)":t?"var(--accent-strong)":"var(--text-muted)"}function oD(e,t,r,a){return a?"var(--warning)":r?"var(--accent-strong)":e.nodeKind==="blocked_attempt"?t?"var(--error)":"rgba(239, 68, 68, 0.5)":e.nodeKind==="checkpoint"?t?"var(--success)":"rgba(34, 197, 94, 0.45)":t?"rgba(0, 240, 255, 0.55)":"rgba(123, 141, 167, 0.45)"}const sD=[{test:e=>e.hasFailedValidations,color:"var(--error)"},{test:e=>e.hasGaps,color:"var(--warning)"},{test:e=>e.hasRecap||e.hasArtifacts,color:"var(--accent)"}];function lD(e){return sD.find(t=>t.test(e))?.color??null}function uD(e){switch(e){case"blocked_attempt":return"Blocked";case"checkpoint":return"Checkpoint";case"step":return"Step"}}function cD(e,t,r){return t==="blocked"?r?`Blocked branch ${r}`:"Blocked branch":t==="alternate"?r?`Alt branch ${r}`:"Alt branch":uD(e)}function fD(e){switch(e){case"complete":return"Complete";case"complete_with_gaps":return"Complete with gaps";case"blocked":return"Blocked";case"in_progress":return"In progress"}}function kE(e,t,r){return e.stepLabel?e.stepLabel:t==="blocked"?r?`Blocked attempt ${r}`:"Blocked attempt":t==="alternate"?r?`Alternate path ${r}`:"Alternate path":Ym(e.nodeId)}function dD(e){return e.length>18?`${e.slice(0,18)}…`:e}function hD(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const pD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gD={};function Wb(e,t){return(gD.jsx?mD:pD).test(e)}const yD=/[ \t\n\f\r]/g;function xD(e){return typeof e=="object"?e.type==="text"?Jb(e.value):!1:Jb(e)}function Jb(e){return e.replace(yD,"")===""}class bl{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}bl.prototype.normal={};bl.prototype.property={};bl.prototype.space=void 0;function ME(e,t){const r={},a={};for(const o of e)Object.assign(r,o.property),Object.assign(a,o.normal);return new bl(r,a,t)}function Xp(e){return e.toLowerCase()}class an{constructor(t,r){this.attribute=r,this.property=t}}an.prototype.attribute="";an.prototype.booleanish=!1;an.prototype.boolean=!1;an.prototype.commaOrSpaceSeparated=!1;an.prototype.commaSeparated=!1;an.prototype.defined=!1;an.prototype.mustUseProperty=!1;an.prototype.number=!1;an.prototype.overloadedBoolean=!1;an.prototype.property="";an.prototype.spaceSeparated=!1;an.prototype.space=void 0;let vD=0;const Oe=sa(),wt=sa(),Qp=sa(),he=sa(),nt=sa(),lo=sa(),mn=sa();function sa(){return 2**++vD}const Kp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:wt,commaOrSpaceSeparated:mn,commaSeparated:lo,number:he,overloadedBoolean:Qp,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),tp=Object.keys(Kp);class $m extends an{constructor(t,r,a,o){let l=-1;if(super(t,r),e1(this,"space",o),typeof a=="number")for(;++l<tp.length;){const u=tp[l];e1(this,tp[l],(a&Kp[u])===Kp[u])}}}$m.prototype.defined=!0;function e1(e,t,r){r&&(e[t]=r)}function _o(e){const t={},r={};for(const[a,o]of Object.entries(e.properties)){const l=new $m(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,r[Xp(a)]=a,r[Xp(l.attribute)]=a}return new bl(t,r,e.space)}const TE=_o({properties:{ariaActiveDescendant:null,ariaAtomic:wt,ariaAutoComplete:null,ariaBusy:wt,ariaChecked:wt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:wt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:wt,ariaFlowTo:nt,ariaGrabbed:wt,ariaHasPopup:null,ariaHidden:wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:he,ariaLive:null,ariaModal:wt,ariaMultiLine:wt,ariaMultiSelectable:wt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:wt,ariaReadOnly:wt,ariaRelevant:null,ariaRequired:wt,ariaRoleDescription:nt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:wt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function AE(e,t){return t in e?e[t]:t}function RE(e,t){return AE(e,t.toLowerCase())}const bD=_o({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lo,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:nt,autoFocus:Oe,autoPlay:Oe,blocking:nt,capture:null,charSet:null,checked:Oe,cite:null,className:nt,cols:he,colSpan:null,content:null,contentEditable:wt,controls:Oe,controlsList:nt,coords:he|lo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:Qp,draggable:wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:nt,height:he,hidden:Qp,high:he,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:nt,itemRef:nt,itemScope:Oe,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oe,optimum:he,pattern:null,ping:nt,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:nt,required:Oe,reversed:Oe,rows:he,rowSpan:he,sandbox:nt,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:wt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:wt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oe,disableRemotePlayback:Oe,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:RE}),wD=_o({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:lo,g2:lo,glyphName:lo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mn,rev:mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mn,requiredFeatures:mn,requiredFonts:mn,requiredFormats:mn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:AE}),jE=_o({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),OE=_o({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:RE}),DE=_o({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),SD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ED=/[A-Z]/g,t1=/-[a-z]/g,CD=/^data[-\w.:]+$/i;function _D(e,t){const r=Xp(t);let a=t,o=an;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&CD.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(t1,kD);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!t1.test(l)){let u=l.replace(ED,ND);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=$m}return new o(a,t)}function ND(e){return"-"+e.toLowerCase()}function kD(e){return e.charAt(1).toUpperCase()}const MD=ME([TE,bD,jE,OE,DE],"html"),Gm=ME([TE,wD,jE,OE,DE],"svg");function TD(e){return e.join(" ").trim()}var Wa={},np,n1;function AD(){if(n1)return np;n1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
16
- `,d="/",p="*",g="",y="comment",v="declaration";function w(N,S){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];S=S||{};var A=1,_=1;function k(L){var V=L.match(t);V&&(A+=V.length);var M=L.lastIndexOf(h);_=~M?L.length-M:_+L.length}function B(){var L={line:A,column:_};return function(V){return V.position=new T(L),P(),V}}function T(L){this.start=L,this.end={line:A,column:_},this.source=S.source}T.prototype.content=N;function O(L){var V=new Error(S.source+":"+A+":"+_+": "+L);if(V.reason=L,V.filename=S.source,V.line=A,V.column=_,V.source=N,!S.silent)throw V}function U(L){var V=L.exec(N);if(V){var M=V[0];return k(M),N=N.slice(M.length),V}}function P(){U(r)}function F(L){var V;for(L=L||[];V=I();)V!==!1&&L.push(V);return L}function I(){var L=B();if(!(d!=N.charAt(0)||p!=N.charAt(1))){for(var V=2;g!=N.charAt(V)&&(p!=N.charAt(V)||d!=N.charAt(V+1));)++V;if(V+=2,g===N.charAt(V-1))return O("End of comment missing");var M=N.slice(2,V-2);return _+=2,k(M),N=N.slice(V),_+=2,L({type:y,comment:M})}}function Y(){var L=B(),V=U(a);if(V){if(I(),!U(o))return O("property missing ':'");var M=U(l),q=L({type:v,property:C(V[0].replace(e,g)),value:M?C(M[0].replace(e,g)):g});return U(u),q}}function Q(){var L=[];F(L);for(var V;V=Y();)V!==!1&&(L.push(V),F(L));return L}return P(),Q()}function C(N){return N?N.replace(f,g):g}return np=w,np}var r1;function RD(){if(r1)return Wa;r1=1;var e=Wa&&Wa.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.default=r;const t=e(AD());function r(a,o){let l=null;if(!a||typeof a!="string")return l;const u=(0,t.default)(a),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:p}=h;f?o(d,p,h):p&&(l=l||{},l[d]=p)}),l}return Wa}var As={},i1;function jD(){if(i1)return As;i1=1,Object.defineProperty(As,"__esModule",{value:!0}),As.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(d){return!d||r.test(d)||e.test(d)},u=function(d,p){return p.toUpperCase()},f=function(d,p){return"".concat(p,"-")},h=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(o,f):d=d.replace(a,f),d.replace(t,u))};return As.camelCase=h,As}var Rs,a1;function OD(){if(a1)return Rs;a1=1;var e=Rs&&Rs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(RD()),r=jD();function a(o,l){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(f,h){f&&h&&(u[(0,r.camelCase)(f,l)]=h)}),u}return a.default=a,Rs=a,Rs}var DD=OD();const zD=Vc(DD),zE=LE("end"),Xm=LE("start");function LE(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function LD(e){const t=Xm(e),r=zE(e);if(t&&r)return{start:t,end:r}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?o1(e.position):"start"in e||"end"in e?o1(e):"line"in e||"column"in e?Zp(e):""}function Zp(e){return s1(e&&e.line)+":"+s1(e&&e.column)}function o1(e){return Zp(e&&e.start)+"-"+Zp(e&&e.end)}function s1(e){return e&&typeof e=="number"?e:1}class Bt extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",l={},u=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?o=t:!l.cause&&t&&(u=!0,o=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?l.ruleId=a:(l.source=a.slice(0,h),l.ruleId=a.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=Us(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bt.prototype.file="";Bt.prototype.name="";Bt.prototype.reason="";Bt.prototype.message="";Bt.prototype.stack="";Bt.prototype.column=void 0;Bt.prototype.line=void 0;Bt.prototype.ancestors=void 0;Bt.prototype.cause=void 0;Bt.prototype.fatal=void 0;Bt.prototype.place=void 0;Bt.prototype.ruleId=void 0;Bt.prototype.source=void 0;const Qm={}.hasOwnProperty,ID=new Map,BD=/[A-Z]/g,HD=new Set(["table","tbody","thead","tfoot","tr"]),PD=new Set(["td","th"]),IE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function UD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=QD(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=XD(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Gm:MD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=BE(o,e,void 0);return l&&typeof l!="string"?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}function BE(e,t,r){if(t.type==="element")return VD(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return YD(e,t,r);if(t.type==="mdxjsEsm")return FD(e,t);if(t.type==="root")return $D(e,t,r);if(t.type==="text")return GD(e,t)}function VD(e,t,r){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Gm,e.schema=o),e.ancestors.push(t);const l=PE(e,t.tagName,!1),u=KD(e,t);let f=Zm(e,t);return HD.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!xD(h):!0})),HE(e,u,l,t),Km(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function qD(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}cl(e,t.position)}function FD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cl(e,t.position)}function YD(e,t,r){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Gm,e.schema=o),e.ancestors.push(t);const l=t.name===null?e.Fragment:PE(e,t.name,!0),u=ZD(e,t),f=Zm(e,t);return HE(e,u,l,t),Km(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function $D(e,t,r){const a={};return Km(a,Zm(e,t)),e.create(t,e.Fragment,a,r)}function GD(e,t){return t.value}function HE(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function Km(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function XD(e,t,r){return a;function a(o,l,u,f){const d=Array.isArray(u.children)?r:t;return f?d(l,u,f):d(l,u)}}function QD(e,t){return r;function r(a,o,l,u){const f=Array.isArray(l.children),h=Xm(a);return t(o,l,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function KD(e,t){const r={};let a,o;for(o in t.properties)if(o!=="children"&&Qm.call(t.properties,o)){const l=WD(e,o,t.properties[o]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&PD.has(t.tagName)?a=f:r[u]=f}}if(a){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function ZD(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else cl(e,t.position);else{const o=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else cl(e,t.position);else l=a.value===null?!0:a.value;r[o]=l}return r}function Zm(e,t){const r=[];let a=-1;const o=e.passKeys?new Map:ID;for(;++a<t.children.length;){const l=t.children[a];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=o.get(h)||0;u=h+"-"+d,o.set(h,d+1)}}const f=BE(e,l,u);f!==void 0&&r.push(f)}return r}function WD(e,t,r){const a=_D(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?hD(r):TD(r)),a.property==="style"){let o=typeof r=="object"?r:JD(e,String(r));return e.stylePropertyNameCase==="css"&&(o=ez(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?SD[a.property]||a.property:a.attribute,r]}}function JD(e,t){try{return zD(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,o=new Bt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=IE+"#cannot-parse-style-attribute",o}}function PE(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let l=-1,u;for(;++l<o.length;){const f=Wb(o[l])?{type:"Identifier",name:o[l]}:{type:"Literal",value:o[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}a=u}else a=Wb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return Qm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);cl(e)}function cl(e,t){const r=new Bt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=IE+"#cannot-handle-mdx-estrees-without-createevaluater",r}function ez(e){const t={};let r;for(r in e)Qm.call(e,r)&&(t[tz(r)]=e[r]);return t}function tz(e){let t=e.replace(BD,nz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nz(e){return"-"+e.toLowerCase()}const rp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rz={};function iz(e,t){const r=rz,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return UE(e,a,o)}function UE(e,t,r){if(az(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return l1(e.children,t,r)}return Array.isArray(e)?l1(e,t,r):""}function l1(e,t,r){const a=[];let o=-1;for(;++o<e.length;)a[o]=UE(e[o],t,r);return a.join("")}function az(e){return!!(e&&typeof e=="object")}const u1=document.createElement("i");function Wm(e){const t="&"+e+";";u1.innerHTML=t;const r=u1.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function tr(e,t,r,a){const o=e.length;let l=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,a.length<1e4)u=Array.from(a),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);l<a.length;)u=a.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Rn(e,t){return e.length>0?(tr(e,e.length,0,t),e):t}const c1={}.hasOwnProperty;function oz(e){const t={};let r=-1;for(;++r<e.length;)sz(t,e[r]);return t}function sz(e,t){let r;for(r in t){const o=(c1.call(e,r)?e[r]:void 0)||(e[r]={}),l=t[r];let u;if(l)for(u in l){c1.call(o,u)||(o[u]=[]);const f=l[u];lz(o[u],Array.isArray(f)?f:f?[f]:[])}}}function lz(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);tr(e,0,0,a)}function VE(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wn=yi(/[A-Za-z]/),vn=yi(/[\dA-Za-z]/),uz=yi(/[#-'*+\--9=?A-Z^-~]/);function Wp(e){return e!==null&&(e<32||e===127)}const Jp=yi(/\d/),cz=yi(/[\dA-Fa-f]/),fz=yi(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const dz=yi(new RegExp("\\p{P}|\\p{S}","u")),hz=yi(/\s/);function yi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function No(e){const t=[];let r=-1,a=0,o=0;for(;++r<e.length;){const l=e.charCodeAt(r);let u="";if(l===37&&vn(e.charCodeAt(r+1))&&vn(e.charCodeAt(r+2)))o=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const f=e.charCodeAt(r+1);l<56320&&f>56319&&f<57344?(u=String.fromCharCode(l,f),o=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(a,r),encodeURIComponent(u)),a=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(a)}function rt(e,t,r,a){const o=a?a-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(h){return Xe(h)?(e.enter(r),f(h)):t(h)}function f(h){return Xe(h)&&l++<o?(e.consume(h),f):(e.exit(r),t(h))}}const pz={tokenize:mz};function mz(e){const t=e.attempt(this.parser.constructs.contentInitial,a,o);let r;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),rt(e,t,"linePrefix")}function o(f){return e.enter("paragraph"),l(f)}function l(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Me(f)?(e.consume(f),e.exit("chunkText"),l):(e.consume(f),u)}}const gz={tokenize:yz},f1={tokenize:xz};function yz(e){const t=this,r=[];let a=0,o,l,u;return f;function f(_){if(a<r.length){const k=r[a];return t.containerState=k[1],e.attempt(k[0].continuation,h,d)(_)}return d(_)}function h(_){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&A();const k=t.events.length;let B=k,T;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){T=t.events[B][1].end;break}S(a);let O=k;for(;O<t.events.length;)t.events[O][1].end={...T},O++;return tr(t.events,B+1,0,t.events.slice(k)),t.events.length=O,d(_)}return f(_)}function d(_){if(a===r.length){if(!o)return y(_);if(o.currentConstruct&&o.currentConstruct.concrete)return w(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(f1,p,g)(_)}function p(_){return o&&A(),S(a),y(_)}function g(_){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,w(_)}function y(_){return t.containerState={},e.attempt(f1,v,w)(_)}function v(_){return a++,r.push([t.currentConstruct,t.containerState]),y(_)}function w(_){if(_===null){o&&A(),S(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:l}),C(_)}function C(_){if(_===null){N(e.exit("chunkFlow"),!0),S(0),e.consume(_);return}return Me(_)?(e.consume(_),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(_),C)}function N(_,k){const B=t.sliceStream(_);if(k&&B.push(null),_.previous=l,l&&(l.next=_),l=_,o.defineSkip(_.start),o.write(B),t.parser.lazy[_.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<u&&(!o.events[T][1].end||o.events[T][1].end.offset>u))return;const O=t.events.length;let U=O,P,F;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(P){F=t.events[U][1].end;break}P=!0}for(S(a),T=O;T<t.events.length;)t.events[T][1].end={...F},T++;tr(t.events,U+1,0,t.events.slice(O)),t.events.length=T}}function S(_){let k=r.length;for(;k-- >_;){const B=r[k];t.containerState=B[1],B[0].exit.call(t,e)}r.length=_}function A(){o.write([null]),l=void 0,o=void 0,t.containerState._closeFlow=void 0}}function xz(e,t,r){return rt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function d1(e){if(e===null||nn(e)||hz(e))return 1;if(dz(e))return 2}function Jm(e,t,r){const a=[];let o=-1;for(;++o<e.length;){const l=e[o].resolveAll;l&&!a.includes(l)&&(t=l(t,r),a.push(l))}return t}const em={name:"attention",resolveAll:vz,tokenize:bz};function vz(e,t){let r=-1,a,o,l,u,f,h,d,p;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[a][1].end},y={...e[r][1].start};h1(g,-h),h1(y,h),u={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:y},l={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[r][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Rn(d,[["enter",e[a][1],t],["exit",e[a][1],t]])),d=Rn(d,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",l,t]]),d=Rn(d,Jm(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),d=Rn(d,[["exit",l,t],["enter",f,t],["exit",f,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(p=2,d=Rn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):p=0,tr(e,a-1,r-a+3,d),r=a+d.length-p-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function bz(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=d1(a);let l;return u;function u(h){return l=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===l)return e.consume(h),f;const d=e.exit("attentionSequence"),p=d1(h),g=!p||p===2&&o||r.includes(h),y=!o||o===2&&p||r.includes(a);return d._open=!!(l===42?g:g&&(o||!y)),d._close=!!(l===42?y:y&&(p||!g)),t(h)}}function h1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wz={name:"autolink",tokenize:Sz};function Sz(e,t,r){let a=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return Wn(v)?(e.consume(v),u):v===64?r(v):d(v)}function u(v){return v===43||v===45||v===46||vn(v)?(a=1,f(v)):d(v)}function f(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||vn(v))&&a++<32?(e.consume(v),f):(a=0,d(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Wp(v)?r(v):(e.consume(v),h)}function d(v){return v===64?(e.consume(v),p):uz(v)?(e.consume(v),d):r(v)}function p(v){return vn(v)?g(v):r(v)}function g(v){return v===46?(e.consume(v),a=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||vn(v))&&a++<63){const w=v===45?y:g;return e.consume(v),w}return r(v)}}const lf={partial:!0,tokenize:Ez};function Ez(e,t,r){return a;function a(l){return Xe(l)?rt(e,o,"linePrefix")(l):o(l)}function o(l){return l===null||Me(l)?t(l):r(l)}}const qE={continuation:{tokenize:_z},exit:Nz,name:"blockQuote",tokenize:Cz};function Cz(e,t,r){const a=this;return o;function o(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return r(u)}function l(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function _z(e,t,r){const a=this;return o;function o(u){return Xe(u)?rt(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(qE,t,r)(u)}}function Nz(e){e.exit("blockQuote")}const FE={name:"characterEscape",tokenize:kz};function kz(e,t,r){return a;function a(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),o}function o(l){return fz(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(l)}}const YE={name:"characterReference",tokenize:Mz};function Mz(e,t,r){const a=this;let o=0,l,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,u=vn,p(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=cz,p):(e.enter("characterReferenceValue"),l=7,u=Jp,p(g))}function p(g){if(g===59&&o){const y=e.exit("characterReferenceValue");return u===vn&&!Wm(a.sliceSerialize(y))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&o++<l?(e.consume(g),p):r(g)}}const p1={partial:!0,tokenize:Az},m1={concrete:!0,name:"codeFenced",tokenize:Tz};function Tz(e,t,r){const a=this,o={partial:!0,tokenize:B};let l=0,u=0,f;return h;function h(T){return d(T)}function d(T){const O=a.events[a.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,f=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(T)}function p(T){return T===f?(u++,e.consume(T),p):u<3?r(T):(e.exit("codeFencedFenceSequence"),Xe(T)?rt(e,g,"whitespace")(T):g(T))}function g(T){return T===null||Me(T)?(e.exit("codeFencedFence"),a.interrupt?t(T):e.check(p1,C,k)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Me(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(T)):Xe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rt(e,v,"whitespace")(T)):T===96&&T===f?r(T):(e.consume(T),y)}function v(T){return T===null||Me(T)?g(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===null||Me(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(T)):T===96&&T===f?r(T):(e.consume(T),w)}function C(T){return e.attempt(o,k,N)(T)}function N(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),S}function S(T){return l>0&&Xe(T)?rt(e,A,"linePrefix",l+1)(T):A(T)}function A(T){return T===null||Me(T)?e.check(p1,C,k)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||Me(T)?(e.exit("codeFlowValue"),A(T)):(e.consume(T),_)}function k(T){return e.exit("codeFenced"),t(T)}function B(T,O,U){let P=0;return F;function F(V){return T.enter("lineEnding"),T.consume(V),T.exit("lineEnding"),I}function I(V){return T.enter("codeFencedFence"),Xe(V)?rt(T,Y,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):Y(V)}function Y(V){return V===f?(T.enter("codeFencedFenceSequence"),Q(V)):U(V)}function Q(V){return V===f?(P++,T.consume(V),Q):P>=u?(T.exit("codeFencedFenceSequence"),Xe(V)?rt(T,L,"whitespace")(V):L(V)):U(V)}function L(V){return V===null||Me(V)?(T.exit("codeFencedFence"),O(V)):U(V)}}}function Az(e,t,r){const a=this;return o;function o(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}const ip={name:"codeIndented",tokenize:jz},Rz={partial:!0,tokenize:Oz};function jz(e,t,r){const a=this;return o;function o(d){return e.enter("codeIndented"),rt(e,l,"linePrefix",5)(d)}function l(d){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(d):r(d)}function u(d){return d===null?h(d):Me(d)?e.attempt(Rz,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Me(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function Oz(e,t,r){const a=this;return o;function o(u){return a.parser.lazy[a.now().line]?r(u):Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):rt(e,l,"linePrefix",5)(u)}function l(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Me(u)?o(u):r(u)}}const Dz={name:"codeText",previous:Lz,resolve:zz,tokenize:Iz};function zz(e){let t=e.length-4,r=3,a,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)o===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(o=a):(a===t||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),t-=a-o-2,a=o+2),o=void 0);return e}function Lz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Iz(e,t,r){let a=0,o,l;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(l=e.enter("codeTextSequence"),o=0,p(g)):Me(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Me(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),d)}function p(g){return g===96?(e.consume(g),o++,p):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",d(g))}}class Bz{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const o=r||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&js(this.left,a),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);js(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);js(this.left,r.reverse())}}}function js(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function $E(e){const t={};let r=-1,a,o,l,u,f,h,d;const p=new Bz(e);for(;++r<p.length;){for(;r in t;)r=t[r];if(a=p.get(r),r&&a[1].type==="chunkFlow"&&p.get(r-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,Hz(p,r)),r=t[r],d=!0);else if(a[1]._container){for(l=r,o=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(a[1].end={...p.get(o)[1].start},f=p.slice(o,r),f.unshift(a),p.splice(o,r-o+1,f))}}return tr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function Hz(e,t){const r=e.get(t)[1],a=e.get(t)[2];let o=t-1;const l=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let p,g,y=-1,v=r,w=0,C=0;const N=[C];for(;v;){for(;e.get(++o)[1]!==v;);l.push(o),v._tokenizer||(p=a.sliceStream(v),v.next||p.push(null),g&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=r;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(C=y+1,N.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),y=N.length;y--;){const S=f.slice(N[y],N[y+1]),A=l.pop();h.push([A,A+S.length-1]),e.splice(A,2,S)}for(h.reverse(),y=-1;++y<h.length;)d[w+h[y][0]]=w+h[y][1],w+=h[y][1]-h[y][0]-1;return d}const Pz={resolve:Vz,tokenize:qz},Uz={partial:!0,tokenize:Fz};function Vz(e){return $E(e),e}function qz(e,t){let r;return a;function a(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?l(f):Me(f)?e.check(Uz,u,l)(f):(e.consume(f),o)}function l(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function Fz(e,t,r){const a=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),rt(e,l,"linePrefix")}function l(u){if(u===null||Me(u))return r(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function GE(e,t,r,a,o,l,u,f,h){const d=h||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(a),e.enter(o),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||Wp(S)?r(S):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(o),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(f),y(S)):S===null||S===60||Me(S)?r(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!p&&(S===null||S===41||nn(S))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(S)):p<d&&S===40?(e.consume(S),p++,C):S===41?(e.consume(S),p--,C):S===null||S===32||S===40||Wp(S)?r(S):(e.consume(S),S===92?N:C)}function N(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function XE(e,t,r,a,o,l){const u=this;let f=0,h;return d;function d(v){return e.enter(a),e.enter(o),e.consume(v),e.exit(o),e.enter(l),p}function p(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(v):v===93?(e.exit(l),e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):Me(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Me(v)||f++>999?(e.exit("chunkString"),p(v)):(e.consume(v),h||(h=!Xe(v)),v===92?y:g)}function y(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function QE(e,t,r,a,o,l){let u;return f;function f(y){return y===34||y===39||y===40?(e.enter(a),e.enter(o),e.consume(y),e.exit(o),u=y===40?41:y,h):r(y)}function h(y){return y===u?(e.enter(o),e.consume(y),e.exit(o),e.exit(a),t):(e.enter(l),d(y))}function d(y){return y===u?(e.exit(l),h(u)):y===null?r(y):Me(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),rt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===u||y===null||Me(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?g:p)}function g(y){return y===u||y===92?(e.consume(y),p):p(y)}}function Vs(e,t){let r;return a;function a(o){return Me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,a):Xe(o)?rt(e,a,r?"linePrefix":"lineSuffix")(o):t(o)}}const Yz={name:"definition",tokenize:Gz},$z={partial:!0,tokenize:Xz};function Gz(e,t,r){const a=this;let o;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return XE.call(a,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=uo(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):r(v)}function h(v){return nn(v)?Vs(e,d)(v):d(v)}function d(v){return GE(e,p,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt($z,g,g)(v)}function g(v){return Xe(v)?rt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Me(v)?(e.exit("definition"),a.parser.defined.push(o),t(v)):r(v)}}function Xz(e,t,r){return a;function a(f){return nn(f)?Vs(e,o)(f):r(f)}function o(f){return QE(e,l,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return Xe(f)?rt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Me(f)?t(f):r(f)}}const Qz={name:"hardBreakEscape",tokenize:Kz};function Kz(e,t,r){return a;function a(l){return e.enter("hardBreakEscape"),e.consume(l),o}function o(l){return Me(l)?(e.exit("hardBreakEscape"),t(l)):r(l)}}const Zz={name:"headingAtx",resolve:Wz,tokenize:Jz};function Wz(e,t){let r=e.length-2,a=3,o,l;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},l={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},tr(e,a,r-a+1,[["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t]])),e}function Jz(e,t,r){let a=0;return o;function o(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&a++<6?(e.consume(p),u):p===null||nn(p)?(e.exit("atxHeadingSequence"),f(p)):r(p)}function f(p){return p===35?(e.enter("atxHeadingSequence"),h(p)):p===null||Me(p)?(e.exit("atxHeading"),t(p)):Xe(p)?rt(e,f,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function h(p){return p===35?(e.consume(p),h):(e.exit("atxHeadingSequence"),f(p))}function d(p){return p===null||p===35||nn(p)?(e.exit("atxHeadingText"),f(p)):(e.consume(p),d)}}const e5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],g1=["pre","script","style","textarea"],t5={concrete:!0,name:"htmlFlow",resolveTo:i5,tokenize:a5},n5={partial:!0,tokenize:s5},r5={partial:!0,tokenize:o5};function i5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function a5(e,t,r){const a=this;let o,l,u,f,h;return d;function d(R){return p(R)}function p(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),g}function g(R){return R===33?(e.consume(R),y):R===47?(e.consume(R),l=!0,C):R===63?(e.consume(R),o=3,a.interrupt?t:j):Wn(R)?(e.consume(R),u=String.fromCharCode(R),N):r(R)}function y(R){return R===45?(e.consume(R),o=2,v):R===91?(e.consume(R),o=5,f=0,w):Wn(R)?(e.consume(R),o=4,a.interrupt?t:j):r(R)}function v(R){return R===45?(e.consume(R),a.interrupt?t:j):r(R)}function w(R){const te="CDATA[";return R===te.charCodeAt(f++)?(e.consume(R),f===te.length?a.interrupt?t:Y:w):r(R)}function C(R){return Wn(R)?(e.consume(R),u=String.fromCharCode(R),N):r(R)}function N(R){if(R===null||R===47||R===62||nn(R)){const te=R===47,ue=u.toLowerCase();return!te&&!l&&g1.includes(ue)?(o=1,a.interrupt?t(R):Y(R)):e5.includes(u.toLowerCase())?(o=6,te?(e.consume(R),S):a.interrupt?t(R):Y(R)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(R):l?A(R):_(R))}return R===45||vn(R)?(e.consume(R),u+=String.fromCharCode(R),N):r(R)}function S(R){return R===62?(e.consume(R),a.interrupt?t:Y):r(R)}function A(R){return Xe(R)?(e.consume(R),A):F(R)}function _(R){return R===47?(e.consume(R),F):R===58||R===95||Wn(R)?(e.consume(R),k):Xe(R)?(e.consume(R),_):F(R)}function k(R){return R===45||R===46||R===58||R===95||vn(R)?(e.consume(R),k):B(R)}function B(R){return R===61?(e.consume(R),T):Xe(R)?(e.consume(R),B):_(R)}function T(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),h=R,O):Xe(R)?(e.consume(R),T):U(R)}function O(R){return R===h?(e.consume(R),h=null,P):R===null||Me(R)?r(R):(e.consume(R),O)}function U(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||nn(R)?B(R):(e.consume(R),U)}function P(R){return R===47||R===62||Xe(R)?_(R):r(R)}function F(R){return R===62?(e.consume(R),I):r(R)}function I(R){return R===null||Me(R)?Y(R):Xe(R)?(e.consume(R),I):r(R)}function Y(R){return R===45&&o===2?(e.consume(R),M):R===60&&o===1?(e.consume(R),q):R===62&&o===4?(e.consume(R),z):R===63&&o===3?(e.consume(R),j):R===93&&o===5?(e.consume(R),Z):Me(R)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(n5,$,Q)(R)):R===null||Me(R)?(e.exit("htmlFlowData"),Q(R)):(e.consume(R),Y)}function Q(R){return e.check(r5,L,$)(R)}function L(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return R===null||Me(R)?Q(R):(e.enter("htmlFlowData"),Y(R))}function M(R){return R===45?(e.consume(R),j):Y(R)}function q(R){return R===47?(e.consume(R),u="",X):Y(R)}function X(R){if(R===62){const te=u.toLowerCase();return g1.includes(te)?(e.consume(R),z):Y(R)}return Wn(R)&&u.length<8?(e.consume(R),u+=String.fromCharCode(R),X):Y(R)}function Z(R){return R===93?(e.consume(R),j):Y(R)}function j(R){return R===62?(e.consume(R),z):R===45&&o===2?(e.consume(R),j):Y(R)}function z(R){return R===null||Me(R)?(e.exit("htmlFlowData"),$(R)):(e.consume(R),z)}function $(R){return e.exit("htmlFlow"),t(R)}}function o5(e,t,r){const a=this;return o;function o(u){return Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):r(u)}function l(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}function s5(e,t,r){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(lf,t,r)}}const l5={name:"htmlText",tokenize:u5};function u5(e,t,r){const a=this;let o,l,u;return f;function f(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),d):j===47?(e.consume(j),B):j===63?(e.consume(j),_):Wn(j)?(e.consume(j),U):r(j)}function d(j){return j===45?(e.consume(j),p):j===91?(e.consume(j),l=0,w):Wn(j)?(e.consume(j),A):r(j)}function p(j){return j===45?(e.consume(j),v):r(j)}function g(j){return j===null?r(j):j===45?(e.consume(j),y):Me(j)?(u=g,q(j)):(e.consume(j),g)}function y(j){return j===45?(e.consume(j),v):g(j)}function v(j){return j===62?M(j):j===45?y(j):g(j)}function w(j){const z="CDATA[";return j===z.charCodeAt(l++)?(e.consume(j),l===z.length?C:w):r(j)}function C(j){return j===null?r(j):j===93?(e.consume(j),N):Me(j)?(u=C,q(j)):(e.consume(j),C)}function N(j){return j===93?(e.consume(j),S):C(j)}function S(j){return j===62?M(j):j===93?(e.consume(j),S):C(j)}function A(j){return j===null||j===62?M(j):Me(j)?(u=A,q(j)):(e.consume(j),A)}function _(j){return j===null?r(j):j===63?(e.consume(j),k):Me(j)?(u=_,q(j)):(e.consume(j),_)}function k(j){return j===62?M(j):_(j)}function B(j){return Wn(j)?(e.consume(j),T):r(j)}function T(j){return j===45||vn(j)?(e.consume(j),T):O(j)}function O(j){return Me(j)?(u=O,q(j)):Xe(j)?(e.consume(j),O):M(j)}function U(j){return j===45||vn(j)?(e.consume(j),U):j===47||j===62||nn(j)?P(j):r(j)}function P(j){return j===47?(e.consume(j),M):j===58||j===95||Wn(j)?(e.consume(j),F):Me(j)?(u=P,q(j)):Xe(j)?(e.consume(j),P):M(j)}function F(j){return j===45||j===46||j===58||j===95||vn(j)?(e.consume(j),F):I(j)}function I(j){return j===61?(e.consume(j),Y):Me(j)?(u=I,q(j)):Xe(j)?(e.consume(j),I):P(j)}function Y(j){return j===null||j===60||j===61||j===62||j===96?r(j):j===34||j===39?(e.consume(j),o=j,Q):Me(j)?(u=Y,q(j)):Xe(j)?(e.consume(j),Y):(e.consume(j),L)}function Q(j){return j===o?(e.consume(j),o=void 0,V):j===null?r(j):Me(j)?(u=Q,q(j)):(e.consume(j),Q)}function L(j){return j===null||j===34||j===39||j===60||j===61||j===96?r(j):j===47||j===62||nn(j)?P(j):(e.consume(j),L)}function V(j){return j===47||j===62||nn(j)?P(j):r(j)}function M(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):r(j)}function q(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),X}function X(j){return Xe(j)?rt(e,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):Z(j)}function Z(j){return e.enter("htmlTextData"),u(j)}}const eg={name:"labelEnd",resolveAll:h5,resolveTo:p5,tokenize:m5},c5={tokenize:g5},f5={tokenize:y5},d5={tokenize:x5};function h5(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",t+=o}}return e.length!==r.length&&tr(e,0,e.length,r),e}function p5(e,t){let r=e.length,a=0,o,l,u,f;for(;r--;)if(o=e[r][1],l){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(l=r,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(u=r);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=Rn(f,e.slice(l+1,l+a+3)),f=Rn(f,[["enter",p,t]]),f=Rn(f,Jm(t.parser.constructs.insideSpan.null,e.slice(l+a+4,u-3),t)),f=Rn(f,[["exit",p,t],e[u-2],e[u-1],["exit",d,t]]),f=Rn(f,e.slice(u+1)),f=Rn(f,[["exit",h,t]]),tr(e,l,e.length,f),e}function m5(e,t,r){const a=this;let o=a.events.length,l,u;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){l=a.events[o][1];break}return f;function f(y){return l?l._inactive?g(y):(u=a.parser.defined.includes(uo(a.sliceSerialize({start:l.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),h):r(y)}function h(y){return y===40?e.attempt(c5,p,u?p:g)(y):y===91?e.attempt(f5,p,u?d:g)(y):u?p(y):g(y)}function d(y){return e.attempt(d5,p,g)(y)}function p(y){return t(y)}function g(y){return l._balanced=!0,r(y)}}function g5(e,t,r){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return nn(g)?Vs(e,l)(g):l(g)}function l(g){return g===41?p(g):GE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return nn(g)?Vs(e,h)(g):p(g)}function f(g){return r(g)}function h(g){return g===34||g===39||g===40?QE(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function d(g){return nn(g)?Vs(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):r(g)}}function y5(e,t,r){const a=this;return o;function o(f){return XE.call(a,e,l,u,"reference","referenceMarker","referenceString")(f)}function l(f){return a.parser.defined.includes(uo(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function u(f){return r(f)}}function x5(e,t,r){return a;function a(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),o}function o(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):r(l)}}const v5={name:"labelStartImage",resolveAll:eg.resolveAll,tokenize:b5};function b5(e,t,r){const a=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),l}function l(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(f):t(f)}}const w5={name:"labelStartLink",resolveAll:eg.resolveAll,tokenize:S5};function S5(e,t,r){const a=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):t(u)}}const ap={name:"lineEnding",tokenize:E5};function E5(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),rt(e,t,"linePrefix")}}const xc={name:"thematicBreak",tokenize:C5};function C5(e,t,r){let a=0,o;return l;function l(d){return e.enter("thematicBreak"),u(d)}function u(d){return o=d,f(d)}function f(d){return d===o?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||Me(d))?(e.exit("thematicBreak"),t(d)):r(d)}function h(d){return d===o?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),Xe(d)?rt(e,f,"whitespace")(d):f(d))}}const Zt={continuation:{tokenize:M5},exit:A5,name:"list",tokenize:k5},_5={partial:!0,tokenize:R5},N5={partial:!0,tokenize:T5};function k5(e,t,r){const a=this,o=a.events[a.events.length-1];let l=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(v){const w=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Jp(v)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(xc,r,d)(v):d(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return r(v)}function h(v){return Jp(v)&&++u<10?(e.consume(v),h):(!a.interrupt||u<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):r(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(lf,a.interrupt?r:p,e.attempt(_5,y,g))}function p(v){return a.containerState.initialBlankLine=!0,l++,y(v)}function g(v){return Xe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):r(v)}function y(v){return a.containerState.size=l+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function M5(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(lf,o,l);function o(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,rt(e,t,"listItemIndent",a.containerState.size+1)(f)}function l(f){return a.containerState.furtherBlankLines||!Xe(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(N5,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,rt(e,e.attempt(Zt,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function T5(e,t,r){const a=this;return rt(e,o,"listItemIndent",a.containerState.size+1);function o(l){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(l):r(l)}}function A5(e){e.exit(this.containerState.type)}function R5(e,t,r){const a=this;return rt(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(l){const u=a.events[a.events.length-1];return!Xe(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):r(l)}}const y1={name:"setextUnderline",resolveTo:j5,tokenize:O5};function j5(e,t){let r=e.length,a,o,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!l&&e[r][1].type==="definition"&&(l=r);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",l?(e.splice(o,0,["enter",u,t]),e.splice(l+1,0,["exit",e[a][1],t]),e[a][1].end={...e[l][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function O5(e,t,r){const a=this;let o;return l;function l(d){let p=a.events.length,g;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){g=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),o=d,u(d)):r(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===o?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Xe(d)?rt(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Me(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const D5={tokenize:z5};function z5(e){const t=this,r=e.attempt(lf,a,e.attempt(this.parser.constructs.flowInitial,o,rt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Pz,o)),"linePrefix")));return r;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const L5={resolveAll:ZE()},I5=KE("string"),B5=KE("text");function KE(e){return{resolveAll:ZE(e==="text"?H5:void 0),tokenize:t};function t(r){const a=this,o=this.parser.constructs[e],l=r.attempt(o,u,f);return u;function u(p){return d(p)?l(p):f(p)}function f(p){if(p===null){r.consume(p);return}return r.enter("data"),r.consume(p),h}function h(p){return d(p)?(r.exit("data"),l(p)):(r.consume(p),h)}function d(p){if(p===null)return!0;const g=o[p];let y=-1;if(g)for(;++y<g.length;){const v=g[y];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function ZE(e){return t;function t(r,a){let o=-1,l;for(;++o<=r.length;)l===void 0?r[o]&&r[o][1].type==="data"&&(l=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==l+2&&(r[l][1].end=r[o-1][1].end,r.splice(l+2,o-l-2),o=l+2),l=void 0);return e?e(r,a):r}}function H5(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],o=t.sliceStream(a);let l=o.length,u=-1,f=0,h;for(;l--;){const d=o[l];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:a.start._bufferIndex+u,_index:a.start._index+l,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const P5={42:Zt,43:Zt,45:Zt,48:Zt,49:Zt,50:Zt,51:Zt,52:Zt,53:Zt,54:Zt,55:Zt,56:Zt,57:Zt,62:qE},U5={91:Yz},V5={[-2]:ip,[-1]:ip,32:ip},q5={35:Zz,42:xc,45:[y1,xc],60:t5,61:y1,95:xc,96:m1,126:m1},F5={38:YE,92:FE},Y5={[-5]:ap,[-4]:ap,[-3]:ap,33:v5,38:YE,42:em,60:[wz,l5],91:w5,92:[Qz,FE],93:eg,95:em,96:Dz},$5={null:[em,L5]},G5={null:[42,95]},X5={null:[]},Q5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:G5,contentInitial:U5,disable:X5,document:P5,flow:q5,flowInitial:V5,insideSpan:$5,string:F5,text:Y5},Symbol.toStringTag,{value:"Module"}));function K5(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},l=[];let u=[],f=[];const h={attempt:O(B),check:O(T),consume:A,enter:_,exit:k,interrupt:O(T,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:g};let p=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function g(I){return u=Rn(u,I),N(),u[u.length-1]!==null?[]:(U(t,0),d.events=Jm(l,d.events,d),d.events)}function y(I,Y){return W5(v(I),Y)}function v(I){return Z5(u,I)}function w(){const{_bufferIndex:I,_index:Y,line:Q,column:L,offset:V}=a;return{_bufferIndex:I,_index:Y,line:Q,column:L,offset:V}}function C(I){o[I.line]=I.column,F()}function N(){let I;for(;a._index<u.length;){const Y=u[a._index];if(typeof Y=="string")for(I=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===I&&a._bufferIndex<Y.length;)S(Y.charCodeAt(a._bufferIndex));else S(Y)}}function S(I){p=p(I)}function A(I){Me(I)?(a.line++,a.column=1,a.offset+=I===-3?2:1,F()):I!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=I}function _(I,Y){const Q=Y||{};return Q.type=I,Q.start=w(),d.events.push(["enter",Q,d]),f.push(Q),Q}function k(I){const Y=f.pop();return Y.end=w(),d.events.push(["exit",Y,d]),Y}function B(I,Y){U(I,Y.from)}function T(I,Y){Y.restore()}function O(I,Y){return Q;function Q(L,V,M){let q,X,Z,j;return Array.isArray(L)?$(L):"tokenize"in L?$([L]):z(L);function z(fe){return de;function de(le){const pe=le!==null&&fe[le],we=le!==null&&fe.null,Ee=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(we)?we:we?[we]:[]];return $(Ee)(le)}}function $(fe){return q=fe,X=0,fe.length===0?M:R(fe[X])}function R(fe){return de;function de(le){return j=P(),Z=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ue():fe.tokenize.call(Y?Object.assign(Object.create(d),Y):d,h,te,ue)(le)}}function te(fe){return I(Z,j),V}function ue(fe){return j.restore(),++X<q.length?R(q[X]):M}}}function U(I,Y){I.resolveAll&&!l.includes(I)&&l.push(I),I.resolve&&tr(d.events,Y,d.events.length-Y,I.resolve(d.events.slice(Y),d)),I.resolveTo&&(d.events=I.resolveTo(d.events,d))}function P(){const I=w(),Y=d.previous,Q=d.currentConstruct,L=d.events.length,V=Array.from(f);return{from:L,restore:M};function M(){a=I,d.previous=Y,d.currentConstruct=Q,d.events.length=L,f=V,F()}}function F(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function Z5(e,t){const r=t.start._index,a=t.start._bufferIndex,o=t.end._index,l=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(a,l)];else{if(u=e.slice(r,o),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}l>0&&u.push(e[o].slice(0,l))}return u}function W5(e,t){let r=-1;const a=[];let o;for(;++r<e.length;){const l=e[r];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
17
- `;break}case-3:{u=`\r
18
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(l)}o=l===-2,a.push(u)}return a.join("")}function J5(e){const a={constructs:oz([Q5,...(e||{}).extensions||[]]),content:o(pz),defined:[],document:o(gz),flow:o(D5),lazy:{},string:o(I5),text:o(B5)};return a;function o(l){return u;function u(f){return K5(a,l,f)}}}function eL(e){for(;!$E(e););return e}const x1=/[\0\t\n\r]/g;function tL(){let e=1,t="",r=!0,a;return o;function o(l,u,f){const h=[];let d,p,g,y,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),g=0,t="",r&&(l.charCodeAt(0)===65279&&g++,r=void 0);g<l.length;){if(x1.lastIndex=g,d=x1.exec(l),y=d&&d.index!==void 0?d.index:l.length,v=l.charCodeAt(y),!d){t=l.slice(g);break}if(v===10&&g===y&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),g<y&&(h.push(l.slice(g,y)),e+=y-g),v){case 0:{h.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,h.push(-2);e++<p;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}g=y+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const nL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rL(e){return e.replace(nL,iL)}function iL(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),l=o===120||o===88;return VE(r.slice(l?2:1),l?16:10)}return Wm(r)||e}const WE={}.hasOwnProperty;function aL(e,t,r){return typeof t!="string"&&(r=t,t=void 0),oL(r)(eL(J5(r).document().write(tL()(e,t,!0))))}function oL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:l(ge),blockQuote:l(we),characterEscape:P,characterReference:P,codeFenced:l(Ee),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Ee,u),codeText:l(ve,u),codeTextData:P,data:P,codeFlowValue:P,definition:l(Ce),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(ce),hardBreakEscape:l(be),hardBreakTrailing:l(be),htmlFlow:l(De,u),htmlFlowData:P,htmlText:l(De,u),htmlTextData:P,image:l(qe),label:u,link:l(Fe),listItem:l(Ot),listItemValue:y,listOrdered:l(_t,g),listUnordered:l(_t),paragraph:l(on),reference:R,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(ge),strong:l(wn),thematicBreak:l(ct)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:pe,autolinkProtocol:le,blockQuote:h(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:fe,characterReference:de,codeFenced:h(N),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:h(S),codeText:h(V),codeTextData:F,data:F,definition:h(),definitionDestinationString:k,definitionLabelString:A,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(Q),htmlFlowData:F,htmlText:h(L),htmlTextData:F,image:h(q),label:Z,labelText:X,lineEnding:I,link:h(M),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:te,resourceDestinationString:j,resourceTitleString:z,resource:$,setextHeading:h(U),setextHeadingLineSequence:O,setextHeadingText:T,strong:h(),thematicBreak:h()}};JE(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(ie){let me={type:"root",children:[]};const Ne={stack:[me],tokenStack:[],config:t,enter:f,exit:d,buffer:u,resume:p,data:r},ze=[];let Ue=-1;for(;++Ue<ie.length;)if(ie[Ue][1].type==="listOrdered"||ie[Ue][1].type==="listUnordered")if(ie[Ue][0]==="enter")ze.push(Ue);else{const Ht=ze.pop();Ue=o(ie,Ht,Ue)}for(Ue=-1;++Ue<ie.length;){const Ht=t[ie[Ue][0]];WE.call(Ht,ie[Ue][1].type)&&Ht[ie[Ue][1].type].call(Object.assign({sliceSerialize:ie[Ue][2].sliceSerialize},Ne),ie[Ue][1])}if(Ne.tokenStack.length>0){const Ht=Ne.tokenStack[Ne.tokenStack.length-1];(Ht[1]||v1).call(Ne,void 0,Ht[0])}for(me.position={start:si(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:si(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<t.transforms.length;)me=t.transforms[Ue](me)||me;return me}function o(ie,me,Ne){let ze=me-1,Ue=-1,Ht=!1,jn,kt,ht,Dt;for(;++ze<=Ne;){const Qe=ie[ze];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Ue++:Ue--,Dt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(jn&&!Dt&&!Ue&&!ht&&(ht=ze),Dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dt=void 0}if(!Ue&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Ue===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(jn){let Vn=ze;for(kt=void 0;Vn--;){const sn=ie[Vn];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;kt&&(ie[kt][1].type="lineEndingBlank",Ht=!0),sn[1].type="lineEnding",kt=Vn}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}ht&&(!kt||ht<kt)&&(jn._spread=!0),jn.end=Object.assign({},kt?ie[kt][1].start:Qe[1].end),ie.splice(kt||ze,0,["exit",jn,Qe[2]]),ze++,Ne++}if(Qe[1].type==="listItemPrefix"){const Vn={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};jn=Vn,ie.splice(ze,0,["enter",Vn,Qe[2]]),ze++,Ne++,ht=void 0,Dt=!0}}}return ie[me][1]._spread=Ht,Ne}function l(ie,me){return Ne;function Ne(ze){f.call(this,ie(ze),ze),me&&me.call(this,ze)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ie,me,Ne){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([me,Ne||void 0]),ie.position={start:si(me.start),end:void 0}}function h(ie){return me;function me(Ne){ie&&ie.call(this,Ne),d.call(this,Ne)}}function d(ie,me){const Ne=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==ie.type&&(me?me.call(this,ie,ze[0]):(ze[1]||v1).call(this,ie,ze[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Us({start:ie.start,end:ie.end})+"): it’s not open");Ne.position.end=si(ie.end)}function p(){return iz(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(ie){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.lang=ie}function w(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie.replace(/(\r?\n|\r)$/g,"")}function A(ie){const me=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=me,Ne.identifier=uo(this.sliceSerialize(ie)).toLowerCase()}function _(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.title=ie}function k(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.url=ie}function B(ie){const me=this.stack[this.stack.length-1];if(!me.depth){const Ne=this.sliceSerialize(ie).length;me.depth=Ne}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function O(ie){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ie){const Ne=this.stack[this.stack.length-1].children;let ze=Ne[Ne.length-1];(!ze||ze.type!=="text")&&(ze=Te(),ze.position={start:si(ie.start),end:void 0},Ne.push(ze)),this.stack.push(ze)}function F(ie){const me=this.stack.pop();me.value+=this.sliceSerialize(ie),me.position.end=si(ie.end)}function I(ie){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=me.children[me.children.length-1];Ne.position.end=si(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(P.call(this,ie),F.call(this,ie))}function Y(){this.data.atHardBreak=!0}function Q(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function L(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function V(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function M(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=me,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function q(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=me,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function X(ie){const me=this.sliceSerialize(ie),Ne=this.stack[this.stack.length-2];Ne.label=rL(me),Ne.identifier=uo(me).toLowerCase()}function Z(){const ie=this.stack[this.stack.length-1],me=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const ze=ie.children;Ne.children=ze}else Ne.alt=me}function j(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.url=ie}function z(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.title=ie}function $(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function te(ie){const me=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=me,Ne.identifier=uo(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function ue(ie){this.data.characterReferenceType=ie.type}function fe(ie){const me=this.sliceSerialize(ie),Ne=this.data.characterReferenceType;let ze;Ne?(ze=VE(me,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=Wm(me);const Ue=this.stack[this.stack.length-1];Ue.value+=ze}function de(ie){const me=this.stack.pop();me.position.end=si(ie.end)}function le(ie){F.call(this,ie);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ie)}function pe(ie){F.call(this,ie);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ie)}function we(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function ge(){return{type:"heading",depth:0,children:[]}}function be(){return{type:"break"}}function De(){return{type:"html",value:""}}function qe(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function _t(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Ot(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function on(){return{type:"paragraph",children:[]}}function wn(){return{type:"strong",children:[]}}function Te(){return{type:"text",value:""}}function ct(){return{type:"thematicBreak"}}}function si(e){return{line:e.line,column:e.column,offset:e.offset}}function JE(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?JE(e,a):sL(e,a)}}function sL(e,t){let r;for(r in t)if(WE.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function v1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Us({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Us({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Us({start:t.start,end:t.end})+") is still open")}function lL(e){const t=this;t.parser=r;function r(a){return aL(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uL(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function cL(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
19
- `}]}function fL(e,t){const r=t.value?t.value+`
20
- `:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function dL(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hL(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pL(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=No(a.toLowerCase()),l=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=l+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function mL(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gL(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function eC(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),l=o[0];l&&l.type==="text"?l.value="["+l.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function yL(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return eC(e,t);const o={src:No(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const l={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,l),e.applyData(t,l)}function xL(e,t){const r={src:No(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function vL(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function bL(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return eC(e,t);const o={href:No(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const l={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function wL(e,t){const r={href:No(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function SL(e,t,r){const a=e.all(t),o=r?EL(r):tC(t),l={},u=[];if(typeof t.checked=="boolean"){const p=a[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const p=a[f];(o||f!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
21
- `}),p.type==="element"&&p.tagName==="p"&&!o?u.push(...p.children):u.push(p)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
22
- `});const d={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,d),e.applyData(t,d)}function EL(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=tC(r[a])}return t}function tC(e){const t=e.spread;return t??e.children.length>1}function CL(e,t){const r={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<a.length;){const u=a[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function _L(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function NL(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function kL(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ML(e,t){const r=e.all(t),a=r.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),o.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Xm(t.children[1]),h=zE(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),o.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)}function TL(e,t,r){const a=r?r.children:void 0,l=(a?a.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const g=t.children[h],y={},v=u?u[h]:void 0;v&&(y.align=v);let w={type:"element",tagName:l,properties:y,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),d.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function AL(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const b1=9,w1=32;function RL(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),o=0;const l=[];for(;a;)l.push(S1(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(t);return l.push(S1(t.slice(o),o>0,!1)),l.join("")}function S1(e,t,r){let a=0,o=e.length;if(t){let l=e.codePointAt(a);for(;l===b1||l===w1;)a++,l=e.codePointAt(a)}if(r){let l=e.codePointAt(o-1);for(;l===b1||l===w1;)o--,l=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function jL(e,t){const r={type:"text",value:RL(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function OL(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const DL={blockquote:uL,break:cL,code:fL,delete:dL,emphasis:hL,footnoteReference:pL,heading:mL,html:gL,imageReference:yL,image:xL,inlineCode:vL,linkReference:bL,link:wL,listItem:SL,list:CL,paragraph:_L,root:NL,strong:kL,table:ML,tableCell:AL,tableRow:TL,text:jL,thematicBreak:OL,toml:ic,yaml:ic,definition:ic,footnoteDefinition:ic};function ic(){}const nC=-1,uf=0,qs=1,Hc=2,tg=3,ng=4,rg=5,ig=6,rC=7,iC=8,E1=typeof self=="object"?self:globalThis,zL=(e,t)=>{const r=(o,l)=>(e.set(l,o),o),a=o=>{if(e.has(o))return e.get(o);const[l,u]=t[o];switch(l){case uf:case nC:return r(u,o);case qs:{const f=r([],o);for(const h of u)f.push(a(h));return f}case Hc:{const f=r({},o);for(const[h,d]of u)f[a(h)]=a(d);return f}case tg:return r(new Date(u),o);case ng:{const{source:f,flags:h}=u;return r(new RegExp(f,h),o)}case rg:{const f=r(new Map,o);for(const[h,d]of u)f.set(a(h),a(d));return f}case ig:{const f=r(new Set,o);for(const h of u)f.add(a(h));return f}case rC:{const{name:f,message:h}=u;return r(new E1[f](h),o)}case iC:return r(BigInt(u),o);case"BigInt":return r(Object(BigInt(u)),o);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new E1[l](u),o)};return a},C1=e=>zL(new Map,e)(0),Ja="",{toString:LL}={},{keys:IL}=Object,Os=e=>{const t=typeof e;if(t!=="object"||!e)return[uf,t];const r=LL.call(e).slice(8,-1);switch(r){case"Array":return[qs,Ja];case"Object":return[Hc,Ja];case"Date":return[tg,Ja];case"RegExp":return[ng,Ja];case"Map":return[rg,Ja];case"Set":return[ig,Ja];case"DataView":return[qs,r]}return r.includes("Array")?[qs,r]:r.includes("Error")?[rC,r]:[Hc,r]},ac=([e,t])=>e===uf&&(t==="function"||t==="symbol"),BL=(e,t,r,a)=>{const o=(u,f)=>{const h=a.push(u)-1;return r.set(f,h),h},l=u=>{if(r.has(u))return r.get(u);let[f,h]=Os(u);switch(f){case uf:{let p=u;switch(h){case"bigint":f=iC,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);p=null;break;case"undefined":return o([nC],u)}return o([f,p],u)}case qs:{if(h){let y=u;return h==="DataView"?y=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(y=new Uint8Array(u)),o([h,[...y]],u)}const p=[],g=o([f,p],u);for(const y of u)p.push(l(y));return g}case Hc:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],g=o([f,p],u);for(const y of IL(u))(e||!ac(Os(u[y])))&&p.push([l(y),l(u[y])]);return g}case tg:return o([f,u.toISOString()],u);case ng:{const{source:p,flags:g}=u;return o([f,{source:p,flags:g}],u)}case rg:{const p=[],g=o([f,p],u);for(const[y,v]of u)(e||!(ac(Os(y))||ac(Os(v))))&&p.push([l(y),l(v)]);return g}case ig:{const p=[],g=o([f,p],u);for(const y of u)(e||!ac(Os(y)))&&p.push(l(y));return g}}const{message:d}=u;return o([f,{name:h,message:d}],u)};return l},_1=(e,{json:t,lossy:r}={})=>{const a=[];return BL(!(t||r),!!t,new Map,a)(e),a},Pc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?C1(_1(e,t)):structuredClone(e):(e,t)=>C1(_1(e,t));function HL(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function PL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function UL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||HL,a=e.options.footnoteBackLabel||PL,o=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const p=e.all(d),g=String(d.identifier).toUpperCase(),y=No(g.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let A=typeof r=="string"?r:r(h,v);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const A=N.children[N.children.length-1];A&&A.type==="text"?A.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else p.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(d,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Pc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
23
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
24
- `}]}}const aC=(function(e){if(e==null)return YL;if(typeof e=="function")return cf(e);if(typeof e=="object")return Array.isArray(e)?VL(e):qL(e);if(typeof e=="string")return FL(e);throw new Error("Expected function, string, or object as test")});function VL(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=aC(e[r]);return cf(a);function a(...o){let l=-1;for(;++l<t.length;)if(t[l].apply(this,o))return!0;return!1}}function qL(e){const t=e;return cf(r);function r(a){const o=a;let l;for(l in e)if(o[l]!==t[l])return!1;return!0}}function FL(e){return cf(t);function t(r){return r&&r.type===e}}function cf(e){return t;function t(r,a,o){return!!($L(r)&&e.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function YL(){return!0}function $L(e){return e!==null&&typeof e=="object"&&"type"in e}const oC=[],GL=!0,N1=!1,XL="skip";function QL(e,t,r,a){let o;typeof t=="function"&&typeof r!="function"?(a=r,r=t):o=t;const l=aC(o),u=a?-1:1;f(e,void 0,[])();function f(h,d,p){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=oC,w,C,N;if((!t||l(h,d,p[p.length-1]||void 0))&&(v=KL(r(h,p)),v[0]===N1))return v;if("children"in h&&h.children){const S=h;if(S.children&&v[0]!==XL)for(C=(a?S.children.length:-1)+u,N=p.concat(S);C>-1&&C<S.children.length;){const A=S.children[C];if(w=f(A,C,N)(),w[0]===N1)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function KL(e){return Array.isArray(e)?e:typeof e=="number"?[GL,e]:e==null?oC:[e]}function sC(e,t,r,a){let o,l,u;typeof t=="function"&&typeof r!="function"?(l=void 0,u=t,o=r):(l=t,u=r,o=a),QL(e,l,f,o);function f(h,d){const p=d[d.length-1],g=p?p.children.indexOf(h):void 0;return u(h,g,p)}}const tm={}.hasOwnProperty,ZL={};function WL(e,t){const r=t||ZL,a=new Map,o=new Map,l=new Map,u={...DL,...r.handlers},f={all:d,applyData:e6,definitionById:a,footnoteById:o,footnoteCounts:l,footnoteOrder:[],handlers:u,one:h,options:r,patch:JL,wrap:n6};return sC(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?a:o,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),f;function h(p,g){const y=p.type,v=f.handlers[y];if(tm.call(f.handlers,y)&&v)return v(f,p,g);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in p){const{children:C,...N}=p,S=Pc(N);return S.children=f.all(p),S}return Pc(p)}return(f.options.unknownHandler||t6)(f,p,g)}function d(p){const g=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=f.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=k1(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=k1(C.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function JL(e,t){e.position&&(t.position=LD(e))}function e6(e,t){let r=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,l=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const u="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:u}}r.type==="element"&&l&&Object.assign(r.properties,Pc(l)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function t6(e,t){const r=t.data||{},a="value"in t&&!(tm.call(r,"hProperties")||tm.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function n6(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
25
- `});++a<e.length;)a&&r.push({type:"text",value:`
26
- `}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
27
- `}),r}function k1(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function M1(e,t){const r=WL(e,t),a=r.one(e,void 0),o=UL(r),l=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&l.children.push({type:"text",value:`
28
- `},o),l}function r6(e,t){return e&&"run"in e?async function(r,a){const o=M1(r,{file:a,...t});await e.run(o,a)}:function(r,a){return M1(r,{file:a,...e||t})}}function T1(e){if(e)throw e}var op,A1;function i6(){if(A1)return op;A1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!g)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},u=function(d,p){r&&p.name==="__proto__"?r(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},f=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(a)return a(d,p).value}else return;return d[p]};return op=function h(){var d,p,g,y,v,w,C=arguments[0],N=1,S=arguments.length,A=!1;for(typeof C=="boolean"&&(A=C,C=arguments[1]||{},N=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});N<S;++N)if(d=arguments[N],d!=null)for(p in d)g=f(C,p),y=f(d,p),C!==y&&(A&&y&&(l(y)||(v=o(y)))?(v?(v=!1,w=g&&o(g)?g:[]):w=g&&l(g)?g:{},u(C,{name:p,newValue:h(A,w,y)})):typeof y<"u"&&u(C,{name:p,newValue:y}));return C},op}var a6=i6();const sp=Vc(a6);function nm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function o6(){const e=[],t={run:r,use:a};return t;function r(...o){let l=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...o);function f(h,...d){const p=e[++l];let g=-1;if(h){u(h);return}for(;++g<o.length;)(d[g]===null||d[g]===void 0)&&(d[g]=o[g]);o=d,p?s6(p,f)(...d):u(null,...d)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function s6(e,t){let r;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(o);try{h=e.apply(this,u)}catch(d){const p=d;if(f&&r)throw p;return o(p)}f||(h&&h.then&&typeof h.then=="function"?h.then(l,o):h instanceof Error?o(h):l(h))}function o(u,...f){r||(r=!0,t(u,...f))}function l(u){o(null,u)}}const Qn={basename:l6,dirname:u6,extname:c6,join:f6,sep:"/"};function l6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wl(e);let r=0,a=-1,o=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else a<0&&(l=!0,a=o+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else u<0&&(l=!0,u=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(a=o):(f=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function u6(e){if(wl(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function c6(e){wl(e);let t=e.length,r=-1,a=0,o=-1,l=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),f===46?o<0?o=t:l!==1&&(l=1):o>-1&&(l=-1)}return o<0||r<0||l===0||l===1&&o===r-1&&o===a+1?"":e.slice(o,r)}function f6(...e){let t=-1,r;for(;++t<e.length;)wl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":d6(r)}function d6(e){wl(e);const t=e.codePointAt(0)===47;let r=h6(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function h6(e,t){let r="",a=0,o=-1,l=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(o===u-1||l===1))if(o!==u-1&&l===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",a=0):(r=r.slice(0,h),a=r.length-1-r.lastIndexOf("/")),o=u,l=0;continue}}else if(r.length>0){r="",a=0,o=u,l=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(o+1,u):r=e.slice(o+1,u),a=u-o-1;o=u,l=0}else f===46&&l>-1?l++:l=-1}return r}function wl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const p6={cwd:m6};function m6(){return"/"}function rm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function g6(e){if(typeof e=="string")e=new URL(e);else if(!rm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return y6(e)}function y6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const lp=["history","path","basename","stem","extname","dirname"];class lC{constructor(t){let r;t?rm(t)?r={path:t}:typeof t=="string"||x6(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":p6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<lp.length;){const l=lp[a];l in r&&r[l]!==void 0&&r[l]!==null&&(this[l]=l==="history"?[...r[l]]:r[l])}let o;for(o in r)lp.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Qn.basename(this.path):void 0}set basename(t){cp(t,"basename"),up(t,"basename"),this.path=Qn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qn.dirname(this.path):void 0}set dirname(t){R1(this.basename,"dirname"),this.path=Qn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qn.extname(this.path):void 0}set extname(t){if(up(t,"extname"),R1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Qn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rm(t)&&(t=g6(t)),cp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qn.basename(this.path,this.extname):void 0}set stem(t){cp(t,"stem"),up(t,"stem"),this.path=Qn.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const o=this.message(t,r,a);throw o.fatal=!0,o}info(t,r,a){const o=this.message(t,r,a);return o.fatal=void 0,o}message(t,r,a){const o=new Bt(t,r,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function up(e,t){if(e&&e.includes(Qn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qn.sep+"`")}function cp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function R1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function x6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v6=(function(e){const a=this.constructor.prototype,o=a[e],l=function(){return o.apply(l,arguments)};return Object.setPrototypeOf(l,a),l}),b6={}.hasOwnProperty;class ag extends v6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=o6()}copy(){const t=new ag;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(sp(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(hp("data",this.frozen),this.namespace[t]=r,this):b6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=r.call(t,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=oc(t),a=this.parser||this.Parser;return fp("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),fp("process",this.parser||this.Parser),dp("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(l,u){const f=oc(t),h=a.parse(f);a.run(h,f,function(p,g,y){if(p||!g||!y)return d(p);const v=g,w=a.stringify(v,y);E6(w)?y.value=w:y.result=w,d(p,y)});function d(p,g){p||!g?u(p):l?l(g):r(void 0,g)}}}processSync(t){let r=!1,a;return this.freeze(),fp("processSync",this.parser||this.Parser),dp("processSync",this.compiler||this.Compiler),this.process(t,o),O1("processSync","process",r),a;function o(l,u){r=!0,T1(l),a=u}}run(t,r,a){j1(t),this.freeze();const o=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?l(void 0,a):new Promise(l);function l(u,f){const h=oc(r);o.run(t,h,d);function d(p,g,y){const v=g||t;p?f(p):u?u(v):a(void 0,v,y)}}}runSync(t,r){let a=!1,o;return this.run(t,r,l),O1("runSync","run",a),o;function l(u,f){T1(u),o=f,a=!0}}stringify(t,r){this.freeze();const a=oc(r),o=this.compiler||this.Compiler;return dp("stringify",o),j1(t),o(t,a)}use(t,...r){const a=this.attachers,o=this.namespace;if(hp("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...g]=d;h(p,g)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(o.settings=sp(!0,o.settings,d.settings))}function f(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const g=d[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,p){let g=-1,y=-1;for(;++g<a.length;)if(a[g][0]===d){y=g;break}if(y===-1)a.push([d,...p]);else if(p.length>0){let[v,...w]=p;const C=a[y][1];nm(C)&&nm(v)&&(v=sp(!0,C,v)),a[y]=[d,v,...w]}}}}const w6=new ag().freeze();function fp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function j1(e){if(!nm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function O1(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oc(e){return S6(e)?e:new lC(e)}function S6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function E6(e){return typeof e=="string"||C6(e)}function C6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",D1=[],z1={allowDangerousHtml:!0},N6=/^(https?|ircs?|mailto|xmpp)$/i,k6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function M6(e){const t=T6(e),r=A6(e);return R6(t.runSync(t.parse(r),r),e)}function T6(e){const t=e.rehypePlugins||D1,r=e.remarkPlugins||D1,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...z1}:z1;return w6().use(lL).use(r).use(r6,a).use(t)}function A6(e){const t=e.children||"",r=new lC;return typeof t=="string"&&(r.value=t),r}function R6(e,t){const r=t.allowedElements,a=t.allowElement,o=t.components,l=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||j6;for(const p of k6)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+_6+p.id,void 0);return sC(e,d),UD(e,{Fragment:b.Fragment,components:o,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function d(p,g,y){if(p.type==="raw"&&y&&typeof g=="number")return u?y.children.splice(g,1):y.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let v;for(v in rp)if(Object.hasOwn(rp,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],C=rp[v];(C===null||C.includes(p.tagName))&&(p.properties[v]=h(String(w||""),v,p))}}if(p.type==="element"){let v=r?!r.includes(p.tagName):l?l.includes(p.tagName):!1;if(!v&&a&&typeof g=="number"&&(v=!a(p,g,y)),v&&y&&typeof g=="number")return f&&p.children?y.children.splice(g,1,...p.children):y.children.splice(g,1),g}}}function j6(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||a!==-1&&t>a||N6.test(e.slice(0,t))?e:""}function uC({children:e,className:t}){return b.jsx("div",{className:`markdown-view ${t??""}`,children:b.jsx(M6,{children:e})})}function O6({sessionId:e,nodeId:t,runStatus:r="complete",currentNodeId:a=null}){const{data:o,isLoading:l,error:u}=xM(e,t);return t?b.jsxs("div",{children:[b.jsx(D6,{stepLabel:o?.stepLabel??null,nodeId:t}),b.jsxs("div",{className:"p-4 space-y-4",children:[l&&b.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading..."}),u&&b.jsx("div",{className:"text-[var(--error)] text-sm bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3",children:u.message}),o&&b.jsx(L6,{detail:o,runStatus:r,currentNodeId:a})]})]}):b.jsx("div",{className:"px-5 py-8 text-sm text-[var(--text-secondary)]",children:"Select a node in the lineage to inspect its recap, validations, gaps, and artifacts."})}function D6({stepLabel:e,nodeId:t}){return b.jsxs("div",{className:"px-5 py-4 border-b border-[var(--border)] console-blueprint-grid",children:[b.jsx("div",{className:"text-base font-semibold text-[var(--text-primary)] leading-tight",children:e??"Untitled node"}),b.jsx("div",{className:"mt-1 font-mono text-[11px] text-[var(--text-muted)] truncate",children:t})]})}const z6=[{id:"recap",column:"primary",render:({detail:e,runStatus:t,currentNodeId:r})=>e.recapMarkdown?b.jsx(P6,{markdown:e.recapMarkdown},"recap"):t==="in_progress"&&e.nodeId===r&&!e.recapMarkdown?b.jsx(I6,{detail:e},"recap-in-progress"):null},{id:"validations",column:"primary",render:({detail:e})=>e.validations.length>0?b.jsx(V6,{validations:e.validations},"validations"):null},{id:"gaps",column:"primary",render:({detail:e})=>e.gaps.length>0?b.jsx(F6,{gaps:e.gaps},"gaps"):null},{id:"advance-outcome",column:"primary",render:({detail:e})=>e.advanceOutcome?b.jsx(U6,{outcome:e.advanceOutcome},"advance-outcome"):null},{id:"artifacts",column:"primary",render:({detail:e})=>e.artifacts.length>0?b.jsx(G6,{artifacts:e.artifacts},"artifacts"):null},{id:"node-meta",column:"primary",render:({detail:e})=>b.jsx(H6,{detail:e},"node-meta")}];function L6(e){return b.jsx("div",{className:"space-y-4",children:z6.map(t=>t.render(e))})}function I6({detail:e}){return b.jsx(la,{title:"Recap",children:b.jsxs("div",{className:"space-y-4 text-sm text-[var(--text-secondary)]",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx(B6,{children:"In progress"}),b.jsxs("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:["event #",e.createdAtEventIndex]})]}),b.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[b.jsx(L1,{label:"Current focus",value:e.stepLabel??"Current workflow step",supportingText:"This step is still running, so the recap will appear once execution finishes."}),b.jsx(L1,{label:"Current state",value:"Waiting for step completion",supportingText:"The node has been created and selected as the current workflow position.",mono:!0})]}),b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] overflow-hidden",children:[b.jsx("div",{className:"px-4 py-3 border-b border-[var(--border)]",children:b.jsx(gn,{children:"What lands here next"})}),b.jsxs("div",{className:"p-4 grid gap-3 md:grid-cols-3",children:[b.jsx(pp,{title:"Recap",description:"A step summary is written when this node completes."}),b.jsx(pp,{title:"Validations",description:"Validation results appear if this step records contract checks."}),b.jsx(pp,{title:"Artifacts",description:"Generated outputs show up here after the step produces them."})]})]})]})})}function B6({children:e}){return b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium text-xs",style:{backgroundColor:"rgba(0, 219, 233, 0.12)",color:"var(--accent-strong)"},children:e})}function L1({label:e,value:t,supportingText:r,mono:a=!1}){return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 space-y-2",children:[b.jsx(gn,{children:e}),b.jsx("div",{className:a?"font-mono text-sm text-[var(--text-primary)]":"text-[var(--text-primary)]",children:t}),b.jsx("div",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:r})]})}function pp({title:e,description:t}){return b.jsxs("div",{className:"border border-[var(--border)] bg-[rgba(255,255,255,0.02)] px-3 py-3 space-y-2",children:[b.jsx(gn,{color:"var(--text-secondary)",children:e}),b.jsx("div",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:t})]})}function H6({detail:e}){return b.jsx(la,{title:"Node details",children:b.jsxs("div",{className:"space-y-3",children:[b.jsx(sc,{label:"Kind",value:b.jsx(Q6,{kind:e.nodeKind})}),b.jsx(sc,{label:"Event index",value:String(e.createdAtEventIndex),mono:!0}),b.jsx(sc,{label:"Parent",value:e.parentNodeId??"Root",mono:!0}),b.jsx(sc,{label:"Tip state",value:e.isTip?e.isPreferredTip?"Preferred tip":"Tip":"Historical"})]})})}function P6({markdown:e}){return b.jsx(la,{title:"Recap",children:b.jsx(uC,{children:e})})}function U6({outcome:e}){const t=e.kind==="advanced";return b.jsx(la,{title:"Advance outcome",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs",children:[b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t?"var(--success)20":"var(--blocked)20",color:t?"var(--success)":"var(--blocked)"},children:t?"Advanced":"Blocked"}),b.jsxs("span",{className:"text-[var(--text-muted)]",children:["attempt ",e.attemptId.slice(-8)," at event #",e.recordedAtEventIndex]})]})})}function V6({validations:e}){return b.jsx(la,{title:`Validations (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsx(q6,{validation:t},t.validationId))})})}function q6({validation:e}){const t=e.outcome==="pass";return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t?"var(--success)20":"var(--error)20",color:t?"var(--success)":"var(--error)"},children:t?"Pass":"Fail"}),b.jsx("span",{className:"text-[var(--text-muted)] font-mono",children:e.contractRef})]}),e.issues.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Issues"}),b.jsx("ul",{className:"list-disc list-inside text-[var(--error)] space-y-0.5",children:e.issues.map((r,a)=>b.jsx("li",{children:r},a))})]}),e.suggestions.length>0&&b.jsxs("div",{children:[b.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Suggestions"}),b.jsx("ul",{className:"list-disc list-inside text-[var(--text-secondary)] space-y-0.5",children:e.suggestions.map((r,a)=>b.jsx("li",{children:r},a))})]})]})}function F6({gaps:e}){return b.jsx(la,{title:`Gaps (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsxs("div",{className:"flex items-start gap-3 text-xs bg-[var(--bg-primary)] border border-[var(--border)] px-3 py-3",children:[b.jsx("span",{className:"shrink-0 inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t.isResolved?"var(--success)20":t.severity==="critical"?"var(--error)20":"var(--warning)20",color:t.isResolved?"var(--success)":t.severity==="critical"?"var(--error)":"var(--warning)"},children:t.isResolved?"Resolved":t.severity==="critical"?"Critical":"Non-critical"}),b.jsx("span",{className:"text-[var(--text-secondary)] leading-relaxed",children:t.summary})]},t.gapId))})})}const I1=1e5,Y6=[{prefix:"text/",render:e=>b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e=="string"?e:String(e)})},{prefix:"application/json",render:e=>b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e=="string"?e:JSON.stringify(e,null,2)})}];function $6(e){if(e.byteLength>I1)return b.jsxs("div",{className:"text-[var(--text-muted)] italic",children:["Content too large to display (",im(e.byteLength)," -- limit ",im(I1),")"]});const t=Y6.find(r=>e.contentType.startsWith(r.prefix));return t?t.render(e.content):b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e.content=="string"?e.content:JSON.stringify(e.content,null,2)})}function G6({artifacts:e}){return b.jsx(la,{title:`Artifacts (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[var(--text-muted)]",children:[b.jsx("span",{children:t.contentType}),b.jsx("span",{children:"//"}),b.jsx("span",{children:im(t.byteLength)})]}),$6(t)]},t.sha256))})})}function la({title:e,children:t}){return b.jsxs("div",{children:[b.jsx("div",{className:"mb-2",children:b.jsx(gn,{children:e})}),t]})}function sc({label:e,value:t,mono:r=!1}){return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3",children:[b.jsx(gn,{children:e}),b.jsx("div",{className:r?"mt-2 font-mono text-sm text-[var(--text-secondary)] truncate":"mt-2 text-sm text-[var(--text-primary)]",children:t})]})}const X6={step:{label:"Step",color:"var(--accent)"},checkpoint:{label:"Checkpoint",color:"var(--success)"},blocked_attempt:{label:"Blocked",color:"var(--error)"}};function Q6({kind:e}){const t=X6[e];return b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:`${t.color}20`,color:t.color},children:t.label})}function im(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function K6(e){return e.length>16?`…${e.slice(-16)}`:e}function Z6({data:e}){const t=e.runs[0]??null,r=t?.workflowName??t?.workflowId??"--",a=t?.workflowHash?.slice(0,12)??"--";return b.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border)] px-5 py-4 corner-brackets",style:{backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[e.sessionTitle&&b.jsx("h2",{className:"text-base font-medium text-[var(--text-primary)] mb-3",children:e.sessionTitle}),b.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-8 gap-y-2",children:[b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Session"}),b.jsx("dd",{className:"font-mono text-xs text-[var(--text-secondary)] self-center",children:K6(e.sessionId)}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Workflow"}),b.jsx("dd",{className:"text-sm text-[var(--text-primary)] self-center",children:r}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Hash"}),b.jsx("dd",{className:"font-mono text-xs text-[var(--text-secondary)] self-center",children:a}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Status"}),b.jsxs("dd",{className:"self-center flex items-center gap-2",children:[b.jsx(jw,{health:e.health}),e.health==="healthy"&&b.jsx("span",{className:"text-sm text-[var(--text-primary)]",children:"Healthy"})]}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Runs"}),b.jsxs("dd",{className:"text-sm text-[var(--text-primary)] self-center",children:[e.runs.length," run",e.runs.length!==1?"s":""]})]})]})}function W6({runs:e}){const r=e.some(a=>a.preferredTipNodeId!==null)?"Nodes with a gold border are the current execution tips — click any node to inspect its execution detail.":"Click any node in the DAG to inspect its execution detail.";return b.jsx("p",{className:"border border-[var(--border)] px-4 py-3 text-xs text-[var(--text-muted)]",children:r})}function J6({sessionId:e}){const{data:t,isLoading:r,error:a}=yM(e),[o,l]=H.useState(null),u=H.useCallback((h,d)=>{l(p=>p?.runId===h&&p?.nodeId===d?null:{runId:h,nodeId:d})},[]);if(r)return b.jsx("div",{className:"text-[var(--text-secondary)]",children:"Loading session..."});if(a)return b.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load session: ",a.message]});if(!t)return null;const f=o?t.runs.find(h=>h.runId===o.runId)??null:null;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-4",children:[b.jsx(Z6,{data:t}),t.runs.length===0?b.jsx("div",{className:"text-center py-16 text-[var(--text-secondary)]",children:"No runs in this session"}):b.jsxs(b.Fragment,{children:[o===null&&b.jsx(W6,{runs:t.runs}),b.jsx("div",{className:"space-y-6",children:t.runs.map(h=>b.jsx(eI,{run:h,selectedNodeId:o?.runId===h.runId?o.nodeId:null,onNodeClick:u},h.runId))})]})]}),b.jsxs(Co,{cut:18,borderColor:"rgba(244, 196, 48, 0.35)",background:"rgba(27, 31, 44, 0.78)",dropShadow:"drop-shadow(0 16px 48px rgba(0,0,0,0.9)) drop-shadow(0 2px 12px rgba(244,196,48,0.15))",backdropFilter:"blur(16px)",className:"fixed top-3 right-3 bottom-3 w-[560px] max-w-[calc(92vw-12px)] transition-transform duration-200 ease-out",style:{zIndex:40,transform:o?"translateX(0)":"translateX(calc(100% + 12px))"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0 console-blueprint-grid",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)]",children:"Node detail"}),b.jsx("button",{onClick:()=>l(null),className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none px-1","aria-label":"Close",children:"×"})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:b.jsx(O6,{sessionId:e,nodeId:o?.nodeId??null,runStatus:f?.status??"complete",currentNodeId:f?.preferredTipNodeId??null})})]})]})}function eI({run:e,selectedNodeId:t,onNodeClick:r}){return b.jsxs(Co,{cut:10,background:"rgba(27, 31, 44, 0.72)",backdropFilter:"blur(8px)",className:"relative",style:{height:"506px"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:e.workflowName??e.workflowId??"Run"}),b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:e.runId}),b.jsxs("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:[e.nodes.length," nodes · ",e.tipNodeIds.length," tip",e.tipNodeIds.length!==1?"s":""]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[e.hasUnresolvedCriticalGaps&&b.jsx("span",{className:"text-xs text-[var(--warning)]",children:"Critical gaps"}),b.jsx(Cm,{status:e.status})]})]}),b.jsx("div",{className:"flex-1",children:b.jsx(tD,{run:e,selectedNodeId:t,onNodeClick:a=>r(e.runId,a)})})]})}const Gi=[{id:"coding",label:"Coding"},{id:"review_audit",label:"Review & Audit"},{id:"investigation",label:"Investigation"},{id:"design",label:"Design"},{id:"documentation",label:"Documentation"},{id:"tickets",label:"Tickets"},{id:"learning",label:"Learning"},{id:"authoring",label:"Workflow Authoring"}],Uc=Object.fromEntries(Gi.map(e=>[e.id,e.label]));function B1({label:e,count:t,countLabel:r="workflow",showRule:a=!0,separator:o="//"}){const l=t!=null?` ${o} ${t} ${r}${t!==1?"s":""}`:"";return b.jsxs("div",{className:"flex items-center gap-3 mb-3 mt-2",children:[b.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-secondary)] shrink-0",children:[e,l]}),a&&b.jsx("div",{className:"flex-1 h-px bg-[var(--border)]"})]})}function am({segments:e,className:t=""}){return b.jsx("nav",{"aria-label":"Breadcrumb",className:`flex items-center gap-0 ${t}`,children:e.map((r,a)=>{const o=a===e.length-1,l=!!r.onClick;return b.jsxs("span",{className:"flex items-center",children:[b.jsx("span",{className:"font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mx-1",children:"//"}),l?b.jsx("button",{type:"button",onClick:r.onClick,className:"font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors cursor-pointer",children:r.label.toUpperCase()}):b.jsx("span",{className:`font-mono text-[10px] uppercase tracking-[0.25em] ${o?"text-[var(--text-secondary)]":"text-[var(--text-muted)]"}`,"aria-current":o?"page":void 0,children:r.label.toUpperCase()})]},a)})})}function cC({workflowId:e,activeTag:t,onBack:r}){const l=cm().getQueryData(["workflows"])?.workflows.find(N=>N.id===e),{data:u,isLoading:f,isError:h,error:d,refetch:p}=wM(e),g=t?Uc[t]??t:null,y=u?.name??l?.name??e,v=u?.description??l?.description??null,w=u?.tags??l?.tags??[],C=u?.source??l?.source??null;return b.jsxs("div",{className:"space-y-5 max-w-3xl",children:[b.jsx(am,{segments:g?[{label:"Workflows",onClick:r},{label:g}]:[{label:"Workflows",onClick:r}]}),b.jsxs("div",{className:"border border-[var(--border)] px-5 py-5 console-blueprint-grid",children:[b.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.35em] text-[var(--text-muted)] mb-2",children:"// Workflow"}),b.jsx("h2",{className:"font-mono text-xl font-bold uppercase tracking-[0.08em] leading-tight mb-3",style:{color:"var(--accent)",textShadow:"0 0 24px rgba(244,196,48,0.45), 0 0 48px rgba(244,196,48,0.15)"},children:y}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u&&u.stepCount!=null&&u.stepCount>0&&b.jsxs("span",{className:"font-mono text-[10px] px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-secondary)]",children:[u.stepCount," step",u.stepCount!==1?"s":""]}),w.filter(N=>N!=="routines").map(N=>b.jsx("span",{"aria-hidden":"true",className:"font-mono text-[10px] px-1.5 py-0.5 bg-[var(--bg-secondary)] text-[var(--text-muted)]",children:Uc[N]??N},N)),C&&b.jsxs("span",{"aria-hidden":"true",className:"font-mono text-[10px] px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-muted)]",children:["src: ",C.displayName]})]}),v&&b.jsx("p",{className:"text-sm text-[var(--text-secondary)] leading-relaxed mt-3",children:v})]}),f&&!l?b.jsx(rI,{}):h?b.jsx(iI,{message:d instanceof Error?d.message:"Could not load workflow details.",is404:d instanceof Rw&&d.status===404,onRetry:()=>{p()},onBack:r}):u?b.jsx(tI,{detail:u,name:y}):b.jsx("div",{className:"space-y-4",children:b.jsx(fC,{})}),b.jsx(am,{segments:[{label:"Workflows",onClick:r}]})]})}function tI({detail:e,name:t}){const r=e.about!==void 0&&e.about.length>0,a=e.examples!==void 0&&e.examples.length>0,o=e.preconditions!==void 0&&e.preconditions.length>0;return r||a||o?b.jsxs("div",{className:"space-y-6",children:[r&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"About"}),b.jsx(uC,{children:e.about})]}),a&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Try it with:"}),b.jsx("ul",{className:"space-y-2",children:e.examples.map(u=>b.jsxs("li",{className:"flex items-start gap-3 bg-[var(--bg-card)] border border-[var(--border)] rounded-none px-4 py-3",children:[b.jsx("div",{"aria-hidden":"true",className:"w-0.5 shrink-0 self-stretch rounded-full",style:{backgroundColor:"var(--accent)"}}),b.jsxs("span",{className:"text-sm text-[var(--text-secondary)] leading-relaxed",children:['"',u,'"']})]},u))})]}),o&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Before you start:"}),b.jsx("ul",{className:"space-y-1.5",children:e.preconditions.map(u=>b.jsxs("li",{className:"flex items-start gap-2 text-sm text-[var(--text-secondary)]",children:[b.jsx("span",{className:"shrink-0 text-[var(--text-muted)] mt-0.5",children:"•"}),b.jsx("span",{children:u})]},u))})]}),b.jsx(nI,{name:t})]}):b.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No additional documentation available."})}function nI({name:e}){const[t,r]=H.useState(!1),a=`Use the ${e} to [your goal]`,o=()=>{navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Start with this prompt"}),b.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] px-4 py-3",children:[b.jsxs("span",{className:"flex-1 text-sm text-[var(--text-secondary)] font-mono truncate",children:['"',a,'"']}),b.jsx("button",{type:"button",onClick:o,className:"shrink-0 text-xs font-mono text-[var(--accent)] hover:text-[var(--text-primary)] transition-colors",children:t?"Copied!":"Copy"})]})]})}function fC(){return b.jsxs("div",{className:"space-y-3 motion-safe:animate-pulse",children:[b.jsx("div",{className:"h-3 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-full rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-5/6 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-4/6 rounded bg-[var(--bg-tertiary)]"})]})}function rI(){return b.jsxs("div",{className:"space-y-6 motion-safe:animate-pulse",children:[b.jsxs("div",{className:"space-y-2",children:[b.jsx("div",{className:"h-6 w-1/2 rounded bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("div",{className:"h-5 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-5 w-24 rounded bg-[var(--bg-tertiary)]"})]}),b.jsx("div",{className:"h-4 w-full rounded bg-[var(--bg-tertiary)]"})]}),b.jsx(fC,{})]})}function iI({message:e,is404:t,onRetry:r,onBack:a}){return b.jsxs("div",{className:"space-y-4 bg-[var(--bg-card)] border border-[var(--border)] p-4",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:t?"Workflow not found.":e}),b.jsxs("div",{className:"flex gap-3",children:[!t&&b.jsx("button",{type:"button",onClick:r,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"}),b.jsxs("button",{type:"button",onClick:a,"aria-label":"Back to workflows list",className:"font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:["<"," WORKFLOWS"]})]})]})}function H1(e){const t=new Set(Gi.map(l=>l.id)),r=new Map,a=[];for(const l of e){const u=l.tags.find(f=>f!=="routines"&&t.has(f));if(u){const f=r.get(u)??[];f.push(l),r.set(u,f)}else a.push(l)}const o=Gi.filter(l=>r.has(l.id)).map(l=>({tagId:l.id,label:l.label,workflows:r.get(l.id)}));return a.length>0&&o.push({tagId:null,label:"Other",workflows:a}),o}function aI({selectedTag:e,onSelectTag:t,onSelectWorkflow:r}){const[a,o]=H.useState(null),[l,u]=H.useState(null),f=H.useRef(null),h=H.useRef(null),d=H.useRef(null),p=H.useRef(!1),g=H.useRef(null),y=H.useRef(null),[v,w]=H.useState(0),[C,N]=H.useState(0),[S,A]=H.useState(38),[_,k]=H.useState(62),[B,T]=H.useState(3),[O,U]=H.useState(2),[P,F]=H.useState(""),[I,Y]=H.useState(!1),[Q,L]=H.useState(!1),{data:V,isLoading:M,isError:q,error:X,refetch:Z}=bM();H.useEffect(()=>{if(a){const ce=requestAnimationFrame(()=>h.current?.focus());return()=>cancelAnimationFrame(ce)}else f.current&&(f.current.focus(),f.current=null)},[a]),H.useEffect(()=>{if(!a)return;const ce=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${ce}px`,document.body.style.width="100%",()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(0,ce)}},[a]),H.useEffect(()=>{if(!a)return;const ce=ge=>{ge.key==="Escape"&&o(null)};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[a]);const j=H.useMemo(()=>V?.workflows.filter(ce=>!ce.tags.includes("routines"))??[],[V]),z=H.useMemo(()=>[...new Set(j.map(ge=>ge.source.displayName))].sort(),[j]),$=H.useMemo(()=>{const ce=new Set(Gi.map(be=>be.id));let ge=e?e==="__other__"?j.filter(be=>!be.tags.some(De=>De!=="routines"&&ce.has(De))):j.filter(be=>be.tags.includes(e)):j;return l&&(ge=ge.filter(be=>be.source.displayName===l)),ge},[j,e,l]),R=H.useMemo(()=>e?$:H1($).flatMap(ce=>ce.workflows),[$,e]),te=R.findIndex(ce=>ce.id===a),ue=H.useCallback((ce,ge)=>{f.current=ge,o(ce),y.current=ce,ge.blur()},[]),fe=H.useCallback((ce,ge)=>{if(R.length<=1)return;const be=R.findIndex(qe=>qe.id===a);if(be===-1)return;const De=ce==="next"?(be+1)%R.length:(be-1+R.length)%R.length;if(p.current){g.current=De;return}de(De,ce,ge)},[R,a]);function de(ce,ge,be){p.current=!0,Y(!0),w(Fe=>Fe+1),N(Math.floor(Math.random()*4)),A(5+Math.floor(Math.random()*80)),k(5+Math.floor(Math.random()*80)),T(2+Math.floor(Math.random()*40)),U(2+Math.floor(Math.random()*25)),F(be==="horizontal"?ge==="next"?"modal-content--exit-h-next":"modal-content--exit-h-prev":ge==="next"?"modal-content--exit-v-next":"modal-content--exit-v-prev"),d.current&&(d.current.scrollTop=0);const qe=R[ce].id;setTimeout(()=>{o(qe),y.current=qe,F(be==="horizontal"?ge==="next"?"modal-content--enter-h-next":"modal-content--enter-h-prev":ge==="next"?"modal-content--enter-v-next":"modal-content--enter-v-prev"),Y(!1)},80),setTimeout(()=>{if(F(""),p.current=!1,g.current!==null){const Fe=g.current;g.current=null;const _t=R.findIndex(on=>on.id===y.current),Ot=Fe>_t?"next":"prev";de(Fe,Ot,"horizontal")}},240)}H.useEffect(()=>{if(!a)return;R.length>1&&L(!0);const ce=setTimeout(()=>L(!1),3e3),ge=["ArrowLeft","ArrowRight","a","A","d","D"],be=["ArrowUp","ArrowDown","w","W","s","S"],De=qe=>{if(be.includes(qe.key)){qe.preventDefault(),qe.stopPropagation();return}if(!ge.includes(qe.key))return;qe.preventDefault(),qe.stopPropagation();const Fe=["ArrowLeft","a","A"].includes(qe.key);fe(Fe?"prev":"next","horizontal")};return document.addEventListener("keydown",De,{capture:!0}),()=>{document.removeEventListener("keydown",De,{capture:!0}),clearTimeout(ce)}},[a,fe]);const{getItemProps:le,containerProps:pe}=Dw({count:R.length,cols:"auto",onActivate:H.useCallback(ce=>{const ge=document.activeElement;ue(R[ce].id,ge)},[R,ue])}),we=new Set(Gi.map(ce=>ce.id)),Ee=new Set(j.flatMap(ce=>ce.tags)),ve=new Map(Gi.map(ce=>[ce.id,j.filter(ge=>ge.tags.includes(ce.id)).length])),Ce=j.filter(ce=>!ce.tags.some(ge=>ge!=="routines"&&we.has(ge))).length;return b.jsxs("div",{className:"space-y-4","aria-busy":M,children:[b.jsxs("div",{children:[b.jsx("h1",{className:"font-mono text-2xl font-bold uppercase tracking-[0.12em] leading-none",style:{color:"var(--accent)",textShadow:"0 0 28px rgba(244,196,48,0.35)"},children:"Workflows"}),b.jsxs("p",{className:"font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mt-1.5",children:["// ",j.length," available"]})]}),b.jsxs("div",{role:"group","aria-label":"Filter workflows by category",className:"flex flex-wrap gap-1.5",children:[b.jsx(Ds,{label:"All",count:j.length,isActive:e===null,disabled:M,onClick:()=>t(null)}),Gi.filter(ce=>Ee.has(ce.id)||!V).map(ce=>b.jsx(Ds,{label:ce.label,count:ve.get(ce.id)??0,isActive:e===ce.id,disabled:M,onClick:()=>t(e===ce.id?null:ce.id)},ce.id)),Ce>0&&b.jsx(Ds,{label:"Other",count:Ce,isActive:e==="__other__",disabled:M,onClick:()=>t(e==="__other__"?null:"__other__")})]}),z.length>1&&b.jsxs("div",{role:"group","aria-label":"Filter workflows by source",className:"flex flex-wrap gap-1.5",children:[b.jsx(Ds,{label:"All Sources",count:j.length,isActive:l===null,disabled:M,onClick:()=>u(null)}),z.map(ce=>b.jsx(Ds,{label:ce,count:j.filter(ge=>ge.source.displayName===ce).length,isActive:l===ce,disabled:M,onClick:()=>u(l===ce?null:ce)},ce))]}),M?b.jsx(oI,{}):q?b.jsx(sI,{message:X instanceof Error?X.message:"Could not load workflows.",onRetry:()=>{Z()}}):$.length===0?b.jsxs("div",{className:"py-8 text-center space-y-3",children:[b.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No workflows in this category."}),e!==null&&b.jsx("button",{type:"button",onClick:()=>t(null),className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Clear filter"})]}):e!==null?b.jsxs("div",{className:"space-y-2",children:[b.jsx(B1,{label:e==="__other__"?"Other":Uc[e]??e,count:$.length,showRule:!0}),b.jsx("div",{...pe,className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:$.map((ce,ge)=>b.jsx(P1,{workflow:ce,onSelect:be=>ue(ce.id,be),navProps:le(ge),isActive:ce.id===a},ce.id))})]}):b.jsx("div",{className:"space-y-6",children:(()=>{let ce=0;return H1($).map(ge=>b.jsxs("div",{className:"space-y-2",children:[b.jsx(B1,{label:ge.label,count:ge.workflows.length,showRule:!0}),b.jsx("div",{...pe,className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:ge.workflows.map(be=>{const De=ce++;return b.jsx(P1,{workflow:be,onSelect:qe=>ue(be.id,qe),navProps:le(De),isActive:be.id===a},be.id)})})]},ge.tagId??"__other__"))})()}),b.jsxs("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-4 pointer-events-none","aria-hidden":!a,children:[a&&b.jsx("div",{className:"absolute inset-0 pointer-events-auto",style:{background:"rgba(0,0,0,0.22)",backdropFilter:"blur(2px)"},onClick:()=>o(null)}),b.jsx("div",{ref:h,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":`Workflow detail${a?`: ${R.find(ce=>ce.id===a)?.name??""}`:""}`,className:`relative w-full max-w-3xl ${a?"pointer-events-auto":"pointer-events-none"}${I?" modal-border-flashing":""}`,style:{height:"85vh",transform:a?"translateY(0) scale(1)":"translateY(24px) scale(0.97)",opacity:a?1:0,transition:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"opacity 150ms ease-out":"transform 250ms ease-out, opacity 250ms ease-out",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)"},children:b.jsxs(Co,{cut:20,borderColor:"rgba(244, 196, 48, 0.45)",background:"rgba(15, 19, 31, 0.50)",dropShadow:"drop-shadow(0 4px 24px rgba(244,196,48,0.15))",className:"h-full flex flex-col",children:[v>0&&b.jsx("div",{className:"modal-scanline","aria-hidden":"true",style:{"--crt-offset":`${C}px`,"--glitch-y":`${S}%`,"--glitch-y2":`${_}%`,"--glitch-w":`${B}px`,"--glitch-w2":`${O}px`,clipPath:Ow(20)}},v),b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--border)] shrink-0 console-blueprint-grid",style:{background:"rgba(15, 19, 31, 0.55)"},children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-secondary)]",children:"Workflow"}),te>=0&&b.jsxs("span",{className:"font-mono text-[10px] tracking-[0.20em] text-[var(--text-secondary)]",children:["[ ",te+1," / ",R.length," ]"]}),b.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] text-[var(--text-secondary)] transition-opacity duration-600",style:{opacity:Q?.5:0},"aria-hidden":"true",children:"[ A / D ] NAV"})]}),b.jsx("button",{type:"button",onClick:()=>o(null),className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none","aria-label":"Close",children:"×"})]}),b.jsxs("div",{ref:d,className:`flex-1 overflow-auto overscroll-contain px-6 py-5 ${P}`,style:{"--text-muted":"var(--text-secondary)"},children:[b.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:R.find(ce=>ce.id===a)?.name??""}),a&&b.jsx(cC,{workflowId:a,activeTag:e,onBack:()=>o(null)})]})]})})]})]})}function Ds({label:e,count:t,isActive:r,disabled:a,onClick:o}){return b.jsxs("button",{type:"button",onClick:o,disabled:a,"aria-pressed":r,className:["px-3 py-2 min-w-[44px] min-h-[44px] rounded-none text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed",r?"border border-[var(--accent)] text-[var(--accent)] bg-transparent":"text-[var(--text-muted)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-card)]"].join(" "),children:[e," · ",t,r&&b.jsx("span",{className:"sr-only",children:"(selected)"})]})}function P1({workflow:e,onSelect:t,navProps:r,isActive:a}){const o=e.tags.filter(u=>u!=="routines").map(u=>Uc[u]??u),l=[e.name,e.description,o.length>0?`Tag: ${o.join(", ")}`:null,`Source: ${e.source.displayName}`].filter(Boolean).join(". ");return b.jsx(_m,{variant:"grid",onClick:u=>t(u.currentTarget),"aria-label":l,style:a?{borderColor:"var(--accent)",boxShadow:"0 0 0 1px rgba(244,196,48,0.4), 0 0 16px rgba(244,196,48,0.12)"}:void 0,...r,children:b.jsxs("div",{className:"flex flex-col flex-1 p-4 gap-2 min-w-0",children:[b.jsx("p",{className:"text-sm font-medium text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug line-clamp-2",children:e.name}),b.jsx("p",{className:"text-xs text-[var(--text-secondary)] line-clamp-3 leading-relaxed flex-1",children:e.description}),b.jsxs("div",{className:"flex items-center justify-between gap-2 mt-auto pt-2 border-t border-[var(--border)]",children:[b.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.slice(0,1).map(u=>b.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 bg-[var(--bg-secondary)] text-[var(--text-muted)]",children:u},u))}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.stepCount!=null&&e.stepCount>0&&b.jsxs("span",{className:"font-mono text-[9px] text-[var(--text-muted)]",children:[e.stepCount,"s"]}),b.jsxs("span",{className:"font-mono text-[9px] text-[var(--text-muted)] max-w-[80px] truncate",children:["src: ",e.source.displayName]})]})]})]})})}function oI(){return b.jsx("div",{className:"space-y-6 motion-safe:animate-pulse",children:[0,1].map(e=>b.jsxs("div",{className:"space-y-3",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:"h-3 w-24 bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"flex-1 h-px bg-[var(--bg-tertiary)]"})]}),b.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:[0,1,2,3,4,5].map(t=>b.jsxs("div",{className:"min-h-[160px] bg-[var(--bg-card)] border border-[var(--border)] flex flex-col",children:[b.jsx("div",{className:"h-[3px] bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"p-4 flex flex-col gap-2 flex-1",children:[b.jsx("div",{className:"h-4 w-3/4 bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-full bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-5/6 bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"mt-auto pt-2 border-t border-[var(--border)] flex justify-between",children:[b.jsx("div",{className:"h-3 w-12 bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-16 bg-[var(--bg-tertiary)]"})]})]})]},t))})]},e))})}function sI({message:e,onRetry:t}){return b.jsxs("div",{className:"space-y-3 py-8 text-center",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:e}),b.jsx("button",{type:"button",onClick:t,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"})]})}function lI(){const e=$c(),t=Wk(),{location:r}=iM(),a=t({to:"/session/$sessionId"}),o=t({to:"/workflows"}),l=t({to:"/workflows/$workflowId"}),u=a!==!1,f=o!==!1||l!==!1,h=l!==!1,d=u?a.sessionId:null,p=h?l.workflowId:null,g=new URLSearchParams(r.search).get("tag"),{data:y}=Em(),v=y?.sessions.filter(O=>O.status==="in_progress").length??0,w=y?.sessions.filter(O=>O.status==="blocked").length??0,C=H.useCallback(()=>{e({to:"/"})},[e]),N=H.useCallback(O=>{e({to:"/workflows",search:{tag:O??void 0}})},[e]),S=H.useCallback(O=>{e({to:"/workflows/$workflowId",params:{workflowId:O},search:{tag:g??void 0}})},[e,g]),A=H.useCallback(()=>{e({to:"/workflows",search:{tag:g??void 0}})},[e,g]),[_,k]=H.useState(null),B=H.useCallback((O,U)=>{U(),k(O),setTimeout(()=>k(null),200)},[]),T=H.useRef(null);return H.useEffect(()=>{const O=T.current;if(!O)return;function U(P){(P.key==="ArrowLeft"||P.key==="ArrowRight")&&(P.preventDefault(),e(f?{to:"/"}:{to:"/workflows",search:{tag:void 0}}))}return O.addEventListener("keydown",U),()=>O.removeEventListener("keydown",U)},[f,e]),b.jsxs("div",{className:"min-h-screen",style:{"--app-header-height":"56px"},children:[b.jsxs("header",{style:{background:"rgba(23, 27, 40, 0.92)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",borderBottom:"1px solid rgba(244, 196, 48, 0.25)",boxShadow:"0 4px 24px rgba(0,0,0,0.4)"},className:"fixed top-0 w-full z-50 flex items-center h-14 px-4 gap-6",children:[b.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[b.jsx(Co,{cut:8,borderColor:"rgba(244, 196, 48, 0.5)",background:"rgba(27, 31, 44, 0.8)",className:"relative w-10 h-10",children:b.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:b.jsx("span",{className:"font-mono text-[11px] font-bold text-[var(--accent)] tracking-widest",children:"WR"})})}),b.jsxs("div",{className:"hidden sm:flex flex-col leading-none",children:[b.jsx("span",{className:"font-mono text-[11px] font-bold text-[var(--text-primary)] tracking-[0.25em] uppercase",children:"WR_CONSOLE"}),b.jsxs("span",{className:"font-mono text-[9px] text-[var(--text-muted)] tracking-[0.15em]",children:["// V","3.16.0"]})]})]}),u&&d?b.jsx("nav",{className:"flex items-center flex-1 justify-center",children:b.jsx(am,{segments:[{label:"Workspace",onClick:C},{label:d?.slice(-12)??""}]})}):b.jsxs("div",{role:"tablist","aria-label":"Console sections",ref:T,className:"flex items-center gap-1 flex-1 justify-center",children:[b.jsxs("button",{role:"tab",id:"tab-workspace","aria-selected":!f,"aria-controls":"panel-workspace",tabIndex:f?-1:0,onClick:()=>B("workspace",()=>{e({to:"/"})}),className:["tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150","focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",f?"text-[var(--text-secondary)] hover:text-[var(--text-primary)]":"tab-btn--active text-[var(--accent)] text-glow-amber",_==="workspace"?"tab-activating":""].join(" "),style:f?void 0:{backgroundColor:"rgba(244, 196, 48, 0.06)"},children:[b.jsx("span",{className:"tab-corner tab-corner--tl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--tr","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--bl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--br","aria-hidden":"true"}),"Workspace"]}),b.jsxs("button",{role:"tab",id:"tab-workflows","aria-selected":f,"aria-controls":"panel-workflows",tabIndex:f?0:-1,onClick:()=>B("workflows",()=>{e({to:"/workflows",search:{tag:void 0}})}),className:["tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150","focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",f?"tab-btn--active text-[var(--accent)] text-glow-amber":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]",_==="workflows"?"tab-activating":""].join(" "),style:f?{backgroundColor:"rgba(244, 196, 48, 0.06)"}:void 0,children:[b.jsx("span",{className:"tab-corner tab-corner--tl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--tr","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--bl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--br","aria-hidden":"true"}),"Workflows"]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[v>0&&b.jsx(_c,{label:`${Math.min(v,9)}${v>9?"+":""} LIVE`,color:"var(--accent-strong)",pulse:!0,role:"status","aria-label":`${v} live session${v===1?"":"s"}`}),w>0&&b.jsx(_c,{label:`${Math.min(w,9)}${w>9?"+":""} BLOCKED`,color:"var(--blocked)",role:"status","aria-label":`${w} blocked session${w===1?"":"s"}`})]})]}),b.jsxs("main",{className:"p-6",style:{paddingTop:"calc(56px + 1.5rem)"},children:[b.jsxs("div",{id:"panel-workspace",role:"tabpanel","aria-labelledby":"tab-workspace",hidden:f,children:[b.jsx(UM,{hidden:u}),u&&d&&b.jsx(J6,{sessionId:d})]}),f&&b.jsx("div",{id:"panel-workflows",role:"tabpanel","aria-labelledby":"tab-workflows",children:h&&p?b.jsx(cC,{workflowId:p,onBack:A}):b.jsx(aI,{selectedTag:g,onSelectTag:N,onSelectWorkflow:S})})]})]})}const ko=Uk({component:lI}),uI=hl({getParentRoute:()=>ko,path:"/",component:()=>null}),cI=hl({getParentRoute:()=>ko,path:"/session/$sessionId",component:()=>null}),fI=hl({getParentRoute:()=>ko,path:"/workflows",validateSearch:e=>({tag:typeof e.tag=="string"?e.tag:void 0}),component:()=>null}),dI=hl({getParentRoute:()=>ko,path:"/workflows/$workflowId",validateSearch:e=>({tag:typeof e.tag=="string"?e.tag:void 0}),component:()=>null}),hI=hl({getParentRoute:()=>ko,path:"/perf",component:()=>null}),pI=ko.addChildren([uI,cI,fI,dI,hI]),mI=eM({routeTree:pI,history:ek()}),gI=new K_({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3}}});__.createRoot(document.getElementById("root")).render(b.jsx(H.StrictMode,{children:b.jsx(Z_,{client:gI,children:b.jsx(rM,{router:mI})})}));