makecc 0.1.0 → 0.2.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,133 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();function Xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zh={exports:{}},mo={};var Dx;function oE(){if(Dx)return mo;Dx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,o,s){var u=null;if(s!==void 0&&(u=""+s),o.key!==void 0&&(u=""+o.key),"key"in o){s={};for(var f in o)f!=="key"&&(s[f]=o[f])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:s}}return mo.Fragment=n,mo.jsx=i,mo.jsxs=i,mo}var jx;function sE(){return jx||(jx=1,zh.exports=oE()),zh.exports}var v=sE(),Dh={exports:{}},Te={};var Rx;function uE(){if(Rx)return Te;Rx=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=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"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function _(R,$,M){this.props=R,this.context=$,this.refs=N,this.updater=M||w}_.prototype.isReactComponent={},_.prototype.setState=function(R,$){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,$,"setState")},_.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function j(){}j.prototype=_.prototype;function k(R,$,M){this.props=R,this.context=$,this.refs=N,this.updater=M||w}var C=k.prototype=new j;C.constructor=k,E(C,_.prototype),C.isPureReactComponent=!0;var L=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function G(R,$,M){var ie=M.ref;return{$$typeof:e,type:R,key:$,ref:ie!==void 0?ie:null,props:M}}function q(R,$){return G(R.type,$,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function P(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(M){return $[M]})}var te=/\/+/g;function O(R,$){return typeof R=="object"&&R!==null&&R.key!=null?P(""+R.key):$.toString(36)}function B(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(A,A):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function D(R,$,M,ie,ce){var fe=typeof R;(fe==="undefined"||fe==="boolean")&&(R=null);var he=!1;if(R===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(R.$$typeof){case e:case n:he=!0;break;case g:return he=R._init,D(he(R._payload),$,M,ie,ce)}}if(he)return ce=ce(R),he=ie===""?"."+O(R,0):ie,L(ce)?(M="",he!=null&&(M=he.replace(te,"$&/")+"/"),D(ce,$,M,"",function(Ee){return Ee})):ce!=null&&(V(ce)&&(ce=q(ce,M+(ce.key==null||R&&R.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),$.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(L(R))for(var me=0;me<R.length;me++)ie=R[me],fe=ue+O(ie,me),he+=D(ie,$,M,fe,ce);else if(me=b(R),typeof me=="function")for(R=me.call(R),me=0;!(ie=R.next()).done;)ie=ie.value,fe=ue+O(ie,me++),he+=D(ie,$,M,fe,ce);else if(fe==="object"){if(typeof R.then=="function")return D(B(R),$,M,ie,ce);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return he}function U(R,$,M){if(R==null)return R;var ie=[],ce=0;return D(R,ie,"","",function(fe){return $.call(M,fe,ce++)}),ie}function Y(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(M){(R._status===0||R._status===-1)&&(R._status=1,R._result=M)},function(M){(R._status===0||R._status===-1)&&(R._status=2,R._result=M)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var Q=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},z={map:U,forEach:function(R,$,M){U(R,function(){$.apply(this,arguments)},M)},count:function(R){var $=0;return U(R,function(){$++}),$},toArray:function(R){return U(R,function($){return $})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Te.Activity=m,Te.Children=z,Te.Component=_,Te.Fragment=i,Te.Profiler=o,Te.PureComponent=k,Te.StrictMode=a,Te.Suspense=h,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Te.__COMPILER_RUNTIME={__proto__:null,c:function(R){return H.H.useMemoCache(R)}},Te.cache=function(R){return function(){return R.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(R,$,M){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ie=E({},R.props),ce=R.key;if($!=null)for(fe in $.key!==void 0&&(ce=""+$.key),$)!F.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(ie[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)ie.children=M;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return G(R.type,ce,ie)},Te.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:s,_context:R},R},Te.createElement=function(R,$,M){var ie,ce={},fe=null;if($!=null)for(ie in $.key!==void 0&&(fe=""+$.key),$)F.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=$[ie]);var he=arguments.length-2;if(he===1)ce.children=M;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(R&&R.defaultProps)for(ie in he=R.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return G(R,fe,ce)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(R){return{$$typeof:f,render:R}},Te.isValidElement=V,Te.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:Y}},Te.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},Te.startTransition=function(R){var $=H.T,M={};H.T=M;try{var ie=R(),ce=H.S;ce!==null&&ce(M,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,Q)}catch(fe){Q(fe)}finally{$!==null&&M.types!==null&&($.types=M.types),H.T=$}},Te.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Te.use=function(R){return H.H.use(R)},Te.useActionState=function(R,$,M){return H.H.useActionState(R,$,M)},Te.useCallback=function(R,$){return H.H.useCallback(R,$)},Te.useContext=function(R){return H.H.useContext(R)},Te.useDebugValue=function(){},Te.useDeferredValue=function(R,$){return H.H.useDeferredValue(R,$)},Te.useEffect=function(R,$){return H.H.useEffect(R,$)},Te.useEffectEvent=function(R){return H.H.useEffectEvent(R)},Te.useId=function(){return H.H.useId()},Te.useImperativeHandle=function(R,$,M){return H.H.useImperativeHandle(R,$,M)},Te.useInsertionEffect=function(R,$){return H.H.useInsertionEffect(R,$)},Te.useLayoutEffect=function(R,$){return H.H.useLayoutEffect(R,$)},Te.useMemo=function(R,$){return H.H.useMemo(R,$)},Te.useOptimistic=function(R,$){return H.H.useOptimistic(R,$)},Te.useReducer=function(R,$,M){return H.H.useReducer(R,$,M)},Te.useRef=function(R){return H.H.useRef(R)},Te.useState=function(R){return H.H.useState(R)},Te.useSyncExternalStore=function(R,$,M){return H.H.useSyncExternalStore(R,$,M)},Te.useTransition=function(){return H.H.useTransition()},Te.version="19.2.3",Te}var Ox;function ls(){return Ox||(Ox=1,Dh.exports=uE()),Dh.exports}var K=ls();const Bo=Xc(K);var jh={exports:{}},go={},Rh={exports:{}},Oh={};var Lx;function cE(){return Lx||(Lx=1,(function(e){function n(D,U){var Y=D.length;D.push(U);e:for(;0<Y;){var Q=Y-1>>>1,z=D[Q];if(0<o(z,U))D[Q]=U,D[Y]=z,Y=Q;else break e}}function i(D){return D.length===0?null:D[0]}function a(D){if(D.length===0)return null;var U=D[0],Y=D.pop();if(Y!==U){D[0]=Y;e:for(var Q=0,z=D.length,R=z>>>1;Q<R;){var $=2*(Q+1)-1,M=D[$],ie=$+1,ce=D[ie];if(0>o(M,Y))ie<z&&0>o(ce,M)?(D[Q]=ce,D[ie]=Y,Q=ie):(D[Q]=M,D[$]=Y,Q=$);else if(ie<z&&0>o(ce,Y))D[Q]=ce,D[ie]=Y,Q=ie;else break e}}return U}function o(D,U){var Y=D.sortIndex-U.sortIndex;return Y!==0?Y:D.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],g=1,m=null,x=3,b=!1,w=!1,E=!1,N=!1,_=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(D){for(var U=i(d);U!==null;){if(U.callback===null)a(d);else if(U.startTime<=D)a(d),U.sortIndex=U.expirationTime,n(h,U);else break;U=i(d)}}function L(D){if(E=!1,C(D),!w)if(i(h)!==null)w=!0,A||(A=!0,P());else{var U=i(d);U!==null&&B(L,U.startTime-D)}}var A=!1,H=-1,F=5,G=-1;function q(){return N?!0:!(e.unstable_now()-G<F)}function V(){if(N=!1,A){var D=e.unstable_now();G=D;var U=!0;try{e:{w=!1,E&&(E=!1,j(H),H=-1),b=!0;var Y=x;try{t:{for(C(D),m=i(h);m!==null&&!(m.expirationTime>D&&q());){var Q=m.callback;if(typeof Q=="function"){m.callback=null,x=m.priorityLevel;var z=Q(m.expirationTime<=D);if(D=e.unstable_now(),typeof z=="function"){m.callback=z,C(D),U=!0;break t}m===i(h)&&a(h),C(D)}else a(h);m=i(h)}if(m!==null)U=!0;else{var R=i(d);R!==null&&B(L,R.startTime-D),U=!1}}break e}finally{m=null,x=Y,b=!1}U=void 0}}finally{U?P():A=!1}}}var P;if(typeof k=="function")P=function(){k(V)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,O=te.port2;te.port1.onmessage=V,P=function(){O.postMessage(null)}}else P=function(){_(V,0)};function B(D,U){H=_(function(){D(e.unstable_now())},U)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(D){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Y=x;x=U;try{return D()}finally{x=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(D,U){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var Y=x;x=D;try{return U()}finally{x=Y}},e.unstable_scheduleCallback=function(D,U,Y){var Q=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,D){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,D={id:g++,callback:U,priorityLevel:D,startTime:Y,expirationTime:z,sortIndex:-1},Y>Q?(D.sortIndex=Y,n(d,D),i(h)===null&&D===i(d)&&(E?(j(H),H=-1):E=!0,B(L,Y-Q))):(D.sortIndex=z,n(h,D),w||b||(w=!0,A||(A=!0,P()))),D},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(D){var U=x;return function(){var Y=x;x=U;try{return D.apply(this,arguments)}finally{x=Y}}}})(Oh)),Oh}var Hx;function fE(){return Hx||(Hx=1,Rh.exports=cE()),Rh.exports}var Lh={exports:{}},Ut={};var Bx;function dE(){if(Bx)return Ut;Bx=1;var e=ls();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}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 i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(h,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:h,containerInfo:d,implementation:g}}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 Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return s(h,d,null,g)},Ut.flushSync=function(h){var d=u.T,g=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=g,a.d.f()}},Ut.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))},Ut.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Ut.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ut.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:g,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)},Ut.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);a.d.L(h,g,{crossOrigin:m,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})}},Ut.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Ut.requestFormReset=function(h){a.d.r(h)},Ut.unstable_batchedUpdates=function(h,d){return h(d)},Ut.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},Ut.useFormStatus=function(){return u.H.useHostTransitionStatus()},Ut.version="19.2.3",Ut}var Ux;function mv(){if(Ux)return Lh.exports;Ux=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Lh.exports=dE(),Lh.exports}var Ix;function hE(){if(Ix)return go;Ix=1;var e=fE(),n=ls(),i=mv();function a(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function s(t){var r=t,l=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(l=r.return),t=r.return;while(t)}return r.tag===3?l:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(s(t)!==t)throw Error(a(188))}function d(t){var r=t.alternate;if(!r){if(r=s(t),r===null)throw Error(a(188));return r!==t?null:t}for(var l=t,c=r;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return h(p),t;if(y===c)return h(p),r;y=y.sibling}throw Error(a(188))}if(l.return!==c.return)l=p,c=y;else{for(var S=!1,T=p.child;T;){if(T===l){S=!0,l=p,c=y;break}if(T===c){S=!0,c=p,l=y;break}T=T.sibling}if(!S){for(T=y.child;T;){if(T===l){S=!0,l=y,c=p;break}if(T===c){S=!0,c=y,l=p;break}T=T.sibling}if(!S)throw Error(a(189))}}if(l.alternate!==c)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:r}function g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=V&&t[V]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function O(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case _:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case A:return"SuspenseList";case G:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case k:return t.displayName||"Context";case j:return(t._context.displayName||"Context")+".Consumer";case C:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return r=t.displayName||null,r!==null?r:O(t.type)||"Memo";case F:r=t._payload,t=t._init;try{return O(t(r))}catch{}}return null}var B=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],z=-1;function R(t){return{current:t}}function $(t){0>z||(t.current=Q[z],Q[z]=null,z--)}function M(t,r){z++,Q[z]=t.current,t.current=r}var ie=R(null),ce=R(null),fe=R(null),he=R(null);function ue(t,r){switch(M(fe,r),M(ce,t),M(ie,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?tx(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=tx(r),t=nx(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ie),M(ie,t)}function me(){$(ie),$(ce),$(fe)}function Ee(t){t.memoizedState!==null&&M(he,t);var r=ie.current,l=nx(r,t.type);r!==l&&(M(ce,t),M(ie,l))}function Ce(t){ce.current===t&&($(ie),$(ce)),he.current===t&&($(he),co._currentValue=Y)}var we,Ne;function Re(t){if(we===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ne=-1<l.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+we+t+Ne}var Ze=!1;function Xe(t,r){if(!t||Ze)return"";Ze=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){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 ee=re}Reflect.construct(t,[],se)}else{try{se.call()}catch(re){ee=re}t.call(se.prototype)}}else{try{throw Error()}catch(re){ee=re}(se=t())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),S=y[0],T=y[1];if(S&&T){var I=S.split(`
4
- `),W=T.split(`
5
- `);for(p=c=0;c<I.length&&!I[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===I.length||p===W.length)for(c=I.length-1,p=W.length-1;1<=c&&0<=p&&I[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if(I[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||I[c]!==W[p]){var le=`
6
- `+I[c].replace(" at new "," at ");return t.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",t.displayName)),le}while(1<=c&&0<=p);break}}}finally{Ze=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Re(l):""}function ht(t,r){switch(t.tag){case 26:case 27:case 5:return Re(t.type);case 16:return Re("Lazy");case 13:return t.child!==r&&r!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Xe(t.type,!1);case 11:return Xe(t.type.render,!1);case 1:return Xe(t.type,!0);case 31:return Re("Activity");default:return""}}function on(t){try{var r="",l=null;do r+=ht(t,l),l=t,t=t.return;while(t);return r}catch(c){return`
7
- Error generating stack: `+c.message+`
8
- `+c.stack}}var Lt=Object.prototype.hasOwnProperty,Gt=e.unstable_scheduleCallback,Rn=e.unstable_cancelCallback,oi=e.unstable_shouldYield,si=e.unstable_requestPaint,Et=e.unstable_now,Ii=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,je=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Vt=e.log,On=e.unstable_setDisableYieldValue,At=null,pt=null;function Ht(t){if(typeof Vt=="function"&&On(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(At,t)}catch{}}var Ke=Math.clz32?Math.clz32:bf,Gn=Math.log,sn=Math.LN2;function bf(t){return t>>>=0,t===0?32:31-(Gn(t)/sn|0)|0}var aa=256,la=262144,oa=4194304;function ui(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function sa(t,r,l){var c=t.pendingLanes;if(c===0)return 0;var p=0,y=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var T=c&134217727;return T!==0?(c=T&~y,c!==0?p=ui(c):(S&=T,S!==0?p=ui(S):l||(l=T&~t,l!==0&&(p=ui(l))))):(T=c&~y,T!==0?p=ui(T):S!==0?p=ui(S):l||(l=c&~t,l!==0&&(p=ui(l)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,l=r&-r,y>=l||y===32&&(l&4194048)!==0)?r:p}function _r(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function vf(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 ws(){var t=oa;return oa<<=1,(oa&62914560)===0&&(oa=4194304),t}function wl(t){for(var r=[],l=0;31>l;l++)r.push(t);return r}function kr(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wf(t,r,l,c,p,y){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var T=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(l=S&~l;0<l;){var le=31-Ke(l),se=1<<le;T[le]=0,I[le]=-1;var ee=W[le];if(ee!==null)for(W[le]=null,le=0;le<ee.length;le++){var re=ee[le];re!==null&&(re.lane&=-536870913)}l&=~se}c!==0&&Ss(t,c,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function Ss(t,r,l){t.pendingLanes|=r,t.suspendedLanes&=~r;var c=31-Ke(r);t.entangledLanes|=r,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function _s(t,r){var l=t.entangledLanes|=r;for(t=t.entanglements;l;){var c=31-Ke(l),p=1<<c;p&r|t[c]&r&&(t[c]|=r),l&=~p}}function ks(t,r){var l=r&-r;return l=(l&42)!==0?1:Sl(l),(l&(t.suspendedLanes|r))!==0?0:l}function Sl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function _l(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Es(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Ex(t.type))}function Ns(t,r){var l=U.p;try{return U.p=t,r()}finally{U.p=l}}var Zn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Zn,Bt="__reactProps$"+Zn,ci="__reactContainer$"+Zn,ua="__reactEvents$"+Zn,Cs="__reactListeners$"+Zn,Sf="__reactHandles$"+Zn,Ts="__reactResources$"+Zn,Er="__reactMarker$"+Zn;function kl(t){delete t[Nt],delete t[Bt],delete t[ua],delete t[Cs],delete t[Sf]}function qi(t){var r=t[Nt];if(r)return r;for(var l=t.parentNode;l;){if(r=l[ci]||l[Nt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(t=ux(t);t!==null;){if(l=t[Nt])return l;t=ux(t)}return r}t=l,l=t.parentNode}return null}function $i(t){if(t=t[Nt]||t[ci]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Vi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(a(33))}function Pi(t){var r=t[Ts];return r||(r=t[Ts]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function yt(t){t[Er]=!0}var Ms=new Set,As={};function fi(t,r){Yi(t,r),Yi(t+"Capture",r)}function Yi(t,r){for(As[t]=r,t=0;t<r.length;t++)Ms.add(r[t])}var _f=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]*$"),El={},zs={};function kf(t){return Lt.call(zs,t)?!0:Lt.call(El,t)?!1:_f.test(t)?zs[t]=!0:(El[t]=!0,!1)}function ca(t,r,l){if(kf(r))if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+l)}}function fa(t,r,l){if(l===null)t.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+l)}}function Ln(t,r,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(r,l,""+c)}}function Zt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ds(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ef(t,r,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){l=""+S,y.call(this,S)}}),Object.defineProperty(t,r,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function da(t){if(!t._valueTracker){var r=Ds(t)?"checked":"value";t._valueTracker=Ef(t,r,""+t[r])}}function js(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),c="";return t&&(c=Ds(t)?t.checked?"true":"false":t.value),t=c,t!==l?(r.setValue(t),!0):!1}function Nr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Nf=/[\n"\\]/g;function Qt(t){return t.replace(Nf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(t,r,l,c,p,y,S,T){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r!=null?S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Zt(r)):t.value!==""+Zt(r)&&(t.value=""+Zt(r)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),r!=null?Nl(t,S,Zt(r)):l!=null?Nl(t,S,Zt(l)):c!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+Zt(T):t.removeAttribute("name")}function Rs(t,r,l,c,p,y,S,T){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){da(t);return}l=l!=null?""+Zt(l):"",r=r!=null?""+Zt(r):l,T||r===t.value||(t.value=r),t.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=T?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),da(t)}function Nl(t,r,l){r==="number"&&Nr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function di(t,r,l,c){if(t=t.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=r.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Zt(l),r=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function Qm(t,r,l){if(r!=null&&(r=""+Zt(r),r!==t.value&&(t.value=r),l==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=l!=null?""+Zt(l):""}function Km(t,r,l,c){if(r==null){if(c!=null){if(l!=null)throw Error(a(92));if(B(c)){if(1<c.length)throw Error(a(93));c=c[0]}l=c}l==null&&(l=""),r=l}l=Zt(r),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),da(t)}function ha(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var n_=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 Jm(t,r,l){var c=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":c?t.setProperty(r,l):typeof l!="number"||l===0||n_.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function Wm(t,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var p in r)c=r[p],r.hasOwnProperty(p)&&l[p]!==c&&Jm(t,p,c)}else for(var y in r)r.hasOwnProperty(y)&&Jm(t,y,r[y])}function Cf(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var i_=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"]]),r_=/^[\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 Os(t){return r_.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var Tf=null;function Mf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pa=null,ma=null;function eg(t){var r=$i(t);if(r&&(t=r.stateNode)){var l=t[Bt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Cr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qt(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var c=l[r];if(c!==t&&c.form===t.form){var p=c[Bt]||null;if(!p)throw Error(a(90));Cr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)c=l[r],c.form===t.form&&js(c)}break e;case"textarea":Qm(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&di(t,!!l.multiple,r,!1)}}}var Af=!1;function tg(t,r,l){if(Af)return t(r,l);Af=!0;try{var c=t(r);return c}finally{if(Af=!1,(pa!==null||ma!==null)&&(Su(),pa&&(r=pa,t=ma,ma=pa=null,eg(r),t)))for(r=0;r<t.length;r++)eg(t[r])}}function Cl(t,r){var l=t.stateNode;if(l===null)return null;var c=l[Bt]||null;if(c===null)return null;l=c[r];e:switch(r){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)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var pi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zf=!1;if(pi)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){zf=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{zf=!1}var Xi=null,Df=null,Ls=null;function ng(){if(Ls)return Ls;var t,r=Df,l=r.length,c,p="value"in Xi?Xi.value:Xi.textContent,y=p.length;for(t=0;t<l&&r[t]===p[t];t++);var S=l-t;for(c=1;c<=S&&r[l-c]===p[y-c];c++);return Ls=p.slice(t,1<c?1-c:void 0)}function Hs(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Bs(){return!0}function ig(){return!1}function Kt(t){function r(l,c,p,y,S){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(l=t[T],this[T]=l?l(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Bs:ig,this.isPropagationStopped=ig,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Bs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Bs)},persist:function(){},isPersistent:Bs}),r}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Us=Kt(Tr),Ml=m({},Tr,{view:0,detail:0}),a_=Kt(Ml),jf,Rf,Al,Is=m({},Ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Al&&(Al&&t.type==="mousemove"?(jf=t.screenX-Al.screenX,Rf=t.screenY-Al.screenY):Rf=jf=0,Al=t),jf)},movementY:function(t){return"movementY"in t?t.movementY:Rf}}),rg=Kt(Is),l_=m({},Is,{dataTransfer:0}),o_=Kt(l_),s_=m({},Ml,{relatedTarget:0}),Of=Kt(s_),u_=m({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),c_=Kt(u_),f_=m({},Tr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),d_=Kt(f_),h_=m({},Tr,{data:0}),ag=Kt(h_),p_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},m_={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"},g_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function y_(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=g_[t])?!!r[t]:!1}function Lf(){return y_}var x_=m({},Ml,{key:function(t){if(t.key){var r=p_[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Hs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?m_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lf,charCode:function(t){return t.type==="keypress"?Hs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Hs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),b_=Kt(x_),v_=m({},Is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lg=Kt(v_),w_=m({},Ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lf}),S_=Kt(w_),__=m({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),k_=Kt(__),E_=m({},Is,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),N_=Kt(E_),C_=m({},Tr,{newState:0,oldState:0}),T_=Kt(C_),M_=[9,13,27,32],Hf=pi&&"CompositionEvent"in window,zl=null;pi&&"documentMode"in document&&(zl=document.documentMode);var A_=pi&&"TextEvent"in window&&!zl,og=pi&&(!Hf||zl&&8<zl&&11>=zl),sg=" ",ug=!1;function cg(t,r){switch(t){case"keyup":return M_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function z_(t,r){switch(t){case"compositionend":return fg(r);case"keypress":return r.which!==32?null:(ug=!0,sg);case"textInput":return t=r.data,t===sg&&ug?null:t;default:return null}}function D_(t,r){if(ga)return t==="compositionend"||!Hf&&cg(t,r)?(t=ng(),Ls=Df=Xi=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return og&&r.locale!=="ko"?null:r.data;default:return null}}var j_={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 dg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!j_[t.type]:r==="textarea"}function hg(t,r,l,c){pa?ma?ma.push(c):ma=[c]:pa=c,r=Mu(r,"onChange"),0<r.length&&(l=new Us("onChange","change",null,l,c),t.push({event:l,listeners:r}))}var Dl=null,jl=null;function R_(t){Z0(t,0)}function qs(t){var r=Vi(t);if(js(r))return t}function pg(t,r){if(t==="change")return r}var mg=!1;if(pi){var Bf;if(pi){var Uf="oninput"in document;if(!Uf){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),Uf=typeof gg.oninput=="function"}Bf=Uf}else Bf=!1;mg=Bf&&(!document.documentMode||9<document.documentMode)}function yg(){Dl&&(Dl.detachEvent("onpropertychange",xg),jl=Dl=null)}function xg(t){if(t.propertyName==="value"&&qs(jl)){var r=[];hg(r,jl,t,Mf(t)),tg(R_,r)}}function O_(t,r,l){t==="focusin"?(yg(),Dl=r,jl=l,Dl.attachEvent("onpropertychange",xg)):t==="focusout"&&yg()}function L_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return qs(jl)}function H_(t,r){if(t==="click")return qs(r)}function B_(t,r){if(t==="input"||t==="change")return qs(r)}function U_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var un=typeof Object.is=="function"?Object.is:U_;function Rl(t,r){if(un(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var l=Object.keys(t),c=Object.keys(r);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!Lt.call(r,p)||!un(t[p],r[p]))return!1}return!0}function bg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function vg(t,r){var l=bg(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=r&&c>=r)return{node:l,offset:r-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=bg(l)}}function wg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?wg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Sg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nr(t.document);r instanceof t.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)t=r.contentWindow;else break;r=Nr(t.document)}return r}function If(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var I_=pi&&"documentMode"in document&&11>=document.documentMode,ya=null,qf=null,Ol=null,$f=!1;function _g(t,r,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;$f||ya==null||ya!==Nr(c)||(c=ya,"selectionStart"in c&&If(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}),Ol&&Rl(Ol,c)||(Ol=c,c=Mu(qf,"onSelect"),0<c.length&&(r=new Us("onSelect","select",null,r,l),t.push({event:r,listeners:c}),r.target=ya)))}function Mr(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var xa={animationend:Mr("Animation","AnimationEnd"),animationiteration:Mr("Animation","AnimationIteration"),animationstart:Mr("Animation","AnimationStart"),transitionrun:Mr("Transition","TransitionRun"),transitionstart:Mr("Transition","TransitionStart"),transitioncancel:Mr("Transition","TransitionCancel"),transitionend:Mr("Transition","TransitionEnd")},Vf={},kg={};pi&&(kg=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Ar(t){if(Vf[t])return Vf[t];if(!xa[t])return t;var r=xa[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in kg)return Vf[t]=r[l];return t}var Eg=Ar("animationend"),Ng=Ar("animationiteration"),Cg=Ar("animationstart"),q_=Ar("transitionrun"),$_=Ar("transitionstart"),V_=Ar("transitioncancel"),Tg=Ar("transitionend"),Mg=new Map,Pf="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(" ");Pf.push("scrollEnd");function Hn(t,r){Mg.set(t,r),fi(r,[t])}var $s=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],ba=0,Yf=0;function Vs(){for(var t=ba,r=Yf=ba=0;r<t;){var l=_n[r];_n[r++]=null;var c=_n[r];_n[r++]=null;var p=_n[r];_n[r++]=null;var y=_n[r];if(_n[r++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}y!==0&&Ag(l,p,y)}}function Ps(t,r,l,c){_n[ba++]=t,_n[ba++]=r,_n[ba++]=l,_n[ba++]=c,Yf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Xf(t,r,l,c){return Ps(t,r,l,c),Ys(t)}function zr(t,r){return Ps(t,null,null,r),Ys(t)}function Ag(t,r,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var p=!1,y=t.return;y!==null;)y.childLanes|=l,c=y.alternate,c!==null&&(c.childLanes|=l),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Ke(l),t=y.hiddenUpdates,c=t[p],c===null?t[p]=[r]:c.push(r),r.lane=l|536870912),y):null}function Ys(t){if(50<io)throw io=0,th=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var va={};function P_(t,r,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 cn(t,r,l,c){return new P_(t,r,l,c)}function Ff(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mi(t,r){var l=t.alternate;return l===null?(l=cn(t.tag,r,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=r,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,r=t.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function zg(t,r){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,r=l.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Xs(t,r,l,c,p,y){var S=0;if(c=t,typeof t=="function")Ff(t)&&(S=1);else if(typeof t=="string")S=Zk(t,l,ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case G:return t=cn(31,l,r,p),t.elementType=G,t.lanes=y,t;case E:return Dr(l.children,p,y,r);case N:S=8,p|=24;break;case _:return t=cn(12,l,r,p|2),t.elementType=_,t.lanes=y,t;case L:return t=cn(13,l,r,p),t.elementType=L,t.lanes=y,t;case A:return t=cn(19,l,r,p),t.elementType=A,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case k:S=10;break e;case j:S=9;break e;case C:S=11;break e;case H:S=14;break e;case F:S=16,c=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),c=null}return r=cn(S,l,r,p),r.elementType=t,r.type=c,r.lanes=y,r}function Dr(t,r,l,c){return t=cn(7,t,c,r),t.lanes=l,t}function Gf(t,r,l){return t=cn(6,t,null,r),t.lanes=l,t}function Dg(t){var r=cn(18,null,null,0);return r.stateNode=t,r}function Zf(t,r,l){return r=cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=l,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var jg=new WeakMap;function kn(t,r){if(typeof t=="object"&&t!==null){var l=jg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:on(r)},jg.set(t,r),r)}return{value:t,source:r,stack:on(r)}}var wa=[],Sa=0,Fs=null,Ll=0,En=[],Nn=0,Fi=null,Qn=1,Kn="";function gi(t,r){wa[Sa++]=Ll,wa[Sa++]=Fs,Fs=t,Ll=r}function Rg(t,r,l){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Fi=t;var c=Qn;t=Kn;var p=32-Ke(c)-1;c&=~(1<<p),l+=1;var y=32-Ke(r)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Qn=1<<32-Ke(r)+p|l<<p|c,Kn=y+t}else Qn=1<<y|l<<p|c,Kn=t}function Qf(t){t.return!==null&&(gi(t,1),Rg(t,1,0))}function Kf(t){for(;t===Fs;)Fs=wa[--Sa],wa[Sa]=null,Ll=wa[--Sa],wa[Sa]=null;for(;t===Fi;)Fi=En[--Nn],En[Nn]=null,Kn=En[--Nn],En[Nn]=null,Qn=En[--Nn],En[Nn]=null}function Og(t,r){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Qn=r.id,Kn=r.overflow,Fi=t}var zt=null,lt=null,Ie=!1,Gi=null,Cn=!1,Jf=Error(a(519));function Zi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hl(kn(r,t)),Jf}function Lg(t){var r=t.stateNode,l=t.type,c=t.memoizedProps;switch(r[Nt]=t,r[Bt]=c,l){case"dialog":Le("cancel",r),Le("close",r);break;case"iframe":case"object":case"embed":Le("load",r);break;case"video":case"audio":for(l=0;l<ao.length;l++)Le(ao[l],r);break;case"source":Le("error",r);break;case"img":case"image":case"link":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"input":Le("invalid",r),Rs(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Le("invalid",r);break;case"textarea":Le("invalid",r),Km(r,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||c.suppressHydrationWarning===!0||W0(r.textContent,l)?(c.popover!=null&&(Le("beforetoggle",r),Le("toggle",r)),c.onScroll!=null&&Le("scroll",r),c.onScrollEnd!=null&&Le("scrollend",r),c.onClick!=null&&(r.onclick=hi),r=!0):r=!1,r||Zi(t,!0)}function Hg(t){for(zt=t.return;zt;)switch(zt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:zt=zt.return}}function _a(t){if(t!==zt)return!1;if(!Ie)return Hg(t),Ie=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||gh(t.type,t.memoizedProps)),l=!l),l&&lt&&Zi(t),Hg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=sx(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=sx(t)}else r===27?(r=lt,ur(t.type)?(t=wh,wh=null,lt=t):lt=r):lt=zt?Mn(t.stateNode.nextSibling):null;return!0}function jr(){lt=zt=null,Ie=!1}function Wf(){var t=Gi;return t!==null&&(tn===null?tn=t:tn.push.apply(tn,t),Gi=null),t}function Hl(t){Gi===null?Gi=[t]:Gi.push(t)}var ed=R(null),Rr=null,yi=null;function Qi(t,r,l){M(ed,r._currentValue),r._currentValue=l}function xi(t){t._currentValue=ed.current,$(ed)}function td(t,r,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===l)break;t=t.return}}function nd(t,r,l,c){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var T=y;y=p;for(var I=0;I<r.length;I++)if(T.context===r[I]){y.lanes|=l,T=y.alternate,T!==null&&(T.lanes|=l),td(y.return,l,t),c||(S=null);break e}y=T.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=l,y=S.alternate,y!==null&&(y.lanes|=l),td(S,l,t),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===t){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ka(t,r,l,c){t=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var T=p.type;un(p.pendingProps.value,S.value)||(t!==null?t.push(T):t=[T])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(co):t=[co])}p=p.return}t!==null&&nd(r,t,l,c),r.flags|=262144}function Gs(t){for(t=t.firstContext;t!==null;){if(!un(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Or(t){Rr=t,yi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Dt(t){return Bg(Rr,t)}function Zs(t,r){return Rr===null&&Or(t),Bg(t,r)}function Bg(t,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},yi===null){if(t===null)throw Error(a(308));yi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else yi=yi.next=r;return l}var Y_=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){r.aborted=!0,t.forEach(function(l){return l()})}},X_=e.unstable_scheduleCallback,F_=e.unstable_NormalPriority,xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function id(){return{controller:new Y_,data:new Map,refCount:0}}function Bl(t){t.refCount--,t.refCount===0&&X_(F_,function(){t.controller.abort()})}var Ul=null,rd=0,Ea=0,Na=null;function G_(t,r){if(Ul===null){var l=Ul=[];rd=0,Ea=oh(),Na={status:"pending",value:void 0,then:function(c){l.push(c)}}}return rd++,r.then(Ug,Ug),r}function Ug(){if(--rd===0&&Ul!==null){Na!==null&&(Na.status="fulfilled");var t=Ul;Ul=null,Ea=0,Na=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function Z_(t,r){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var Ig=D.S;D.S=function(t,r){_0=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&G_(t,r),Ig!==null&&Ig(t,r)};var Lr=R(null);function ad(){var t=Lr.current;return t!==null?t:it.pooledCache}function Qs(t,r){r===null?M(Lr,Lr.current):M(Lr,r.pool)}function qg(){var t=ad();return t===null?null:{parent:xt._currentValue,pool:t}}var Ca=Error(a(460)),ld=Error(a(474)),Ks=Error(a(542)),Js={then:function(){}};function $g(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Vg(t,r,l){switch(l=t[l],l===void 0?t.push(r):l!==r&&(r.then(hi,hi),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Yg(t),t;default:if(typeof r.status=="string")r.then(hi,hi);else{if(t=it,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=r,t.status="pending",t.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Yg(t),t}throw Br=r,Ca}}function Hr(t){try{var r=t._init;return r(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Br=l,Ca):l}}var Br=null;function Pg(){if(Br===null)throw Error(a(459));var t=Br;return Br=null,t}function Yg(t){if(t===Ca||t===Ks)throw Error(a(483))}var Ta=null,Il=0;function Ws(t){var r=Il;return Il+=1,Ta===null&&(Ta=[]),Vg(Ta,t,r)}function ql(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function eu(t,r){throw r.$$typeof===x?Error(a(525)):(t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Xg(t){function r(Z,X){if(t){var J=Z.deletions;J===null?(Z.deletions=[X],Z.flags|=16):J.push(X)}}function l(Z,X){if(!t)return null;for(;X!==null;)r(Z,X),X=X.sibling;return null}function c(Z){for(var X=new Map;Z!==null;)Z.key!==null?X.set(Z.key,Z):X.set(Z.index,Z),Z=Z.sibling;return X}function p(Z,X){return Z=mi(Z,X),Z.index=0,Z.sibling=null,Z}function y(Z,X,J){return Z.index=J,t?(J=Z.alternate,J!==null?(J=J.index,J<X?(Z.flags|=67108866,X):J):(Z.flags|=67108866,X)):(Z.flags|=1048576,X)}function S(Z){return t&&Z.alternate===null&&(Z.flags|=67108866),Z}function T(Z,X,J,oe){return X===null||X.tag!==6?(X=Gf(J,Z.mode,oe),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function I(Z,X,J,oe){var ve=J.type;return ve===E?le(Z,X,J.props.children,oe,J.key):X!==null&&(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type)?(X=p(X,J.props),ql(X,J),X.return=Z,X):(X=Xs(J.type,J.key,J.props,null,Z.mode,oe),ql(X,J),X.return=Z,X)}function W(Z,X,J,oe){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=Zf(J,Z.mode,oe),X.return=Z,X):(X=p(X,J.children||[]),X.return=Z,X)}function le(Z,X,J,oe,ve){return X===null||X.tag!==7?(X=Dr(J,Z.mode,oe,ve),X.return=Z,X):(X=p(X,J),X.return=Z,X)}function se(Z,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Gf(""+X,Z.mode,J),X.return=Z,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return J=Xs(X.type,X.key,X.props,null,Z.mode,J),ql(J,X),J.return=Z,J;case w:return X=Zf(X,Z.mode,J),X.return=Z,X;case F:return X=Hr(X),se(Z,X,J)}if(B(X)||P(X))return X=Dr(X,Z.mode,J,null),X.return=Z,X;if(typeof X.then=="function")return se(Z,Ws(X),J);if(X.$$typeof===k)return se(Z,Zs(Z,X),J);eu(Z,X)}return null}function ee(Z,X,J,oe){var ve=X!==null?X.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:T(Z,X,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?I(Z,X,J,oe):null;case w:return J.key===ve?W(Z,X,J,oe):null;case F:return J=Hr(J),ee(Z,X,J,oe)}if(B(J)||P(J))return ve!==null?null:le(Z,X,J,oe,null);if(typeof J.then=="function")return ee(Z,X,Ws(J),oe);if(J.$$typeof===k)return ee(Z,X,Zs(Z,J),oe);eu(Z,J)}return null}function re(Z,X,J,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Z=Z.get(J)||null,T(X,Z,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Z=Z.get(oe.key===null?J:oe.key)||null,I(X,Z,oe,ve);case w:return Z=Z.get(oe.key===null?J:oe.key)||null,W(X,Z,oe,ve);case F:return oe=Hr(oe),re(Z,X,J,oe,ve)}if(B(oe)||P(oe))return Z=Z.get(J)||null,le(X,Z,oe,ve,null);if(typeof oe.then=="function")return re(Z,X,J,Ws(oe),ve);if(oe.$$typeof===k)return re(Z,X,J,Zs(X,oe),ve);eu(X,oe)}return null}function ye(Z,X,J,oe){for(var ve=null,Fe=null,xe=X,ze=X=0,Ue=null;xe!==null&&ze<J.length;ze++){xe.index>ze?(Ue=xe,xe=null):Ue=xe.sibling;var Ge=ee(Z,xe,J[ze],oe);if(Ge===null){xe===null&&(xe=Ue);break}t&&xe&&Ge.alternate===null&&r(Z,xe),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge,xe=Ue}if(ze===J.length)return l(Z,xe),Ie&&gi(Z,ze),ve;if(xe===null){for(;ze<J.length;ze++)xe=se(Z,J[ze],oe),xe!==null&&(X=y(xe,X,ze),Fe===null?ve=xe:Fe.sibling=xe,Fe=xe);return Ie&&gi(Z,ze),ve}for(xe=c(xe);ze<J.length;ze++)Ue=re(xe,Z,ze,J[ze],oe),Ue!==null&&(t&&Ue.alternate!==null&&xe.delete(Ue.key===null?ze:Ue.key),X=y(Ue,X,ze),Fe===null?ve=Ue:Fe.sibling=Ue,Fe=Ue);return t&&xe.forEach(function(pr){return r(Z,pr)}),Ie&&gi(Z,ze),ve}function ke(Z,X,J,oe){if(J==null)throw Error(a(151));for(var ve=null,Fe=null,xe=X,ze=X=0,Ue=null,Ge=J.next();xe!==null&&!Ge.done;ze++,Ge=J.next()){xe.index>ze?(Ue=xe,xe=null):Ue=xe.sibling;var pr=ee(Z,xe,Ge.value,oe);if(pr===null){xe===null&&(xe=Ue);break}t&&xe&&pr.alternate===null&&r(Z,xe),X=y(pr,X,ze),Fe===null?ve=pr:Fe.sibling=pr,Fe=pr,xe=Ue}if(Ge.done)return l(Z,xe),Ie&&gi(Z,ze),ve;if(xe===null){for(;!Ge.done;ze++,Ge=J.next())Ge=se(Z,Ge.value,oe),Ge!==null&&(X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return Ie&&gi(Z,ze),ve}for(xe=c(xe);!Ge.done;ze++,Ge=J.next())Ge=re(xe,Z,ze,Ge.value,oe),Ge!==null&&(t&&Ge.alternate!==null&&xe.delete(Ge.key===null?ze:Ge.key),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return t&&xe.forEach(function(lE){return r(Z,lE)}),Ie&&gi(Z,ze),ve}function nt(Z,X,J,oe){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;X!==null;){if(X.key===ve){if(ve=J.type,ve===E){if(X.tag===7){l(Z,X.sibling),oe=p(X,J.props.children),oe.return=Z,Z=oe;break e}}else if(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type){l(Z,X.sibling),oe=p(X,J.props),ql(oe,J),oe.return=Z,Z=oe;break e}l(Z,X);break}else r(Z,X);X=X.sibling}J.type===E?(oe=Dr(J.props.children,Z.mode,oe,J.key),oe.return=Z,Z=oe):(oe=Xs(J.type,J.key,J.props,null,Z.mode,oe),ql(oe,J),oe.return=Z,Z=oe)}return S(Z);case w:e:{for(ve=J.key;X!==null;){if(X.key===ve)if(X.tag===4&&X.stateNode.containerInfo===J.containerInfo&&X.stateNode.implementation===J.implementation){l(Z,X.sibling),oe=p(X,J.children||[]),oe.return=Z,Z=oe;break e}else{l(Z,X);break}else r(Z,X);X=X.sibling}oe=Zf(J,Z.mode,oe),oe.return=Z,Z=oe}return S(Z);case F:return J=Hr(J),nt(Z,X,J,oe)}if(B(J))return ye(Z,X,J,oe);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(a(150));return J=ve.call(J),ke(Z,X,J,oe)}if(typeof J.then=="function")return nt(Z,X,Ws(J),oe);if(J.$$typeof===k)return nt(Z,X,Zs(Z,J),oe);eu(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Z,X.sibling),oe=p(X,J),oe.return=Z,Z=oe):(l(Z,X),oe=Gf(J,Z.mode,oe),oe.return=Z,Z=oe),S(Z)):l(Z,X)}return function(Z,X,J,oe){try{Il=0;var ve=nt(Z,X,J,oe);return Ta=null,ve}catch(xe){if(xe===Ca||xe===Ks)throw xe;var Fe=cn(29,xe,null,Z.mode);return Fe.lanes=oe,Fe.return=Z,Fe}}}var Ur=Xg(!0),Fg=Xg(!1),Ki=!1;function od(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ji(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Wi(t,r,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Qe&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Ys(t),Ag(t,null,l),r}return Ps(t,c,r,l),Ys(t)}function $l(t,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,_s(t,l)}}function ud(t,r){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,l=l.next}while(l!==null);y===null?p=y=r:y=y.next=r}else p=y=r;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=r:t.next=r,l.lastBaseUpdate=r}var cd=!1;function Vl(){if(cd){var t=Na;if(t!==null)throw t}}function Pl(t,r,l,c){cd=!1;var p=t.updateQueue;Ki=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,T=p.shared.pending;if(T!==null){p.shared.pending=null;var I=T,W=I.next;I.next=null,S===null?y=W:S.next=W,S=I;var le=t.alternate;le!==null&&(le=le.updateQueue,T=le.lastBaseUpdate,T!==S&&(T===null?le.firstBaseUpdate=W:T.next=W,le.lastBaseUpdate=I))}if(y!==null){var se=p.baseState;S=0,le=W=I=null,T=y;do{var ee=T.lane&-536870913,re=ee!==T.lane;if(re?(Be&ee)===ee:(c&ee)===ee){ee!==0&&ee===Ea&&(cd=!0),le!==null&&(le=le.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ye=t,ke=T;ee=r;var nt=l;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){se=ye.call(nt,se,ee);break e}se=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(nt,se,ee):ye,ee==null)break e;se=m({},se,ee);break e;case 2:Ki=!0}}ee=T.callback,ee!==null&&(t.flags|=64,re&&(t.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:T.tag,payload:T.payload,callback:T.callback,next:null},le===null?(W=le=re,I=se):le=le.next=re,S|=ee;if(T=T.next,T===null){if(T=p.shared.pending,T===null)break;re=T,T=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);le===null&&(I=se),p.baseState=I,p.firstBaseUpdate=W,p.lastBaseUpdate=le,y===null&&(p.shared.lanes=0),rr|=S,t.lanes=S,t.memoizedState=se}}function Gg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Zg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Gg(l[t],r)}var Ma=R(null),tu=R(0);function Qg(t,r){t=Ci,M(tu,t),M(Ma,r),Ci=t|r.baseLanes}function fd(){M(tu,Ci),M(Ma,Ma.current)}function dd(){Ci=tu.current,$(Ma),$(tu)}var fn=R(null),Tn=null;function er(t){var r=t.alternate;M(mt,mt.current&1),M(fn,t),Tn===null&&(r===null||Ma.current!==null||r.memoizedState!==null)&&(Tn=t)}function hd(t){M(mt,mt.current),M(fn,t),Tn===null&&(Tn=t)}function Kg(t){t.tag===22?(M(mt,mt.current),M(fn,t),Tn===null&&(Tn=t)):tr()}function tr(){M(mt,mt.current),M(fn,fn.current)}function dn(t){$(fn),Tn===t&&(Tn=null),$(mt)}var mt=R(0);function nu(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||bh(l)||vh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var bi=0,Ae=null,et=null,bt=null,iu=!1,Aa=!1,Ir=!1,ru=0,Yl=0,za=null,Q_=0;function ft(){throw Error(a(321))}function pd(t,r){if(r===null)return!1;for(var l=0;l<r.length&&l<t.length;l++)if(!un(t[l],r[l]))return!1;return!0}function md(t,r,l,c,p,y){return bi=y,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=t===null||t.memoizedState===null?Ry:Ad,Ir=!1,y=l(c,p),Ir=!1,Aa&&(y=Wg(r,l,c,p)),Jg(t),y}function Jg(t){D.H=Gl;var r=et!==null&&et.next!==null;if(bi=0,bt=et=Ae=null,iu=!1,Yl=0,za=null,r)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&Gs(t)&&(vt=!0))}function Wg(t,r,l,c){Ae=t;var p=0;do{if(Aa&&(za=null),Yl=0,Aa=!1,25<=p)throw Error(a(301));if(p+=1,bt=et=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}D.H=Oy,y=r(l,c)}while(Aa);return y}function K_(){var t=D.H,r=t.useState()[0];return r=typeof r.then=="function"?Xl(r):r,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(Ae.flags|=1024),r}function gd(){var t=ru!==0;return ru=0,t}function yd(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function xd(t){if(iu){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}iu=!1}bi=0,bt=et=Ae=null,Aa=!1,Yl=ru=0,za=null}function Pt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Ae.memoizedState=bt=t:bt=bt.next=t,bt}function gt(){if(et===null){var t=Ae.alternate;t=t!==null?t.memoizedState:null}else t=et.next;var r=bt===null?Ae.memoizedState:bt.next;if(r!==null)bt=r,et=t;else{if(t===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));et=t,t={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},bt===null?Ae.memoizedState=bt=t:bt=bt.next=t}return bt}function au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xl(t){var r=Yl;return Yl+=1,za===null&&(za=[]),t=Vg(za,t,r),r=Ae,(bt===null?r.memoizedState:bt.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?Ry:Ad),t}function lu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Xl(t);if(t.$$typeof===k)return Dt(t)}throw Error(a(438,String(t)))}function bd(t){var r=null,l=Ae.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var c=Ae.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=au(),Ae.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(t),c=0;c<t;c++)l[c]=q;return r.index++,l}function vi(t,r){return typeof r=="function"?r(t):r}function ou(t){var r=gt();return vd(r,et,t)}function vd(t,r,l){var c=t.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=l;var p=t.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,c.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var T=S=null,I=null,W=r,le=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Be&se)===se:(bi&se)===se){var ee=W.revertLane;if(ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),se===Ea&&(le=!0);else if((bi&ee)===ee){W=W.next,ee===Ea&&(le=!0);continue}else se={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(T=I=se,S=y):I=I.next=se,Ae.lanes|=ee,rr|=ee;se=W.action,Ir&&l(y,se),y=W.hasEagerState?W.eagerState:l(y,se)}else ee={lane:se,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},I===null?(T=I=ee,S=y):I=I.next=ee,Ae.lanes|=se,rr|=se;W=W.next}while(W!==null&&W!==r);if(I===null?S=y:I.next=T,!un(y,t.memoizedState)&&(vt=!0,le&&(l=Na,l!==null)))throw l;t.memoizedState=y,t.baseState=S,t.baseQueue=I,c.lastRenderedState=y}return p===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function wd(t){var r=gt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var c=l.dispatch,p=l.pending,y=r.memoizedState;if(p!==null){l.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);un(y,r.memoizedState)||(vt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),l.lastRenderedState=y}return[y,c]}function ey(t,r,l){var c=Ae,p=gt(),y=Ie;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=r();var S=!un((et||p).memoizedState,l);if(S&&(p.memoizedState=l,vt=!0),p=p.queue,kd(iy.bind(null,c,p,t),[t]),p.getSnapshot!==r||S||bt!==null&&bt.memoizedState.tag&1){if(c.flags|=2048,Da(9,{destroy:void 0},ny.bind(null,c,p,l,r),null),it===null)throw Error(a(349));y||(bi&127)!==0||ty(c,r,l)}return l}function ty(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Ae.updateQueue,r===null?(r=au(),Ae.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function ny(t,r,l,c){r.value=l,r.getSnapshot=c,ry(r)&&ay(t)}function iy(t,r,l){return l(function(){ry(r)&&ay(t)})}function ry(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!un(t,l)}catch{return!0}}function ay(t){var r=zr(t,2);r!==null&&nn(r,t,2)}function Sd(t){var r=Pt();if(typeof t=="function"){var l=t;if(t=l(),Ir){Ht(!0);try{l()}finally{Ht(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:t},r}function ly(t,r,l,c){return t.baseState=l,vd(t,et,typeof c=="function"?c:vi)}function J_(t,r,l,c,p){if(cu(t))throw Error(a(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};D.T!==null?l(!0):y.isTransition=!1,c(y),l=r.pending,l===null?(y.next=r.pending=y,oy(r,y)):(y.next=l.next,r.pending=l.next=y)}}function oy(t,r){var l=r.action,c=r.payload,p=t.state;if(r.isTransition){var y=D.T,S={};D.T=S;try{var T=l(p,c),I=D.S;I!==null&&I(S,T),sy(t,r,T)}catch(W){_d(t,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),D.T=y}}else try{y=l(p,c),sy(t,r,y)}catch(W){_d(t,r,W)}}function sy(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){uy(t,r,c)},function(c){return _d(t,r,c)}):uy(t,r,l)}function uy(t,r,l){r.status="fulfilled",r.value=l,cy(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,oy(t,l)))}function _d(t,r,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=l,cy(r),r=r.next;while(r!==c)}t.action=null}function cy(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function fy(t,r){return r}function dy(t,r){if(Ie){var l=it.formState;if(l!==null){e:{var c=Ae;if(Ie){if(lt){t:{for(var p=lt,y=Cn;p.nodeType!==8;){if(!y){p=null;break t}if(p=Mn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=Mn(p.nextSibling),c=p.data==="F!";break e}}Zi(c)}c=!1}c&&(r=l[0])}}return l=Pt(),l.memoizedState=l.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fy,lastRenderedState:r},l.queue=c,l=zy.bind(null,Ae,c),c.dispatch=l,c=Sd(!1),y=Md.bind(null,Ae,!1,c.queue),c=Pt(),p={state:r,dispatch:null,action:t,pending:null},c.queue=p,l=J_.bind(null,Ae,p,y,l),p.dispatch=l,c.memoizedState=t,[r,l,!1]}function hy(t){var r=gt();return py(r,et,t)}function py(t,r,l){if(r=vd(t,r,fy)[0],t=ou(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Xl(r)}catch(S){throw S===Ca?Ks:S}else c=r;r=gt();var p=r.queue,y=p.dispatch;return l!==r.memoizedState&&(Ae.flags|=2048,Da(9,{destroy:void 0},W_.bind(null,p,l),null)),[c,y,t]}function W_(t,r){t.action=r}function my(t){var r=gt(),l=et;if(l!==null)return py(r,l,t);gt(),r=r.memoizedState,l=gt();var c=l.queue.dispatch;return l.memoizedState=t,[r,c,!1]}function Da(t,r,l,c){return t={tag:t,create:l,deps:c,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=au(),Ae.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,r.lastEffect=t),t}function gy(){return gt().memoizedState}function su(t,r,l,c){var p=Pt();Ae.flags|=t,p.memoizedState=Da(1|r,{destroy:void 0},l,c===void 0?null:c)}function uu(t,r,l,c){var p=gt();c=c===void 0?null:c;var y=p.memoizedState.inst;et!==null&&c!==null&&pd(c,et.memoizedState.deps)?p.memoizedState=Da(r,y,l,c):(Ae.flags|=t,p.memoizedState=Da(1|r,y,l,c))}function yy(t,r){su(8390656,8,t,r)}function kd(t,r){uu(2048,8,t,r)}function ek(t){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=au(),Ae.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function xy(t){var r=gt().memoizedState;return ek({ref:r,nextImpl:t}),function(){if((Qe&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function by(t,r){return uu(4,2,t,r)}function vy(t,r){return uu(4,4,t,r)}function wy(t,r){if(typeof r=="function"){t=t();var l=r(t);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Sy(t,r,l){l=l!=null?l.concat([t]):null,uu(4,4,wy.bind(null,r,t),l)}function Ed(){}function _y(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;return r!==null&&pd(r,c[1])?c[0]:(l.memoizedState=[t,r],t)}function ky(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;if(r!==null&&pd(r,c[1]))return c[0];if(c=t(),Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c}function Nd(t,r,l){return l===void 0||(bi&1073741824)!==0&&(Be&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=E0(),Ae.lanes|=t,rr|=t,l)}function Ey(t,r,l,c){return un(l,r)?l:Ma.current!==null?(t=Nd(t,l,c),un(t,r)||(vt=!0),t):(bi&42)===0||(bi&1073741824)!==0&&(Be&261930)===0?(vt=!0,t.memoizedState=l):(t=E0(),Ae.lanes|=t,rr|=t,r)}function Ny(t,r,l,c,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=D.T,T={};D.T=T,Md(t,!1,r,l);try{var I=p(),W=D.S;if(W!==null&&W(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var le=Z_(I,c);Fl(t,r,le,mn(t))}else Fl(t,r,c,mn(t))}catch(se){Fl(t,r,{then:function(){},status:"rejected",reason:se},mn())}finally{U.p=y,S!==null&&T.types!==null&&(S.types=T.types),D.T=S}}function tk(){}function Cd(t,r,l,c){if(t.tag!==5)throw Error(a(476));var p=Cy(t).queue;Ny(t,p,r,Y,l===null?tk:function(){return Ty(t),l(c)})}function Cy(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:Y},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:l},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Ty(t){var r=Cy(t);r.next===null&&(r=t.alternate.memoizedState),Fl(t,r.next.queue,{},mn())}function Td(){return Dt(co)}function My(){return gt().memoizedState}function Ay(){return gt().memoizedState}function nk(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var l=mn();t=Ji(l);var c=Wi(r,t,l);c!==null&&(nn(c,r,l),$l(c,r,l)),r={cache:id()},t.payload=r;return}r=r.return}}function ik(t,r,l){var c=mn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},cu(t)?Dy(r,l):(l=Xf(t,r,l,c),l!==null&&(nn(l,t,c),jy(l,r,c)))}function zy(t,r,l){var c=mn();Fl(t,r,l,c)}function Fl(t,r,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(cu(t))Dy(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,T=y(S,l);if(p.hasEagerState=!0,p.eagerState=T,un(T,S))return Ps(t,r,p,0),it===null&&Vs(),!1}catch{}if(l=Xf(t,r,p,c),l!==null)return nn(l,t,c),jy(l,r,c),!0}return!1}function Md(t,r,l,c){if(c={lane:2,revertLane:oh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},cu(t)){if(r)throw Error(a(479))}else r=Xf(t,l,c,2),r!==null&&nn(r,t,2)}function cu(t){var r=t.alternate;return t===Ae||r!==null&&r===Ae}function Dy(t,r){Aa=iu=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function jy(t,r,l){if((l&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,_s(t,l)}}var Gl={readContext:Dt,use:lu,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};Gl.useEffectEvent=ft;var Ry={readContext:Dt,use:lu,useCallback:function(t,r){return Pt().memoizedState=[t,r===void 0?null:r],t},useContext:Dt,useEffect:yy,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,su(4194308,4,wy.bind(null,r,t),l)},useLayoutEffect:function(t,r){return su(4194308,4,t,r)},useInsertionEffect:function(t,r){su(4,2,t,r)},useMemo:function(t,r){var l=Pt();r=r===void 0?null:r;var c=t();if(Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c},useReducer:function(t,r,l){var c=Pt();if(l!==void 0){var p=l(r);if(Ir){Ht(!0);try{l(r)}finally{Ht(!1)}}}else p=r;return c.memoizedState=c.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},c.queue=t,t=t.dispatch=ik.bind(null,Ae,t),[c.memoizedState,t]},useRef:function(t){var r=Pt();return t={current:t},r.memoizedState=t},useState:function(t){t=Sd(t);var r=t.queue,l=zy.bind(null,Ae,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:Ed,useDeferredValue:function(t,r){var l=Pt();return Nd(l,t,r)},useTransition:function(){var t=Sd(!1);return t=Ny.bind(null,Ae,t.queue,!0,!1),Pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var c=Ae,p=Pt();if(Ie){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),it===null)throw Error(a(349));(Be&127)!==0||ty(c,r,l)}p.memoizedState=l;var y={value:l,getSnapshot:r};return p.queue=y,yy(iy.bind(null,c,y,t),[t]),c.flags|=2048,Da(9,{destroy:void 0},ny.bind(null,c,y,l,r),null),l},useId:function(){var t=Pt(),r=it.identifierPrefix;if(Ie){var l=Kn,c=Qn;l=(c&~(1<<32-Ke(c)-1)).toString(32)+l,r="_"+r+"R_"+l,l=ru++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=Q_++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Td,useFormState:dy,useActionState:dy,useOptimistic:function(t){var r=Pt();r.memoizedState=r.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Md.bind(null,Ae,!0,l),l.dispatch=r,[t,r]},useMemoCache:bd,useCacheRefresh:function(){return Pt().memoizedState=nk.bind(null,Ae)},useEffectEvent:function(t){var r=Pt(),l={impl:t};return r.memoizedState=l,function(){if((Qe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Ad={readContext:Dt,use:lu,useCallback:_y,useContext:Dt,useEffect:kd,useImperativeHandle:Sy,useInsertionEffect:by,useLayoutEffect:vy,useMemo:ky,useReducer:ou,useRef:gy,useState:function(){return ou(vi)},useDebugValue:Ed,useDeferredValue:function(t,r){var l=gt();return Ey(l,et.memoizedState,t,r)},useTransition:function(){var t=ou(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Xl(t),r]},useSyncExternalStore:ey,useId:My,useHostTransitionStatus:Td,useFormState:hy,useActionState:hy,useOptimistic:function(t,r){var l=gt();return ly(l,et,t,r)},useMemoCache:bd,useCacheRefresh:Ay};Ad.useEffectEvent=xy;var Oy={readContext:Dt,use:lu,useCallback:_y,useContext:Dt,useEffect:kd,useImperativeHandle:Sy,useInsertionEffect:by,useLayoutEffect:vy,useMemo:ky,useReducer:wd,useRef:gy,useState:function(){return wd(vi)},useDebugValue:Ed,useDeferredValue:function(t,r){var l=gt();return et===null?Nd(l,t,r):Ey(l,et.memoizedState,t,r)},useTransition:function(){var t=wd(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Xl(t),r]},useSyncExternalStore:ey,useId:My,useHostTransitionStatus:Td,useFormState:my,useActionState:my,useOptimistic:function(t,r){var l=gt();return et!==null?ly(l,et,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:bd,useCacheRefresh:Ay};Oy.useEffectEvent=xy;function zd(t,r,l,c){r=t.memoizedState,l=l(c,r),l=l==null?r:m({},r,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Dd={enqueueSetState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),$l(r,t,c))},enqueueReplaceState:function(t,r,l){t=t._reactInternals;var c=mn(),p=Ji(c);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=Wi(t,p,c),r!==null&&(nn(r,t,c),$l(r,t,c))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var l=mn(),c=Ji(l);c.tag=2,r!=null&&(c.callback=r),r=Wi(t,c,l),r!==null&&(nn(r,t,l),$l(r,t,l))}};function Ly(t,r,l,c,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!Rl(l,c)||!Rl(p,y):!0}function Hy(t,r,l,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,c),r.state!==t&&Dd.enqueueReplaceState(r,r.state,null)}function qr(t,r){var l=r;if("ref"in r){l={};for(var c in r)c!=="ref"&&(l[c]=r[c])}if(t=t.defaultProps){l===r&&(l=m({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function By(t){$s(t)}function Uy(t){console.error(t)}function Iy(t){$s(t)}function fu(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function qy(t,r,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function jd(t,r,l){return l=Ji(l),l.tag=3,l.payload={element:null},l.callback=function(){fu(t,r)},l}function $y(t){return t=Ji(t),t.tag=3,t}function Vy(t,r,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;t.payload=function(){return p(y)},t.callback=function(){qy(r,l,c)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){qy(r,l,c),typeof p!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function rk(t,r,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=l.alternate,r!==null&&ka(r,l,p,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:return Tn===null?_u():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===Js?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([c]):r.add(c),rh(t,c,p)),!1;case 22:return l.flags|=65536,c===Js?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([c]):l.add(c)),rh(t,c,p)),!1}throw Error(a(435,l.tag))}return rh(t,c,p),_u(),!1}if(Ie)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==Jf&&(t=Error(a(422),{cause:c}),Hl(kn(t,l)))):(c!==Jf&&(r=Error(a(423),{cause:c}),Hl(kn(r,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=kn(c,l),p=jd(t.stateNode,c,p),ud(t,p),dt!==4&&(dt=2)),!1;var y=Error(a(520),{cause:c});if(y=kn(y,l),no===null?no=[y]:no.push(y),dt!==4&&(dt=2),r===null)return!0;c=kn(c,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=jd(l.stateNode,c,t),ud(l,t),!1;case 1:if(r=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ar===null||!ar.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=$y(p),Vy(p,t,l,c),ud(l,p),!1}l=l.return}while(l!==null);return!1}var Rd=Error(a(461)),vt=!1;function jt(t,r,l,c){r.child=t===null?Fg(r,null,l,c):Ur(r,t.child,l,c)}function Py(t,r,l,c,p){l=l.render;var y=r.ref;if("ref"in c){var S={};for(var T in c)T!=="ref"&&(S[T]=c[T])}else S=c;return Or(r),c=md(t,r,l,S,y,p),T=gd(),t!==null&&!vt?(yd(t,r,p),wi(t,r,p)):(Ie&&T&&Qf(r),r.flags|=1,jt(t,r,c,p),r.child)}function Yy(t,r,l,c,p){if(t===null){var y=l.type;return typeof y=="function"&&!Ff(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,Xy(t,r,y,c,p)):(t=Xs(l.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!$d(t,p)){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:Rl,l(S,c)&&t.ref===r.ref)return wi(t,r,p)}return r.flags|=1,t=mi(y,c),t.ref=r.ref,t.return=r,r.child=t}function Xy(t,r,l,c,p){if(t!==null){var y=t.memoizedProps;if(Rl(y,c)&&t.ref===r.ref)if(vt=!1,r.pendingProps=c=y,$d(t,p))(t.flags&131072)!==0&&(vt=!0);else return r.lanes=t.lanes,wi(t,r,p)}return Od(t,r,l,c,p)}function Fy(t,r,l,c){var p=c.children,y=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,t!==null){for(c=r.child=t.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,r.child=null;return Gy(t,r,y,l,c)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qs(r,y!==null?y.cachePool:null),y!==null?Qg(r,y):fd(),Kg(r);else return c=r.lanes=536870912,Gy(t,r,y!==null?y.baseLanes|l:l,l,c)}else y!==null?(Qs(r,y.cachePool),Qg(r,y),tr(),r.memoizedState=null):(t!==null&&Qs(r,null),fd(),tr());return jt(t,r,p,l),r.child}function Zl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Gy(t,r,l,c,p){var y=ad();return y=y===null?null:{parent:xt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},t!==null&&Qs(r,null),fd(),Kg(r),t!==null&&ka(t,r,c,!0),r.childLanes=p,null}function du(t,r){return r=pu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Zy(t,r,l){return Ur(r,t.child,null,l),t=du(r,r.pendingProps),t.flags|=2,dn(r),r.memoizedState=null,t}function ak(t,r,l){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Ie){if(c.mode==="hidden")return t=du(r,c),r.lanes=536870912,Zl(null,t);if(hd(r),(t=lt)?(t=ox(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return r.lanes=536870912,null}return du(r,c)}var y=t.memoizedState;if(y!==null){var S=y.dehydrated;if(hd(r),p)if(r.flags&256)r.flags&=-257,r=Zy(t,r,l);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(a(558));else if(vt||ka(t,r,l,!1),p=(l&t.childLanes)!==0,vt||p){if(c=it,c!==null&&(S=ks(c,l),S!==0&&S!==y.retryLane))throw y.retryLane=S,zr(t,S),nn(c,t,S),Rd;_u(),r=Zy(t,r,l)}else t=y.treeContext,lt=Mn(S.nextSibling),zt=r,Ie=!0,Gi=null,Cn=!1,t!==null&&Og(r,t),r=du(r,c),r.flags|=4096;return r}return t=mi(t.child,{mode:c.mode,children:c.children}),t.ref=r.ref,r.child=t,t.return=r,t}function hu(t,r){var l=r.ref;if(l===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(r.flags|=4194816)}}function Od(t,r,l,c,p){return Or(r),l=md(t,r,l,c,void 0,p),c=gd(),t!==null&&!vt?(yd(t,r,p),wi(t,r,p)):(Ie&&c&&Qf(r),r.flags|=1,jt(t,r,l,p),r.child)}function Qy(t,r,l,c,p,y){return Or(r),r.updateQueue=null,l=Wg(r,c,l,p),Jg(t),c=gd(),t!==null&&!vt?(yd(t,r,y),wi(t,r,y)):(Ie&&c&&Qf(r),r.flags|=1,jt(t,r,l,y),r.child)}function Ky(t,r,l,c,p){if(Or(r),r.stateNode===null){var y=va,S=l.contextType;typeof S=="object"&&S!==null&&(y=Dt(S)),y=new l(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Dd,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},od(r),S=l.contextType,y.context=typeof S=="object"&&S!==null?Dt(S):va,y.state=r.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(zd(r,l,S,c),y.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&Dd.enqueueReplaceState(y,y.state,null),Pl(r,c,y,p),Vl(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){y=r.stateNode;var T=r.memoizedProps,I=qr(l,T);y.props=I;var W=y.context,le=l.contextType;S=va,typeof le=="object"&&le!==null&&(S=Dt(le));var se=l.getDerivedStateFromProps;le=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",T=r.pendingProps!==T,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T||W!==S)&&Hy(r,y,c,S),Ki=!1;var ee=r.memoizedState;y.state=ee,Pl(r,c,y,p),Vl(),W=r.memoizedState,T||ee!==W||Ki?(typeof se=="function"&&(zd(r,l,se,c),W=r.memoizedState),(I=Ki||Ly(r,l,I,c,ee,W,S))?(le||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=W),y.props=c,y.state=W,y.context=S,c=I):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,sd(t,r),S=r.memoizedProps,le=qr(l,S),y.props=le,se=r.pendingProps,ee=y.context,W=l.contextType,I=va,typeof W=="object"&&W!==null&&(I=Dt(W)),T=l.getDerivedStateFromProps,(W=typeof T=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==se||ee!==I)&&Hy(r,y,c,I),Ki=!1,ee=r.memoizedState,y.state=ee,Pl(r,c,y,p),Vl();var re=r.memoizedState;S!==se||ee!==re||Ki||t!==null&&t.dependencies!==null&&Gs(t.dependencies)?(typeof T=="function"&&(zd(r,l,T,c),re=r.memoizedState),(le=Ki||Ly(r,l,le,c,ee,re,I)||t!==null&&t.dependencies!==null&&Gs(t.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,I)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=re),y.props=c,y.state=re,y.context=I,c=le):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(r.flags|=1024),c=!1)}return y=c,hu(t,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&c?(r.child=Ur(r,t.child,null,p),r.child=Ur(r,null,l,p)):jt(t,r,l,p),r.memoizedState=y.state,t=r.child):t=wi(t,r,p),t}function Jy(t,r,l,c){return jr(),r.flags|=256,jt(t,r,l,c),r.child}var Ld={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hd(t){return{baseLanes:t,cachePool:qg()}}function Bd(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=pn),t}function Wy(t,r,l){var c=r.pendingProps,p=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=t!==null&&t.memoizedState===null?!1:(mt.current&2)!==0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,t===null){if(Ie){if(p?er(r):tr(),(t=lt)?(t=ox(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:Qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},l=Dg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return vh(t)?r.lanes=32:r.lanes=536870912,null}var T=c.children;return c=c.fallback,p?(tr(),p=r.mode,T=pu({mode:"hidden",children:T},p),c=Dr(c,p,l,null),T.return=r,c.return=r,T.sibling=c,r.child=T,c=r.child,c.memoizedState=Hd(l),c.childLanes=Bd(t,S,l),r.memoizedState=Ld,Zl(null,c)):(er(r),Ud(r,T))}var I=t.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(y)r.flags&256?(er(r),r.flags&=-257,r=Id(t,r,l)):r.memoizedState!==null?(tr(),r.child=t.child,r.flags|=128,r=null):(tr(),T=c.fallback,p=r.mode,c=pu({mode:"visible",children:c.children},p),T=Dr(T,p,l,null),T.flags|=2,c.return=r,T.return=r,c.sibling=T,r.child=c,Ur(r,t.child,null,l),c=r.child,c.memoizedState=Hd(l),c.childLanes=Bd(t,S,l),r.memoizedState=Ld,r=Zl(null,c));else if(er(r),vh(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(a(419)),c.stack="",c.digest=S,Hl({value:c,source:null,stack:null}),r=Id(t,r,l)}else if(vt||ka(t,r,l,!1),S=(l&t.childLanes)!==0,vt||S){if(S=it,S!==null&&(c=ks(S,l),c!==0&&c!==I.retryLane))throw I.retryLane=c,zr(t,c),nn(S,t,c),Rd;bh(T)||_u(),r=Id(t,r,l)}else bh(T)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,lt=Mn(T.nextSibling),zt=r,Ie=!0,Gi=null,Cn=!1,t!==null&&Og(r,t),r=Ud(r,c.children),r.flags|=4096);return r}return p?(tr(),T=c.fallback,p=r.mode,I=t.child,W=I.sibling,c=mi(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,W!==null?T=mi(W,T):(T=Dr(T,p,l,null),T.flags|=2),T.return=r,c.return=r,c.sibling=T,r.child=c,Zl(null,c),c=r.child,T=t.child.memoizedState,T===null?T=Hd(l):(p=T.cachePool,p!==null?(I=xt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=qg(),T={baseLanes:T.baseLanes|l,cachePool:p}),c.memoizedState=T,c.childLanes=Bd(t,S,l),r.memoizedState=Ld,Zl(t.child,c)):(er(r),l=t.child,t=l.sibling,l=mi(l,{mode:"visible",children:c.children}),l.return=r,l.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=l,r.memoizedState=null,l)}function Ud(t,r){return r=pu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function pu(t,r){return t=cn(22,t,null,r),t.lanes=0,t}function Id(t,r,l){return Ur(r,t.child,null,l),t=Ud(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function e0(t,r,l){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),td(t.return,r,l)}function qd(t,r,l,c,p,y){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=l,S.tailMode=p,S.treeForkCount=y)}function t0(t,r,l){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=mt.current,T=(S&2)!==0;if(T?(S=S&1|2,r.flags|=128):S&=1,M(mt,S),jt(t,r,c,l),c=Ie?Ll:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&e0(t,l,r);else if(t.tag===19)e0(t,l,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)t=l.alternate,t!==null&&nu(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),qd(r,!1,p,l,y,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&nu(t)===null){r.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}qd(r,!0,l,null,y,c);break;case"together":qd(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function wi(t,r,l){if(t!==null&&(r.dependencies=t.dependencies),rr|=r.lanes,(l&r.childLanes)===0)if(t!==null){if(ka(t,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,l=mi(t,t.pendingProps),r.child=l,l.return=r;t.sibling!==null;)t=t.sibling,l=l.sibling=mi(t,t.pendingProps),l.return=r;l.sibling=null}return r.child}function $d(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Gs(t)))}function lk(t,r,l){switch(r.tag){case 3:ue(r,r.stateNode.containerInfo),Qi(r,xt,t.memoizedState.cache),jr();break;case 27:case 5:Ee(r);break;case 4:ue(r,r.stateNode.containerInfo);break;case 10:Qi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,hd(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(er(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Wy(t,r,l):(er(r),t=wi(t,r,l),t!==null?t.sibling:null);er(r);break;case 19:var p=(t.flags&128)!==0;if(c=(l&r.childLanes)!==0,c||(ka(t,r,l,!1),c=(l&r.childLanes)!==0),p){if(c)return t0(t,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),M(mt,mt.current),c)break;return null;case 22:return r.lanes=0,Fy(t,r,l,r.pendingProps);case 24:Qi(r,xt,t.memoizedState.cache)}return wi(t,r,l)}function n0(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)vt=!0;else{if(!$d(t,l)&&(r.flags&128)===0)return vt=!1,lk(t,r,l);vt=(t.flags&131072)!==0}else vt=!1,Ie&&(r.flags&1048576)!==0&&Rg(r,Ll,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(t=Hr(r.elementType),r.type=t,typeof t=="function")Ff(t)?(c=qr(t,c),r.tag=1,r=Ky(null,r,t,c,l)):(r.tag=0,r=Od(null,r,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===C){r.tag=11,r=Py(null,r,t,c,l);break e}else if(p===H){r.tag=14,r=Yy(null,r,t,c,l);break e}}throw r=O(t)||t,Error(a(306,r,""))}}return r;case 0:return Od(t,r,r.type,r.pendingProps,l);case 1:return c=r.type,p=qr(c,r.pendingProps),Ky(t,r,c,p,l);case 3:e:{if(ue(r,r.stateNode.containerInfo),t===null)throw Error(a(387));c=r.pendingProps;var y=r.memoizedState;p=y.element,sd(t,r),Pl(r,c,null,l);var S=r.memoizedState;if(c=S.cache,Qi(r,xt,c),c!==y.cache&&nd(r,[xt],l,!0),Vl(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=Jy(t,r,c,l);break e}else if(c!==p){p=kn(Error(a(424)),r),Hl(p),r=Jy(t,r,c,l);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=Mn(t.firstChild),zt=r,Ie=!0,Gi=null,Cn=!0,l=Fg(r,null,c,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(jr(),c===p){r=wi(t,r,l);break e}jt(t,r,c,l)}r=r.child}return r;case 26:return hu(t,r),t===null?(l=hx(r.type,null,r.pendingProps,null))?r.memoizedState=l:Ie||(l=r.type,t=r.pendingProps,c=Au(fe.current).createElement(l),c[Nt]=r,c[Bt]=t,Rt(c,l,t),yt(c),r.stateNode=c):r.memoizedState=hx(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ee(r),t===null&&Ie&&(c=r.stateNode=cx(r.type,r.pendingProps,fe.current),zt=r,Cn=!0,p=lt,ur(r.type)?(wh=p,lt=Mn(c.firstChild)):lt=p),jt(t,r,r.pendingProps.children,l),hu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Ie&&((p=c=lt)&&(c=Lk(c,r.type,r.pendingProps,Cn),c!==null?(r.stateNode=c,zt=r,lt=Mn(c.firstChild),Cn=!1,p=!0):p=!1),p||Zi(r)),Ee(r),p=r.type,y=r.pendingProps,S=t!==null?t.memoizedProps:null,c=y.children,gh(p,y)?c=null:S!==null&&gh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=md(t,r,K_,null,null,l),co._currentValue=p),hu(t,r),jt(t,r,c,l),r.child;case 6:return t===null&&Ie&&((t=l=lt)&&(l=Hk(l,r.pendingProps,Cn),l!==null?(r.stateNode=l,zt=r,lt=null,t=!0):t=!1),t||Zi(r)),null;case 13:return Wy(t,r,l);case 4:return ue(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Ur(r,null,c,l):jt(t,r,c,l),r.child;case 11:return Py(t,r,r.type,r.pendingProps,l);case 7:return jt(t,r,r.pendingProps,l),r.child;case 8:return jt(t,r,r.pendingProps.children,l),r.child;case 12:return jt(t,r,r.pendingProps.children,l),r.child;case 10:return c=r.pendingProps,Qi(r,r.type,c.value),jt(t,r,c.children,l),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,Or(r),p=Dt(p),c=c(p),r.flags|=1,jt(t,r,c,l),r.child;case 14:return Yy(t,r,r.type,r.pendingProps,l);case 15:return Xy(t,r,r.type,r.pendingProps,l);case 19:return t0(t,r,l);case 31:return ak(t,r,l);case 22:return Fy(t,r,l,r.pendingProps);case 24:return Or(r),c=Dt(xt),t===null?(p=ad(),p===null&&(p=it,y=id(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),r.memoizedState={parent:c,cache:p},od(r),Qi(r,xt,p)):((t.lanes&l)!==0&&(sd(t,r),Pl(r,null,null,l),Vl()),p=t.memoizedState,y=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Qi(r,xt,c)):(c=y.cache,Qi(r,xt,c),c!==p.cache&&nd(r,[xt],l,!0))),jt(t,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Si(t){t.flags|=4}function Vd(t,r,l,c,p){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(M0())t.flags|=8192;else throw Br=Js,ld}else t.flags&=-16777217}function i0(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!xx(r))if(M0())t.flags|=8192;else throw Br=Js,ld}function mu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?ws():536870912,t.lanes|=r,La|=r)}function Ql(t,r){if(!Ie)switch(t.tailMode){case"hidden":r=t.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function ot(t){var r=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(r)for(var p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=l,r}function ok(t,r,l){var c=r.pendingProps;switch(Kf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(r),null;case 1:return ot(r),null;case 3:return l=r.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),xi(xt),me(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(_a(r)?Si(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Wf())),ot(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(Si(r),y!==null?(ot(r),i0(r,y)):(ot(r),Vd(r,p,null,c,l))):y?y!==t.memoizedState?(Si(r),ot(r),i0(r,y)):(ot(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&Si(r),ot(r),Vd(r,p,t,c,l)),null;case 27:if(Ce(r),l=fe.current,p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return ot(r),null}t=ie.current,_a(r)?Lg(r):(t=cx(p,c,l),r.stateNode=t,Si(r))}return ot(r),null;case 5:if(Ce(r),p=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(!c){if(r.stateNode===null)throw Error(a(166));return ot(r),null}if(y=ie.current,_a(r))Lg(r);else{var S=Au(fe.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}y[Nt]=r,y[Bt]=c;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=y;e:switch(Rt(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Si(r)}}return ot(r),Vd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,l),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&Si(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(t=fe.current,_a(r)){if(t=r.stateNode,l=r.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}t[Nt]=r,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||W0(t.nodeValue,l)),t||Zi(r,!0)}else t=Au(t).createTextNode(c),t[Nt]=r,r.stateNode=t}return ot(r),null;case 31:if(l=r.memoizedState,t===null||t.memoizedState!==null){if(c=_a(r),l!==null){if(t===null){if(!c)throw Error(a(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Nt]=r}else jr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),t=!1}else l=Wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return r.flags&256?(dn(r),r):(dn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return ot(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=_a(r),c!==null&&c.dehydrated!==null){if(t===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Nt]=r}else jr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),p=!1}else p=Wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(dn(r),r):(dn(r),null)}return dn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),l!==t&&l&&(r.child.flags|=8192),mu(r,r.updateQueue),ot(r),null);case 4:return me(),t===null&&fh(r.stateNode.containerInfo),ot(r),null;case 10:return xi(r.type),ot(r),null;case 19:if($(mt),c=r.memoizedState,c===null)return ot(r),null;if(p=(r.flags&128)!==0,y=c.rendering,y===null)if(p)Ql(c,!1);else{if(dt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=nu(t),y!==null){for(r.flags|=128,Ql(c,!1),t=y.updateQueue,r.updateQueue=t,mu(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)zg(l,t),l=l.sibling;return M(mt,mt.current&1|2),Ie&&gi(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&Et()>vu&&(r.flags|=128,p=!0,Ql(c,!1),r.lanes=4194304)}else{if(!p)if(t=nu(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,mu(r,t),Ql(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!Ie)return ot(r),null}else 2*Et()-c.renderingStartTime>vu&&l!==536870912&&(r.flags|=128,p=!0,Ql(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(t=c.last,t!==null?t.sibling=y:r.child=y,c.last=y)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Et(),t.sibling=null,l=mt.current,M(mt,p?l&1|2:l&1),Ie&&gi(r,c.treeForkCount),t):(ot(r),null);case 22:case 23:return dn(r),dd(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(l&536870912)!==0&&(r.flags&128)===0&&(ot(r),r.subtreeFlags&6&&(r.flags|=8192)):ot(r),l=r.updateQueue,l!==null&&mu(r,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==l&&(r.flags|=2048),t!==null&&$(Lr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),xi(xt),ot(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function sk(t,r){switch(Kf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return xi(xt),me(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return Ce(r),null;case 31:if(r.memoizedState!==null){if(dn(r),r.alternate===null)throw Error(a(340));jr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(dn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));jr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return $(mt),null;case 4:return me(),null;case 10:return xi(r.type),null;case 22:case 23:return dn(r),dd(),t!==null&&$(Lr),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return xi(xt),null;case 25:return null;default:return null}}function r0(t,r){switch(Kf(r),r.tag){case 3:xi(xt),me();break;case 26:case 27:case 5:Ce(r);break;case 4:me();break;case 31:r.memoizedState!==null&&dn(r);break;case 13:dn(r);break;case 19:$(mt);break;case 10:xi(r.type);break;case 22:case 23:dn(r),dd(),t!==null&&$(Lr);break;case 24:xi(xt)}}function Kl(t,r){try{var l=r.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&t)===t){c=void 0;var y=l.create,S=l.inst;c=y(),S.destroy=c}l=l.next}while(l!==p)}}catch(T){We(r,r.return,T)}}function nr(t,r,l){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&t)===t){var S=c.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,p=r;var I=l,W=T;try{W()}catch(le){We(p,I,le)}}}c=c.next}while(c!==y)}}catch(le){We(r,r.return,le)}}function a0(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{Zg(r,l)}catch(c){We(t,t.return,c)}}}function l0(t,r,l){l.props=qr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){We(t,r,c)}}function Jl(t,r){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(p){We(t,r,p)}}function Jn(t,r){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){We(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){We(t,r,p)}else l.current=null}function o0(t){var r=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){We(t,t.return,p)}}function Pd(t,r,l){try{var c=t.stateNode;Ak(c,t.type,l,r),c[Bt]=r}catch(p){We(t,t.return,p)}}function s0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Yd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||s0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ur(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xd(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(t),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=hi));else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode,r=null),t=t.child,t!==null))for(Xd(t,r,l),t=t.sibling;t!==null;)Xd(t,r,l),t=t.sibling}function gu(t,r,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?l.insertBefore(t,r):l.appendChild(t);else if(c!==4&&(c===27&&ur(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(gu(t,r,l),t=t.sibling;t!==null;)gu(t,r,l),t=t.sibling}function u0(t){var r=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Rt(r,c,l),r[Nt]=t,r[Bt]=l}catch(y){We(t,t.return,y)}}var _i=!1,wt=!1,Fd=!1,c0=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function uk(t,r){if(t=t.containerInfo,ph=Hu,t=Sg(t),If(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var S=0,T=-1,I=-1,W=0,le=0,se=t,ee=null;t:for(;;){for(var re;se!==l||p!==0&&se.nodeType!==3||(T=S+p),se!==y||c!==0&&se.nodeType!==3||(I=S+c),se.nodeType===3&&(S+=se.nodeValue.length),(re=se.firstChild)!==null;)ee=se,se=re;for(;;){if(se===t)break t;if(ee===l&&++W===p&&(T=S),ee===y&&++le===c&&(I=S),(re=se.nextSibling)!==null)break;se=ee,ee=se.parentNode}se=re}l=T===-1||I===-1?null:{start:T,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(mh={focusedElem:t,selectionRange:l},Hu=!1,Mt=r;Mt!==null;)if(r=Mt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Mt=t;else for(;Mt!==null;){switch(r=Mt,y=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,l=r,p=y.memoizedProps,y=y.memoizedState,c=l.stateNode;try{var ye=qr(l.type,p);t=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=t}catch(ke){We(l,l.return,ke)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,l=t.nodeType,l===9)xh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=r.sibling,t!==null){t.return=r.return,Mt=t;break}Mt=r.return}}function f0(t,r,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(t,l),c&4&&Kl(5,l);break;case 1:if(Ei(t,l),c&4)if(t=l.stateNode,r===null)try{t.componentDidMount()}catch(S){We(l,l.return,S)}else{var p=qr(l.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){We(l,l.return,S)}}c&64&&a0(l),c&512&&Jl(l,l.return);break;case 3:if(Ei(t,l),c&64&&(t=l.updateQueue,t!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Zg(t,r)}catch(S){We(l,l.return,S)}}break;case 27:r===null&&c&4&&u0(l);case 26:case 5:Ei(t,l),r===null&&c&4&&o0(l),c&512&&Jl(l,l.return);break;case 12:Ei(t,l);break;case 31:Ei(t,l),c&4&&p0(t,l);break;case 13:Ei(t,l),c&4&&m0(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=xk.bind(null,l),Bk(t,l))));break;case 22:if(c=l.memoizedState!==null||_i,!c){r=r!==null&&r.memoizedState!==null||wt,p=_i;var y=wt;_i=c,(wt=r)&&!y?Ni(t,l,(l.subtreeFlags&8772)!==0):Ei(t,l),_i=p,wt=y}break;case 30:break;default:Ei(t,l)}}function d0(t){var r=t.alternate;r!==null&&(t.alternate=null,d0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&kl(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var st=null,Jt=!1;function ki(t,r,l){for(l=l.child;l!==null;)h0(t,r,l),l=l.sibling}function h0(t,r,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(At,l)}catch{}switch(l.tag){case 26:wt||Jn(l,r),ki(t,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:wt||Jn(l,r);var c=st,p=Jt;ur(l.type)&&(st=l.stateNode,Jt=!1),ki(t,r,l),oo(l.stateNode),st=c,Jt=p;break;case 5:wt||Jn(l,r);case 6:if(c=st,p=Jt,st=null,ki(t,r,l),st=c,Jt=p,st!==null)if(Jt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(l.stateNode)}catch(y){We(l,r,y)}else try{st.removeChild(l.stateNode)}catch(y){We(l,r,y)}break;case 18:st!==null&&(Jt?(t=st,ax(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Pa(t)):ax(st,l.stateNode));break;case 4:c=st,p=Jt,st=l.stateNode.containerInfo,Jt=!0,ki(t,r,l),st=c,Jt=p;break;case 0:case 11:case 14:case 15:nr(2,l,r),wt||nr(4,l,r),ki(t,r,l);break;case 1:wt||(Jn(l,r),c=l.stateNode,typeof c.componentWillUnmount=="function"&&l0(l,r,c)),ki(t,r,l);break;case 21:ki(t,r,l);break;case 22:wt=(c=wt)||l.memoizedState!==null,ki(t,r,l),wt=c;break;default:ki(t,r,l)}}function p0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Pa(t)}catch(l){We(r,r.return,l)}}}function m0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pa(t)}catch(l){We(r,r.return,l)}}function ck(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new c0),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new c0),r;default:throw Error(a(435,t.tag))}}function yu(t,r){var l=ck(t);r.forEach(function(c){if(!l.has(c)){l.add(c);var p=bk.bind(null,t,c);c.then(p,p)}})}function Wt(t,r){var l=r.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],y=t,S=r,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(ur(T.type)){st=T.stateNode,Jt=!1;break e}break;case 5:st=T.stateNode,Jt=!1;break e;case 3:case 4:st=T.stateNode.containerInfo,Jt=!0;break e}T=T.return}if(st===null)throw Error(a(160));h0(y,S,p),st=null,Jt=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)g0(r,t),r=r.sibling}var Bn=null;function g0(t,r){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Wt(r,t),en(t),c&4&&(nr(3,t,t.return),Kl(3,t),nr(5,t,t.return));break;case 1:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&64&&_i&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Bn;if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),c&4){var y=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Er]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Rt(y,c,l),y[Nt]=t,yt(y),c=y;break e;case"link":var S=gx("link","href",p).get(c+(l.href||""));if(S){for(var T=0;T<S.length;T++)if(y=S[T],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(T,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;case"meta":if(S=gx("meta","content",p).get(c+(l.content||""))){for(T=0;T<S.length;T++)if(y=S[T],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(T,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;default:throw Error(a(468,c))}y[Nt]=t,yt(y),c=y}t.stateNode=c}else yx(p,t.type,t.stateNode);else t.stateNode=mx(p,c,t.memoizedProps);else y!==c?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,c===null?yx(p,t.type,t.stateNode):mx(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Pd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),l!==null&&c&4&&Pd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Wt(r,t),en(t),c&512&&(wt||l===null||Jn(l,l.return)),t.flags&32){p=t.stateNode;try{ha(p,"")}catch(ye){We(t,t.return,ye)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,Pd(t,p,l!==null?l.memoizedProps:p)),c&1024&&(Fd=!0);break;case 6:if(Wt(r,t),en(t),c&4){if(t.stateNode===null)throw Error(a(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(ye){We(t,t.return,ye)}}break;case 3:if(ju=null,p=Bn,Bn=zu(r.containerInfo),Wt(r,t),Bn=p,en(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Pa(r.containerInfo)}catch(ye){We(t,t.return,ye)}Fd&&(Fd=!1,y0(t));break;case 4:c=Bn,Bn=zu(t.stateNode.containerInfo),Wt(r,t),en(t),Bn=c;break;case 12:Wt(r,t),en(t);break;case 31:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,yu(t,c)));break;case 13:Wt(r,t),en(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(bu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,yu(t,c)));break;case 22:p=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,W=_i,le=wt;if(_i=W||p,wt=le||I,Wt(r,t),wt=le,_i=W,en(t),c&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||_i||wt||$r(t)),l=null,r=t;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(y=I.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=I.stateNode;var se=I.memoizedProps.style,ee=se!=null&&se.hasOwnProperty("display")?se.display:null;T.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){We(I,I.return,ye)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(ye){We(I,I.return,ye)}}}else if(r.tag===18){if(l===null){I=r;try{var re=I.stateNode;p?lx(re,!0):lx(I.stateNode,!1)}catch(ye){We(I,I.return,ye)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,yu(t,l))));break;case 19:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,yu(t,c)));break;case 30:break;case 21:break;default:Wt(r,t),en(t)}}function en(t){var r=t.flags;if(r&2){try{for(var l,c=t.return;c!==null;){if(s0(c)){l=c;break}c=c.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,y=Yd(t);gu(t,y,p);break;case 5:var S=l.stateNode;l.flags&32&&(ha(S,""),l.flags&=-33);var T=Yd(t);gu(t,T,S);break;case 3:case 4:var I=l.stateNode.containerInfo,W=Yd(t);Xd(t,W,I);break;default:throw Error(a(161))}}catch(le){We(t,t.return,le)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function y0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;y0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ei(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)f0(t,r.alternate,r),r=r.sibling}function $r(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:nr(4,r,r.return),$r(r);break;case 1:Jn(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&l0(r,r.return,l),$r(r);break;case 27:oo(r.stateNode);case 26:case 5:Jn(r,r.return),$r(r);break;case 22:r.memoizedState===null&&$r(r);break;case 30:$r(r);break;default:$r(r)}t=t.sibling}}function Ni(t,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,p=t,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:Ni(p,y,l),Kl(4,y);break;case 1:if(Ni(p,y,l),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){We(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var T=c.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Gg(I[p],T)}catch(W){We(c,c.return,W)}}l&&S&64&&a0(y),Jl(y,y.return);break;case 27:u0(y);case 26:case 5:Ni(p,y,l),l&&c===null&&S&4&&o0(y),Jl(y,y.return);break;case 12:Ni(p,y,l);break;case 31:Ni(p,y,l),l&&S&4&&p0(p,y);break;case 13:Ni(p,y,l),l&&S&4&&m0(p,y);break;case 22:y.memoizedState===null&&Ni(p,y,l),Jl(y,y.return);break;case 30:break;default:Ni(p,y,l)}r=r.sibling}}function Gd(t,r){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Bl(l))}function Zd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Bl(t))}function Un(t,r,l,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)x0(t,r,l,c),r=r.sibling}function x0(t,r,l,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Un(t,r,l,c),p&2048&&Kl(9,r);break;case 1:Un(t,r,l,c);break;case 3:Un(t,r,l,c),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Bl(t)));break;case 12:if(p&2048){Un(t,r,l,c),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,T=y.onPostCommit;typeof T=="function"&&T(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){We(r,r.return,I)}}else Un(t,r,l,c);break;case 31:Un(t,r,l,c);break;case 13:Un(t,r,l,c);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?Un(t,r,l,c):Wl(t,r):y._visibility&2?Un(t,r,l,c):(y._visibility|=2,ja(t,r,l,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Gd(S,r);break;case 24:Un(t,r,l,c),p&2048&&Zd(r.alternate,r);break;default:Un(t,r,l,c)}}function ja(t,r,l,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,S=r,T=l,I=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:ja(y,S,T,I,p),Kl(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?ja(y,S,T,I,p):Wl(y,S):(le._visibility|=2,ja(y,S,T,I,p)),p&&W&2048&&Gd(S.alternate,S);break;case 24:ja(y,S,T,I,p),p&&W&2048&&Zd(S.alternate,S);break;default:ja(y,S,T,I,p)}r=r.sibling}}function Wl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=t,c=r,p=c.flags;switch(c.tag){case 22:Wl(l,c),p&2048&&Gd(c.alternate,c);break;case 24:Wl(l,c),p&2048&&Zd(c.alternate,c);break;default:Wl(l,c)}r=r.sibling}}var eo=8192;function Ra(t,r,l){if(t.subtreeFlags&eo)for(t=t.child;t!==null;)b0(t,r,l),t=t.sibling}function b0(t,r,l){switch(t.tag){case 26:Ra(t,r,l),t.flags&eo&&t.memoizedState!==null&&Qk(l,Bn,t.memoizedState,t.memoizedProps);break;case 5:Ra(t,r,l);break;case 3:case 4:var c=Bn;Bn=zu(t.stateNode.containerInfo),Ra(t,r,l),Bn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=eo,eo=16777216,Ra(t,r,l),eo=c):Ra(t,r,l));break;default:Ra(t,r,l)}}function v0(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function to(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Mt=c,S0(c,t)}v0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)w0(t),t=t.sibling}function w0(t){switch(t.tag){case 0:case 11:case 15:to(t),t.flags&2048&&nr(9,t,t.return);break;case 3:to(t);break;case 12:to(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,xu(t)):to(t);break;default:to(t)}}function xu(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var c=r[l];Mt=c,S0(c,t)}v0(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:nr(8,r,r.return),xu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,xu(r));break;default:xu(r)}t=t.sibling}}function S0(t,r){for(;Mt!==null;){var l=Mt;switch(l.tag){case 0:case 11:case 15:nr(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Bl(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Mt=c;else e:for(l=t;Mt!==null;){c=Mt;var p=c.sibling,y=c.return;if(d0(c),c===l){Mt=null;break e}if(p!==null){p.return=y,Mt=p;break e}Mt=y}}}var fk={getCacheForType:function(t){var r=Dt(xt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return Dt(xt).controller.signal}},dk=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Oe=null,Be=0,Je=0,hn=null,ir=!1,Oa=!1,Qd=!1,Ci=0,dt=0,rr=0,Vr=0,Kd=0,pn=0,La=0,no=null,tn=null,Jd=!1,bu=0,_0=0,vu=1/0,wu=null,ar=null,Ct=0,lr=null,Ha=null,Ti=0,Wd=0,eh=null,k0=null,io=0,th=null;function mn(){return(Qe&2)!==0&&Be!==0?Be&-Be:D.T!==null?oh():Es()}function E0(){if(pn===0)if((Be&536870912)===0||Ie){var t=la;la<<=1,(la&3932160)===0&&(la=262144),pn=t}else pn=536870912;return t=fn.current,t!==null&&(t.flags|=32),pn}function nn(t,r,l){(t===it&&(Je===2||Je===9)||t.cancelPendingCommit!==null)&&(Ba(t,0),or(t,Be,pn,!1)),kr(t,l),((Qe&2)===0||t!==it)&&(t===it&&((Qe&2)===0&&(Vr|=l),dt===4&&or(t,Be,pn,!1)),Wn(t))}function N0(t,r,l){if((Qe&6)!==0)throw Error(a(327));var c=!l&&(r&127)===0&&(r&t.expiredLanes)===0||_r(t,r),p=c?mk(t,r):ih(t,r,!0),y=c;do{if(p===0){Oa&&!c&&or(t,r,0,!1);break}else{if(l=t.current.alternate,y&&!hk(l)){p=ih(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var T=t;p=no;var I=T.current.memoizedState.isDehydrated;if(I&&(Ba(T,S).flags|=256),S=ih(T,S,!1),S!==2){if(Qd&&!I){T.errorRecoveryDisabledLanes|=y,Vr|=y,p=4;break e}y=tn,tn=p,y!==null&&(tn===null?tn=y:tn.push.apply(tn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Ba(t,0),or(t,r,0,!0);break}e:{switch(c=t,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:or(c,r,pn,!ir);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=bu+300-Et(),10<p)){if(or(c,r,pn,!ir),sa(c,0,!0)!==0)break e;Ti=r,c.timeoutHandle=ix(C0.bind(null,c,l,tn,wu,Jd,r,pn,Vr,La,ir,y,"Throttled",-0,0),p);break e}C0(c,l,tn,wu,Jd,r,pn,Vr,La,ir,y,null,-0,0)}}break}while(!0);Wn(t)}function C0(t,r,l,c,p,y,S,T,I,W,le,se,ee,re){if(t.timeoutHandle=-1,se=r.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hi},b0(r,y,se);var ye=(y&62914560)===y?bu-Et():(y&4194048)===y?_0-Et():0;if(ye=Kk(se,ye),ye!==null){Ti=y,t.cancelPendingCommit=ye(O0.bind(null,t,r,y,l,c,p,S,T,I,le,se,null,ee,re)),or(t,y,S,!W);return}}O0(t,r,y,l,c,p,S,T,I)}function hk(t){for(var r=t;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],y=p.getSnapshot;p=p.value;try{if(!un(y(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function or(t,r,l,c){r&=~Kd,r&=~Vr,t.suspendedLanes|=r,t.pingedLanes&=~r,c&&(t.warmLanes|=r),c=t.expirationTimes;for(var p=r;0<p;){var y=31-Ke(p),S=1<<y;c[y]=-1,p&=~S}l!==0&&Ss(t,l,r)}function Su(){return(Qe&6)===0?(ro(0),!1):!0}function nh(){if(Oe!==null){if(Je===0)var t=Oe.return;else t=Oe,yi=Rr=null,xd(t),Ta=null,Il=0,t=Oe;for(;t!==null;)r0(t.alternate,t),t=t.return;Oe=null}}function Ba(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,jk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Ti=0,nh(),it=t,Oe=l=mi(t.current,null),Be=r,Je=0,hn=null,ir=!1,Oa=_r(t,r),Qd=!1,La=pn=Kd=Vr=rr=dt=0,tn=no=null,Jd=!1,(r&8)!==0&&(r|=r&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=r;0<c;){var p=31-Ke(c),y=1<<p;r|=t[p],c&=~y}return Ci=r,Vs(),l}function T0(t,r){Ae=null,D.H=Gl,r===Ca||r===Ks?(r=Pg(),Je=3):r===ld?(r=Pg(),Je=4):Je=r===Rd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Oe===null&&(dt=1,fu(t,kn(r,t.current)))}function M0(){var t=fn.current;return t===null?!0:(Be&4194048)===Be?Tn===null:(Be&62914560)===Be||(Be&536870912)!==0?t===Tn:!1}function A0(){var t=D.H;return D.H=Gl,t===null?Gl:t}function z0(){var t=D.A;return D.A=fk,t}function _u(){dt=4,ir||(Be&4194048)!==Be&&fn.current!==null||(Oa=!0),(rr&134217727)===0&&(Vr&134217727)===0||it===null||or(it,Be,pn,!1)}function ih(t,r,l){var c=Qe;Qe|=2;var p=A0(),y=z0();(it!==t||Be!==r)&&(wu=null,Ba(t,r)),r=!1;var S=dt;e:do try{if(Je!==0&&Oe!==null){var T=Oe,I=hn;switch(Je){case 8:nh(),S=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(r=!0);var W=Je;if(Je=0,hn=null,Ua(t,T,I,W),l&&Oa){S=0;break e}break;default:W=Je,Je=0,hn=null,Ua(t,T,I,W)}}pk(),S=dt;break}catch(le){T0(t,le)}while(!0);return r&&t.shellSuspendCounter++,yi=Rr=null,Qe=c,D.H=p,D.A=y,Oe===null&&(it=null,Be=0,Vs()),S}function pk(){for(;Oe!==null;)D0(Oe)}function mk(t,r){var l=Qe;Qe|=2;var c=A0(),p=z0();it!==t||Be!==r?(wu=null,vu=Et()+500,Ba(t,r)):Oa=_r(t,r);e:do try{if(Je!==0&&Oe!==null){r=Oe;var y=hn;t:switch(Je){case 1:Je=0,hn=null,Ua(t,r,y,1);break;case 2:case 9:if($g(y)){Je=0,hn=null,j0(r);break}r=function(){Je!==2&&Je!==9||it!==t||(Je=7),Wn(t)},y.then(r,r);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:$g(y)?(Je=0,hn=null,j0(r)):(Je=0,hn=null,Ua(t,r,y,7));break;case 5:var S=null;switch(Oe.tag){case 26:S=Oe.memoizedState;case 5:case 27:var T=Oe;if(S?xx(S):T.stateNode.complete){Je=0,hn=null;var I=T.sibling;if(I!==null)Oe=I;else{var W=T.return;W!==null?(Oe=W,ku(W)):Oe=null}break t}}Je=0,hn=null,Ua(t,r,y,5);break;case 6:Je=0,hn=null,Ua(t,r,y,6);break;case 8:nh(),dt=6;break e;default:throw Error(a(462))}}gk();break}catch(le){T0(t,le)}while(!0);return yi=Rr=null,D.H=c,D.A=p,Qe=l,Oe!==null?0:(it=null,Be=0,Vs(),dt)}function gk(){for(;Oe!==null&&!oi();)D0(Oe)}function D0(t){var r=n0(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?ku(t):Oe=r}function j0(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=Qy(l,r,r.pendingProps,r.type,void 0,Be);break;case 11:r=Qy(l,r,r.pendingProps,r.type.render,r.ref,Be);break;case 5:xd(r);default:r0(l,r),r=Oe=zg(r,Ci),r=n0(l,r,Ci)}t.memoizedProps=t.pendingProps,r===null?ku(t):Oe=r}function Ua(t,r,l,c){yi=Rr=null,xd(r),Ta=null,Il=0;var p=r.return;try{if(rk(t,p,r,l,Be)){dt=1,fu(t,kn(l,t.current)),Oe=null;return}}catch(y){if(p!==null)throw Oe=p,y;dt=1,fu(t,kn(l,t.current)),Oe=null;return}r.flags&32768?(Ie||c===1?t=!0:Oa||(Be&536870912)!==0?t=!1:(ir=t=!0,(c===2||c===9||c===3||c===6)&&(c=fn.current,c!==null&&c.tag===13&&(c.flags|=16384))),R0(r,t)):ku(r)}function ku(t){var r=t;do{if((r.flags&32768)!==0){R0(r,ir);return}t=r.return;var l=ok(r.alternate,r,Ci);if(l!==null){Oe=l;return}if(r=r.sibling,r!==null){Oe=r;return}Oe=r=t}while(r!==null);dt===0&&(dt=5)}function R0(t,r){do{var l=sk(t.alternate,t);if(l!==null){l.flags&=32767,Oe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Oe=t;return}Oe=t=l}while(t!==null);dt=6,Oe=null}function O0(t,r,l,c,p,y,S,T,I){t.cancelPendingCommit=null;do Eu();while(Ct!==0);if((Qe&6)!==0)throw Error(a(327));if(r!==null){if(r===t.current)throw Error(a(177));if(y=r.lanes|r.childLanes,y|=Yf,wf(t,l,y,S,T,I),t===it&&(Oe=it=null,Be=0),Ha=r,lr=t,Ti=l,Wd=y,eh=p,k0=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,vk(_e,function(){return I0(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=D.T,D.T=null,p=U.p,U.p=2,S=Qe,Qe|=4;try{uk(t,r,l)}finally{Qe=S,U.p=p,D.T=c}}Ct=1,L0(),H0(),B0()}}function L0(){if(Ct===1){Ct=0;var t=lr,r=Ha,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=D.T,D.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{g0(r,t);var y=mh,S=Sg(t.containerInfo),T=y.focusedElem,I=y.selectionRange;if(S!==T&&T&&T.ownerDocument&&wg(T.ownerDocument.documentElement,T)){if(I!==null&&If(T)){var W=I.start,le=I.end;if(le===void 0&&(le=W),"selectionStart"in T)T.selectionStart=W,T.selectionEnd=Math.min(le,T.value.length);else{var se=T.ownerDocument||document,ee=se&&se.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=T.textContent.length,ke=Math.min(I.start,ye),nt=I.end===void 0?ke:Math.min(I.end,ye);!re.extend&&ke>nt&&(S=nt,nt=ke,ke=S);var Z=vg(T,ke),X=vg(T,nt);if(Z&&X&&(re.rangeCount!==1||re.anchorNode!==Z.node||re.anchorOffset!==Z.offset||re.focusNode!==X.node||re.focusOffset!==X.offset)){var J=se.createRange();J.setStart(Z.node,Z.offset),re.removeAllRanges(),ke>nt?(re.addRange(J),re.extend(X.node,X.offset)):(J.setEnd(X.node,X.offset),re.addRange(J))}}}}for(se=[],re=T;re=re.parentNode;)re.nodeType===1&&se.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<se.length;T++){var oe=se[T];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Hu=!!ph,mh=ph=null}finally{Qe=p,U.p=c,D.T=l}}t.current=r,Ct=2}}function H0(){if(Ct===2){Ct=0;var t=lr,r=Ha,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=D.T,D.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{f0(t,r.alternate,r)}finally{Qe=p,U.p=c,D.T=l}}Ct=3}}function B0(){if(Ct===4||Ct===3){Ct=0,si();var t=lr,r=Ha,l=Ti,c=k0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ct=5:(Ct=0,Ha=lr=null,U0(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ar=null),_l(l),r=r.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(At,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=D.T,p=U.p,U.p=2,D.T=null;try{for(var y=t.onRecoverableError,S=0;S<c.length;S++){var T=c[S];y(T.value,{componentStack:T.stack})}}finally{D.T=r,U.p=p}}(Ti&3)!==0&&Eu(),Wn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===th?io++:(io=0,th=t):io=0,ro(0)}}function U0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Bl(r)))}function Eu(){return L0(),H0(),B0(),I0()}function I0(){if(Ct!==5)return!1;var t=lr,r=Wd;Wd=0;var l=_l(Ti),c=D.T,p=U.p;try{U.p=32>l?32:l,D.T=null,l=eh,eh=null;var y=lr,S=Ti;if(Ct=0,Ha=lr=null,Ti=0,(Qe&6)!==0)throw Error(a(331));var T=Qe;if(Qe|=4,w0(y.current),x0(y,y.current,S,l),Qe=T,ro(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(At,y)}catch{}return!0}finally{U.p=p,D.T=c,U0(t,r)}}function q0(t,r,l){r=kn(l,r),r=jd(t.stateNode,r,2),t=Wi(t,r,2),t!==null&&(kr(t,2),Wn(t))}function We(t,r,l){if(t.tag===3)q0(t,t,l);else for(;r!==null;){if(r.tag===3){q0(r,t,l);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ar===null||!ar.has(c))){t=kn(l,t),l=$y(2),c=Wi(r,l,2),c!==null&&(Vy(l,c,r,t),kr(c,2),Wn(c));break}}r=r.return}}function rh(t,r,l){var c=t.pingCache;if(c===null){c=t.pingCache=new dk;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(l)||(Qd=!0,p.add(l),t=yk.bind(null,t,r,l),r.then(t,t))}function yk(t,r,l){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,it===t&&(Be&l)===l&&(dt===4||dt===3&&(Be&62914560)===Be&&300>Et()-bu?(Qe&2)===0&&Ba(t,0):Kd|=l,La===Be&&(La=0)),Wn(t)}function $0(t,r){r===0&&(r=ws()),t=zr(t,r),t!==null&&(kr(t,r),Wn(t))}function xk(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),$0(t,l)}function bk(t,r){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(r),$0(t,l)}function vk(t,r){return Gt(t,r)}var Nu=null,Ia=null,ah=!1,Cu=!1,lh=!1,sr=0;function Wn(t){t!==Ia&&t.next===null&&(Ia===null?Nu=Ia=t:Ia=Ia.next=t),Cu=!0,ah||(ah=!0,Sk())}function ro(t,r){if(!lh&&Cu){lh=!0;do for(var l=!1,c=Nu;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,T=c.pingedLanes;y=(1<<31-Ke(42|t)+1)-1,y&=p&~(S&~T),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,X0(c,y))}else y=Be,y=sa(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||_r(c,y)||(l=!0,X0(c,y));c=c.next}while(l);lh=!1}}function wk(){V0()}function V0(){Cu=ah=!1;var t=0;sr!==0&&Dk()&&(t=sr);for(var r=Et(),l=null,c=Nu;c!==null;){var p=c.next,y=P0(c,r);y===0?(c.next=null,l===null?Nu=p:l.next=p,p===null&&(Ia=l)):(l=c,(t!==0||(y&3)!==0)&&(Cu=!0)),c=p}Ct!==0&&Ct!==5||ro(t),sr!==0&&(sr=0)}function P0(t,r){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ke(y),T=1<<S,I=p[S];I===-1?((T&l)===0||(T&c)!==0)&&(p[S]=vf(T,r)):I<=r&&(t.expiredLanes|=T),y&=~T}if(r=it,l=Be,l=sa(t,t===r?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===r&&(Je===2||Je===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Rn(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||_r(t,l)){if(r=l&-l,r===t.callbackPriority)return r;switch(c!==null&&Rn(c),_l(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=$e;break;default:l=_e}return c=Y0.bind(null,t),l=Gt(l,c),t.callbackPriority=r,t.callbackNode=l,r}return c!==null&&c!==null&&Rn(c),t.callbackPriority=2,t.callbackNode=null,2}function Y0(t,r){if(Ct!==0&&Ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Eu()&&t.callbackNode!==l)return null;var c=Be;return c=sa(t,t===it?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(N0(t,c,r),P0(t,Et()),t.callbackNode!=null&&t.callbackNode===l?Y0.bind(null,t):null)}function X0(t,r){if(Eu())return null;N0(t,r,!0)}function Sk(){Rk(function(){(Qe&6)!==0?Gt(ae,wk):V0()})}function oh(){if(sr===0){var t=Ea;t===0&&(t=aa,aa<<=1,(aa&261888)===0&&(aa=256)),sr=t}return sr}function F0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Os(""+t)}function G0(t,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,t.id&&l.setAttribute("form",t.id),r.parentNode.insertBefore(l,r),t=new FormData(t),l.parentNode.removeChild(l),t}function _k(t,r,l,c,p){if(r==="submit"&&l&&l.stateNode===p){var y=F0((p[Bt]||null).action),S=c.submitter;S&&(r=(r=S[Bt]||null)?F0(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var T=new Us("action","action",null,c,p);t.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(sr!==0){var I=S?G0(p,S):new FormData(p);Cd(l,{pending:!0,data:I,method:p.method,action:y},null,I)}}else typeof y=="function"&&(T.preventDefault(),I=S?G0(p,S):new FormData(p),Cd(l,{pending:!0,data:I,method:p.method,action:y},y,I))},currentTarget:p}]})}}for(var sh=0;sh<Pf.length;sh++){var uh=Pf[sh],kk=uh.toLowerCase(),Ek=uh[0].toUpperCase()+uh.slice(1);Hn(kk,"on"+Ek)}Hn(Eg,"onAnimationEnd"),Hn(Ng,"onAnimationIteration"),Hn(Cg,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(q_,"onTransitionRun"),Hn($_,"onTransitionStart"),Hn(V_,"onTransitionCancel"),Hn(Tg,"onTransitionEnd"),Yi("onMouseEnter",["mouseout","mouseover"]),Yi("onMouseLeave",["mouseout","mouseover"]),Yi("onPointerEnter",["pointerout","pointerover"]),Yi("onPointerLeave",["pointerout","pointerover"]),fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ao="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(" "),Nk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ao));function Z0(t,r){r=(r&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var S=c.length-1;0<=S;S--){var T=c[S],I=T.instance,W=T.currentTarget;if(T=T.listener,I!==y&&p.isPropagationStopped())break e;y=T,p.currentTarget=W;try{y(p)}catch(le){$s(le)}p.currentTarget=null,y=I}else for(S=0;S<c.length;S++){if(T=c[S],I=T.instance,W=T.currentTarget,T=T.listener,I!==y&&p.isPropagationStopped())break e;y=T,p.currentTarget=W;try{y(p)}catch(le){$s(le)}p.currentTarget=null,y=I}}}}function Le(t,r){var l=r[ua];l===void 0&&(l=r[ua]=new Set);var c=t+"__bubble";l.has(c)||(Q0(r,t,2,!1),l.add(c))}function ch(t,r,l){var c=0;r&&(c|=4),Q0(l,t,c,r)}var Tu="_reactListening"+Math.random().toString(36).slice(2);function fh(t){if(!t[Tu]){t[Tu]=!0,Ms.forEach(function(l){l!=="selectionchange"&&(Nk.has(l)||ch(l,!1,t),ch(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Tu]||(r[Tu]=!0,ch("selectionchange",!1,r))}}function Q0(t,r,l,c){switch(Ex(r)){case 2:var p=eE;break;case 8:p=tE;break;default:p=Nh}l=p.bind(null,r,l,t),p=void 0,!zf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(r,l,{capture:!0,passive:p}):t.addEventListener(r,l,!0):p!==void 0?t.addEventListener(r,l,{passive:p}):t.addEventListener(r,l,!1)}function dh(t,r,l,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var T=c.stateNode.containerInfo;if(T===p)break;if(S===4)for(S=c.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;T!==null;){if(S=qi(T),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){c=y=S;continue e}T=T.parentNode}}c=c.return}tg(function(){var W=y,le=Mf(l),se=[];e:{var ee=Mg.get(t);if(ee!==void 0){var re=Us,ye=t;switch(t){case"keypress":if(Hs(l)===0)break e;case"keydown":case"keyup":re=b_;break;case"focusin":ye="focus",re=Of;break;case"focusout":ye="blur",re=Of;break;case"beforeblur":case"afterblur":re=Of;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=rg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=o_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=S_;break;case Eg:case Ng:case Cg:re=c_;break;case Tg:re=k_;break;case"scroll":case"scrollend":re=a_;break;case"wheel":re=N_;break;case"copy":case"cut":case"paste":re=d_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=lg;break;case"toggle":case"beforetoggle":re=T_}var ke=(r&4)!==0,nt=!ke&&(t==="scroll"||t==="scrollend"),Z=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var X=W,J;X!==null;){var oe=X;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||Z===null||(oe=Cl(X,Z),oe!=null&&ke.push(lo(X,oe,J))),nt)break;X=X.return}0<ke.length&&(ee=new re(ee,ye,null,l,le),se.push({event:ee,listeners:ke}))}}if((r&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",re=t==="mouseout"||t==="pointerout",ee&&l!==Tf&&(ye=l.relatedTarget||l.fromElement)&&(qi(ye)||ye[ci]))break e;if((re||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=l.relatedTarget||l.toElement,re=W,ye=ye?qi(ye):null,ye!==null&&(nt=s(ye),ke=ye.tag,ye!==nt||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=rg,oe="onMouseLeave",Z="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(ke=lg,oe="onPointerLeave",Z="onPointerEnter",X="pointer"),nt=re==null?ee:Vi(re),J=ye==null?ee:Vi(ye),ee=new ke(oe,X+"leave",re,l,le),ee.target=nt,ee.relatedTarget=J,oe=null,qi(le)===W&&(ke=new ke(Z,X+"enter",ye,l,le),ke.target=J,ke.relatedTarget=nt,oe=ke),nt=oe,re&&ye)t:{for(ke=Ck,Z=re,X=ye,J=0,oe=Z;oe;oe=ke(oe))J++;oe=0;for(var ve=X;ve;ve=ke(ve))oe++;for(;0<J-oe;)Z=ke(Z),J--;for(;0<oe-J;)X=ke(X),oe--;for(;J--;){if(Z===X||X!==null&&Z===X.alternate){ke=Z;break t}Z=ke(Z),X=ke(X)}ke=null}else ke=null;re!==null&&K0(se,ee,re,ke,!1),ye!==null&&nt!==null&&K0(se,nt,ye,ke,!0)}}e:{if(ee=W?Vi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Fe=pg;else if(dg(ee))if(mg)Fe=B_;else{Fe=L_;var xe=O_}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Cf(W.elementType)&&(Fe=pg):Fe=H_;if(Fe&&(Fe=Fe(t,W))){hg(se,Fe,l,le);break e}xe&&xe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&Nl(ee,"number",ee.value)}switch(xe=W?Vi(W):window,t){case"focusin":(dg(xe)||xe.contentEditable==="true")&&(ya=xe,qf=W,Ol=null);break;case"focusout":Ol=qf=ya=null;break;case"mousedown":$f=!0;break;case"contextmenu":case"mouseup":case"dragend":$f=!1,_g(se,l,le);break;case"selectionchange":if(I_)break;case"keydown":case"keyup":_g(se,l,le)}var ze;if(Hf)e:{switch(t){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ga?cg(t,l)&&(Ue="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ue="onCompositionStart");Ue&&(og&&l.locale!=="ko"&&(ga||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ga&&(ze=ng()):(Xi=le,Df="value"in Xi?Xi.value:Xi.textContent,ga=!0)),xe=Mu(W,Ue),0<xe.length&&(Ue=new ag(Ue,t,null,l,le),se.push({event:Ue,listeners:xe}),ze?Ue.data=ze:(ze=fg(l),ze!==null&&(Ue.data=ze)))),(ze=A_?z_(t,l):D_(t,l))&&(Ue=Mu(W,"onBeforeInput"),0<Ue.length&&(xe=new ag("onBeforeInput","beforeinput",null,l,le),se.push({event:xe,listeners:Ue}),xe.data=ze)),_k(se,t,W,l,le)}Z0(se,r)})}function lo(t,r,l){return{instance:t,listener:r,currentTarget:l}}function Mu(t,r){for(var l=r+"Capture",c=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Cl(t,l),p!=null&&c.unshift(lo(t,p,y)),p=Cl(t,r),p!=null&&c.push(lo(t,p,y))),t.tag===3)return c;t=t.return}return[]}function Ck(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function K0(t,r,l,c,p){for(var y=r._reactName,S=[];l!==null&&l!==c;){var T=l,I=T.alternate,W=T.stateNode;if(T=T.tag,I!==null&&I===c)break;T!==5&&T!==26&&T!==27||W===null||(I=W,p?(W=Cl(l,y),W!=null&&S.unshift(lo(l,W,I))):p||(W=Cl(l,y),W!=null&&S.push(lo(l,W,I)))),l=l.return}S.length!==0&&t.push({event:r,listeners:S})}var Tk=/\r\n?/g,Mk=/\u0000|\uFFFD/g;function J0(t){return(typeof t=="string"?t:""+t).replace(Tk,`
9
- `).replace(Mk,"")}function W0(t,r){return r=J0(r),J0(t)===r}function tt(t,r,l,c,p,y){switch(l){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ha(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ha(t,""+c);break;case"className":fa(t,"class",c);break;case"tabIndex":fa(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":fa(t,l,c);break;case"style":Wm(t,c,y);break;case"data":if(r!=="object"){fa(t,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Os(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(r!=="input"&&tt(t,r,"name",p.name,p,null),tt(t,r,"formEncType",p.formEncType,p,null),tt(t,r,"formMethod",p.formMethod,p,null),tt(t,r,"formTarget",p.formTarget,p,null)):(tt(t,r,"encType",p.encType,p,null),tt(t,r,"method",p.method,p,null),tt(t,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Os(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=hi);break;case"onScroll":c!=null&&Le("scroll",t);break;case"onScrollEnd":c!=null&&Le("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.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"){t.removeAttribute("xlink:href");break}l=Os(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":Le("beforetoggle",t),Le("toggle",t),ca(t,"popover",c);break;case"xlinkActuate":Ln(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Ln(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Ln(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Ln(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Ln(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Ln(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Ln(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ca(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=i_.get(l)||l,ca(t,l,c))}}function hh(t,r,l,c,p,y){switch(l){case"style":Wm(t,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof c=="string"?ha(t,c):(typeof c=="number"||typeof c=="bigint")&&ha(t,""+c);break;case"onScroll":c!=null&&Le("scroll",t);break;case"onScrollEnd":c!=null&&Le("scrollend",t);break;case"onClick":c!=null&&(t.onclick=hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!As.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),y=t[Bt]||null,y=y!=null?y[l]:null,typeof y=="function"&&t.removeEventListener(r,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(r,c,p);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):ca(t,l,c)}}}function Rt(t,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",t),Le("load",t);var c=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var S=l[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,y,S,l,null)}}p&&tt(t,r,"srcSet",l.srcSet,l,null),c&&tt(t,r,"src",l.src,l,null);return;case"input":Le("invalid",t);var T=y=S=p=null,I=null,W=null;for(c in l)if(l.hasOwnProperty(c)){var le=l[c];if(le!=null)switch(c){case"name":p=le;break;case"type":S=le;break;case"checked":I=le;break;case"defaultChecked":W=le;break;case"value":y=le;break;case"defaultValue":T=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:tt(t,r,c,le,l,null)}}Rs(t,y,T,I,W,S,p,!1);return;case"select":Le("invalid",t),c=S=y=null;for(p in l)if(l.hasOwnProperty(p)&&(T=l[p],T!=null))switch(p){case"value":y=T;break;case"defaultValue":S=T;break;case"multiple":c=T;default:tt(t,r,p,T,l,null)}r=y,l=S,t.multiple=!!c,r!=null?di(t,!!c,r,!1):l!=null&&di(t,!!c,l,!0);return;case"textarea":Le("invalid",t),y=p=c=null;for(S in l)if(l.hasOwnProperty(S)&&(T=l[S],T!=null))switch(S){case"value":c=T;break;case"defaultValue":p=T;break;case"children":y=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:tt(t,r,S,T,l,null)}Km(t,c,p,y);return;case"option":for(I in l)l.hasOwnProperty(I)&&(c=l[I],c!=null)&&(I==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":tt(t,r,I,c,l,null));return;case"dialog":Le("beforetoggle",t),Le("toggle",t),Le("cancel",t),Le("close",t);break;case"iframe":case"object":Le("load",t);break;case"video":case"audio":for(c=0;c<ao.length;c++)Le(ao[c],t);break;case"image":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"embed":case"source":case"link":Le("error",t),Le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in l)if(l.hasOwnProperty(W)&&(c=l[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:tt(t,r,W,c,l,null)}return;default:if(Cf(r)){for(le in l)l.hasOwnProperty(le)&&(c=l[le],c!==void 0&&hh(t,r,le,c,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(c=l[T],c!=null&&tt(t,r,T,c,l,null))}function Ak(t,r,l,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,T=null,I=null,W=null,le=null;for(re in l){var se=l[re];if(l.hasOwnProperty(re)&&se!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":I=se;default:c.hasOwnProperty(re)||tt(t,r,re,null,c,se)}}for(var ee in c){var re=c[ee];if(se=l[ee],c.hasOwnProperty(ee)&&(re!=null||se!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":le=re;break;case"value":S=re;break;case"defaultValue":T=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,r));break;default:re!==se&&tt(t,r,ee,re,c,se)}}Cr(t,S,T,I,W,le,y,p);return;case"select":re=S=T=ee=null;for(y in l)if(I=l[y],l.hasOwnProperty(y)&&I!=null)switch(y){case"value":break;case"multiple":re=I;default:c.hasOwnProperty(y)||tt(t,r,y,null,c,I)}for(p in c)if(y=c[p],I=l[p],c.hasOwnProperty(p)&&(y!=null||I!=null))switch(p){case"value":ee=y;break;case"defaultValue":T=y;break;case"multiple":S=y;default:y!==I&&tt(t,r,p,y,c,I)}r=T,l=S,c=re,ee!=null?di(t,!!l,ee,!1):!!c!=!!l&&(r!=null?di(t,!!l,r,!0):di(t,!!l,l?[]:"",!1));return;case"textarea":re=ee=null;for(T in l)if(p=l[T],l.hasOwnProperty(T)&&p!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:tt(t,r,T,null,c,p)}for(S in c)if(p=c[S],y=l[S],c.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ee=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&tt(t,r,S,p,c,y)}Qm(t,ee,re);return;case"option":for(var ye in l)ee=l[ye],l.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:tt(t,r,ye,null,c,ee));for(I in c)ee=c[I],re=l[I],c.hasOwnProperty(I)&&ee!==re&&(ee!=null||re!=null)&&(I==="selected"?t.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":tt(t,r,I,ee,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 l)ee=l[ke],l.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&tt(t,r,ke,null,c,ee);for(W in c)if(ee=c[W],re=l[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:tt(t,r,W,ee,c,re)}return;default:if(Cf(r)){for(var nt in l)ee=l[nt],l.hasOwnProperty(nt)&&ee!==void 0&&!c.hasOwnProperty(nt)&&hh(t,r,nt,void 0,c,ee);for(le in c)ee=c[le],re=l[le],!c.hasOwnProperty(le)||ee===re||ee===void 0&&re===void 0||hh(t,r,le,ee,c,re);return}}for(var Z in l)ee=l[Z],l.hasOwnProperty(Z)&&ee!=null&&!c.hasOwnProperty(Z)&&tt(t,r,Z,null,c,ee);for(se in c)ee=c[se],re=l[se],!c.hasOwnProperty(se)||ee===re||ee==null&&re==null||tt(t,r,se,ee,c,re)}function ex(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],y=p.transferSize,S=p.initiatorType,T=p.duration;if(y&&T&&ex(S)){for(S=0,T=p.responseEnd,c+=1;c<l.length;c++){var I=l[c],W=I.startTime;if(W>T)break;var le=I.transferSize,se=I.initiatorType;le&&ex(se)&&(I=I.responseEnd,S+=le*(I<T?1:(T-W)/(I-W)))}if(--c,r+=8*(y+S)/(p.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var ph=null,mh=null;function Au(t){return t.nodeType===9?t:t.ownerDocument}function tx(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nx(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function gh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var yh=null;function Dk(){var t=window.event;return t&&t.type==="popstate"?t===yh?!1:(yh=t,!0):(yh=null,!1)}var ix=typeof setTimeout=="function"?setTimeout:void 0,jk=typeof clearTimeout=="function"?clearTimeout:void 0,rx=typeof Promise=="function"?Promise:void 0,Rk=typeof queueMicrotask=="function"?queueMicrotask:typeof rx<"u"?function(t){return rx.resolve(null).then(t).catch(Ok)}:ix;function Ok(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function ax(t,r){var l=r,c=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(p),Pa(r);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")oo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,oo(l);for(var y=l.firstChild;y;){var S=y.nextSibling,T=y.nodeName;y[Er]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=S}}else l==="body"&&oo(t.ownerDocument.body);l=p}while(l);Pa(r)}function lx(t,r){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function xh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":xh(l),kl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Lk(t,r,l,c){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Mn(t.nextSibling),t===null)break}return null}function Hk(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Mn(t.nextSibling),t===null))return null;return t}function ox(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Mn(t.nextSibling),t===null))return null;return t}function bh(t){return t.data==="$?"||t.data==="$~"}function vh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Bk(t,r){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||l.readyState!=="loading")r();else{var c=function(){r(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Mn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var wh=null;function sx(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Mn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function ux(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return t;r--}else l!=="/$"&&l!=="/&"||r++}t=t.previousSibling}return null}function cx(t,r,l){switch(r=Au(l),t){case"html":if(t=r.documentElement,!t)throw Error(a(452));return t;case"head":if(t=r.head,!t)throw Error(a(453));return t;case"body":if(t=r.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function oo(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);kl(t)}var An=new Map,fx=new Set;function zu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Mi=U.d;U.d={f:Uk,r:Ik,D:qk,C:$k,L:Vk,m:Pk,X:Xk,S:Yk,M:Fk};function Uk(){var t=Mi.f(),r=Su();return t||r}function Ik(t){var r=$i(t);r!==null&&r.tag===5&&r.type==="form"?Ty(r):Mi.r(t)}var qa=typeof document>"u"?null:document;function dx(t,r,l){var c=qa;if(c&&typeof r=="string"&&r){var p=Qt(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),fx.has(p)||(fx.add(p),t={rel:t,crossOrigin:l,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function qk(t){Mi.D(t),dx("dns-prefetch",t,null)}function $k(t,r){Mi.C(t,r),dx("preconnect",t,r)}function Vk(t,r,l){Mi.L(t,r,l);var c=qa;if(c&&t&&r){var p='link[rel="preload"][as="'+Qt(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Qt(l.imageSizes)+'"]')):p+='[href="'+Qt(t)+'"]';var y=p;switch(r){case"style":y=$a(t);break;case"script":y=Va(t)}An.has(y)||(t=m({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:t,as:r},l),An.set(y,t),c.querySelector(p)!==null||r==="style"&&c.querySelector(so(y))||r==="script"&&c.querySelector(uo(y))||(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function Pk(t,r){Mi.m(t,r);var l=qa;if(l&&t){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Qt(c)+'"][href="'+Qt(t)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Va(t)}if(!An.has(y)&&(t=m({rel:"modulepreload",href:t},r),An.set(y,t),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(uo(y)))return}c=l.createElement("link"),Rt(c,"link",t),yt(c),l.head.appendChild(c)}}}function Yk(t,r,l){Mi.S(t,r,l);var c=qa;if(c&&t){var p=Pi(c).hoistableStyles,y=$a(t);r=r||"default";var S=p.get(y);if(!S){var T={loading:0,preload:null};if(S=c.querySelector(so(y)))T.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},l),(l=An.get(y))&&Sh(t,l);var I=S=c.createElement("link");yt(I),Rt(I,"link",t),I._p=new Promise(function(W,le){I.onload=W,I.onerror=le}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Du(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:T},p.set(y,S)}}}function Xk(t,r){Mi.X(t,r);var l=qa;if(l&&t){var c=Pi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(uo(p)),y||(t=m({src:t,async:!0},r),(r=An.get(p))&&_h(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function Fk(t,r){Mi.M(t,r);var l=qa;if(l&&t){var c=Pi(l).hoistableScripts,p=Va(t),y=c.get(p);y||(y=l.querySelector(uo(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=An.get(p))&&_h(t,r),y=l.createElement("script"),yt(y),Rt(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function hx(t,r,l,c){var p=(p=fe.current)?zu(p):null;if(!p)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=$a(l.href),l=Pi(p).hoistableStyles,c=l.get(r),c||(c={type:"style",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=$a(l.href);var y=Pi(p).hoistableStyles,S=y.get(t);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,S),(y=p.querySelector(so(t)))&&!y._p&&(S.instance=y,S.state.loading=5),An.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},An.set(t,l),y||Gk(p,t,l,S.state))),r&&c===null)throw Error(a(528,""));return S}if(r&&c!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Va(l),l=Pi(p).hoistableScripts,c=l.get(r),c||(c={type:"script",instance:null,count:0,state:null},l.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function $a(t){return'href="'+Qt(t)+'"'}function so(t){return'link[rel="stylesheet"]['+t+"]"}function px(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function Gk(t,r,l,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Rt(r,"link",l),yt(r),t.head.appendChild(r))}function Va(t){return'[src="'+Qt(t)+'"]'}function uo(t){return"script[async]"+t}function mx(t,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(c)return r.instance=c,yt(c),c;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),yt(c),Rt(c,"style",p),Du(c,l.precedence,t),r.instance=c;case"stylesheet":p=$a(l.href);var y=t.querySelector(so(p));if(y)return r.state.loading|=4,r.instance=y,yt(y),y;c=px(l),(p=An.get(p))&&Sh(c,p),y=(t.ownerDocument||t).createElement("link"),yt(y);var S=y;return S._p=new Promise(function(T,I){S.onload=T,S.onerror=I}),Rt(y,"link",c),r.state.loading|=4,Du(y,l.precedence,t),r.instance=y;case"script":return y=Va(l.src),(p=t.querySelector(uo(y)))?(r.instance=p,yt(p),p):(c=l,(p=An.get(y))&&(c=m({},l),_h(c,p)),t=t.ownerDocument||t,p=t.createElement("script"),yt(p),Rt(p,"link",c),t.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Du(c,l.precedence,t));return r.instance}function Du(t,r,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,S=0;S<c.length;S++){var T=c[S];if(T.dataset.precedence===r)y=T;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(t,r.firstChild))}function Sh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function _h(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var ju=null;function gx(t,r,l){if(ju===null){var c=new Map,p=ju=new Map;p.set(l,c)}else p=ju,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var y=l[p];if(!(y[Er]||y[Nt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=t+S;var T=c.get(S);T?T.push(y):c.set(S,[y])}}return c}function yx(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function Zk(t,r,l){if(l===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function xx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Qk(t,r,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=$a(c.href),y=r.querySelector(so(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Ru.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=y,yt(y);return}y=r.ownerDocument||r,c=px(c),(p=An.get(p))&&Sh(c,p),y=y.createElement("link"),yt(y);var S=y;S._p=new Promise(function(T,I){S.onload=T,S.onerror=I}),Rt(y,"link",c),l.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Ru.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var kh=0;function Kk(t,r){return t.stylesheets&&t.count===0&&Lu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Lu(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&kh===0&&(kh=62500*zk());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Lu(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>kh?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Ru(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ou=null;function Lu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ou=new Map,r.forEach(Jk,t),Ou=null,Ru.call(t))}function Jk(t,r){if(!(r.state.loading&4)){var l=Ou.get(t);if(l)var c=l.get(null);else{l=new Map,Ou.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),c=S)}c&&l.set(null,c)}p=r.instance,S=p.getAttribute("data-precedence"),y=l.get(S)||c,y===c&&l.set(null,p),l.set(S,p),this.count++,c=Ru.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var co={$$typeof:k,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function Wk(t,r,l,c,p,y,S,T,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.hiddenUpdates=wl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function bx(t,r,l,c,p,y,S,T,I,W,le,se){return t=new Wk(t,r,l,S,I,W,le,se,T),r=1,y===!0&&(r|=24),y=cn(3,null,null,r),t.current=y,y.stateNode=t,r=id(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:l,cache:r},od(y),t}function vx(t){return t?(t=va,t):va}function wx(t,r,l,c,p,y){p=vx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ji(r),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Wi(t,c,r),l!==null&&(nn(l,t,r),$l(l,t,r))}function Sx(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function Eh(t,r){Sx(t,r),(t=t.alternate)&&Sx(t,r)}function _x(t){if(t.tag===13||t.tag===31){var r=zr(t,67108864);r!==null&&nn(r,t,67108864),Eh(t,67108864)}}function kx(t){if(t.tag===13||t.tag===31){var r=mn();r=Sl(r);var l=zr(t,r);l!==null&&nn(l,t,r),Eh(t,r)}}var Hu=!0;function eE(t,r,l,c){var p=D.T;D.T=null;var y=U.p;try{U.p=2,Nh(t,r,l,c)}finally{U.p=y,D.T=p}}function tE(t,r,l,c){var p=D.T;D.T=null;var y=U.p;try{U.p=8,Nh(t,r,l,c)}finally{U.p=y,D.T=p}}function Nh(t,r,l,c){if(Hu){var p=Ch(c);if(p===null)dh(t,r,c,Bu,l),Nx(t,c);else if(iE(p,t,r,l,c))c.stopPropagation();else if(Nx(t,c),r&4&&-1<nE.indexOf(t)){for(;p!==null;){var y=$i(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ui(y.pendingLanes);if(S!==0){var T=y;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var I=1<<31-Ke(S);T.entanglements[1]|=I,S&=~I}Wn(y),(Qe&6)===0&&(vu=Et()+500,ro(0))}}break;case 31:case 13:T=zr(y,2),T!==null&&nn(T,y,2),Su(),Eh(y,2)}if(y=Ch(c),y===null&&dh(t,r,c,Bu,l),y===p)break;p=y}p!==null&&c.stopPropagation()}else dh(t,r,c,null,l)}}function Ch(t){return t=Mf(t),Th(t)}var Bu=null;function Th(t){if(Bu=null,t=qi(t),t!==null){var r=s(t);if(r===null)t=null;else{var l=r.tag;if(l===13){if(t=u(r),t!==null)return t;t=null}else if(l===31){if(t=f(r),t!==null)return t;t=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Bu=t,null}function Ex(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ii()){case ae:return 2;case pe:return 8;case _e:case je:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Mh=!1,cr=null,fr=null,dr=null,fo=new Map,ho=new Map,hr=[],nE="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 Nx(t,r){switch(t){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":fo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ho.delete(r.pointerId)}}function po(t,r,l,c,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:l,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=$i(r),r!==null&&_x(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function iE(t,r,l,c,p){switch(r){case"focusin":return cr=po(cr,t,r,l,c,p),!0;case"dragenter":return fr=po(fr,t,r,l,c,p),!0;case"mouseover":return dr=po(dr,t,r,l,c,p),!0;case"pointerover":var y=p.pointerId;return fo.set(y,po(fo.get(y)||null,t,r,l,c,p)),!0;case"gotpointercapture":return y=p.pointerId,ho.set(y,po(ho.get(y)||null,t,r,l,c,p)),!0}return!1}function Cx(t){var r=qi(t.target);if(r!==null){var l=s(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){t.blockedOn=r,Ns(t.priority,function(){kx(l)});return}}else if(r===31){if(r=f(l),r!==null){t.blockedOn=r,Ns(t.priority,function(){kx(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Uu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=Ch(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);Tf=c,l.target.dispatchEvent(c),Tf=null}else return r=$i(l),r!==null&&_x(r),t.blockedOn=l,!1;r.shift()}return!0}function Tx(t,r,l){Uu(t)&&l.delete(r)}function rE(){Mh=!1,cr!==null&&Uu(cr)&&(cr=null),fr!==null&&Uu(fr)&&(fr=null),dr!==null&&Uu(dr)&&(dr=null),fo.forEach(Tx),ho.forEach(Tx)}function Iu(t,r){t.blockedOn===r&&(t.blockedOn=null,Mh||(Mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,rE)))}var qu=null;function Mx(t){qu!==t&&(qu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){qu===t&&(qu=null);for(var r=0;r<t.length;r+=3){var l=t[r],c=t[r+1],p=t[r+2];if(typeof c!="function"){if(Th(c||l)===null)continue;break}var y=$i(l);y!==null&&(t.splice(r,3),r-=3,Cd(y,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Pa(t){function r(I){return Iu(I,t)}cr!==null&&Iu(cr,t),fr!==null&&Iu(fr,t),dr!==null&&Iu(dr,t),fo.forEach(r),ho.forEach(r);for(var l=0;l<hr.length;l++){var c=hr[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<hr.length&&(l=hr[0],l.blockedOn===null);)Cx(l),l.blockedOn===null&&hr.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],y=l[c+1],S=p[Bt]||null;if(typeof y=="function")S||Mx(l);else if(S){var T=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Bt]||null)T=S.formAction;else if(Th(p)!==null)continue}else T=S.action;typeof T=="function"?l[c+1]=T:(l.splice(c,3),c-=3),Mx(l)}}}function Ax(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Ah(t){this._internalRoot=t}$u.prototype.render=Ah.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,c=mn();wx(l,c,t,r,null,null)},$u.prototype.unmount=Ah.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;wx(t.current,2,null,t,null,null),Su(),r[ci]=null}};function $u(t){this._internalRoot=t}$u.prototype.unstable_scheduleHydration=function(t){if(t){var r=Es();t={blockedOn:null,target:t,priority:r};for(var l=0;l<hr.length&&r!==0&&r<hr[l].priority;l++);hr.splice(l,0,t),l===0&&Cx(t)}};var zx=n.version;if(zx!=="19.2.3")throw Error(a(527,zx,"19.2.3"));U.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var aE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{At=Vu.inject(aE),pt=Vu}catch{}}return go.createRoot=function(t,r){if(!o(t))throw Error(a(299));var l=!1,c="",p=By,y=Uy,S=Iy;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=bx(t,1,!1,null,null,l,c,null,p,y,S,Ax),t[ci]=r.current,fh(t),new Ah(r)},go.hydrateRoot=function(t,r,l){if(!o(t))throw Error(a(299));var c=!1,p="",y=By,S=Uy,T=Iy,I=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=bx(t,1,!0,r,l??null,c,p,I,y,S,T,Ax),r.context=vx(null),l=r.current,c=mn(),c=Sl(c),p=Ji(c),p.callback=null,Wi(l,p,c),l=c,r.current.lanes=l,kr(r,l),Wn(r),t[ci]=r.current,fh(t),new $u(r)},go.version="19.2.3",go}var qx;function pE(){if(qx)return jh.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(n){console.error(n)}}return e(),jh.exports=hE(),jh.exports}var mE=pE();function _t(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,a;i<e.length;i++)(a=_t(e[i]))!==""&&(n+=(n&&" ")+a);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var gE={value:()=>{}};function Fc(){for(var e=0,n=arguments.length,i={},a;e<n;++e){if(!(a=arguments[e]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new bc(i)}function bc(e){this._=e}function yE(e,n){return e.trim().split(/^|\s+/).map(function(i){var a="",o=i.indexOf(".");if(o>=0&&(a=i.slice(o+1),i=i.slice(0,o)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}bc.prototype=Fc.prototype={constructor:bc,on:function(e,n){var i=this._,a=yE(e+"",i),o,s=-1,u=a.length;if(arguments.length<2){for(;++s<u;)if((o=(e=a[s]).type)&&(o=xE(i[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<u;)if(o=(e=a[s]).type)i[o]=$x(i[o],e.name,n);else if(n==null)for(o in i)i[o]=$x(i[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new bc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var i=new Array(o),a=0,o,s;a<o;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],a=0,o=s.length;a<o;++a)s[a].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,s=a.length;o<s;++o)a[o].value.apply(n,i)}};function xE(e,n){for(var i=0,a=e.length,o;i<a;++i)if((o=e[i]).name===n)return o.value}function $x(e,n,i){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=gE,e=e.slice(0,a).concat(e.slice(a+1));break}return i!=null&&e.push({name:n,value:i}),e}var _p="http://www.w3.org/1999/xhtml";const Vx={svg:"http://www.w3.org/2000/svg",xhtml:_p,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gc(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Vx.hasOwnProperty(n)?{space:Vx[n],local:e}:e}function bE(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===_p&&n.documentElement.namespaceURI===_p?n.createElement(e):n.createElementNS(i,e)}}function vE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gv(e){var n=Gc(e);return(n.local?vE:bE)(n)}function wE(){}function rm(e){return e==null?wE:function(){return this.querySelector(e)}}function SE(e){typeof e!="function"&&(e=rm(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,f=a[o]=new Array(u),h,d,g=0;g<u;++g)(h=s[g])&&(d=e.call(h,h.__data__,g,s))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new Sn(a,this._parents)}function _E(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kE(){return[]}function yv(e){return e==null?kE:function(){return this.querySelectorAll(e)}}function EE(e){return function(){return _E(e.apply(this,arguments))}}function NE(e){typeof e=="function"?e=EE(e):e=yv(e);for(var n=this._groups,i=n.length,a=[],o=[],s=0;s<i;++s)for(var u=n[s],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 Sn(a,o)}function xv(e){return function(){return this.matches(e)}}function bv(e){return function(n){return n.matches(e)}}var CE=Array.prototype.find;function TE(e){return function(){return CE.call(this.children,e)}}function ME(){return this.firstElementChild}function AE(e){return this.select(e==null?ME:TE(typeof e=="function"?e:bv(e)))}var zE=Array.prototype.filter;function DE(){return Array.from(this.children)}function jE(e){return function(){return zE.call(this.children,e)}}function RE(e){return this.selectAll(e==null?DE:jE(typeof e=="function"?e:bv(e)))}function OE(e){typeof e!="function"&&(e=xv(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,f=a[o]=[],h,d=0;d<u;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Sn(a,this._parents)}function vv(e){return new Array(e.length)}function LE(){return new Sn(this._enter||this._groups.map(vv),this._parents)}function Cc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Cc.prototype={constructor:Cc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function HE(e){return function(){return e}}function BE(e,n,i,a,o,s){for(var u=0,f,h=n.length,d=s.length;u<d;++u)(f=n[u])?(f.__data__=s[u],a[u]=f):i[u]=new Cc(e,s[u]);for(;u<h;++u)(f=n[u])&&(o[u]=f)}function UE(e,n,i,a,o,s,u){var f,h,d=new Map,g=n.length,m=s.length,x=new Array(g),b;for(f=0;f<g;++f)(h=n[f])&&(x[f]=b=u.call(h,h.__data__,f,n)+"",d.has(b)?o[f]=h:d.set(b,h));for(f=0;f<m;++f)b=u.call(e,s[f],f,s)+"",(h=d.get(b))?(a[f]=h,h.__data__=s[f],d.delete(b)):i[f]=new Cc(e,s[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(o[f]=h)}function IE(e){return e.__data__}function qE(e,n){if(!arguments.length)return Array.from(this,IE);var i=n?UE:BE,a=this._parents,o=this._groups;typeof e!="function"&&(e=HE(e));for(var s=o.length,u=new Array(s),f=new Array(s),h=new Array(s),d=0;d<s;++d){var g=a[d],m=o[d],x=m.length,b=$E(e.call(g,g&&g.__data__,d,a)),w=b.length,E=f[d]=new Array(w),N=u[d]=new Array(w),_=h[d]=new Array(x);i(g,m,E,N,_,b,n);for(var j=0,k=0,C,L;j<w;++j)if(C=E[j]){for(j>=k&&(k=j+1);!(L=N[k])&&++k<w;);C._next=L||null}}return u=new Sn(u,a),u._enter=f,u._exit=h,u}function $E(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VE(){return new Sn(this._exit||this._groups.map(vv),this._parents)}function PE(e,n,i){var a=this.enter(),o=this,s=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),i==null?s.remove():i(s),a&&o?a.merge(o).order():o}function YE(e){for(var n=e.selection?e.selection():e,i=this._groups,a=n._groups,o=i.length,s=a.length,u=Math.min(o,s),f=new Array(o),h=0;h<u;++h)for(var d=i[h],g=a[h],m=d.length,x=f[h]=new Array(m),b,w=0;w<m;++w)(b=d[w]||g[w])&&(x[w]=b);for(;h<o;++h)f[h]=i[h];return new Sn(f,this._parents)}function XE(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var a=e[n],o=a.length-1,s=a[o],u;--o>=0;)(u=a[o])&&(s&&u.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(u,s),s=u);return this}function FE(e){e||(e=GE);function n(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var i=this._groups,a=i.length,o=new Array(a),s=0;s<a;++s){for(var u=i[s],f=u.length,h=o[s]=new Array(f),d,g=0;g<f;++g)(d=u[g])&&(h[g]=d);h.sort(n)}return new Sn(o,this._parents).order()}function GE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function ZE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function QE(){return Array.from(this)}function KE(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length;o<s;++o){var u=a[o];if(u)return u}return null}function JE(){let e=0;for(const n of this)++e;return e}function WE(){return!this.node()}function eN(e){for(var n=this._groups,i=0,a=n.length;i<a;++i)for(var o=n[i],s=0,u=o.length,f;s<u;++s)(f=o[s])&&e.call(f,f.__data__,s,o);return this}function tN(e){return function(){this.removeAttribute(e)}}function nN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iN(e,n){return function(){this.setAttribute(e,n)}}function rN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function aN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function lN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function oN(e,n){var i=Gc(e);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((n==null?i.local?nN:tN:typeof n=="function"?i.local?lN:aN:i.local?rN:iN)(i,n))}function wv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function sN(e){return function(){this.style.removeProperty(e)}}function uN(e,n,i){return function(){this.style.setProperty(e,n,i)}}function cN(e,n,i){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,i)}}function fN(e,n,i){return arguments.length>1?this.each((n==null?sN:typeof n=="function"?cN:uN)(e,n,i??"")):ol(this.node(),e)}function ol(e,n){return e.style.getPropertyValue(n)||wv(e).getComputedStyle(e,null).getPropertyValue(n)}function dN(e){return function(){delete this[e]}}function hN(e,n){return function(){this[e]=n}}function pN(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function mN(e,n){return arguments.length>1?this.each((n==null?dN:typeof n=="function"?pN:hN)(e,n)):this.node()[e]}function Sv(e){return e.trim().split(/^|\s+/)}function am(e){return e.classList||new _v(e)}function _v(e){this._node=e,this._names=Sv(e.getAttribute("class")||"")}_v.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function kv(e,n){for(var i=am(e),a=-1,o=n.length;++a<o;)i.add(n[a])}function Ev(e,n){for(var i=am(e),a=-1,o=n.length;++a<o;)i.remove(n[a])}function gN(e){return function(){kv(this,e)}}function yN(e){return function(){Ev(this,e)}}function xN(e,n){return function(){(n.apply(this,arguments)?kv:Ev)(this,e)}}function bN(e,n){var i=Sv(e+"");if(arguments.length<2){for(var a=am(this.node()),o=-1,s=i.length;++o<s;)if(!a.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?xN:n?gN:yN)(i,n))}function vN(){this.textContent=""}function wN(e){return function(){this.textContent=e}}function SN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function _N(e){return arguments.length?this.each(e==null?vN:(typeof e=="function"?SN:wN)(e)):this.node().textContent}function kN(){this.innerHTML=""}function EN(e){return function(){this.innerHTML=e}}function NN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function CN(e){return arguments.length?this.each(e==null?kN:(typeof e=="function"?NN:EN)(e)):this.node().innerHTML}function TN(){this.nextSibling&&this.parentNode.appendChild(this)}function MN(){return this.each(TN)}function AN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zN(){return this.each(AN)}function DN(e){var n=typeof e=="function"?e:gv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function jN(){return null}function RN(e,n){var i=typeof e=="function"?e:gv(e),a=n==null?jN:typeof n=="function"?n:rm(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function ON(){var e=this.parentNode;e&&e.removeChild(this)}function LN(){return this.each(ON)}function HN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function BN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function UN(e){return this.select(e?BN:HN)}function IN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function qN(e){return function(n){e.call(this,n,this.__data__)}}function $N(e){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");return a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),{type:n,name:i}})}function VN(e){return function(){var n=this.__on;if(n){for(var i=0,a=-1,o=n.length,s;i<o;++i)s=n[i],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):n[++a]=s;++a?n.length=a:delete this.__on}}}function PN(e,n,i){return function(){var a=this.__on,o,s=qN(n);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=s,o.options=i),o.value=n;return}}this.addEventListener(e.type,s,i),o={type:e.type,name:e.name,value:n,listener:s,options:i},a?a.push(o):this.__on=[o]}}function YN(e,n,i){var a=$N(e+""),o,s=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(o=0,g=f[h];o<s;++o)if((u=a[o]).type===g.type&&u.name===g.name)return g.value}return}for(f=n?PN:VN,o=0;o<s;++o)this.each(f(a[o],n,i));return this}function Nv(e,n,i){var a=wv(e),o=a.CustomEvent;typeof o=="function"?o=new o(n,i):(o=a.document.createEvent("Event"),i?(o.initEvent(n,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function XN(e,n){return function(){return Nv(this,e,n)}}function FN(e,n){return function(){return Nv(this,e,n.apply(this,arguments))}}function GN(e,n){return this.each((typeof n=="function"?FN:XN)(e,n))}function*ZN(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length,u;o<s;++o)(u=a[o])&&(yield u)}var Cv=[null];function Sn(e,n){this._groups=e,this._parents=n}function os(){return new Sn([[document.documentElement]],Cv)}function QN(){return this}Sn.prototype=os.prototype={constructor:Sn,select:SE,selectAll:NE,selectChild:AE,selectChildren:RE,filter:OE,data:qE,enter:LE,exit:VE,join:PE,merge:YE,selection:QN,order:XE,sort:FE,call:ZE,nodes:QE,node:KE,size:JE,empty:WE,each:eN,attr:oN,style:fN,property:mN,classed:bN,text:_N,html:CN,raise:MN,lower:zN,append:DN,insert:RN,remove:LN,clone:UN,datum:IN,on:YN,dispatch:GN,[Symbol.iterator]:ZN};function vn(e){return typeof e=="string"?new Sn([[document.querySelector(e)]],[document.documentElement]):new Sn([[e]],Cv)}function KN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=KN(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const JN={passive:!1},Go={capture:!0,passive:!1};function Hh(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}function Tv(e){var n=e.document.documentElement,i=vn(e).on("dragstart.drag",tl,Go);"onselectstart"in n?i.on("selectstart.drag",tl,Go):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Mv(e,n){var i=e.document.documentElement,a=vn(e).on("dragstart.drag",null);n&&(a.on("click.drag",tl,Go),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Pu=e=>()=>e;function kp(e,{sourceEvent:n,subject:i,target:a,identifier:o,active:s,x:u,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,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:g}})}kp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function WN(e){return!e.ctrlKey&&!e.button}function eC(){return this.parentNode}function tC(e,n){return n??{x:e.x,y:e.y}}function nC(){return navigator.maxTouchPoints||"ontouchstart"in this}function Av(){var e=WN,n=eC,i=tC,a=nC,o={},s=Fc("start","drag","end"),u=0,f,h,d,g,m=0;function x(C){C.on("mousedown.drag",b).filter(a).on("touchstart.drag",N).on("touchmove.drag",_,JN).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,L){if(!(g||!e.call(this,C,L))){var A=k(this,n.call(this,C,L),C,L,"mouse");A&&(vn(C.view).on("mousemove.drag",w,Go).on("mouseup.drag",E,Go),Tv(C.view),Hh(C),d=!1,f=C.clientX,h=C.clientY,A("start",C))}}function w(C){if(tl(C),!d){var L=C.clientX-f,A=C.clientY-h;d=L*L+A*A>m}o.mouse("drag",C)}function E(C){vn(C.view).on("mousemove.drag mouseup.drag",null),Mv(C.view,d),tl(C),o.mouse("end",C)}function N(C,L){if(e.call(this,C,L)){var A=C.changedTouches,H=n.call(this,C,L),F=A.length,G,q;for(G=0;G<F;++G)(q=k(this,H,C,L,A[G].identifier,A[G]))&&(Hh(C),q("start",C,A[G]))}}function _(C){var L=C.changedTouches,A=L.length,H,F;for(H=0;H<A;++H)(F=o[L[H].identifier])&&(tl(C),F("drag",C,L[H]))}function j(C){var L=C.changedTouches,A=L.length,H,F;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),H=0;H<A;++H)(F=o[L[H].identifier])&&(Hh(C),F("end",C,L[H]))}function k(C,L,A,H,F,G){var q=s.copy(),V=In(G||A,L),P,te,O;if((O=i.call(C,new kp("beforestart",{sourceEvent:A,target:x,identifier:F,active:u,x:V[0],y:V[1],dx:0,dy:0,dispatch:q}),H))!=null)return P=O.x-V[0]||0,te=O.y-V[1]||0,function B(D,U,Y){var Q=V,z;switch(D){case"start":o[F]=B,z=u++;break;case"end":delete o[F],--u;case"drag":V=In(Y||U,L),z=u;break}q.call(D,C,new kp(D,{sourceEvent:U,subject:O,target:x,identifier:F,active:z,x:V[0]+P,y:V[1]+te,dx:V[0]-Q[0],dy:V[1]-Q[1],dispatch:q}),H)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Pu(!!C),x):e},x.container=function(C){return arguments.length?(n=typeof C=="function"?C:Pu(C),x):n},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Pu(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Pu(!!C),x):a},x.on=function(){var C=s.on.apply(s,arguments);return C===s?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function lm(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function zv(e,n){var i=Object.create(e.prototype);for(var a in n)i[a]=n[a];return i}function ss(){}var Zo=.7,Tc=1/Zo,nl="\\s*([+-]?\\d+)\\s*",Qo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iC=/^#([0-9a-f]{3,8})$/,rC=new RegExp(`^rgb\\(${nl},${nl},${nl}\\)$`),aC=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),lC=new RegExp(`^rgba\\(${nl},${nl},${nl},${Qo}\\)$`),oC=new RegExp(`^rgba\\(${ii},${ii},${ii},${Qo}\\)$`),sC=new RegExp(`^hsl\\(${Qo},${ii},${ii}\\)$`),uC=new RegExp(`^hsla\\(${Qo},${ii},${ii},${Qo}\\)$`),Px={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};lm(ss,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yx,formatHex:Yx,formatHex8:cC,formatHsl:fC,formatRgb:Xx,toString:Xx});function Yx(){return this.rgb().formatHex()}function cC(){return this.rgb().formatHex8()}function fC(){return Dv(this).formatHsl()}function Xx(){return this.rgb().formatRgb()}function Wr(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=iC.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?Fx(n):i===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Yu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Yu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=rC.exec(e))?new an(n[1],n[2],n[3],1):(n=aC.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=lC.exec(e))?Yu(n[1],n[2],n[3],n[4]):(n=oC.exec(e))?Yu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=sC.exec(e))?Qx(n[1],n[2]/100,n[3]/100,1):(n=uC.exec(e))?Qx(n[1],n[2]/100,n[3]/100,n[4]):Px.hasOwnProperty(e)?Fx(Px[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Fx(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Yu(e,n,i,a){return a<=0&&(e=n=i=NaN),new an(e,n,i,a)}function dC(e){return e instanceof ss||(e=Wr(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Ep(e,n,i,a){return arguments.length===1?dC(e):new an(e,n,i,a??1)}function an(e,n,i,a){this.r=+e,this.g=+n,this.b=+i,this.opacity=+a}lm(an,Ep,zv(ss,{brighter(e){return e=e==null?Tc:Math.pow(Tc,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zo:Math.pow(Zo,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new an(Kr(this.r),Kr(this.g),Kr(this.b),Mc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gx,formatHex:Gx,formatHex8:hC,formatRgb:Zx,toString:Zx}));function Gx(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function hC(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zx(){const e=Mc(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function Mc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Kr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=Kr(e),(e<16?"0":"")+e.toString(16)}function Qx(e,n,i,a){return a<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new qn(e,n,i,a)}function Dv(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof ss||(e=Wr(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,a=e.b/255,o=Math.min(n,i,a),s=Math.max(n,i,a),u=NaN,f=s-o,h=(s+o)/2;return f?(n===s?u=(i-a)/f+(i<a)*6:i===s?u=(a-n)/f+2:u=(n-i)/f+4,f/=h<.5?s+o:2-s-o,u*=60):f=h>0&&h<1?0:u,new qn(u,f,h,e.opacity)}function pC(e,n,i,a){return arguments.length===1?Dv(e):new qn(e,n,i,a??1)}function qn(e,n,i,a){this.h=+e,this.s=+n,this.l=+i,this.opacity=+a}lm(qn,pC,zv(ss,{brighter(e){return e=e==null?Tc:Math.pow(Tc,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zo:Math.pow(Zo,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*n,o=2*i-a;return new an(Bh(e>=240?e-240:e+120,o,a),Bh(e,o,a),Bh(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new qn(Kx(this.h),Xu(this.s),Xu(this.l),Mc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Mc(this.opacity);return`${e===1?"hsl(":"hsla("}${Kx(this.h)}, ${Xu(this.s)*100}%, ${Xu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kx(e){return e=(e||0)%360,e<0?e+360:e}function Xu(e){return Math.max(0,Math.min(1,e||0))}function Bh(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const om=e=>()=>e;function mC(e,n){return function(i){return e+i*n}}function gC(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(a){return Math.pow(e+a*n,i)}}function yC(e){return(e=+e)==1?jv:function(n,i){return i-n?gC(n,i,e):om(isNaN(n)?i:n)}}function jv(e,n){var i=n-e;return i?mC(e,i):om(isNaN(e)?n:e)}const Ac=(function e(n){var i=yC(n);function a(o,s){var u=i((o=Ep(o)).r,(s=Ep(s)).r),f=i(o.g,s.g),h=i(o.b,s.b),d=jv(o.opacity,s.opacity);return function(g){return o.r=u(g),o.g=f(g),o.b=h(g),o.opacity=d(g),o+""}}return a.gamma=e,a})(1);function xC(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,a=n.slice(),o;return function(s){for(o=0;o<i;++o)a[o]=e[o]*(1-s)+n[o]*s;return a}}function bC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vC(e,n){var i=n?n.length:0,a=e?Math.min(i,e.length):0,o=new Array(a),s=new Array(i),u;for(u=0;u<a;++u)o[u]=Vo(e[u],n[u]);for(;u<i;++u)s[u]=n[u];return function(f){for(u=0;u<a;++u)s[u]=o[u](f);return s}}function wC(e,n){var i=new Date;return e=+e,n=+n,function(a){return i.setTime(e*(1-a)+n*a),i}}function ti(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function SC(e,n){var i={},a={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?i[o]=Vo(e[o],n[o]):a[o]=n[o];return function(s){for(o in i)a[o]=i[o](s);return a}}var Np=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uh=new RegExp(Np.source,"g");function _C(e){return function(){return e}}function kC(e){return function(n){return e(n)+""}}function Rv(e,n){var i=Np.lastIndex=Uh.lastIndex=0,a,o,s,u=-1,f=[],h=[];for(e=e+"",n=n+"";(a=Np.exec(e))&&(o=Uh.exec(n));)(s=o.index)>i&&(s=n.slice(i,s),f[u]?f[u]+=s:f[++u]=s),(a=a[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:ti(a,o)})),i=Uh.lastIndex;return i<n.length&&(s=n.slice(i),f[u]?f[u]+=s:f[++u]=s),f.length<2?h[0]?kC(h[0].x):_C(n):(n=h.length,function(d){for(var g=0,m;g<n;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function Vo(e,n){var i=typeof n,a;return n==null||i==="boolean"?om(n):(i==="number"?ti:i==="string"?(a=Wr(n))?(n=a,Ac):Rv:n instanceof Wr?Ac:n instanceof Date?wC:bC(n)?xC:Array.isArray(n)?vC:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?SC:ti)(e,n)}var Jx=180/Math.PI,Cp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ov(e,n,i,a,o,s){var u,f,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*i+n*a)&&(i-=e*h,a-=n*h),(f=Math.sqrt(i*i+a*a))&&(i/=f,a/=f,h/=f),e*a<n*i&&(e=-e,n=-n,h=-h,u=-u),{translateX:o,translateY:s,rotate:Math.atan2(n,e)*Jx,skewX:Math.atan(h)*Jx,scaleX:u,scaleY:f}}var Fu;function EC(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Cp:Ov(n.a,n.b,n.c,n.d,n.e,n.f)}function NC(e){return e==null||(Fu||(Fu=document.createElementNS("http://www.w3.org/2000/svg","g")),Fu.setAttribute("transform",e),!(e=Fu.transform.baseVal.consolidate()))?Cp:(e=e.matrix,Ov(e.a,e.b,e.c,e.d,e.e,e.f))}function Lv(e,n,i,a){function o(d){return d.length?d.pop()+" ":""}function s(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push("translate(",null,n,null,i);w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m||x)&&b.push("translate("+m+n+x+i)}function u(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(o(m)+"rotate(",null,a)-2,x:ti(d,g)})):g&&m.push(o(m)+"rotate("+g+a)}function f(d,g,m,x){d!==g?x.push({i:m.push(o(m)+"skewX(",null,a)-2,x:ti(d,g)}):g&&m.push(o(m)+"skewX("+g+a)}function h(d,g,m,x,b,w){if(d!==m||g!==x){var E=b.push(o(b)+"scale(",null,",",null,")");w.push({i:E-4,x:ti(d,m)},{i:E-2,x:ti(g,x)})}else(m!==1||x!==1)&&b.push(o(b)+"scale("+m+","+x+")")}return function(d,g){var m=[],x=[];return d=e(d),g=e(g),s(d.translateX,d.translateY,g.translateX,g.translateY,m,x),u(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(b){for(var w=-1,E=x.length,N;++w<E;)m[(N=x[w]).i]=N.x(b);return m.join("")}}}var CC=Lv(EC,"px, ","px)","deg)"),TC=Lv(NC,", ",")",")"),MC=1e-12;function Wx(e){return((e=Math.exp(e))+1/e)/2}function AC(e){return((e=Math.exp(e))-1/e)/2}function zC(e){return((e=Math.exp(2*e))-1)/(e+1)}const vc=(function e(n,i,a){function o(s,u){var f=s[0],h=s[1],d=s[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-h,E=b*b+w*w,N,_;if(E<MC)_=Math.log(x/d)/n,N=function(H){return[f+H*b,h+H*w,d*Math.exp(n*H*_)]};else{var j=Math.sqrt(E),k=(x*x-d*d+a*E)/(2*d*i*j),C=(x*x-d*d-a*E)/(2*x*i*j),L=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(C*C+1)-C);_=(A-L)/n,N=function(H){var F=H*_,G=Wx(L),q=d/(i*j)*(G*zC(n*F+L)-AC(L));return[f+q*b,h+q*w,d*G/Wx(n*F+L)]}}return N.duration=_*1e3*n/Math.SQRT2,N}return o.rho=function(s){var u=Math.max(.001,+s),f=u*u,h=f*f;return e(u,f,h)},o})(Math.SQRT2,2,4);var sl=0,Uo=0,yo=0,Hv=1e3,zc,Io,Dc=0,ea=0,Zc=0,Ko=typeof performance=="object"&&performance.now?performance:Date,Bv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sm(){return ea||(Bv(DC),ea=Ko.now()+Zc)}function DC(){ea=0}function jc(){this._call=this._time=this._next=null}jc.prototype=Uv.prototype={constructor:jc,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?sm():+i)+(n==null?0:+n),!this._next&&Io!==this&&(Io?Io._next=this:zc=this,Io=this),this._call=e,this._time=i,Tp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tp())}};function Uv(e,n,i){var a=new jc;return a.restart(e,n,i),a}function jC(){sm(),++sl;for(var e=zc,n;e;)(n=ea-e._time)>=0&&e._call.call(void 0,n),e=e._next;--sl}function eb(){ea=(Dc=Ko.now())+Zc,sl=Uo=0;try{jC()}finally{sl=0,OC(),ea=0}}function RC(){var e=Ko.now(),n=e-Dc;n>Hv&&(Zc-=n,Dc=e)}function OC(){for(var e,n=zc,i,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:zc=i);Io=e,Tp(a)}function Tp(e){if(!sl){Uo&&(Uo=clearTimeout(Uo));var n=e-ea;n>24?(e<1/0&&(Uo=setTimeout(eb,e-Ko.now()-Zc)),yo&&(yo=clearInterval(yo))):(yo||(Dc=Ko.now(),yo=setInterval(RC,Hv)),sl=1,Bv(eb))}}function tb(e,n,i){var a=new jc;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,i),a}var LC=Fc("start","end","cancel","interrupt"),HC=[],Iv=0,nb=1,Mp=2,wc=3,ib=4,Ap=5,Sc=6;function Qc(e,n,i,a,o,s){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;BC(e,i,{name:n,index:a,group:o,on:LC,tween:HC,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Iv})}function um(e,n){var i=Xn(e,n);if(i.state>Iv)throw new Error("too late; already scheduled");return i}function ai(e,n){var i=Xn(e,n);if(i.state>wc)throw new Error("too late; already running");return i}function Xn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function BC(e,n,i){var a=e.__transition,o;a[n]=i,i.timer=Uv(s,0,i.time);function s(d){i.state=nb,i.timer.restart(u,i.delay,i.time),i.delay<=d&&u(d-i.delay)}function u(d){var g,m,x,b;if(i.state!==nb)return h();for(g in a)if(b=a[g],b.name===i.name){if(b.state===wc)return tb(u);b.state===ib?(b.state=Sc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<n&&(b.state=Sc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(tb(function(){i.state===wc&&(i.state=ib,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=Mp,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Mp){for(i.state=wc,o=new Array(x=i.tween.length),g=0,m=-1;g<x;++g)(b=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=b);o.length=m+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=Ap,1),m=-1,x=o.length;++m<x;)o[m].call(e,g);i.state===Ap&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=Sc,i.timer.stop(),delete a[n];for(var d in a)return;delete e.__transition}}function _c(e,n){var i=e.__transition,a,o,s=!0,u;if(i){n=n==null?null:n+"";for(u in i){if((a=i[u]).name!==n){s=!1;continue}o=a.state>Mp&&a.state<Ap,a.state=Sc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete i[u]}s&&delete e.__transition}}function UC(e){return this.each(function(){_c(this,e)})}function IC(e,n){var i,a;return function(){var o=ai(this,e),s=o.tween;if(s!==i){a=i=s;for(var u=0,f=a.length;u<f;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function qC(e,n,i){var a,o;if(typeof i!="function")throw new Error;return function(){var s=ai(this,e),u=s.tween;if(u!==a){o=(a=u).slice();for(var f={name:n,value:i},h=0,d=o.length;h<d;++h)if(o[h].name===n){o[h]=f;break}h===d&&o.push(f)}s.tween=o}}function $C(e,n){var i=this._id;if(e+="",arguments.length<2){for(var a=Xn(this.node(),i).tween,o=0,s=a.length,u;o<s;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((n==null?IC:qC)(i,e,n))}function cm(e,n,i){var a=e._id;return e.each(function(){var o=ai(this,a);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return Xn(o,a).value[n]}}function qv(e,n){var i;return(typeof n=="number"?ti:n instanceof Wr?Ac:(i=Wr(n))?(n=i,Ac):Rv)(e,n)}function VC(e){return function(){this.removeAttribute(e)}}function PC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function YC(e,n,i){var a,o=i+"",s;return function(){var u=this.getAttribute(e);return u===o?null:u===a?s:s=n(a=u,i)}}function XC(e,n,i){var a,o=i+"",s;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?s:s=n(a=u,i)}}function FC(e,n,i){var a,o,s;return function(){var u,f=i(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===o?s:(o=h,s=n(a=u,f)))}}function GC(e,n,i){var a,o,s;return function(){var u,f=i(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?s:(o=h,s=n(a=u,f)))}}function ZC(e,n){var i=Gc(e),a=i==="transform"?TC:qv;return this.attrTween(e,typeof n=="function"?(i.local?GC:FC)(i,a,cm(this,"attr."+e,n)):n==null?(i.local?PC:VC)(i):(i.local?XC:YC)(i,a,n))}function QC(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function KC(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function JC(e,n){var i,a;function o(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&KC(e,s)),i}return o._value=n,o}function WC(e,n){var i,a;function o(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&QC(e,s)),i}return o._value=n,o}function eT(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var a=Gc(e);return this.tween(i,(a.local?JC:WC)(a,n))}function tT(e,n){return function(){um(this,e).delay=+n.apply(this,arguments)}}function nT(e,n){return n=+n,function(){um(this,e).delay=n}}function iT(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?tT:nT)(n,e)):Xn(this.node(),n).delay}function rT(e,n){return function(){ai(this,e).duration=+n.apply(this,arguments)}}function aT(e,n){return n=+n,function(){ai(this,e).duration=n}}function lT(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?rT:aT)(n,e)):Xn(this.node(),n).duration}function oT(e,n){if(typeof n!="function")throw new Error;return function(){ai(this,e).ease=n}}function sT(e){var n=this._id;return arguments.length?this.each(oT(n,e)):Xn(this.node(),n).ease}function uT(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ai(this,e).ease=i}}function cT(e){if(typeof e!="function")throw new Error;return this.each(uT(this._id,e))}function fT(e){typeof e!="function"&&(e=xv(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],u=s.length,f=a[o]=[],h,d=0;d<u;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Li(a,this._parents,this._name,this._id)}function dT(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,a=n.length,o=i.length,s=Math.min(a,o),u=new Array(a),f=0;f<s;++f)for(var h=n[f],d=i[f],g=h.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=h[b]||d[b])&&(m[b]=x);for(;f<a;++f)u[f]=n[f];return new Li(u,this._parents,this._name,this._id)}function hT(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function pT(e,n,i){var a,o,s=hT(n)?um:ai;return function(){var u=s(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(n,i),u.on=o}}function mT(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(pT(i,e,n))}function gT(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function yT(){return this.on("end.remove",gT(this._id))}function xT(e){var n=this._name,i=this._id;typeof e!="function"&&(e=rm(e));for(var a=this._groups,o=a.length,s=new Array(o),u=0;u<o;++u)for(var f=a[u],h=f.length,d=s[u]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,Qc(d[x],n,i,x,d,Xn(g,i)));return new Li(s,this._parents,n,i)}function bT(e){var n=this._name,i=this._id;typeof e!="function"&&(e=yv(e));for(var a=this._groups,o=a.length,s=[],u=[],f=0;f<o;++f)for(var h=a[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),b,w=Xn(g,i),E=0,N=x.length;E<N;++E)(b=x[E])&&Qc(b,n,i,E,x,w);s.push(x),u.push(g)}return new Li(s,u,n,i)}var vT=os.prototype.constructor;function wT(){return new vT(this._groups,this._parents)}function ST(e,n){var i,a,o;return function(){var s=ol(this,e),u=(this.style.removeProperty(e),ol(this,e));return s===u?null:s===i&&u===a?o:o=n(i=s,a=u)}}function $v(e){return function(){this.style.removeProperty(e)}}function _T(e,n,i){var a,o=i+"",s;return function(){var u=ol(this,e);return u===o?null:u===a?s:s=n(a=u,i)}}function kT(e,n,i){var a,o,s;return function(){var u=ol(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),ol(this,e))),u===h?null:u===a&&h===o?s:(o=h,s=n(a=u,f))}}function ET(e,n){var i,a,o,s="style."+n,u="end."+s,f;return function(){var h=ai(this,e),d=h.on,g=h.value[s]==null?f||(f=$v(n)):void 0;(d!==i||o!==g)&&(a=(i=d).copy()).on(u,o=g),h.on=a}}function NT(e,n,i){var a=(e+="")=="transform"?CC:qv;return n==null?this.styleTween(e,ST(e,a)).on("end.style."+e,$v(e)):typeof n=="function"?this.styleTween(e,kT(e,a,cm(this,"style."+e,n))).each(ET(this._id,e)):this.styleTween(e,_T(e,a,n),i).on("end.style."+e,null)}function CT(e,n,i){return function(a){this.style.setProperty(e,n.call(this,a),i)}}function TT(e,n,i){var a,o;function s(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&CT(e,u,i)),a}return s._value=n,s}function MT(e,n,i){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,TT(e,n,i??""))}function AT(e){return function(){this.textContent=e}}function zT(e){return function(){var n=e(this);this.textContent=n??""}}function DT(e){return this.tween("text",typeof e=="function"?zT(cm(this,"text",e)):AT(e==null?"":e+""))}function jT(e){return function(n){this.textContent=e.call(this,n)}}function RT(e){var n,i;function a(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&jT(o)),n}return a._value=e,a}function OT(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,RT(e))}function LT(){for(var e=this._name,n=this._id,i=Vv(),a=this._groups,o=a.length,s=0;s<o;++s)for(var u=a[s],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Xn(h,n);Qc(h,e,i,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Li(a,this._parents,e,i)}function HT(){var e,n,i=this,a=i._id,o=i.size();return new Promise(function(s,u){var f={value:u},h={value:function(){--o===0&&s()}};i.each(function(){var d=ai(this,a),g=d.on;g!==e&&(n=(e=g).copy(),n._.cancel.push(f),n._.interrupt.push(f),n._.end.push(h)),d.on=n}),o===0&&s()})}var BT=0;function Li(e,n,i,a){this._groups=e,this._parents=n,this._name=i,this._id=a}function Vv(){return++BT}var Ai=os.prototype;Li.prototype={constructor:Li,select:xT,selectAll:bT,selectChild:Ai.selectChild,selectChildren:Ai.selectChildren,filter:fT,merge:dT,selection:wT,transition:LT,call:Ai.call,nodes:Ai.nodes,node:Ai.node,size:Ai.size,empty:Ai.empty,each:Ai.each,on:mT,attr:ZC,attrTween:eT,style:NT,styleTween:MT,text:DT,textTween:OT,remove:yT,tween:$C,delay:iT,duration:lT,ease:sT,easeVarying:cT,end:HT,[Symbol.iterator]:Ai[Symbol.iterator]};function UT(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var IT={time:null,delay:0,duration:250,ease:UT};function qT(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function $T(e){var n,i;e instanceof Li?(n=e._id,e=e._name):(n=Vv(),(i=IT).time=sm(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,s=0;s<o;++s)for(var u=a[s],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Qc(h,e,n,d,u,i||qT(h,n));return new Li(a,this._parents,e,n)}os.prototype.interrupt=UC;os.prototype.transition=$T;const Gu=e=>()=>e;function VT(e,{sourceEvent:n,target:i,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function Ri(e,n,i){this.k=e,this.x=n,this.y=i}Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Kc=new Ri(1,0,0);Pv.prototype=Ri.prototype;function Pv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Kc;return e.__zoom}function Ih(e){e.stopImmediatePropagation()}function xo(e){e.preventDefault(),e.stopImmediatePropagation()}function PT(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function YT(){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 rb(){return this.__zoom||Kc}function XT(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function FT(){return navigator.maxTouchPoints||"ontouchstart"in this}function GT(e,n,i){var a=e.invertX(n[0][0])-i[0][0],o=e.invertX(n[1][0])-i[1][0],s=e.invertY(n[0][1])-i[0][1],u=e.invertY(n[1][1])-i[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u))}function Yv(){var e=PT,n=YT,i=GT,a=XT,o=FT,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=vc,d=Fc("start","zoom","end"),g,m,x,b=500,w=150,E=0,N=10;function _(O){O.property("__zoom",rb).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(O,B,D,U){var Y=O.selection?O.selection():O;Y.property("__zoom",rb),O!==Y?L(O,B,D,U):Y.interrupt().each(function(){A(this,arguments).event(U).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},_.scaleBy=function(O,B,D,U){_.scaleTo(O,function(){var Y=this.__zoom.k,Q=typeof B=="function"?B.apply(this,arguments):B;return Y*Q},D,U)},_.scaleTo=function(O,B,D,U){_.transform(O,function(){var Y=n.apply(this,arguments),Q=this.__zoom,z=D==null?C(Y):typeof D=="function"?D.apply(this,arguments):D,R=Q.invert(z),$=typeof B=="function"?B.apply(this,arguments):B;return i(k(j(Q,$),z,R),Y,u)},D,U)},_.translateBy=function(O,B,D,U){_.transform(O,function(){return i(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof D=="function"?D.apply(this,arguments):D),n.apply(this,arguments),u)},null,U)},_.translateTo=function(O,B,D,U,Y){_.transform(O,function(){var Q=n.apply(this,arguments),z=this.__zoom,R=U==null?C(Q):typeof U=="function"?U.apply(this,arguments):U;return i(Kc.translate(R[0],R[1]).scale(z.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof D=="function"?-D.apply(this,arguments):-D),Q,u)},U,Y)};function j(O,B){return B=Math.max(s[0],Math.min(s[1],B)),B===O.k?O:new Ri(B,O.x,O.y)}function k(O,B,D){var U=B[0]-D[0]*O.k,Y=B[1]-D[1]*O.k;return U===O.x&&Y===O.y?O:new Ri(O.k,U,Y)}function C(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function L(O,B,D,U){O.on("start.zoom",function(){A(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(U).end()}).tween("zoom",function(){var Y=this,Q=arguments,z=A(Y,Q).event(U),R=n.apply(Y,Q),$=D==null?C(R):typeof D=="function"?D.apply(Y,Q):D,M=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ie=Y.__zoom,ce=typeof B=="function"?B.apply(Y,Q):B,fe=h(ie.invert($).concat(M/ie.k),ce.invert($).concat(M/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=M/ue[2];he=new Ri(me,$[0]-ue[0]*me,$[1]-ue[1]*me)}z.zoom(null,he)}})}function A(O,B,D){return!D&&O.__zooming||new H(O,B)}function H(O,B){this.that=O,this.args=B,this.active=0,this.sourceEvent=null,this.extent=n.apply(O,B),this.taps=0}H.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,B){return this.mouse&&O!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var B=vn(this.that).datum();d.call(O,this.that,new VT(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),B)}};function F(O,...B){if(!e.apply(this,arguments))return;var D=A(this,B).event(O),U=this.__zoom,Y=Math.max(s[0],Math.min(s[1],U.k*Math.pow(2,a.apply(this,arguments)))),Q=In(O);if(D.wheel)(D.mouse[0][0]!==Q[0]||D.mouse[0][1]!==Q[1])&&(D.mouse[1]=U.invert(D.mouse[0]=Q)),clearTimeout(D.wheel);else{if(U.k===Y)return;D.mouse=[Q,U.invert(Q)],_c(this),D.start()}xo(O),D.wheel=setTimeout(z,w),D.zoom("mouse",i(k(j(U,Y),D.mouse[0],D.mouse[1]),D.extent,u));function z(){D.wheel=null,D.end()}}function G(O,...B){if(x||!e.apply(this,arguments))return;var D=O.currentTarget,U=A(this,B,!0).event(O),Y=vn(O.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",M,!0),Q=In(O,D),z=O.clientX,R=O.clientY;Tv(O.view),Ih(O),U.mouse=[Q,this.__zoom.invert(Q)],_c(this),U.start();function $(ie){if(xo(ie),!U.moved){var ce=ie.clientX-z,fe=ie.clientY-R;U.moved=ce*ce+fe*fe>E}U.event(ie).zoom("mouse",i(k(U.that.__zoom,U.mouse[0]=In(ie,D),U.mouse[1]),U.extent,u))}function M(ie){Y.on("mousemove.zoom mouseup.zoom",null),Mv(ie.view,U.moved),xo(ie),U.event(ie).end()}}function q(O,...B){if(e.apply(this,arguments)){var D=this.__zoom,U=In(O.changedTouches?O.changedTouches[0]:O,this),Y=D.invert(U),Q=D.k*(O.shiftKey?.5:2),z=i(k(j(D,Q),U,Y),n.apply(this,B),u);xo(O),f>0?vn(this).transition().duration(f).call(L,z,U,O):vn(this).call(_.transform,z,U,O)}}function V(O,...B){if(e.apply(this,arguments)){var D=O.touches,U=D.length,Y=A(this,B,O.changedTouches.length===U).event(O),Q,z,R,$;for(Ih(O),z=0;z<U;++z)R=D[z],$=In(R,this),$=[$,this.__zoom.invert($),R.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==$[2]&&(Y.touch1=$,Y.taps=0):(Y.touch0=$,Q=!0,Y.taps=1+!!g);g&&(g=clearTimeout(g)),Q&&(Y.taps<2&&(m=$[0],g=setTimeout(function(){g=null},b)),_c(this),Y.start())}}function P(O,...B){if(this.__zooming){var D=A(this,B).event(O),U=O.changedTouches,Y=U.length,Q,z,R,$;for(xo(O),Q=0;Q<Y;++Q)z=U[Q],R=In(z,this),D.touch0&&D.touch0[2]===z.identifier?D.touch0[0]=R:D.touch1&&D.touch1[2]===z.identifier&&(D.touch1[0]=R);if(z=D.that.__zoom,D.touch1){var M=D.touch0[0],ie=D.touch0[1],ce=D.touch1[0],fe=D.touch1[1],he=(he=ce[0]-M[0])*he+(he=ce[1]-M[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=j(z,Math.sqrt(he/ue)),R=[(M[0]+ce[0])/2,(M[1]+ce[1])/2],$=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(D.touch0)R=D.touch0[0],$=D.touch0[1];else return;D.zoom("touch",i(k(z,R,$),D.extent,u))}}function te(O,...B){if(this.__zooming){var D=A(this,B).event(O),U=O.changedTouches,Y=U.length,Q,z;for(Ih(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),Q=0;Q<Y;++Q)z=U[Q],D.touch0&&D.touch0[2]===z.identifier?delete D.touch0:D.touch1&&D.touch1[2]===z.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(z=In(z,this),Math.hypot(m[0]-z[0],m[1]-z[1])<N)){var R=vn(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return _.wheelDelta=function(O){return arguments.length?(a=typeof O=="function"?O:Gu(+O),_):a},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Gu(!!O),_):e},_.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:Gu(!!O),_):o},_.extent=function(O){return arguments.length?(n=typeof O=="function"?O:Gu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),_):n},_.scaleExtent=function(O){return arguments.length?(s[0]=+O[0],s[1]=+O[1],_):[s[0],s[1]]},_.translateExtent=function(O){return arguments.length?(u[0][0]=+O[0][0],u[1][0]=+O[1][0],u[0][1]=+O[0][1],u[1][1]=+O[1][1],_):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},_.constrain=function(O){return arguments.length?(i=O,_):i},_.duration=function(O){return arguments.length?(f=+O,_):f},_.interpolate=function(O){return arguments.length?(h=O,_):h},_.on=function(){var O=d.on.apply(d,arguments);return O===d?_:O},_.clickDistance=function(O){return arguments.length?(E=(O=+O)*O,_):Math.sqrt(E)},_.tapDistance=function(O){return arguments.length?(N=+O,_):N},_}const ri={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:n,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:a}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Jo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xv=["Enter"," ","Escape"],Fv={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"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 ul;(function(e){e.Strict="strict",e.Loose="loose"})(ul||(ul={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var Wo;(function(e){e.Partial="partial",e.Full="full"})(Wo||(Wo={}));const Gv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(wr||(wr={}));var Rc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Rc||(Rc={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const ab={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Zv(e){return e===null?null:e?"valid":"invalid"}const Qv=e=>"id"in e&&"source"in e&&"target"in e,ZT=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),us=(e,n=[0,0])=>{const{width:i,height:a}=Bi(e),o=e.origin??n,s=i*o[0],u=a*o[1];return{x:e.position.x-s,y:e.position.y-u}},QT=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((a,o)=>{const s=typeof o=="string";let u=!n.nodeLookup&&!s?o:void 0;n.nodeLookup&&(u=s?n.nodeLookup.get(o):fm(o)?o:n.nodeLookup.get(o.id));const f=u?Oc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Jc(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Wc(i)},cs=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(i=Jc(i,Oc(o)),a=!0)}),a?Wc(i):{x:0,y:0,width:0,height:0}},dm=(e,n,[i,a,o]=[0,0,1],s=!1,u=!1)=>{const f={...ds(n,[i,a,o]),width:n.width/o,height:n.height/o},h=[];for(const d of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=d;if(u&&!m||x)continue;const b=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,E=es(f,fl(d)),N=(b??0)*(w??0),_=s&&E>0;(!d.internals.handleBounds||_||E>=N||d.dragging)&&h.push(d)}return h},KT=(e,n)=>{const i=new Set;return e.forEach(a=>{i.add(a.id)}),n.filter(a=>i.has(a.source)||i.has(a.target))};function JT(e,n){const i=new Map,a=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&i.set(o.id,o)}),i}async function WT({nodes:e,width:n,height:i,panZoom:a,minZoom:o,maxZoom:s},u){if(e.size===0)return Promise.resolve(!0);const f=JT(e,u),h=cs(f),d=hm(h,n,i,u?.minZoom??o,u?.maxZoom??s,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Kv({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:o,onError:s}){const u=i.get(e),f=u.parentId?i.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??a;let m=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)s?.("005",ri.error005());else{const b=f.measured.width,w=f.measured.height;b&&w&&(m=[[h,d],[h+b,d+w]])}else f&&dl(u.extent)&&(m=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const x=dl(m)?ta(n,m,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&s?.("015",ri.error015()),{position:{x:x.x-h+(u.measured.width??0)*g[0],y:x.y-d+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function e4({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:a,onBeforeDelete:o}){const s=new Set(e.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const b=s.has(x.id),w=!b&&x.parentId&&u.find(E=>E.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(n.map(x=>x.id)),h=a.filter(x=>x.deletable!==!1),g=KT(u,h);for(const x of h)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!o)return{edges:g,nodes:u};const m=await o({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const cl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),ta=(e={x:0,y:0},n,i)=>({x:cl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:cl(e.y,n[0][1],n[1][1]-(i?.height??0))});function Jv(e,n,i){const{width:a,height:o}=Bi(i),{x:s,y:u}=i.internals.positionAbsolute;return ta(e,[[s,u],[s+a,u+o]],n)}const lb=(e,n,i)=>e<n?cl(Math.abs(e-n),1,n)/n:e>i?-cl(Math.abs(e-i),1,n)/n:0,Wv=(e,n,i=15,a=40)=>{const o=lb(e.x,a,n.width-a)*i,s=lb(e.y,a,n.height-a)*i;return[o,s]},Jc=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),zp=({x:e,y:n,width:i,height:a})=>({x:e,y:n,x2:e+i,y2:n+a}),Wc=({x:e,y:n,x2:i,y2:a})=>({x:e,y:n,width:i-e,height:a-n}),fl=(e,n=[0,0])=>{const{x:i,y:a}=fm(e)?e.internals.positionAbsolute:us(e,n);return{x:i,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Oc=(e,n=[0,0])=>{const{x:i,y:a}=fm(e)?e.internals.positionAbsolute:us(e,n);return{x:i,y:a,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},ew=(e,n)=>Wc(Jc(zp(e),zp(n))),es=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*a)},ob=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),t4=(e,n)=>{},fs=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),ds=({x:e,y:n},[i,a,o],s=!1,u=[1,1])=>{const f={x:(e-i)/o,y:(n-a)/o};return s?fs(f,u):f},Lc=({x:e,y:n},[i,a,o])=>({x:e*o+i,y:n*o+a});function Ya(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.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 n4(e,n,i){if(typeof e=="string"||typeof e=="number"){const a=Ya(e,i),o=Ya(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Ya(e.top??e.y??0,i),o=Ya(e.bottom??e.y??0,i),s=Ya(e.left??e.x??0,n),u=Ya(e.right??e.x??0,n);return{top:a,right:u,bottom:o,left:s,x:s+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function i4(e,n,i,a,o,s){const{x:u,y:f}=Lc(e,[n,i,a]),{x:h,y:d}=Lc({x:e.x+e.width,y:e.y+e.height},[n,i,a]),g=o-h,m=s-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const hm=(e,n,i,a,o,s)=>{const u=n4(s,n,i),f=(n-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=cl(d,a,o),m=e.x+e.width/2,x=e.y+e.height/2,b=n/2-m*g,w=i/2-x*g,E=i4(e,b,w,g,n,i),N={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:b-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},ts=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function dl(e){return e!=null&&e!=="parent"}function Bi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function tw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function nw(e,n={width:0,height:0},i,a,o){const s={...e},u=a.get(i);if(u){const f=u.origin||o;s.x+=u.internals.positionAbsolute.x-(n.width??0)*f[0],s.y+=u.internals.positionAbsolute.y-(n.height??0)*f[1]}return s}function sb(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function r4(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function a4(e){return{...Fv,...e||{}}}function Po(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:a,containerBounds:o}){const{x:s,y:u}=Vn(e),f=ds({x:s-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:d}=i?fs(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const pm=e=>({width:e.offsetWidth,height:e.offsetHeight}),iw=e=>e?.getRootNode?.()||window?.document,l4=["INPUT","SELECT","TEXTAREA"];function rw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:l4.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const aw=e=>"clientX"in e,Vn=(e,n)=>{const i=aw(e),a=i?e.clientX:e.touches?.[0].clientX,o=i?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:o-(n?.top??0)}},ub=(e,n,i,a,o)=>{const s=n.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(f.left-i.left)/a,y:(f.top-i.top)/a,...pm(u)}})};function lw({sourceX:e,sourceY:n,targetX:i,targetY:a,sourceControlX:o,sourceControlY:s,targetControlX:u,targetControlY:f}){const h=e*.125+o*.375+u*.375+i*.125,d=n*.125+s*.375+f*.375+a*.125,g=Math.abs(h-e),m=Math.abs(d-n);return[h,d,g,m]}function Zu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function cb({pos:e,x1:n,y1:i,x2:a,y2:o,c:s}){switch(e){case be.Left:return[n-Zu(n-a,s),i];case be.Right:return[n+Zu(a-n,s),i];case be.Top:return[n,i-Zu(i-o,s)];case be.Bottom:return[n,i+Zu(o-i,s)]}}function ow({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top,curvature:u=.25}){const[f,h]=cb({pos:i,x1:e,y1:n,x2:a,y2:o,c:u}),[d,g]=cb({pos:s,x1:a,y1:o,x2:e,y2:n,c:u}),[m,x,b,w]=lw({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${n} C${f},${h} ${d},${g} ${a},${o}`,m,x,b,w]}function sw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const o=Math.abs(i-e)/2,s=i<e?i+o:i-o,u=Math.abs(a-n)/2,f=a<n?a+u:a-u;return[s,f,o,u]}function o4({sourceNode:e,targetNode:n,selected:i=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return a;const u=o&&i?a+1e3:a,f=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+f}function s4({sourceNode:e,targetNode:n,width:i,height:a,transform:o}){const s=Jc(Oc(e),Oc(n));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:i/o[2],height:a/o[2]};return es(u,Wc(s))>0}const u4=({source:e,sourceHandle:n,target:i,targetHandle:a})=>`xy-edge__${e}${n||""}-${i}${a||""}`,c4=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),uw=(e,n,i={})=>{if(!e.source||!e.target)return n;const a=i.getEdgeId||u4;let o;return Qv(e)?o={...e}:o={...e,id:a(e)},c4(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function cw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const[o,s,u,f]=sw({sourceX:e,sourceY:n,targetX:i,targetY:a});return[`M ${e},${n}L ${i},${a}`,o,s,u,f]}const fb={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},f4=({source:e,sourcePosition:n=be.Bottom,target:i})=>n===be.Left||n===be.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},db=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function d4({source:e,sourcePosition:n=be.Bottom,target:i,targetPosition:a=be.Top,center:o,offset:s,stepPosition:u}){const f=fb[n],h=fb[a],d={x:e.x+f.x*s,y:e.y+f.y*s},g={x:i.x+h.x*s,y:i.y+h.y*s},m=f4({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],E,N;const _={x:0,y:0},j={x:0,y:0},[,,k,C]=sw({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(f[x]*h[x]===-1){x==="x"?(E=o.x??d.x+(g.x-d.x)*u,N=o.y??(d.y+g.y)/2):(E=o.x??(d.x+g.x)/2,N=o.y??d.y+(g.y-d.y)*u);const A=[{x:E,y:d.y},{x:E,y:g.y}],H=[{x:d.x,y:N},{x:g.x,y:N}];f[x]===b?w=x==="x"?A:H:w=x==="x"?H:A}else{const A=[{x:d.x,y:g.y}],H=[{x:g.x,y:d.y}];if(x==="x"?w=f.x===b?H:A:w=f.y===b?A:H,n===a){const P=Math.abs(e[x]-i[x]);if(P<=s){const te=Math.min(s-1,s-P);f[x]===b?_[x]=(d[x]>e[x]?-1:1)*te:j[x]=(g[x]>i[x]?-1:1)*te}}if(n!==a){const P=x==="x"?"y":"x",te=f[x]===h[P],O=d[P]>g[P],B=d[P]<g[P];(f[x]===1&&(!te&&O||te&&B)||f[x]!==1&&(!te&&B||te&&O))&&(w=x==="x"?A:H)}const F={x:d.x+_.x,y:d.y+_.y},G={x:g.x+j.x,y:g.y+j.y},q=Math.max(Math.abs(F.x-w[0].x),Math.abs(G.x-w[0].x)),V=Math.max(Math.abs(F.y-w[0].y),Math.abs(G.y-w[0].y));q>=V?(E=(F.x+G.x)/2,N=w[0].y):(E=w[0].x,N=(F.y+G.y)/2)}return[[e,{x:d.x+_.x,y:d.y+_.y},...w,{x:g.x+j.x,y:g.y+j.y},i],E,N,k,C]}function h4(e,n,i,a){const o=Math.min(db(e,n)/2,db(n,i)/2,a),{x:s,y:u}=n;if(e.x===s&&s===i.x||e.y===u&&u===i.y)return`L${s} ${u}`;if(e.y===u){const d=e.x<i.x?-1:1,g=e.y<i.y?1:-1;return`L ${s+o*d},${u}Q ${s},${u} ${s},${u+o*g}`}const f=e.x<i.x?1:-1,h=e.y<i.y?-1:1;return`L ${s},${u+o*h}Q ${s},${u} ${s+o*f},${u}`}function Dp({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,b,w,E]=d4({source:{x:e,y:n},sourcePosition:i,target:{x:a,y:o},targetPosition:s,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((_,j,k)=>{let C="";return k>0&&k<m.length-1?C=h4(m[k-1],j,m[k+1],u):C=`${k===0?"M":"L"}${j.x} ${j.y}`,_+=C,_},""),x,b,w,E]}function hb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function p4(e){const{sourceNode:n,targetNode:i}=e;if(!hb(n)||!hb(i))return null;const a=n.internals.handleBounds||pb(n.handles),o=i.internals.handleBounds||pb(i.handles),s=mb(a?.source??[],e.sourceHandle),u=mb(e.connectionMode===ul.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!s||!u)return e.onError?.("008",ri.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=s?.position||be.Bottom,h=u?.position||be.Top,d=na(n,s,f),g=na(i,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function pb(e){if(!e)return null;const n=[],i=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&i.push(a);return{source:n,target:i}}function na(e,n,i=be.Left,a=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,s=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=n??Bi(e);if(a)return{x:o+u/2,y:s+f/2};switch(n?.position??i){case be.Top:return{x:o+u/2,y:s};case be.Right:return{x:o+u,y:s+f/2};case be.Bottom:return{x:o+u/2,y:s+f};case be.Left:return{x:o,y:s+f/2}}}function mb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function jp(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function m4(e,{id:n,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:o}){const s=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const d=jp(h,n);s.has(d)||(u.push({id:d,color:h.color||i,...h}),s.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const fw=1e3,g4=10,mm={nodeOrigin:[0,0],nodeExtent:Jo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},y4={...mm,checkEquality:!0};function gm(e,n){const i={...e};for(const a in n)n[a]!==void 0&&(i[a]=n[a]);return i}function x4(e,n,i){const a=gm(mm,i);for(const o of e.values())if(o.parentId)xm(o,e,n,a);else{const s=us(o,a.nodeOrigin),u=dl(o.extent)?o.extent:a.nodeExtent,f=ta(s,u,Bi(o));o.internals.positionAbsolute=f}}function b4(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],a=[];for(const o of e.handles){const s={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"?i.push(s):o.type==="target"&&a.push(s)}return{source:i,target:a}}function ym(e){return e==="manual"}function Rp(e,n,i,a={}){const o=gm(y4,a),s={i:0},u=new Map(n),f=o?.elevateNodesOnSelect&&!ym(o.zIndexMode)?fw:0;let h=e.length>0;n.clear(),i.clear();for(const d of e){let g=u.get(d.id);if(o.checkEquality&&d===g?.internals.userNode)n.set(d.id,g);else{const m=us(d,o.nodeOrigin),x=dl(d.extent)?d.extent:o.nodeExtent,b=ta(m,x,Bi(d));g={...o.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:b4(d,g),z:dw(d,f,o.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&xm(g,n,i,a,s)}return h}function v4(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function xm(e,n,i,a,o){const{elevateNodesOnSelect:s,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=gm(mm,a),d=e.parentId,g=n.get(d);if(!g){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}v4(e,i),o&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++o.i,g.internals.z=g.internals.z+o.i*g4),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const m=s&&!ym(h)?fw:0,{x,y:b,z:w}=w4(e,g,u,f,m,h),{positionAbsolute:E}=e.internals,N=x!==E.x||b!==E.y;(N||w!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:b}:E,z:w}})}function dw(e,n,i){const a=$n(e.zIndex)?e.zIndex:0;return ym(i)?a:a+(e.selected?n:0)}function w4(e,n,i,a,o,s){const{x:u,y:f}=n.internals.positionAbsolute,h=Bi(e),d=us(e,i),g=dl(e.extent)?ta(d,e.extent,h):d;let m=ta({x:u+g.x,y:f+g.y},a,h);e.extent==="parent"&&(m=Jv(m,h,n));const x=dw(e,o,s),b=n.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function bm(e,n,i,a=[0,0]){const o=[],s=new Map;for(const u of e){const f=n.get(u.parentId);if(!f)continue;const h=s.get(u.parentId)?.expandedRect??fl(f),d=ew(h,u.rect);s.set(u.parentId,{expandedRect:d,parent:f})}return s.size>0&&s.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Bi(f),m=f.origin??a,x=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,b=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),E=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],_=(E-g.height)*m[1];(x>0||b>0||N||_)&&(o.push({id:h,type:"position",position:{x:f.position.x-x+N,y:f.position.y-b+_}}),i.get(h)?.forEach(j=>{e.some(k=>k.id===j.id)||o.push({id:j.id,type:"position",position:{x:j.position.x+x,y:j.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:E+(b?m[1]*b-_:0)}})}),o}function S4(e,n,i,a,o,s,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=n.get(b.id);if(!w)continue;if(w.hidden){n.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const E=pm(b.nodeElement),N=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(N||!w.internals.handleBounds||b.force))){const j=b.nodeElement.getBoundingClientRect(),k=dl(w.extent)?w.extent:s;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=Jv(C,E,n.get(w.parentId)):k&&(C=ta(C,k,E));const L={...w,measured:E,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:ub("source",b.nodeElement,j,m,w.id),target:ub("target",b.nodeElement,j,m,w.id)}}};n.set(w.id,L),w.parentId&&xm(L,n,i,{nodeOrigin:o,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:fl(L,o)}))}}if(x.length>0){const b=bm(x,n,i,o);d.push(...b)}return{changes:d,updatedInternals:h}}async function _4({delta:e,panZoom:n,transform:i,translateExtent:a,width:o,height:s}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const u=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[o,s]],a),f=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(f)}function gb(e,n,i,a,o,s){let u=o;const f=a.get(u)||new Map;a.set(u,f.set(i,n)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(i,n)),s){u=`${o}-${e}-${s}`;const d=a.get(u)||new Map;a.set(u,d.set(i,n))}}function hw(e,n,i){e.clear(),n.clear();for(const a of i){const{source:o,target:s,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:o,target:s,sourceHandle:u,targetHandle:f},d=`${o}-${u}--${s}-${f}`,g=`${s}-${f}--${o}-${u}`;gb("source",h,g,e,o,u),gb("target",h,d,e,s,f),n.set(a.id,a)}}function pw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:pw(i,n):!1}function yb(e,n,i){let a=e;do{if(a?.matches?.(n))return!0;if(a===i)return!1;a=a?.parentElement}while(a);return!1}function k4(e,n,i,a){const o=new Map;for(const[s,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!pw(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const f=e.get(s);f&&o.set(s,{id:s,position:f.position||{x:0,y:0},distance:{x:i.x-f.internals.positionAbsolute.x,y:i.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:n,nodeLookup:i,dragging:a=!0}){const o=[];for(const[u,f]of n){const h=i.get(u)?.internals.userNode;h&&o.push({...h,position:f.position,dragging:a})}if(!e)return[o[0],o];const s=i.get(e)?.internals.userNode;return[s?{...s,position:n.get(e)?.position||s.position,dragging:a}:o[0],o]}function E4({dragItems:e,snapGrid:n,x:i,y:a}){const o=e.values().next().value;if(!o)return null;const s={x:i-o.distance.x,y:a-o.distance.y},u=fs(s,n);return{x:u.x-s.x,y:u.y-s.y}}function N4({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:a,onDragStop:o}){let s={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,E=null;function N({noDragClassName:j,handleSelector:k,domNode:C,isSelectable:L,nodeId:A,nodeClickDistance:H=0}){x=vn(C);function F({x:P,y:te}){const{nodeLookup:O,nodeExtent:B,snapGrid:D,snapToGrid:U,nodeOrigin:Y,onNodeDrag:Q,onSelectionDrag:z,onError:R,updateNodePositions:$}=n();s={x:P,y:te};let M=!1;const ie=f.size>1,ce=ie&&B?zp(cs(f)):null,fe=ie&&U?E4({dragItems:f,snapGrid:D,x:P,y:te}):null;for(const[he,ue]of f){if(!O.has(he))continue;let me={x:P-ue.distance.x,y:te-ue.distance.y};U&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:fs(me,D));let Ee=null;if(ie&&B&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,Re=Ne.x-ce.x+B[0][0],Ze=Ne.x+ue.measured.width-ce.x2+B[1][0],Xe=Ne.y-ce.y+B[0][1],ht=Ne.y+ue.measured.height-ce.y2+B[1][1];Ee=[[Re,Xe],[Ze,ht]]}const{position:Ce,positionAbsolute:we}=Kv({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||B,nodeOrigin:Y,onError:R});M=M||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||M,!!M&&($(f,!0),E&&(a||Q||!A&&z))){const[he,ue]=qh({nodeId:A,dragItems:f,nodeLookup:O});a?.(E,f,he,ue),Q?.(E,he,ue),A||z?.(E,ue)}}async function G(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:O,autoPanOnNodeDrag:B}=n();if(!B){h=!1,cancelAnimationFrame(u);return}const[D,U]=Wv(d,g,O);(D!==0||U!==0)&&(s.x=(s.x??0)-D/P[2],s.y=(s.y??0)-U/P[2],await te({x:D,y:U})&&F(s)),u=requestAnimationFrame(G)}function q(P){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:B,transform:D,snapGrid:U,snapToGrid:Y,selectNodesOnDrag:Q,onNodeDragStart:z,onSelectionDragStart:R,unselectNodesAndEdges:$}=n();m=!0,(!Q||!L)&&!O&&A&&(te.get(A)?.selected||$()),L&&Q&&A&&e?.(A);const M=Po(P.sourceEvent,{transform:D,snapGrid:U,snapToGrid:Y,containerBounds:g});if(s=M,f=k4(te,B,M,A),f.size>0&&(i||z||!A&&R)){const[ie,ce]=qh({nodeId:A,dragItems:f,nodeLookup:te});i?.(P.sourceEvent,f,ie,ce),z?.(P.sourceEvent,ie,ce),A||R?.(P.sourceEvent,ce)}}const V=Av().clickDistance(H).on("start",P=>{const{domNode:te,nodeDragThreshold:O,transform:B,snapGrid:D,snapToGrid:U}=n();g=te?.getBoundingClientRect()||null,b=!1,w=!1,E=P.sourceEvent,O===0&&q(P),s=Po(P.sourceEvent,{transform:B,snapGrid:D,snapToGrid:U,containerBounds:g}),d=Vn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:B,snapToGrid:D,nodeDragThreshold:U,nodeLookup:Y}=n(),Q=Po(P.sourceEvent,{transform:O,snapGrid:B,snapToGrid:D,containerBounds:g});if(E=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!Y.has(A))&&(b=!0),!b){if(!h&&te&&m&&(h=!0,G()),!m){const z=Vn(P.sourceEvent,g),R=z.x-d.x,$=z.y-d.y;Math.sqrt(R*R+$*$)>U&&q(P)}(s.x!==Q.xSnapped||s.y!==Q.ySnapped)&&f&&m&&(d=Vn(P.sourceEvent,g),F(Q))}}).on("end",P=>{if(!(!m||b)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:B,onSelectionDragStop:D}=n();if(w&&(O(f,!1),w=!1),o||B||!A&&D){const[U,Y]=qh({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});o?.(P.sourceEvent,f,U,Y),B?.(P.sourceEvent,U,Y),A||D?.(P.sourceEvent,Y)}}}).filter(P=>{const te=P.target;return!P.button&&(!j||!yb(te,`.${j}`,C))&&(!k||yb(te,k,C))});x.call(V)}function _(){x?.on(".drag",null)}return{update:N,destroy:_}}function C4(e,n,i){const a=[],o={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const s of n.values())es(o,fl(s))>0&&a.push(s);return a}const T4=250;function M4(e,n,i,a){let o=[],s=1/0;const u=C4(e,i,n+T4);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:g,y:m}=na(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>n||(x<s?(o=[{...d,x:g,y:m}],s=x):x===s&&o.push({...d,x:g,y:m}))}}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 mw(e,n,i,a,o,s=!1){const u=a.get(e);if(!u)return null;const f=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&s?{...h,...na(u,h,h.position,!0)}:h}function gw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function A4(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const yw=()=>!0;function z4(e,{connectionMode:n,connectionRadius:i,handleId:a,nodeId:o,edgeUpdaterType:s,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:_=yw,onReconnectEnd:j,updateConnection:k,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:F}){const G=iw(e.target);let q=0,V;const{x:P,y:te}=Vn(e),O=gw(s,F),B=f?.getBoundingClientRect();let D=!1;if(!B||!O)return;const U=mw(o,O,a,h,n);if(!U)return;let Y=Vn(e,B),Q=!1,z=null,R=!1,$=null;function M(){if(!g||!B)return;const[Ce,we]=Wv(Y,B,A);x({x:Ce,y:we}),q=requestAnimationFrame(M)}const ie={...U,nodeId:o,type:O,position:U.position},ce=h.get(o);let he={inProgress:!0,isValid:null,from:na(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:Y,toHandle:null,toPosition:ab[ie.position],toNode:null,pointer:Y};function ue(){D=!0,k(he),w?.(e,{nodeId:o,handleId:a,handleType:O})}H===0&&ue();function me(Ce){if(!D){const{x:ht,y:on}=Vn(Ce),Lt=ht-P,Gt=on-te;if(!(Lt*Lt+Gt*Gt>H*H))return;ue()}if(!L()||!ie){Ee(Ce);return}const we=C();Y=Vn(Ce,B),V=M4(ds(Y,we,!1,[1,1]),i,h,ie),Q||(M(),Q=!0);const Ne=xw(Ce,{handle:V,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:_,doc:G,lib:d,flowId:m,nodeLookup:h});$=Ne.handleDomNode,z=Ne.connection,R=A4(!!V,Ne.isValid);const Re=h.get(o),Ze=Re?na(Re,ie,be.Left,!0):he.from,Xe={...he,from:Ze,isValid:R,to:Ne.toHandle&&R?Lc({x:Ne.toHandle.x,y:Ne.toHandle.y},we):Y,toHandle:Ne.toHandle,toPosition:R&&Ne.toHandle?Ne.toHandle.position:ab[ie.position],toNode:Ne.toHandle?h.get(Ne.toHandle.nodeId):null,pointer:Y};k(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(D){(V||$)&&z&&R&&E?.(z);const{inProgress:we,...Ne}=he,Re={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,Re),s&&j?.(Ce,Re)}b(),cancelAnimationFrame(q),Q=!1,R=!1,z=null,$=null,G.removeEventListener("mousemove",me),G.removeEventListener("mouseup",Ee),G.removeEventListener("touchmove",me),G.removeEventListener("touchend",Ee)}}G.addEventListener("mousemove",me),G.addEventListener("mouseup",Ee),G.addEventListener("touchmove",me),G.addEventListener("touchend",Ee)}function xw(e,{handle:n,connectionMode:i,fromNodeId:a,fromHandleId:o,fromType:s,doc:u,lib:f,flowId:h,isValidConnection:d=yw,nodeLookup:g}){const m=s==="target",x=n?u.querySelector(`.${f}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:b,y:w}=Vn(e),E=u.elementFromPoint(b,w),N=E?.classList.contains(`${f}-flow__handle`)?E:x,_={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const j=gw(void 0,N),k=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),L=N.classList.contains("connectable"),A=N.classList.contains("connectableend");if(!k||!j)return _;const H={source:m?k:a,sourceHandle:m?C:o,target:m?a:k,targetHandle:m?o:C};_.connection=H;const G=L&&A&&(i===ul.Strict?m&&j==="source"||!m&&j==="target":k!==a||C!==o);_.isValid=G&&d(H),_.toHandle=mw(k,j,C,g,i,!0)}return _}const Op={onPointerDown:z4,isValid:xw};function D4({domNode:e,panZoom:n,getTransform:i,getViewScale:a}){const o=vn(e);function s({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!n)return;const C=i(),L=k.sourceEvent.ctrlKey&&ts()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,H=C[2]*Math.pow(2,A*L);n.scaleTo(H)};let E=[0,0];const N=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(E=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},_=k=>{const C=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!n)return;const L=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[L[0]-E[0],L[1]-E[1]];E=L;const H=a()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),F={x:C[0]-A[0]*H,y:C[1]-A[1]*H},G=[[0,0],[h,d]];n.setViewportConstrained({x:F.x,y:F.y,zoom:C[2]},G,f)},j=Yv().on("start",N).on("zoom",m?_:null).on("zoom.wheel",x?w:null);o.call(j,{})}function u(){o.on("zoom",null)}return{update:s,destroy:u,pointer:In}}const ef=e=>({x:e.x,y:e.y,zoom:e.k}),$h=({x:e,y:n,zoom:i})=>Kc.translate(e,n).scale(i),Wa=(e,n)=>e.target.closest(`.${n}`),bw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),j4=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Vh=(e,n=0,i=j4,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(i).on("end",a):e},vw=e=>{const n=e.ctrlKey&&ts()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function R4({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(Wa(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(g.ctrlKey&&u){const N=In(g),_=vw(g),j=m*Math.pow(2,_);a.scaleTo(i,j,N,g);return}const x=g.deltaMode===1?20:1;let b=o===Jr.Vertical?0:g.deltaX*x,w=o===Jr.Horizontal?0:g.deltaY*x;!ts()&&g.shiftKey&&o!==Jr.Vertical&&(b=g.deltaY*x,w=0),a.translateBy(i,-(b/m)*s,-(w/m)*s,{internal:!0});const E=ef(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,E),e.panScrollTimeout=setTimeout(()=>{d?.(g,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,E))}}function O4({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(a,o){const s=a.type==="wheel",u=!n&&s&&!a.ctrlKey,f=Wa(a,e);if(a.ctrlKey&&s&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),i.call(this,a,o)}}function L4({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const o=ef(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(a.sourceEvent,o)}}function H4({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:a,onPanZoom:o}){return s=>{e.usedRightMouseButton=!!(i&&bw(n,e.mouseButton??0)),s.sourceEvent?.sync||a([s.transform.x,s.transform.y,s.transform.k]),o&&!s.sourceEvent?.internal&&o?.(s.sourceEvent,ef(s.transform))}}function B4({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:s}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&bw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&s(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const f=ef(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,f)},i?150:0)}}}function U4({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||n,b=i&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Wa(m,`${d}-flow__node`)||Wa(m,`${d}-flow__edge`)))return!0;if(!a&&!x&&!o&&!s&&!i||u||g&&!w||Wa(m,f)&&w||Wa(m,h)&&(!w||o&&w&&!e)||!i&&m.ctrlKey&&w)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!o&&!b&&w||!a&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(a)&&!a.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&E}}function I4({domNode:e,minZoom:n,maxZoom:i,translateExtent:a,viewport:o,onPanZoom:s,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Yv().scaleExtent([n,i]).translateExtent(a),x=vn(e).call(m);j({x:o.x,y:o.y,zoom:cl(o.zoom,n,i)},[[0,0],[g.width,g.height]],a);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(vw);function E(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Vo:vc).transform(Vh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function N({noWheelClassName:V,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:B,panOnDrag:D,panOnScrollMode:U,panOnScrollSpeed:Y,preventScrolling:Q,zoomOnPinch:z,zoomOnScroll:R,zoomOnDoubleClick:$,zoomActivationKeyPressed:M,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&_();const me=B&&!M&&!O;m.clickDistance(ue?1/0:!$n(he)||he<0?0:he);const Ee=me?R4({zoomPanValues:d,noWheelClassName:V,d3Selection:x,d3Zoom:m,panOnScrollMode:U,panOnScrollSpeed:Y,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:f}):O4({noWheelClassName:V,preventScrolling:Q,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=L4({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=H4({zoomPanValues:d,panOnDrag:D,onPaneContextMenu:!!te,onPanZoom:s,onTransformChange:ce});m.on("zoom",Ne);const Re=B4({zoomPanValues:d,panOnDrag:D,panOnScroll:B,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Re)}const Ce=U4({zoomActivationKeyPressed:M,panOnDrag:D,zoomOnScroll:R,panOnScroll:B,zoomOnDoubleClick:$,zoomOnPinch:z,userSelectionActive:O,noPanClassName:P,noWheelClassName:V,lib:ie,connectionInProgress:fe});m.filter(Ce),$?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function j(V,P,te){const O=$h(V),B=m?.constrain()(O,P,te);return B&&await E(B),new Promise(D=>D(B))}async function k(V,P){const te=$h(V);return await E(te,P),new Promise(O=>O(te))}function C(V){if(x){const P=$h(V),te=x.property("__zoom");(te.k!==V.zoom||te.x!==V.x||te.y!==V.y)&&m?.transform(x,P,null,{sync:!0})}}function L(){const V=x?Pv(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function A(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Vo:vc).scaleTo(Vh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function H(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Vo:vc).scaleBy(Vh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function F(V){m?.scaleExtent(V)}function G(V){m?.translateExtent(V)}function q(V){const P=!$n(V)||V<0?0:V;m?.clickDistance(P)}return{update:N,destroy:_,setViewport:k,setViewportConstrained:j,getViewport:L,scaleTo:A,scaleBy:H,setScaleExtent:F,setTranslateExtent:G,syncViewport:C,setClickDistance:q}}var hl;(function(e){e.Line="line",e.Handle="handle"})(hl||(hl={}));function q4({width:e,prevWidth:n,height:i,prevHeight:a,affectsX:o,affectsY:s}){const u=e-n,f=i-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&&s&&(h[1]=h[1]*-1),h}function xb(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:a,affectsY:o}}function mr(e,n){return Math.max(0,n-e)}function gr(e,n){return Math.max(0,e-n)}function Qu(e,n,i){return Math.max(0,n-e,e-i)}function bb(e,n){return e?!n:n}function $4(e,n,i,a,o,s,u,f){let{affectsX:h,affectsY:d}=n;const{isHorizontal:g,isVertical:m}=n,x=g&&m,{xSnapped:b,ySnapped:w}=i,{minWidth:E,maxWidth:N,minHeight:_,maxHeight:j}=a,{x:k,y:C,width:L,height:A,aspectRatio:H}=e;let F=Math.floor(g?b-e.pointerX:0),G=Math.floor(m?w-e.pointerY:0);const q=L+(h?-F:F),V=A+(d?-G:G),P=-s[0]*L,te=-s[1]*A;let O=Qu(q,E,N),B=Qu(V,_,j);if(u){let Y=0,Q=0;h&&F<0?Y=mr(k+F+P,u[0][0]):!h&&F>0&&(Y=gr(k+q+P,u[1][0])),d&&G<0?Q=mr(C+G+te,u[0][1]):!d&&G>0&&(Q=gr(C+V+te,u[1][1])),O=Math.max(O,Y),B=Math.max(B,Q)}if(f){let Y=0,Q=0;h&&F>0?Y=gr(k+F,f[0][0]):!h&&F<0&&(Y=mr(k+q,f[1][0])),d&&G>0?Q=gr(C+G,f[0][1]):!d&&G<0&&(Q=mr(C+V,f[1][1])),O=Math.max(O,Y),B=Math.max(B,Q)}if(o){if(g){const Y=Qu(q/H,_,j)*H;if(O=Math.max(O,Y),u){let Q=0;!h&&!d||h&&!d&&x?Q=gr(C+te+q/H,u[1][1])*H:Q=mr(C+te+(h?F:-F)/H,u[0][1])*H,O=Math.max(O,Q)}if(f){let Q=0;!h&&!d||h&&!d&&x?Q=mr(C+q/H,f[1][1])*H:Q=gr(C+(h?F:-F)/H,f[0][1])*H,O=Math.max(O,Q)}}if(m){const Y=Qu(V*H,E,N)/H;if(B=Math.max(B,Y),u){let Q=0;!h&&!d||d&&!h&&x?Q=gr(k+V*H+P,u[1][0])/H:Q=mr(k+(d?G:-G)*H+P,u[0][0])/H,B=Math.max(B,Q)}if(f){let Q=0;!h&&!d||d&&!h&&x?Q=mr(k+V*H,f[1][0])/H:Q=gr(k+(d?G:-G)*H,f[0][0])/H,B=Math.max(B,Q)}}}G=G+(G<0?B:-B),F=F+(F<0?O:-O),o&&(x?q>V*H?G=(bb(h,d)?-F:F)/H:F=(bb(h,d)?-G:G)*H:g?(G=F/H,d=h):(F=G*H,h=d));const D=h?k+F:k,U=d?C+G:C;return{width:L+(h?-F:F),height:A+(d?-G:G),x:s[0]*F*(h?-1:1)+D,y:s[1]*G*(d?-1:1)+U}}const ww={width:0,height:0,x:0,y:0},V4={...ww,pointerX:0,pointerY:0,aspectRatio:1};function P4(e){return[[0,0],[e.measured.width,e.measured.height]]}function Y4(e,n,i){const a=n.position.x+e.position.x,o=n.position.y+e.position.y,s=e.measured.width??0,u=e.measured.height??0,f=i[0]*s,h=i[1]*u;return[[a-f,o-h],[a+s-f,o+u-h]]}function X4({domNode:e,nodeId:n,getStoreItems:i,onChange:a,onEnd:o}){const s=vn(e);let u={controlDirection:xb("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:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:E,shouldResize:N}){let _={...ww},j={...V4};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:xb(d)};let k,C=null,L=[],A,H,F,G=!1;const q=Av().on("start",V=>{const{nodeLookup:P,transform:te,snapGrid:O,snapToGrid:B,nodeOrigin:D,paneDomNode:U}=i();if(k=P.get(n),!k)return;C=U?.getBoundingClientRect()??null;const{xSnapped:Y,ySnapped:Q}=Po(V.sourceEvent,{transform:te,snapGrid:O,snapToGrid:B,containerBounds:C});_={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},j={..._,pointerX:Y,pointerY:Q,aspectRatio:_.width/_.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=P.get(k.parentId),H=A&&k.extent==="parent"?P4(A):void 0),L=[],F=void 0;for(const[z,R]of P)if(R.parentId===n&&(L.push({id:z,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const $=Y4(R,k,R.origin??D);F?F=[[Math.min($[0][0],F[0][0]),Math.min($[0][1],F[0][1])],[Math.max($[1][0],F[1][0]),Math.max($[1][1],F[1][1])]]:F=$}b?.(V,{..._})}).on("drag",V=>{const{transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B}=i(),D=Po(V.sourceEvent,{transform:P,snapGrid:te,snapToGrid:O,containerBounds:C}),U=[];if(!k)return;const{x:Y,y:Q,width:z,height:R}=_,$={},M=k.origin??B,{width:ie,height:ce,x:fe,y:he}=$4(j,u.controlDirection,D,u.boundaries,u.keepAspectRatio,M,H,F),ue=ie!==z,me=ce!==R,Ee=fe!==Y&&ue,Ce=he!==Q&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||M[0]===1||M[1]===1)&&($.x=Ee?fe:_.x,$.y=Ce?he:_.y,_.x=$.x,_.y=$.y,L.length>0)){const Ze=fe-Y,Xe=he-Q;for(const ht of L)ht.position={x:ht.position.x-Ze+M[0]*(ie-z),y:ht.position.y-Xe+M[1]*(ce-R)},U.push(ht)}if((ue||me)&&($.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:_.width,$.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:_.height,_.width=$.width,_.height=$.height),A&&k.expandParent){const Ze=M[0]*($.width??0);$.x&&$.x<Ze&&(_.x=Ze,j.x=j.x-($.x-Ze));const Xe=M[1]*($.height??0);$.y&&$.y<Xe&&(_.y=Xe,j.y=j.y-($.y-Xe))}const we=q4({width:_.width,prevWidth:z,height:_.height,prevHeight:R,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={..._,direction:we};N?.(V,Ne)!==!1&&(G=!0,w?.(V,Ne),a($,U))}).on("end",V=>{G&&(E?.(V,{..._}),o?.({..._}),G=!1)});s.call(q)}function h(){s.on(".drag",null)}return{update:f,destroy:h}}var Ph={exports:{}},Yh={},Xh={exports:{}},Fh={};var vb;function F4(){if(vb)return Fh;vb=1;var e=ls();function n(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var i=typeof Object.is=="function"?Object.is:n,a=e.useState,o=e.useEffect,s=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),E=w[0].inst,N=w[1];return s(function(){E.value=b,E.getSnapshot=x,h(E)&&N({inst:E})},[m,b,x]),o(function(){return h(E)&&N({inst:E}),m(function(){h(E)&&N({inst:E})})},[m]),u(b),b}function h(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!i(m,b)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Fh}var wb;function G4(){return wb||(wb=1,Xh.exports=F4()),Xh.exports}var Sb;function Z4(){if(Sb)return Yh;Sb=1;var e=ls(),n=G4();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var a=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,s=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Yh.useSyncExternalStoreWithSelector=function(d,g,m,x,b){var w=s(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function _(A){if(!j){if(j=!0,k=A,A=x(A),b!==void 0&&E.hasValue){var H=E.value;if(b(H,A))return C=H}return C=A}if(H=C,a(k,A))return H;var F=x(A);return b!==void 0&&b(H,F)?(k=A,H):(k=A,C=F)}var j=!1,k,C,L=m===void 0?null:m;return[function(){return _(g())},L===null?void 0:function(){return _(L())}]},[g,m,x,b]);var N=o(d,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=N},[N]),h(N),N},Yh}var _b;function Q4(){return _b||(_b=1,Ph.exports=Z4()),Ph.exports}var K4=Q4();const J4=Xc(K4),W4={},kb=e=>{let n;const i=new Set,a=(g,m)=>{const x=typeof g=="function"?g(n):g;if(!Object.is(x,n)){const b=n;n=m??(typeof x!="object"||x===null)?x:Object.assign({},n,x),i.forEach(w=>w(n,b))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(W4?"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."),i.clear()}},d=n=e(a,o,h);return h},eM=e=>e?kb(e):kb,{useDebugValue:tM}=Bo,{useSyncExternalStoreWithSelector:nM}=J4,iM=e=>e;function Sw(e,n=iM,i){const a=nM(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return tM(a),a}const Eb=(e,n)=>{const i=eM(e),a=(o,s=n)=>Sw(i,o,s);return Object.assign(a,i),a},rM=(e,n)=>e?Eb(e,n):Eb;function ut(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,o]of e)if(!Object.is(o,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}mv();const tf=K.createContext(null),aM=tf.Provider,_w=ri.error001();function Ye(e,n){const i=K.useContext(tf);if(i===null)throw new Error(_w);return Sw(i,e,n)}function ct(){const e=K.useContext(tf);if(e===null)throw new Error(_w);return K.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Nb={display:"none"},lM={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},kw="react-flow__node-desc",Ew="react-flow__edge-desc",oM="react-flow__aria-live",sM=e=>e.ariaLiveMessage,uM=e=>e.ariaLabelConfig;function cM({rfId:e}){const n=Ye(sM);return v.jsx("div",{id:`${oM}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:lM,children:n})}function fM({rfId:e,disableKeyboardA11y:n}){const i=Ye(uM);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${kw}-${e}`,style:Nb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${Ew}-${e}`,style:Nb,children:i["edge.a11yDescription.default"]}),!n&&v.jsx(cM,{rfId:e})]})}const nf=K.forwardRef(({position:e="top-left",children:n,className:i,style:a,...o},s)=>{const u=`${e}`.split("-");return v.jsx("div",{className:_t(["react-flow__panel",i,...u]),style:a,ref:s,...o,children:n})});nf.displayName="Panel";function dM({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:v.jsx(nf,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const hM=e=>{const n=[],i=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&i.push(a);return{selectedNodes:n,selectedEdges:i}},Ku=e=>e.id;function pM(e,n){return ut(e.selectedNodes.map(Ku),n.selectedNodes.map(Ku))&&ut(e.selectedEdges.map(Ku),n.selectedEdges.map(Ku))}function mM({onSelectionChange:e}){const n=ct(),{selectedNodes:i,selectedEdges:a}=Ye(hM,pM);return K.useEffect(()=>{const o={nodes:i,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[i,a,e]),null}const gM=e=>!!e.onSelectionChangeHandlers;function yM({onSelectionChange:e}){const n=Ye(gM);return e||n?v.jsx(mM,{onSelectionChange:e}):null}const Nw=[0,0],xM={x:0,y:0,zoom:1},bM=["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"],Cb=[...bM,"rfId"],vM=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}),Tb={translateExtent:Jo,nodeOrigin:Nw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wM(e){const{setNodes:n,setEdges:i,setMinZoom:a,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ye(vM,ut),d=ct();K.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=Tb,f()}),[]);const g=K.useRef(Tb);return K.useEffect(()=>{for(const m of Cb){const x=e[m],b=g.current[m];x!==b&&(typeof e[m]>"u"||(m==="nodes"?n(x):m==="edges"?i(x):m==="minZoom"?a(x):m==="maxZoom"?o(x):m==="translateExtent"?s(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:a4(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},Cb.map(m=>e[m])),null}function Mb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function SM(e){const[n,i]=K.useState(e==="system"?null:e);return K.useEffect(()=>{if(e!=="system"){i(e);return}const a=Mb(),o=()=>i(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:Mb()?.matches?"dark":"light"}const Ab=typeof document<"u"?document:null;function ns(e=null,n={target:Ab,actInsideInputWithModifier:!0}){const[i,a]=K.useState(!1),o=K.useRef(!1),s=K.useRef(new Set([])),[u,f]=K.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
10
- `).replace(`
11
-
12
- `,`
13
- +`).split(`
14
- `)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return K.useEffect(()=>{const h=n?.target??Ab,d=n?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(o.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!o.current||o.current&&!d)&&rw(b))return!1;const E=Db(b.code,f);if(s.current.add(b[E]),zb(u,s.current,!1)){const N=b.composedPath?.()?.[0]||b.target,_=N?.nodeName==="BUTTON"||N?.nodeName==="A";n.preventDefault!==!1&&(o.current||!_)&&b.preventDefault(),a(!0)}},m=b=>{const w=Db(b.code,f);zb(u,s.current,!0)?(a(!1),s.current.clear()):s.current.delete(b[w]),b.key==="Meta"&&s.current.clear(),o.current=!1},x=()=>{s.current.clear(),a(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,a]),i}function zb(e,n,i){return e.filter(a=>i||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function Db(e,n){return n.includes(e)?"code":"key"}const _M=()=>{const e=ct();return K.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[a,o,s],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??o,zoom:n.zoom??s},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,a]=e.getState().transform;return{x:n,y:i,zoom:a}},setCenter:async(n,i,a)=>e.getState().setCenter(n,i,a),fitBounds:async(n,i)=>{const{width:a,height:o,minZoom:s,maxZoom:u,panZoom:f}=e.getState(),h=hm(n,a,o,s,u,i?.padding??.1);return f?(await f.setViewport(h,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:a,snapGrid:o,snapToGrid:s,domNode:u}=e.getState();if(!u)return n;const{x:f,y:h}=u.getBoundingClientRect(),d={x:n.x-f,y:n.y-h},g=i.snapGrid??o,m=i.snapToGrid??s;return ds(d,a,m,g)},flowToScreenPosition:n=>{const{transform:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:s}=a.getBoundingClientRect(),u=Lc(n,i);return{x:u.x+o,y:u.y+s}}}),[])};function Cw(e,n){const i=[],a=new Map,o=[];for(const s of e)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")a.set(s.id,[s]);else{const u=a.get(s.id);u?u.push(s):a.set(s.id,[s])}for(const s of n){const u=a.get(s.id);if(!u){i.push(s);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const f={...s};for(const h of u)kM(h,f);i.push(f)}return o.length&&o.forEach(s=>{s.index!==void 0?i.splice(s.index,0,{...s.item}):i.push({...s.item})}),i}function kM(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Tw(e,n){return Cw(e,n)}function Mw(e,n){return Cw(e,n)}function Gr(e,n){return{id:e,type:"select",selected:n}}function el(e,n=new Set,i=!1){const a=[];for(const[o,s]of e){const u=n.has(o);!(s.selected===void 0&&!u)&&s.selected!==u&&(i&&(s.selected=u),a.push(Gr(s.id,u)))}return a}function jb({items:e=[],lookup:n}){const i=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const u=n.get(s.id),f=u?.internals?.userNode??u;f!==void 0&&f!==s&&i.push({id:s.id,item:s,type:"replace"}),f===void 0&&i.push({item:s,type:"add",index:o})}for(const[o]of n)a.get(o)===void 0&&i.push({id:o,type:"remove"});return i}function Rb(e){return{id:e.id,type:"remove"}}const Ob=e=>ZT(e),EM=e=>Qv(e);function Aw(e){return K.forwardRef(e)}const NM=typeof window<"u"?K.useLayoutEffect:K.useEffect;function Lb(e){const[n,i]=K.useState(BigInt(0)),[a]=K.useState(()=>CM(()=>i(o=>o+BigInt(1))));return NM(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function CM(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const zw=K.createContext(null);function TM({children:e}){const n=ct(),i=K.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=n.getState();let E=h;for(const _ of f)E=typeof _=="function"?_(E):_;let N=jb({items:E,lookup:x});for(const _ of w.values())N=_(N);g&&d(E),N.length>0?m?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:_,nodes:j,setNodes:k}=n.getState();_&&k(j)})},[]),a=Lb(i),o=K.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=n.getState();let b=h;for(const w of f)b=typeof w=="function"?w(b):w;g?d(b):m&&m(jb({items:b,lookup:x}))},[]),s=Lb(o),u=K.useMemo(()=>({nodeQueue:a,edgeQueue:s}),[]);return v.jsx(zw.Provider,{value:u,children:e})}function MM(){const e=K.useContext(zw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const AM=e=>!!e.panZoom;function vm(){const e=_M(),n=ct(),i=MM(),a=Ye(AM),o=K.useMemo(()=>{const s=m=>n.getState().nodeLookup.get(m),u=m=>{i.nodeQueue.push(m)},f=m=>{i.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState(),w=Ob(m)?m:x.get(m.id),E=w.parentId?nw(w.position,w.measured,w.parentId,x,b):w.position,N={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return fl(N)},d=(m,x,b={replace:!1})=>{u(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&Ob(N)?N:{...E,...N}}return E}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&EM(N)?N:{...E,...N}}return E}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>s(m)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(x=>({...x}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];i.nodeQueue.push(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];i.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=n.getState(),[w,E,N]=b;return{nodes:m.map(_=>({..._})),edges:x.map(_=>({..._})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:_,triggerEdgeChanges:j,onDelete:k,onBeforeDelete:C}=n.getState(),{nodes:L,edges:A}=await e4({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),H=A.length>0,F=L.length>0;if(H){const G=A.map(Rb);N?.(A),j(G)}if(F){const G=L.map(Rb);E?.(L),_(G)}return(F||H)&&k?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=ob(m),E=w?m:h(m),N=b!==void 0;return E?(b||n.getState().nodes).filter(_=>{const j=n.getState().nodeLookup.get(_.id);if(j&&!w&&(_.id===m.id||!j.internals.positionAbsolute))return!1;const k=fl(N?_:j),C=es(k,E);return x&&C>0||C>=k.width*k.height||C>=E.width*E.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const E=ob(m)?m:h(m);if(!E)return!1;const N=es(E,x);return b&&N>0||N>=x.width*x.height||N>=E.width*E.height},updateNode:d,updateNodeData:(m,x,b={replace:!1})=>{d(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=n.getState();return QT(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(n.getState().connectionLookup.get(`${b}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=n.getState().fitViewResolver??r4();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return K.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const Hb=e=>e.selected,zM=typeof window<"u"?window:void 0;function DM({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ct(),{deleteElements:a}=vm(),o=ns(e,{actInsideInputWithModifier:!1}),s=ns(n,{target:zM});K.useEffect(()=>{if(o){const{edges:u,nodes:f}=i.getState();a({nodes:f.filter(Hb),edges:u.filter(Hb)}),i.setState({nodesSelectionActive:!1})}},[o]),K.useEffect(()=>{i.setState({multiSelectionActive:s})},[s])}function jM(e){const n=ct();K.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=pm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",ri.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(e.current),()=>{window.removeEventListener("resize",i),a&&e.current&&a.unobserve(e.current)}}},[])}const rf={position:"absolute",width:"100%",height:"100%",top:0,left:0},RM=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function OM({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:s=Jr.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:_,isControlledViewport:j,paneClickDistance:k,selectionOnDrag:C}){const L=ct(),A=K.useRef(null),{userSelectionActive:H,lib:F,connectionInProgress:G}=Ye(RM,ut),q=ns(x),V=K.useRef();jM(A);const P=K.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),j||L.setState({transform:te})},[_,j]);return K.useEffect(()=>{if(A.current){V.current=I4({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:D=>L.setState({paneDragging:D}),onPanZoomStart:(D,U)=>{const{onViewportChangeStart:Y,onMoveStart:Q}=L.getState();Q?.(D,U),Y?.(U)},onPanZoom:(D,U)=>{const{onViewportChange:Y,onMove:Q}=L.getState();Q?.(D,U),Y?.(U)},onPanZoomEnd:(D,U)=>{const{onViewportChangeEnd:Y,onMoveEnd:Q}=L.getState();Q?.(D,U),Y?.(U)}});const{x:te,y:O,zoom:B}=V.current.getViewport();return L.setState({panZoom:V.current,transform:[te,O,B],domNode:A.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),K.useEffect(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:s,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:b,noPanClassName:N,userSelectionActive:H,noWheelClassName:E,lib:F,onTransformChange:P,connectionInProgress:G,selectionOnDrag:C,paneClickDistance:k})},[e,n,i,a,o,s,u,f,q,b,N,H,E,F,P,G,C,k]),v.jsx("div",{className:"react-flow__renderer",ref:A,style:rf,children:w})}const LM=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function HM(){const{userSelectionActive:e,userSelectionRect:n}=Ye(LM,ut);return e&&n?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Gh=(e,n)=>i=>{i.target===n.current&&e?.(i)},BM=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function UM({isSelecting:e,selectionKeyPressed:n,selectionMode:i=Wo.Full,panOnDrag:a,paneClickDistance:o,selectionOnDrag:s,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const E=ct(),{userSelectionActive:N,elementsSelectable:_,dragging:j,connectionInProgress:k}=Ye(BM,ut),C=_&&(e||N),L=K.useRef(null),A=K.useRef(),H=K.useRef(new Set),F=K.useRef(new Set),G=K.useRef(!1),q=Y=>{if(G.current||k){G.current=!1;return}h?.(Y),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},V=Y=>{if(Array.isArray(a)&&a?.includes(2)){Y.preventDefault();return}d?.(Y)},P=g?Y=>g(Y):void 0,te=Y=>{G.current&&(Y.stopPropagation(),G.current=!1)},O=Y=>{const{domNode:Q}=E.getState();if(A.current=Q?.getBoundingClientRect(),!A.current)return;const z=Y.target===L.current;if(!z&&!!Y.target.closest(".nokey")||!e||!(s&&z||n)||Y.button!==0||!Y.isPrimary)return;Y.target?.setPointerCapture?.(Y.pointerId),G.current=!1;const{x:M,y:ie}=Vn(Y.nativeEvent,A.current);E.setState({userSelectionRect:{width:0,height:0,startX:M,startY:ie,x:M,y:ie}}),z||(Y.stopPropagation(),Y.preventDefault())},B=Y=>{const{userSelectionRect:Q,transform:z,nodeLookup:R,edgeLookup:$,connectionLookup:M,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=E.getState();if(!A.current||!Q)return;const{x:ue,y:me}=Vn(Y.nativeEvent,A.current),{startX:Ee,startY:Ce}=Q;if(!G.current){const Xe=n?0:o;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(Y)}G.current=!0;const we={startX:Ee,startY:Ce,x:ue<Ee?ue:Ee,y:me<Ce?me:Ce,width:Math.abs(ue-Ee),height:Math.abs(me-Ce)},Ne=H.current,Re=F.current;H.current=new Set(dm(R,we,z,i===Wo.Partial,!0).map(Xe=>Xe.id)),F.current=new Set;const Ze=fe?.selectable??!0;for(const Xe of H.current){const ht=M.get(Xe);if(ht)for(const{edgeId:on}of ht.values()){const Lt=$.get(on);Lt&&(Lt.selectable??Ze)&&F.current.add(on)}}if(!sb(Ne,H.current)){const Xe=el(R,H.current,!0);ie(Xe)}if(!sb(Re,F.current)){const Xe=el($,F.current);ce(Xe)}E.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},D=Y=>{Y.button===0&&(Y.target?.releasePointerCapture?.(Y.pointerId),!N&&Y.target===L.current&&E.getState().userSelectionRect&&q?.(Y),E.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f?.(Y),E.setState({nodesSelectionActive:H.current.size>0})))},U=a===!0||Array.isArray(a)&&a.includes(0);return v.jsxs("div",{className:_t(["react-flow__pane",{draggable:U,dragging:j,selection:e}]),onClick:C?void 0:Gh(q,L),onContextMenu:Gh(V,L),onWheel:Gh(P,L),onPointerEnter:C?void 0:m,onPointerMove:C?B:x,onPointerUp:C?D:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:rf,children:[w,v.jsx(HM,{})]})}function Lp({id:e,store:n,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:u,nodeLookup:f,onError:h}=n.getState(),d=f.get(e);if(!d){h?.("012",ri.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&u)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function Dw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:a,nodeId:o,isSelectable:s,nodeClickDistance:u}){const f=ct(),[h,d]=K.useState(!1),g=K.useRef();return K.useEffect(()=>{g.current=N4({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Lp({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),K.useEffect(()=>{if(n)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:a,domNode:e.current,isSelectable:s,nodeId:o,nodeClickDistance:u}),()=>{g.current?.destroy()}},[i,a,n,s,e,o]),h}const IM=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function jw(){const e=ct();return K.useCallback(i=>{const{nodeExtent:a,snapToGrid:o,snapGrid:s,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=IM(u),b=o?s[0]:5,w=o?s[1]:5,E=i.direction.x*b*i.factor,N=i.direction.y*w*i.factor;for(const[,_]of d){if(!x(_))continue;let j={x:_.internals.positionAbsolute.x+E,y:_.internals.positionAbsolute.y+N};o&&(j=fs(j,s));const{position:k,positionAbsolute:C}=Kv({nodeId:_.id,nextPosition:j,nodeLookup:d,nodeExtent:a,nodeOrigin:g,onError:f});_.position=k,_.internals.positionAbsolute=C,m.set(_.id,_)}h(m)},[])}const wm=K.createContext(null),qM=wm.Provider;wm.Consumer;const Rw=()=>K.useContext(wm),$M=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),VM=(e,n,i)=>a=>{const{connectionClickStartHandle:o,connectionMode:s,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===n&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===n&&f?.type===i,connectingTo:g,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===i,isPossibleEndHandle:s===ul.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:g&&d}};function PM({type:e="source",position:n=be.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,E=e==="target",N=ct(),_=Rw(),{connectOnClick:j,noPanClassName:k,rfId:C}=Ye($M,ut),{connectingFrom:L,connectingTo:A,clickConnecting:H,isPossibleEndHandle:F,connectionInProcess:G,clickConnectionInProcess:q,valid:V}=Ye(VM(_,w,e),ut);_||N.getState().onError?.("010",ri.error010());const P=B=>{const{defaultEdgeOptions:D,onConnect:U,hasDefaultEdges:Y}=N.getState(),Q={...D,...B};if(Y){const{edges:z,setEdges:R}=N.getState();R(uw(Q,z))}U?.(Q),f?.(Q)},te=B=>{if(!_)return;const D=aw(B.nativeEvent);if(o&&(D&&B.button===0||!D)){const U=N.getState();Op.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:E,handleId:w,nodeId:_,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:P,isValidConnection:i||U.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}D?g?.(B):m?.(B)},O=B=>{const{onClickConnectStart:D,onClickConnectEnd:U,connectionClickStartHandle:Y,connectionMode:Q,isValidConnection:z,lib:R,rfId:$,nodeLookup:M,connection:ie}=N.getState();if(!_||!Y&&!o)return;if(!Y){D?.(B.nativeEvent,{nodeId:_,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=iw(B.target),fe=i||z,{connection:he,isValid:ue}=Op.isValid(B.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:Q,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:fe,flowId:$,doc:ce,lib:R,nodeLookup:M});ue&&he&&P(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,U?.(B,me),N.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":_,"data-handlepos":n,"data-id":`${C}-${_}-${w}-${e}`,className:_t(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",k,d,{source:!E,target:E,connectable:a,connectablestart:o,connectableend:s,clickconnecting:H,connectingfrom:L,connectingto:A,valid:V,connectionindicator:a&&(!G||F)&&(G||q?s:o)}]),onMouseDown:te,onTouchStart:te,onClick:j?O:void 0,ref:b,...x,children:h})}const pl=K.memo(Aw(PM));function YM({data:e,isConnectable:n,sourcePosition:i=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(pl,{type:"source",position:i,isConnectable:n})]})}function XM({data:e,isConnectable:n,targetPosition:i=be.Top,sourcePosition:a=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label,v.jsx(pl,{type:"source",position:a,isConnectable:n})]})}function FM(){return null}function GM({data:e,isConnectable:n,targetPosition:i=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(pl,{type:"target",position:i,isConnectable:n}),e?.label]})}const Hc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bb={input:YM,default:XM,output:GM,group:FM};function ZM(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 QM=e=>{const{width:n,height:i,x:a,y:o}=cs(e.nodeLookup,{filter:s=>!!s.selected});return{width:$n(n)?n:null,height:$n(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function KM({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const a=ct(),{width:o,height:s,transformString:u,userSelectionActive:f}=Ye(QM,ut),h=jw(),d=K.useRef(null);if(K.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),Dw({nodeRef:d}),f||!o||!s)return null;const g=e?x=>{const b=a.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(Hc,x.key)&&(x.preventDefault(),h({direction:Hc[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:_t(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:v.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:o,height:s}})})}const Ub=typeof window<"u"?window:void 0,JM=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Ow({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:_,zoomOnScroll:j,zoomOnPinch:k,panOnScroll:C,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:F,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,preventScrolling:te,onSelectionContextMenu:O,noWheelClassName:B,noPanClassName:D,disableKeyboardA11y:U,onViewportChange:Y,isControlledViewport:Q}){const{nodesSelectionActive:z,userSelectionActive:R}=Ye(JM,ut),$=ns(d,{target:Ub}),M=ns(E,{target:Ub}),ie=M||F,ce=M||C,fe=g&&ie!==!0,he=$||R||fe;return DM({deleteKeyCode:h,multiSelectionKeyCode:w}),v.jsx(OM,{onPaneContextMenu:s,elementsSelectable:_,zoomOnScroll:j,zoomOnPinch:k,panOnScroll:ce,panOnScrollSpeed:L,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&ie,defaultViewport:G,translateExtent:q,minZoom:V,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:B,noPanClassName:D,onViewportChange:Y,isControlledViewport:Q,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(UM,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,z&&v.jsx(KM,{onSelectionContextMenu:O,noPanClassName:D,disableKeyboardA11y:U})]})})}Ow.displayName="FlowRenderer";const WM=K.memo(Ow),eA=e=>n=>e?dm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function tA(e){return Ye(K.useCallback(eA(e),[e]),ut)}const nA=e=>e.updateNodeInternals;function iA(){const e=Ye(nA),[n]=K.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(o=>{const s=o.target.getAttribute("data-id");a.set(s,{id:s,nodeElement:o.target,force:!0})}),e(a)}));return K.useEffect(()=>()=>{n?.disconnect()},[n]),n}function rA({node:e,nodeType:n,hasDimensions:i,resizeObserver:a}){const o=ct(),s=K.useRef(null),u=K.useRef(null),f=K.useRef(e.sourcePosition),h=K.useRef(e.targetPosition),d=K.useRef(n),g=i&&!!e.internals.handleBounds;return K.useEffect(()=>{s.current&&!e.hidden&&(!g||u.current!==s.current)&&(u.current&&a?.unobserve(u.current),a?.observe(s.current),u.current=s.current)},[g,e.hidden]),K.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),K.useEffect(()=>{if(s.current){const m=d.current!==n,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(m||x||b)&&(d.current=n,f.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),s}function aA({id:e,onClick:n,onMouseEnter:i,onMouseMove:a,onMouseLeave:o,onContextMenu:s,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:_,onError:j}){const{node:k,internals:C,isParent:L}=Ye(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ut);let A=k.type||"default",H=N?.[A]||Bb[A];H===void 0&&(j?.("003",ri.error003(A)),A="default",H=N?.default||Bb.default);const F=!!(k.draggable||f&&typeof k.draggable>"u"),G=!!(k.selectable||h&&typeof k.selectable>"u"),q=!!(k.connectable||d&&typeof k.connectable>"u"),V=!!(k.focusable||g&&typeof k.focusable>"u"),P=ct(),te=tw(k),O=rA({node:k,nodeType:A,hasDimensions:te,resizeObserver:m}),B=Dw({nodeRef:O,disabled:k.hidden||!F,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:_}),D=jw();if(k.hidden)return null;const U=Bi(k),Y=ZM(k),Q=G||F||n||i||a||o,z=i?ue=>i(ue,{...C.userNode}):void 0,R=a?ue=>a(ue,{...C.userNode}):void 0,$=o?ue=>o(ue,{...C.userNode}):void 0,M=s?ue=>s(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();G&&(!me||!F||Ee>0)&&Lp({id:e,store:P,nodeRef:O}),n&&n(ue,{...C.userNode})},fe=ue=>{if(!(rw(ue.nativeEvent)||w)){if(Xv.includes(ue.key)&&G){const me=ue.key==="Escape";Lp({id:e,store:P,unselect:me,nodeRef:O})}else if(F&&k.selected&&Object.prototype.hasOwnProperty.call(Hc,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),D({direction:Hc[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;dm(new Map([[e,k]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(k.position.x+U.width/2,k.position.y+U.height/2,{zoom:ue[2]})};return v.jsx("div",{className:_t(["react-flow__node",`react-flow__node-${A}`,{[b]:F},k.className,{selected:k.selected,selectable:G,parent:L,draggable:F,dragging:B}]),ref:O,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:te?"visible":"hidden",...k.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:R,onMouseLeave:$,onContextMenu:M,onClick:ce,onDoubleClick:ie,onKeyDown:V?fe:void 0,tabIndex:V?0:void 0,onFocus:V?he:void 0,role:k.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${kw}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:v.jsx(qM,{value:e,children:v.jsx(H,{id:e,data:k.data,type:A,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:k.selected??!1,selectable:G,draggable:F,deletable:k.deletable??!0,isConnectable:q,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:B,dragHandle:k.dragHandle,zIndex:C.z,parentId:k.parentId,...U})})})}var lA=K.memo(aA);const oA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Lw(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:o,onError:s}=Ye(oA,ut),u=tA(e.onlyRenderVisibleElements),f=iA();return v.jsx("div",{className:"react-flow__nodes",style:rf,children:u.map(h=>v.jsx(lA,{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:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:s},h))})}Lw.displayName="NodeRenderer";const sA=K.memo(Lw);function uA(e){return Ye(K.useCallback(i=>{if(!e)return i.edges.map(o=>o.id);const a=[];if(i.width&&i.height)for(const o of i.edges){const s=i.nodeLookup.get(o.source),u=i.nodeLookup.get(o.target);s&&u&&s4({sourceNode:s,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&a.push(o.id)}return a},[e]),ut)}const cA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return v.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},fA=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return v.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ib={[Rc.Arrow]:cA,[Rc.ArrowClosed]:fA};function dA(e){const n=ct();return K.useMemo(()=>Object.prototype.hasOwnProperty.call(Ib,e)?Ib[e]:(n.getState().onError?.("009",ri.error009(e)),null),[e])}const hA=({id:e,type:n,color:i,width:a=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=dA(n);return h?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:v.jsx(h,{color:i,strokeWidth:u})}):null},Hw=({defaultColor:e,rfId:n})=>{const i=Ye(s=>s.edges),a=Ye(s=>s.defaultEdgeOptions),o=K.useMemo(()=>m4(i,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[i,a,n,e]);return o.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:o.map(s=>v.jsx(hA,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};Hw.displayName="MarkerDefinitions";var pA=K.memo(Hw);function Bw({x:e,y:n,label:i,labelStyle:a,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=K.useState({x:1,y:0,width:0,height:0}),b=_t(["react-flow__edge-textwrapper",d]),w=K.useRef(null);return K.useEffect(()=>{if(w.current){const E=w.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[i]),i?v.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[o&&v.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:a,children:i}),h]}):null}Bw.displayName="EdgeText";const mA=K.memo(Bw);function af({path:e,labelX:n,labelY:i,label:a,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:_t(["react-flow__edge-path",g.className])}),d?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&$n(n)&&$n(i)?v.jsx(mA,{x:n,y:i,label:a,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function qb({pos:e,x1:n,y1:i,x2:a,y2:o}){return e===be.Left||e===be.Right?[.5*(n+a),i]:[n,.5*(i+o)]}function Uw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top}){const[u,f]=qb({pos:i,x1:e,y1:n,x2:a,y2:o}),[h,d]=qb({pos:s,x1:a,y1:o,x2:e,y2:n}),[g,m,x,b]=lw({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${n} C${u},${f} ${h},${d} ${a},${o}`,g,m,x,b]}function Iw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})=>{const[j,k,C]=Uw({sourceX:i,sourceY:a,sourcePosition:u,targetX:o,targetY:s,targetPosition:f}),L=e.isInternal?void 0:n;return v.jsx(af,{id:L,path:j,labelX:k,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})})}const gA=Iw({isInternal:!1}),qw=Iw({isInternal:!0});gA.displayName="SimpleBezierEdge";qw.displayName="SimpleBezierEdgeInternal";function $w(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:j})=>{const[k,C,L]=Dp({sourceX:i,sourceY:a,sourcePosition:b,targetX:o,targetY:s,targetPosition:w,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),A=e.isInternal?void 0:n;return v.jsx(af,{id:A,path:k,labelX:C,labelY:L,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:E,markerStart:N,interactionWidth:j})})}const Vw=$w({isInternal:!1}),Pw=$w({isInternal:!0});Vw.displayName="SmoothStepEdge";Pw.displayName="SmoothStepEdgeInternal";function Yw(e){return K.memo(({id:n,...i})=>{const a=e.isInternal?void 0:n;return v.jsx(Vw,{...i,id:a,pathOptions:K.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const yA=Yw({isInternal:!1}),Xw=Yw({isInternal:!0});yA.displayName="StepEdge";Xw.displayName="StepEdgeInternal";function Fw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})=>{const[N,_,j]=cw({sourceX:i,sourceY:a,targetX:o,targetY:s}),k=e.isInternal?void 0:n;return v.jsx(af,{id:k,path:N,labelX:_,labelY:j,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})})}const xA=Fw({isInternal:!1}),Gw=Fw({isInternal:!0});xA.displayName="StraightEdge";Gw.displayName="StraightEdgeInternal";function Zw(e){return K.memo(({id:n,sourceX:i,sourceY:a,targetX:o,targetY:s,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,pathOptions:_,interactionWidth:j})=>{const[k,C,L]=ow({sourceX:i,sourceY:a,sourcePosition:u,targetX:o,targetY:s,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:n;return v.jsx(af,{id:A,path:k,labelX:C,labelY:L,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:j})})}const bA=Zw({isInternal:!1}),Qw=Zw({isInternal:!0});bA.displayName="BezierEdge";Qw.displayName="BezierEdgeInternal";const $b={default:Qw,straight:Gw,step:Xw,smoothstep:Pw,simplebezier:qw},Vb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},vA=(e,n,i)=>i===be.Left?e-n:i===be.Right?e+n:e,wA=(e,n,i)=>i===be.Top?e-n:i===be.Bottom?e+n:e,Pb="react-flow__edgeupdater";function Yb({position:e,centerX:n,centerY:i,radius:a=10,onMouseDown:o,onMouseEnter:s,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:u,className:_t([Pb,`${Pb}-${f}`]),cx:vA(n,a,e),cy:wA(i,a,e),r:a,stroke:"transparent",fill:"transparent"})}function SA({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:a,sourceY:o,targetX:s,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ct(),E=(C,L)=>{if(C.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:F,connectionMode:G,connectionRadius:q,lib:V,onConnectStart:P,onConnectEnd:te,cancelConnection:O,nodeLookup:B,rfId:D,panBy:U,updateConnection:Y}=w.getState(),Q=L.type==="target",z=(M,ie)=>{x(!1),m?.(M,i,L.type,ie)},R=M=>d?.(i,M),$=(M,ie)=>{x(!0),g?.(C,i,L.type),P?.(M,ie)};Op.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:G,connectionRadius:q,domNode:H,handleId:L.id,nodeId:L.nodeId,nodeLookup:B,isTarget:Q,edgeUpdaterType:L.type,lib:V,flowId:D,cancelConnection:O,panBy:U,isValidConnection:F,onConnect:R,onConnectStart:$,onConnectEnd:te,onReconnectEnd:z,updateConnection:Y,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>E(C,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),_=C=>E(C,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),j=()=>b(!0),k=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Yb,{position:f,centerX:a,centerY:o,radius:n,onMouseDown:N,onMouseEnter:j,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&v.jsx(Yb,{position:h,centerX:s,centerY:u,radius:n,onMouseDown:_,onMouseEnter:j,onMouseOut:k,type:"target"})]})}function _A({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:a,onClick:o,onDoubleClick:s,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:E,noPanClassName:N,onError:_,disableKeyboardA11y:j}){let k=Ye(we=>we.edgeLookup.get(e));const C=Ye(we=>we.defaultEdgeOptions);k=C?{...C,...k}:k;let L=k.type||"default",A=E?.[L]||$b[L];A===void 0&&(_?.("011",ri.error011(L)),L="default",A=E?.default||$b.default);const H=!!(k.focusable||n&&typeof k.focusable>"u"),F=typeof m<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),G=!!(k.selectable||a&&typeof k.selectable>"u"),q=K.useRef(null),[V,P]=K.useState(!1),[te,O]=K.useState(!1),B=ct(),{zIndex:D,sourceX:U,sourceY:Y,targetX:Q,targetY:z,sourcePosition:R,targetPosition:$}=Ye(K.useCallback(we=>{const Ne=we.nodeLookup.get(k.source),Re=we.nodeLookup.get(k.target);if(!Ne||!Re)return{zIndex:k.zIndex,...Vb};const Ze=p4({id:e,sourceNode:Ne,targetNode:Re,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:o4({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:Re,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Ze||Vb}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),ut),M=K.useMemo(()=>k.markerStart?`url('#${jp(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ie=K.useMemo(()=>k.markerEnd?`url('#${jp(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||U===null||Y===null||Q===null||z===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:Re,multiSelectionActive:Ze}=B.getState();G&&(B.setState({nodesSelectionActive:!1}),k.selected&&Ze?(Re({nodes:[],edges:[k]}),q.current?.blur()):Ne([e])),o&&o(we,k)},fe=s?we=>{s(we,{...k})}:void 0,he=u?we=>{u(we,{...k})}:void 0,ue=f?we=>{f(we,{...k})}:void 0,me=h?we=>{h(we,{...k})}:void 0,Ee=d?we=>{d(we,{...k})}:void 0,Ce=we=>{if(!j&&Xv.includes(we.key)&&G){const{unselectNodesAndEdges:Ne,addSelectedEdges:Re}=B.getState();we.key==="Escape"?(q.current?.blur(),Ne({edges:[k]})):Re([e])}};return v.jsx("svg",{style:{zIndex:D},children:v.jsxs("g",{className:_t(["react-flow__edge",`react-flow__edge-${L}`,k.className,N,{selected:k.selected,animated:k.animated,inactive:!G&&!o,updating:V,selectable:G}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:H?Ce:void 0,tabIndex:H?0:void 0,role:k.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":H?`${Ew}-${w}`:void 0,ref:q,...k.domAttributes,children:[!te&&v.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:G,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:U,sourceY:Y,targetX:Q,targetY:z,sourcePosition:R,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:M,markerEnd:ie,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),F&&v.jsx(SA,{edge:k,isReconnectable:F,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:U,sourceY:Y,targetX:Q,targetY:z,sourcePosition:R,targetPosition:$,setUpdateHover:P,setReconnecting:O})]})})}var kA=K.memo(_A);const EA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Kw({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:a,noPanClassName:o,onReconnect:s,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:_,elementsSelectable:j,onError:k}=Ye(EA,ut),C=uA(n);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(pA,{defaultColor:e,rfId:i}),C.map(L=>v.jsx(kA,{id:L,edgesFocusable:N,edgesReconnectable:_,elementsSelectable:j,noPanClassName:o,onReconnect:s,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:i,onError:k,edgeTypes:a,disableKeyboardA11y:E},L))]})}Kw.displayName="EdgeRenderer";const NA=K.memo(Kw),CA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function TA({children:e}){const n=Ye(CA);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function MA(e){const n=vm(),i=K.useRef(!1);K.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const AA=e=>e.panZoom?.syncViewport;function zA(e){const n=Ye(AA),i=ct();return K.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function DA(e){return e.connection.inProgress?{...e.connection,to:ds(e.connection.to,e.transform)}:{...e.connection}}function jA(e){return DA}function RA(e){const n=jA();return Ye(n,ut)}const OA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function LA({containerStyle:e,style:n,type:i,component:a}){const{nodesConnectable:o,width:s,height:u,isValid:f,inProgress:h}=Ye(OA,ut);return!(s&&o&&h)?null:v.jsx("svg",{style:e,width:s,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:_t(["react-flow__connection",Zv(f)]),children:v.jsx(Jw,{style:n,type:i,CustomComponent:a,isValid:f})})})}const Jw=({style:e,type:n=wr.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:o,from:s,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:b}=RA();if(!o)return;if(i)return v.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:Zv(a),toNode:g,toHandle:m,pointer:b});let w="";const E={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(n){case wr.Bezier:[w]=ow(E);break;case wr.SimpleBezier:[w]=Uw(E);break;case wr.Step:[w]=Dp({...E,borderRadius:0});break;case wr.SmoothStep:[w]=Dp(E);break;default:[w]=cw(E)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};Jw.displayName="ConnectionLine";const HA={};function Xb(e=HA){K.useRef(e),ct(),K.useEffect(()=>{},[e])}function BA(){ct(),K.useRef(!1),K.useEffect(()=>{},[])}function Ww({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:_,selectionKeyCode:j,selectionOnDrag:k,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:F,onlyRenderVisibleElements:G,elementsSelectable:q,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,preventScrolling:B,defaultMarkerColor:D,zoomOnScroll:U,zoomOnPinch:Y,panOnScroll:Q,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:$,panOnDrag:M,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,onReconnect:ht,onReconnectStart:on,onReconnectEnd:Lt,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:oi,disableKeyboardA11y:si,nodeExtent:Et,rfId:Ii,viewport:ae,onViewportChange:pe}){return Xb(e),Xb(n),BA(),MA(i),zA(ae),v.jsx(WM,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:F,selectionKeyCode:j,selectionOnDrag:k,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:q,zoomOnScroll:U,zoomOnPinch:Y,zoomOnDoubleClick:$,panOnScroll:Q,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:M,defaultViewport:V,translateExtent:P,minZoom:te,maxZoom:O,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:Gt,noWheelClassName:Rn,noPanClassName:oi,disableKeyboardA11y:si,onViewportChange:pe,isControlledViewport:!!ae,children:v.jsxs(TA,{children:[v.jsx(NA,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:ht,onReconnectStart:on,onReconnectEnd:Lt,onlyRenderVisibleElements:G,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Ze,reconnectRadius:Xe,defaultMarkerColor:D,noPanClassName:oi,disableKeyboardA11y:si,rfId:Ii}),v.jsx(LA,{style:E,type:w,component:N,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(sA,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:G,noPanClassName:oi,noDragClassName:Gt,disableKeyboardA11y:si,nodeExtent:Et,rfId:Ii}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ww.displayName="GraphView";const UA=K.memo(Ww),Fb=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,E=new Map,N=new Map,_=a??n??[],j=i??e??[],k=g??[0,0],C=m??Jo;hw(E,N,_);const L=Rp(j,b,w,{nodeOrigin:k,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&o&&s){const H=cs(b,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:F,y:G,zoom:q}=hm(H,o,s,h,d,f?.padding??.1);A=[F,G,q]}return{rfId:"1",width:o??0,height:s??0,transform:A,nodes:j,nodesInitialized:L,nodeLookup:b,parentLookup:w,edges:_,edgeLookup:N,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Jo,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ul.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,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:{...Gv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:t4,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Fv,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},IA=({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>rM((b,w)=>{async function E(){const{nodeLookup:N,panZoom:_,fitViewOptions:j,fitViewResolver:k,width:C,height:L,minZoom:A,maxZoom:H}=w();_&&(await WT({nodes:N,width:C,height:L,panZoom:_,minZoom:A,maxZoom:H},j),k?.resolve(!0),b({fitViewResolver:null}))}return{...Fb({nodes:e,edges:n,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:i,defaultEdges:a,zIndexMode:x}),setNodes:N=>{const{nodeLookup:_,parentLookup:j,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),H=Rp(N,_,j,{nodeOrigin:k,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:A});L&&H?(E(),b({nodes:N,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:H})},setEdges:N=>{const{connectionLookup:_,edgeLookup:j}=w();hw(_,j,N),b({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:j}=w();j(N),b({hasDefaultNodes:!0})}if(_){const{setEdges:j}=w();j(_),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:j,parentLookup:k,domNode:C,nodeOrigin:L,nodeExtent:A,debug:H,fitViewQueued:F,zIndexMode:G}=w(),{changes:q,updatedInternals:V}=S4(N,j,k,C,L,A,G);V&&(x4(j,k,{nodeOrigin:L,nodeExtent:A,zIndexMode:G}),F?(E(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),q?.length>0&&(H&&console.log("React Flow: trigger node changes",q),_?.(q)))},updateNodePositions:(N,_=!1)=>{const j=[];let k=[];const{nodeLookup:C,triggerNodeChanges:L,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:F}=w();for(const[G,q]of N){const V=C.get(G),P=!!(V?.expandParent&&V?.parentId&&q?.position),te={id:G,type:"position",position:P?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:_};if(V&&A.inProgress&&A.fromNode.id===V.id){const O=na(V,A.fromHandle,be.Left,!0);H({...A,from:O})}P&&V.parentId&&j.push({id:G,parentId:V.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),k.push(te)}if(j.length>0){const{parentLookup:G,nodeOrigin:q}=w(),V=bm(j,C,G,q);k.push(...V)}for(const G of F.values())k=G(k);L(k)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:j,nodes:k,hasDefaultNodes:C,debug:L}=w();if(N?.length){if(C){const A=Tw(N,k);j(A)}L&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:j,edges:k,hasDefaultEdges:C,debug:L}=w();if(N?.length){if(C){const A=Mw(N,k);j(A)}L&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:j,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));C(A);return}C(el(k,new Set([...N]),!0)),L(el(j))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:j,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));L(A);return}L(el(j,new Set([...N]))),C(el(k,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:j,nodes:k,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),H=N||k,F=_||j,G=H.map(V=>{const P=C.get(V.id);return P&&(P.selected=!1),Gr(V.id,!1)}),q=F.map(V=>Gr(V.id,!1));L(G),A(q)},setMinZoom:N=>{const{panZoom:_,maxZoom:j}=w();_?.setScaleExtent([N,j]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:j}=w();_?.setScaleExtent([j,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:j,triggerEdgeChanges:k,elementsSelectable:C}=w();if(!C)return;const L=_.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]),A=N.reduce((H,F)=>F.selected?[...H,Gr(F.id,!1)]:H,[]);j(L),k(A)},setNodeExtent:N=>{const{nodes:_,nodeLookup:j,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:L,nodeExtent:A,zIndexMode:H}=w();N[0][0]===A[0][0]&&N[0][1]===A[0][1]&&N[1][0]===A[1][0]&&N[1][1]===A[1][1]||(Rp(_,j,k,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:H}),b({nodeExtent:N}))},panBy:N=>{const{transform:_,width:j,height:k,panZoom:C,translateExtent:L}=w();return _4({delta:N,panZoom:C,transform:_,translateExtent:L,width:j,height:k})},setCenter:async(N,_,j)=>{const{width:k,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const H=typeof j?.zoom<"u"?j.zoom:L;return await A.setViewport({x:k/2-N*H,y:C/2-_*H,zoom:H},{duration:j?.duration,ease:j?.ease,interpolate:j?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Gv}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...Fb()})}},Object.is);function eS({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:o,initialHeight:s,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=K.useState(()=>IA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,width:o,height:s,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(aM,{value:w,children:v.jsx(TM,{children:b})})}function qA({children:e,nodes:n,edges:i,defaultNodes:a,defaultEdges:o,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return K.useContext(tf)?v.jsx(v.Fragment,{children:e}):v.jsx(eS,{initialNodes:n,initialEdges:i,defaultNodes:a,defaultEdges:o,initialWidth:s,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,children:e})}const $A={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function VA({nodes:e,edges:n,defaultNodes:i,defaultEdges:a,className:o,nodeTypes:s,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,onNodeMouseEnter:j,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onSelectionChange:te,onSelectionDragStart:O,onSelectionDrag:B,onSelectionDragStop:D,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:Q,onBeforeDelete:z,connectionMode:R,connectionLineType:$=wr.Bezier,connectionLineStyle:M,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=Wo.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=ts()?"Meta":"Control",zoomActivationKeyCode:we=ts()?"Meta":"Control",snapToGrid:Ne,snapGrid:Re,onlyRenderVisibleElements:Ze=!1,selectNodesOnDrag:Xe,nodesDraggable:ht,autoPanOnNodeFocus:on,nodesConnectable:Lt,nodesFocusable:Gt,nodeOrigin:Rn=Nw,edgesFocusable:oi,edgesReconnectable:si,elementsSelectable:Et=!0,defaultViewport:Ii=xM,minZoom:ae=.5,maxZoom:pe=2,translateExtent:_e=Jo,preventScrolling:je=!0,nodeExtent:$e,defaultMarkerColor:Vt="#b1b1b7",zoomOnScroll:On=!0,zoomOnPinch:At=!0,panOnScroll:pt=!1,panOnScrollSpeed:Ht=.5,panOnScrollMode:Ke=Jr.Free,zoomOnDoubleClick:Gn=!0,panOnDrag:sn=!0,onPaneClick:bf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:oa,onPaneScroll:ui,onPaneContextMenu:sa,paneClickDistance:_r=1,nodeClickDistance:vf=0,children:ws,onReconnect:wl,onReconnectStart:kr,onReconnectEnd:wf,onEdgeContextMenu:Ss,onEdgeDoubleClick:_s,onEdgeMouseEnter:ks,onEdgeMouseMove:Sl,onEdgeMouseLeave:_l,reconnectRadius:Es=10,onNodesChange:Ns,onEdgesChange:Zn,noDragClassName:Nt="nodrag",noWheelClassName:Bt="nowheel",noPanClassName:ci="nopan",fitView:ua,fitViewOptions:Cs,connectOnClick:Sf,attributionPosition:Ts,proOptions:Er,defaultEdgeOptions:kl,elevateNodesOnSelect:qi=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Vi=!1,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:Ms,connectionRadius:As,isValidConnection:fi,onError:Yi,style:_f,id:El,nodeDragThreshold:zs,connectionDragThreshold:kf,viewport:ca,onViewportChange:fa,width:Ln,height:Zt,colorMode:Ds="light",debug:Ef,onScroll:da,ariaLabelConfig:js,zIndexMode:Nr="basic",...Nf},Qt){const Cr=El||"1",Rs=SM(Ds),Nl=K.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),da?.(di)},[da]);return v.jsx("div",{"data-testid":"rf__wrapper",...Nf,onScroll:Nl,style:{..._f,...$A},ref:Qt,className:_t(["react-flow",o,Rs]),id:El,role:"application",children:v.jsxs(qA,{nodes:e,edges:n,width:Ln,height:Zt,fitView:ua,fitViewOptions:Cs,minZoom:ae,maxZoom:pe,nodeOrigin:Rn,nodeExtent:$e,zIndexMode:Nr,children:[v.jsx(UA,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:j,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:u,connectionLineType:$,connectionLineStyle:M,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Ze,defaultViewport:Ii,translateExtent:_e,minZoom:ae,maxZoom:pe,preventScrolling:je,zoomOnScroll:On,zoomOnPinch:At,zoomOnDoubleClick:Gn,panOnScroll:pt,panOnScrollSpeed:Ht,panOnScrollMode:Ke,panOnDrag:sn,onPaneClick:bf,onPaneMouseEnter:aa,onPaneMouseMove:la,onPaneMouseLeave:oa,onPaneScroll:ui,onPaneContextMenu:sa,paneClickDistance:_r,nodeClickDistance:vf,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:Q,onReconnect:wl,onReconnectStart:kr,onReconnectEnd:wf,onEdgeContextMenu:Ss,onEdgeDoubleClick:_s,onEdgeMouseEnter:ks,onEdgeMouseMove:Sl,onEdgeMouseLeave:_l,reconnectRadius:Es,defaultMarkerColor:Vt,noDragClassName:Nt,noWheelClassName:Bt,noPanClassName:ci,rfId:Cr,disableKeyboardA11y:Vi,nodeExtent:$e,viewport:ca,onViewportChange:fa}),v.jsx(wM,{nodes:e,edges:n,defaultNodes:i,defaultEdges:a,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:_,nodesDraggable:ht,autoPanOnNodeFocus:on,nodesConnectable:Lt,nodesFocusable:Gt,edgesFocusable:oi,edgesReconnectable:si,elementsSelectable:Et,elevateNodesOnSelect:qi,elevateEdgesOnSelect:$i,minZoom:ae,maxZoom:pe,nodeExtent:$e,onNodesChange:Ns,onEdgesChange:Zn,snapToGrid:Ne,snapGrid:Re,connectionMode:R,translateExtent:_e,connectOnClick:Sf,defaultEdgeOptions:kl,fitView:ua,fitViewOptions:Cs,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:D,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ci,nodeOrigin:Rn,rfId:Cr,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:Ms,onError:Yi,connectionRadius:As,isValidConnection:fi,selectNodesOnDrag:Xe,nodeDragThreshold:zs,connectionDragThreshold:kf,onBeforeDelete:z,debug:Ef,ariaLabelConfig:js,zIndexMode:Nr}),v.jsx(yM,{onSelectionChange:te}),ws,v.jsx(dM,{proOptions:Er,position:Ts}),v.jsx(fM,{rfId:Cr,disableKeyboardA11y:Vi})]})})}var PA=Aw(VA);function YA({dimensions:e,lineWidth:n,variant:i,className:a}){return v.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_t(["react-flow__background-pattern",i,a])})}function XA({radius:e,className:n}){return v.jsx("circle",{cx:e,cy:e,r:e,className:_t(["react-flow__background-pattern","dots",n])})}var Oi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Oi||(Oi={}));const FA={[Oi.Dots]:1,[Oi.Lines]:1,[Oi.Cross]:6},GA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tS({id:e,variant:n=Oi.Dots,gap:i=20,size:a,lineWidth:o=1,offset:s=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const m=K.useRef(null),{transform:x,patternId:b}=Ye(GA,ut),w=a||FA[n],E=n===Oi.Dots,N=n===Oi.Cross,_=Array.isArray(i)?i:[i,i],j=[_[0]*x[2]||1,_[1]*x[2]||1],k=w*x[2],C=Array.isArray(s)?s:[s,s],L=N?[k,k]:j,A=[C[0]*x[2]||1+L[0]/2,C[1]*x[2]||1+L[1]/2],H=`${b}${e||""}`;return v.jsxs("svg",{className:_t(["react-flow__background",d]),style:{...h,...rf,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:H,x:x[0]%j[0],y:x[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:E?v.jsx(XA,{radius:k/2,className:g}):v.jsx(YA,{dimensions:L,lineWidth:o,variant:n,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}tS.displayName="Background";const ZA=K.memo(tS);function QA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function KA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function JA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.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 WA(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 e3(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 Ju({children:e,className:n,...i}){return v.jsx("button",{type:"button",className:_t(["react-flow__controls-button",n]),...i,children:e})}const t3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nS({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ct(),{isInteractive:E,minZoomReached:N,maxZoomReached:_,ariaLabelConfig:j}=Ye(t3,ut),{zoomIn:k,zoomOut:C,fitView:L}=vm(),A=()=>{k(),s?.()},H=()=>{C(),u?.()},F=()=>{L(o),f?.()},G=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},q=x==="horizontal"?"horizontal":"vertical";return v.jsxs(nf,{className:_t(["react-flow__controls",q,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??j["controls.ariaLabel"],children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(Ju,{onClick:A,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(QA,{})}),v.jsx(Ju,{onClick:H,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(KA,{})})]}),i&&v.jsx(Ju,{className:"react-flow__controls-fitview",onClick:F,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:v.jsx(JA,{})}),a&&v.jsx(Ju,{className:"react-flow__controls-interactive",onClick:G,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:E?v.jsx(e3,{}):v.jsx(WA,{})}),g]})}nS.displayName="Controls";const n3=K.memo(nS);function i3({id:e,x:n,y:i,width:a,height:o,style:s,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:E}=s||{},N=u||w||E;return v.jsx("rect",{className:_t(["react-flow__minimap-node",{selected:x},d]),x:n,y:i,rx:g,ry:g,width:a,height:o,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:m,onClick:b?_=>b(_,e):void 0})}const r3=K.memo(i3),a3=e=>e.nodes.map(n=>n.id),Zh=e=>e instanceof Function?e:()=>e;function l3({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s=r3,onClick:u}){const f=Ye(a3,ut),h=Zh(n),d=Zh(e),g=Zh(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(s3,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:s,onClick:u,shapeRendering:m},x))})}function o3({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:b}=Ye(w=>{const{internals:E}=w.nodeLookup.get(e),N=E.userNode,{x:_,y:j}=E.positionAbsolute,{width:k,height:C}=Bi(N);return{node:N,x:_,y:j,width:k,height:C}},ut);return!d||d.hidden||!tw(d)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:d.style,selected:!!d.selected,className:a(d),color:n(d),borderRadius:o,strokeColor:i(d),strokeWidth:s,shapeRendering:u,onClick:h,id:d.id})}const s3=K.memo(o3);var u3=K.memo(l3);const c3=200,f3=150,d3=e=>!e.hidden,h3=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?ew(cs(e.nodeLookup,{filter:d3}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},p3="react-flow__minimap-desc";function iS({style:e,className:n,nodeStrokeColor:i,nodeColor:a,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:_,inversePan:j,zoomStep:k=1,offsetScale:C=5}){const L=ct(),A=K.useRef(null),{boundingRect:H,viewBB:F,rfId:G,panZoom:q,translateExtent:V,flowWidth:P,flowHeight:te,ariaLabelConfig:O}=Ye(h3,ut),B=e?.width??c3,D=e?.height??f3,U=H.width/B,Y=H.height/D,Q=Math.max(U,Y),z=Q*B,R=Q*D,$=C*Q,M=H.x-(z-H.width)/2-$,ie=H.y-(R-H.height)/2-$,ce=z+$*2,fe=R+$*2,he=`${p3}-${G}`,ue=K.useRef(0),me=K.useRef();ue.current=Q,K.useEffect(()=>{if(A.current&&q)return me.current=D4({domNode:A.current,panZoom:q,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[q]),K.useEffect(()=>{me.current?.update({translateExtent:V,width:P,height:te,inversePan:j,pannable:E,zoomStep:k,zoomable:N})},[E,N,j,k,V,P,te]);const Ee=b?Ne=>{const[Re,Ze]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:Re,y:Ze})}:void 0,Ce=w?K.useCallback((Ne,Re)=>{const Ze=L.getState().nodeLookup.get(Re).internals.userNode;w(Ne,Ze)},[]):void 0,we=_??O["minimap.ariaLabel"];return v.jsx(nf,{position:x,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 g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*Q:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:_t(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:B,height:D,viewBox:`${M} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:A,onClick:Ee,children:[we&&v.jsx("title",{id:he,children:we}),v.jsx(u3,{onClick:Ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${M-$},${ie-$}h${ce+$*2}v${fe+$*2}h${-ce-$*2}z
15
- M${F.x},${F.y}h${F.width}v${F.height}h${-F.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}iS.displayName="MiniMap";const m3=K.memo(iS),g3=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,y3={[hl.Line]:"right",[hl.Handle]:"bottom-right"};function x3({nodeId:e,position:n,variant:i=hl.Handle,className:a,style:o=void 0,children:s,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:_}){const j=Rw(),k=typeof e=="string"?e:j,C=ct(),L=K.useRef(null),A=i===hl.Handle,H=Ye(K.useCallback(g3(A&&b),[A,b]),ut),F=K.useRef(null),G=n??y3[i];K.useEffect(()=>{if(!(!L.current||!k))return F.current||(F.current=X4({domNode:L.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,domNode:D}=C.getState();return{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,paneDomNode:D}},onChange:(V,P)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:B,nodeOrigin:D}=C.getState(),U=[],Y={x:V.x,y:V.y},Q=O.get(k);if(Q&&Q.expandParent&&Q.parentId){const z=Q.origin??D,R=V.width??Q.measured.width??0,$=V.height??Q.measured.height??0,M={id:Q.id,parentId:Q.parentId,rect:{width:R,height:$,...nw({x:V.x??Q.position.x,y:V.y??Q.position.y},{width:R,height:$},Q.parentId,O,z)}},ie=bm([M],O,B,D);U.push(...ie),Y.x=V.x?Math.max(z[0]*R,V.x):void 0,Y.y=V.y?Math.max(z[1]*$,V.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const z={id:k,type:"position",position:{...Y}};U.push(z)}if(V.width!==void 0&&V.height!==void 0){const R={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};U.push(R)}for(const z of P){const R={...z,type:"position"};U.push(R)}te(U)},onEnd:({width:V,height:P})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:V,height:P}};C.getState().triggerNodeChanges([te])}})),F.current.update({controlPosition:G,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:E,onResize:N,onResizeEnd:_,shouldResize:w}),()=>{F.current?.destroy()}},[G,f,h,d,g,m,E,N,_,w]);const q=G.split("-");return v.jsx("div",{className:_t(["react-flow__resize-control","nodrag",...q,i,a]),ref:L,style:{...o,scale:H,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:s})}K.memo(x3);const rS=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();const b3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const v3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.toLowerCase());const Gb=e=>{const n=v3(e);return n.charAt(0).toUpperCase()+n.slice(1)};var w3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const S3=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const _3=K.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:u,...f},h)=>K.createElement("svg",{ref:h,...w3,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:rS("lucide",o),...!s&&!S3(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>K.createElement(d,g)),...Array.isArray(s)?s:[s]]));const qe=(e,n)=>{const i=K.forwardRef(({className:a,...o},s)=>K.createElement(_3,{ref:s,iconNode:n,className:rS(`lucide-${b3(Gb(e))}`,`lucide-${e}`,a),...o}));return i.displayName=Gb(e),i};const k3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],E3=qe("arrow-left",k3);const N3=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],C3=qe("bot",N3);const T3=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],lf=qe("chart-column",T3);const M3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],A3=qe("check",M3);const z3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],D3=qe("chevron-down",z3);const j3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],R3=qe("chevron-up",j3);const O3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Hp=qe("circle-alert",O3);const L3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aS=qe("circle-check-big",L3);const H3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],B3=qe("circle-check",H3);const U3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],lS=qe("circle-x",U3);const I3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],il=qe("download",I3);const q3=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],$3=qe("eye",q3);const V3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rl=qe("file-text",V3);const P3=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zb=qe("folder-open",P3);const Y3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],X3=qe("globe",Y3);const F3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],oS=qe("image",F3);const G3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Z3=qe("info",G3);const Q3=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],K3=qe("link-2",Q3);const J3=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sS=qe("loader-circle",J3);const W3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],e5=qe("maximize-2",W3);const t5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],of=qe("message-square",t5);const n5=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],i5=qe("minimize-2",n5);const r5=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Sm=qe("play",r5);const a5=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],_m=qe("plug",a5);const l5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],o5=qe("save",l5);const s5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],u5=qe("send",s5);const c5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],f5=qe("settings-2",c5);const d5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],uS=qe("settings",d5);const h5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],hs=qe("sparkles",h5);const p5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Bc=qe("terminal",p5);const m5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Bp=qe("trash-2",m5);const g5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],y5=qe("triangle-alert",g5);const x5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],b5=qe("upload",x5);const v5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cS=qe("x",v5);const w5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sf=qe("zap",w5),Qb=e=>{let n;const i=new Set,a=(d,g)=>{const m=typeof d=="function"?d(n):d;if(!Object.is(m,n)){const x=n;n=g??(typeof m!="object"||m===null)?m:Object.assign({},n,m),i.forEach(b=>b(n,x))}},o=()=>n,f={setState:a,getState:o,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=n=e(a,o,f);return f},S5=(e=>e?Qb(e):Qb),_5=e=>e;function k5(e,n=_5){const i=Bo.useSyncExternalStore(e.subscribe,Bo.useCallback(()=>n(e.getState()),[e,n]),Bo.useCallback(()=>n(e.getInitialState()),[e,n]));return Bo.useDebugValue(i),i}const Kb=e=>{const n=S5(e),i=a=>k5(n,a);return Object.assign(i,n),i},km=(e=>e?Kb(e):Kb);function E5(e,n){let i;try{i=e()}catch{return}return{getItem:o=>{var s;const u=h=>h===null?null:JSON.parse(h,void 0),f=(s=i.getItem(o))!=null?s:null;return f instanceof Promise?f.then(u):u(f)},setItem:(o,s)=>i.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>i.removeItem(o)}}const Up=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(a){return Up(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return Up(a)(i)}}}},N5=(e,n)=>(i,a,o)=>{let s={storage:E5(()=>localStorage),partialize:N=>N,version:0,merge:(N,_)=>({..._,...N}),...n},u=!1,f=0;const h=new Set,d=new Set;let g=s.storage;if(!g)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),i(...N)},a,o);const m=()=>{const N=s.partialize({...a()});return g.setItem(s.name,{state:N,version:s.version})},x=o.setState;o.setState=(N,_)=>(x(N,_),m());const b=e((...N)=>(i(...N),m()),a,o);o.getInitialState=()=>b;let w;const E=()=>{var N,_;if(!g)return;const j=++f;u=!1,h.forEach(C=>{var L;return C((L=a())!=null?L:b)});const k=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(N=a())!=null?N:b))||void 0;return Up(g.getItem.bind(g))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate){const L=s.migrate(C.state,C.version);return L instanceof Promise?L.then(A=>[!0,A]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var L;if(j!==f)return;const[A,H]=C;if(w=s.merge(H,(L=a())!=null?L:b),i(w,!0),A)return m()}).then(()=>{j===f&&(k?.(w,void 0),w=a(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{j===f&&k?.(void 0,C)})};return o.persist={setOptions:N=>{s={...s,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>u,onHydrate:N=>(h.add(N),()=>{h.delete(N)}),onFinishHydration:N=>(d.add(N),()=>{d.delete(N)})},s.skipHydration||E(),w||b},C5=N5,T5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ml=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=T5[i[e]&63];return n};const Hi=km()(C5(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:ml(),workflowName:"Untitled Workflow",isDraft:!0,addNode:n=>e(i=>({nodes:[...i.nodes,n]})),updateNode:(n,i)=>e(a=>({nodes:a.nodes.map(o=>o.id===n?{...o,data:{...o.data,...i}}:o)})),updateNodeStatus:(n,i,a)=>e(o=>({nodes:o.nodes.map(s=>s.id===n?{...s,data:{...s.data,status:i,progress:a??s.data.progress}}:s)})),removeNode:n=>e(i=>({nodes:i.nodes.filter(a=>a.id!==n),edges:i.edges.filter(a=>a.source!==n&&a.target!==n),selectedNodeId:i.selectedNodeId===n?null:i.selectedNodeId})),setSelectedNode:n=>e({selectedNodeId:n}),addEdge:n=>e(i=>({edges:[...i.edges,n]})),removeEdge:n=>e(i=>({edges:i.edges.filter(a=>a.id!==n)})),setWorkflowName:n=>e({workflowName:n}),loadWorkflow:n=>e({nodes:n.nodes,edges:n.edges,workflowName:n.name||"Imported Workflow",selectedNodeId:null}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:ml(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:n=>e({nodes:n}),setEdges:n=>e({edges:n})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),fS=e=>e.nodes.find(n=>n.id===e.selectedNodeId),uf=km((e,n)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),n().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),n().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&n().addLog("info","Processing node",i)},markNodeCompleted:(i,a)=>{e(o=>{const s=new Set(o.completedNodes);s.add(i);const u=new Map(o.results);return a!==void 0&&u.set(i,a),{completedNodes:s,results:u}}),n().addLog("success","Node completed",i)},markNodeFailed:(i,a)=>{e(o=>{const s=new Set(o.failedNodes);return s.add(i),{failedNodes:s}}),n().addLog("error",a||"Node failed",i)},setWorkflowResults:(i,a)=>{e({workflowResults:i,outputDir:a||null}),i.forEach(o=>{o.result&&e(s=>{const u=new Map(s.results);return u.set(o.nodeId,o.result),{results:u}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(i,a,o,s)=>{const u={id:ml(),timestamp:Date.now(),level:i,message:a,nodeId:o,details:s};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,n,i,a,o){if(typeof n=="function"?e!==n||!0:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(e,i),i}function ne(e,n,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!a:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:n.get(e)}let dS=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return dS=e.randomUUID.bind(e),e.randomUUID();const n=new Uint8Array(1),i=e?()=>e.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^i()&15>>+a/4).toString(16))};function is(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const Ip=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Me extends Error{}class qt extends Me{constructor(n,i,a,o){super(`${qt.makeMessage(n,i,a)}`),this.status=n,this.headers=o,this.requestID=o?.get("request-id"),this.error=i}static makeMessage(n,i,a){const o=i?.message?typeof i.message=="string"?i.message:JSON.stringify(i.message):i?JSON.stringify(i):a;return n&&o?`${n} ${o}`:n?`${n} status code (no body)`:o||"(no status code or body)"}static generate(n,i,a,o){if(!n||!o)return new cf({message:a,cause:Ip(i)});const s=i;return n===400?new pS(n,s,a,o):n===401?new mS(n,s,a,o):n===403?new gS(n,s,a,o):n===404?new yS(n,s,a,o):n===409?new xS(n,s,a,o):n===422?new bS(n,s,a,o):n===429?new vS(n,s,a,o):n>=500?new wS(n,s,a,o):new qt(n,s,a,o)}}class Pn extends qt{constructor({message:n}={}){super(void 0,void 0,n||"Request was aborted.",void 0)}}class cf extends qt{constructor({message:n,cause:i}){super(void 0,void 0,n||"Connection error.",void 0),i&&(this.cause=i)}}class hS extends cf{constructor({message:n}={}){super({message:n??"Request timed out."})}}class pS extends qt{}class mS extends qt{}class gS extends qt{}class yS extends qt{}class xS extends qt{}class bS extends qt{}class vS extends qt{}class wS extends qt{}const M5=/^[a-z][a-z0-9+.-]*:/i,A5=e=>M5.test(e);let qp=e=>(qp=Array.isArray,qp(e)),Jb=qp;function $p(e){return typeof e!="object"?{}:e??{}}function z5(e){if(!e)return!0;for(const n in e)return!1;return!0}function D5(e,n){return Object.prototype.hasOwnProperty.call(e,n)}const j5=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Me(`${e} must be an integer`);if(n<0)throw new Me(`${e} must be a positive integer`);return n},SS=e=>{try{return JSON.parse(e)}catch{return}},R5=e=>new Promise(n=>setTimeout(n,e)),Qa="0.71.2",O5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function L5(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const H5=()=>{const e=L5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":e1(Deno.build.os),"X-Stainless-Arch":Wb(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":e1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Wb(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const n=B5();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Qa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function B5(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:n,pattern:i}of e){const a=i.exec(navigator.userAgent);if(a){const o=a[1]||0,s=a[2]||0,u=a[3]||0;return{browser:n,version:`${o}.${s}.${u}`}}}return null}const Wb=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",e1=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let t1;const U5=()=>t1??(t1=H5());function I5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function _S(...e){const n=globalThis.ReadableStream;if(typeof n>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new n(...e)}function kS(e){let n=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return _S({start(){},async pull(i){const{done:a,value:o}=await n.next();a?i.close():i.enqueue(o)},async cancel(){await n.return?.()}})}function Em(e){if(e[Symbol.asyncIterator])return e;const n=e.getReader();return{async next(){try{const i=await n.read();return i?.done&&n.releaseLock(),i}catch(i){throw n.releaseLock(),i}},async return(){const i=n.cancel();return n.releaseLock(),await i,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function q5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const n=e.getReader(),i=n.cancel();n.releaseLock(),await i}const $5=({headers:e,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});function V5(e){let n=0;for(const o of e)n+=o.length;const i=new Uint8Array(n);let a=0;for(const o of e)i.set(o,a),a+=o.length;return i}let n1;function Nm(e){let n;return(n1??(n=new globalThis.TextEncoder,n1=n.encode.bind(n)))(e)}let i1;function r1(e){let n;return(i1??(n=new globalThis.TextDecoder,i1=n.decode.bind(n)))(e)}var yn,xn;class ps{constructor(){yn.set(this,void 0),xn.set(this,void 0),ge(this,yn,new Uint8Array),ge(this,xn,null)}decode(n){if(n==null)return[];const i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Nm(n):n;ge(this,yn,V5([ne(this,yn,"f"),i]));const a=[];let o;for(;(o=P5(ne(this,yn,"f"),ne(this,xn,"f")))!=null;){if(o.carriage&&ne(this,xn,"f")==null){ge(this,xn,o.index);continue}if(ne(this,xn,"f")!=null&&(o.index!==ne(this,xn,"f")+1||o.carriage)){a.push(r1(ne(this,yn,"f").subarray(0,ne(this,xn,"f")-1))),ge(this,yn,ne(this,yn,"f").subarray(ne(this,xn,"f"))),ge(this,xn,null);continue}const s=ne(this,xn,"f")!==null?o.preceding-1:o.preceding,u=r1(ne(this,yn,"f").subarray(0,s));a.push(u),ge(this,yn,ne(this,yn,"f").subarray(o.index)),ge(this,xn,null)}return a}flush(){return ne(this,yn,"f").length?this.decode(`
16
- `):[]}}yn=new WeakMap,xn=new WeakMap;ps.NEWLINE_CHARS=new Set([`
17
- `,"\r"]);ps.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function P5(e,n){for(let o=n??0;o<e.length;o++){if(e[o]===10)return{preceding:o,index:o+1,carriage:!1};if(e[o]===13)return{preceding:o,index:o+1,carriage:!0}}return null}function Y5(e){for(let a=0;a<e.length-1;a++){if(e[a]===10&&e[a+1]===10||e[a]===13&&e[a+1]===13)return a+2;if(e[a]===13&&e[a+1]===10&&a+3<e.length&&e[a+2]===13&&e[a+3]===10)return a+4}return-1}const Uc={off:0,error:200,warn:300,info:400,debug:500},a1=(e,n,i)=>{if(e){if(D5(Uc,e))return e;Yt(i).warn(`${n} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Uc))}`)}};function qo(){}function Wu(e,n,i){return!n||Uc[e]>Uc[i]?qo:n[e].bind(n)}const X5={error:qo,warn:qo,info:qo,debug:qo};let l1=new WeakMap;function Yt(e){const n=e.logger,i=e.logLevel??"off";if(!n)return X5;const a=l1.get(n);if(a&&a[0]===i)return a[1];const o={error:Wu("error",n,i),warn:Wu("warn",n,i),info:Wu("info",n,i),debug:Wu("debug",n,i)};return l1.set(n,[i,o]),o}const Zr=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([n,i])=>[n,n.toLowerCase()==="x-api-key"||n.toLowerCase()==="authorization"||n.toLowerCase()==="cookie"||n.toLowerCase()==="set-cookie"?"***":i]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var bo;class ni{constructor(n,i,a){this.iterator=n,bo.set(this,void 0),this.controller=i,ge(this,bo,a)}static fromSSEResponse(n,i,a){let o=!1;const s=a?Yt(a):console;async function*u(){if(o)throw new Me("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let f=!1;try{for await(const h of F5(n,i)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(d){throw s.error("Could not parse message into JSON:",h.data),s.error("From chunk:",h.raw),d}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop")try{yield JSON.parse(h.data)}catch(d){throw s.error("Could not parse message into JSON:",h.data),s.error("From chunk:",h.raw),d}if(h.event!=="ping"&&h.event==="error")throw new qt(void 0,SS(h.data)??h.data,void 0,n.headers)}f=!0}catch(h){if(is(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}static fromReadableStream(n,i,a){let o=!1;async function*s(){const f=new ps,h=Em(n);for await(const d of h)for(const g of f.decode(d))yield g;for(const d of f.flush())yield d}async function*u(){if(o)throw new Me("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let f=!1;try{for await(const h of s())f||h&&(yield JSON.parse(h));f=!0}catch(h){if(is(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}[(bo=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const n=[],i=[],a=this.iterator(),o=s=>({next:()=>{if(s.length===0){const u=a.next();n.push(u),i.push(u)}return s.shift()}});return[new ni(()=>o(n),this.controller,ne(this,bo,"f")),new ni(()=>o(i),this.controller,ne(this,bo,"f"))]}toReadableStream(){const n=this;let i;return _S({async start(){i=n[Symbol.asyncIterator]()},async pull(a){try{const{value:o,done:s}=await i.next();if(s)return a.close();const u=Nm(JSON.stringify(o)+`
18
- `);a.enqueue(u)}catch(o){a.error(o)}},async cancel(){await i.return?.()}})}}async function*F5(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Me("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Me("Attempted to iterate over a response with no body");const i=new Z5,a=new ps,o=Em(e.body);for await(const s of G5(o))for(const u of a.decode(s)){const f=i.decode(u);f&&(yield f)}for(const s of a.flush()){const u=i.decode(s);u&&(yield u)}}async function*G5(e){let n=new Uint8Array;for await(const i of e){if(i==null)continue;const a=i instanceof ArrayBuffer?new Uint8Array(i):typeof i=="string"?Nm(i):i;let o=new Uint8Array(n.length+a.length);o.set(n),o.set(a,n.length),n=o;let s;for(;(s=Y5(n))!==-1;)yield n.slice(0,s),n=n.slice(s)}n.length>0&&(yield n)}class Z5{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(n){if(n.endsWith("\r")&&(n=n.substring(0,n.length-1)),!n){if(!this.event&&!this.data.length)return null;const s={event:this.event,data:this.data.join(`
19
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(n),n.startsWith(":"))return null;let[i,a,o]=Q5(n,":");return o.startsWith(" ")&&(o=o.substring(1)),i==="event"?this.event=o:i==="data"&&this.data.push(o),null}}function Q5(e,n){const i=e.indexOf(n);return i!==-1?[e.substring(0,i),n,e.substring(i+n.length)]:[e,"",""]}async function ES(e,n){const{response:i,requestLogID:a,retryOfRequestLogID:o,startTime:s}=n,u=await(async()=>{if(n.options.stream)return Yt(e).debug("response",i.status,i.url,i.headers,i.body),n.options.__streamClass?n.options.__streamClass.fromSSEResponse(i,n.controller):ni.fromSSEResponse(i,n.controller);if(i.status===204)return null;if(n.options.__binaryResponse)return i;const h=i.headers.get("content-type")?.split(";")[0]?.trim();if(h?.includes("application/json")||h?.endsWith("+json")){const m=await i.json();return NS(m,i)}return await i.text()})();return Yt(e).debug(`[${a}] response parsed`,Zr({retryOfRequestLogID:o,url:i.url,status:i.status,body:u,durationMs:Date.now()-s})),u}function NS(e,n){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:n.headers.get("request-id"),enumerable:!1})}var $o;class ff extends Promise{constructor(n,i,a=ES){super(o=>{o(null)}),this.responsePromise=i,this.parseResponse=a,$o.set(this,void 0),ge(this,$o,n)}_thenUnwrap(n){return new ff(ne(this,$o,"f"),this.responsePromise,async(i,a)=>NS(n(await this.parseResponse(i,a),a),a.response))}asResponse(){return this.responsePromise.then(n=>n.response)}async withResponse(){const[n,i]=await Promise.all([this.parse(),this.asResponse()]);return{data:n,response:i,request_id:i.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(n=>this.parseResponse(ne(this,$o,"f"),n))),this.parsedPromise}then(n,i){return this.parse().then(n,i)}catch(n){return this.parse().catch(n)}finally(n){return this.parse().finally(n)}}$o=new WeakMap;var ec;class CS{constructor(n,i,a,o){ec.set(this,void 0),ge(this,ec,n),this.options=o,this.response=i,this.body=a}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const n=this.nextPageRequestOptions();if(!n)throw new Me("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ne(this,ec,"f").requestAPIList(this.constructor,n)}async*iterPages(){let n=this;for(yield n;n.hasNextPage();)n=await n.getNextPage(),yield n}async*[(ec=new WeakMap,Symbol.asyncIterator)](){for await(const n of this.iterPages())for(const i of n.getPaginatedItems())yield i}}class K5 extends ff{constructor(n,i,a){super(n,i,async(o,s)=>new a(o,s.response,await ES(o,s),s.options))}async*[Symbol.asyncIterator](){const n=await this;for await(const i of n)yield i}}class ms extends CS{constructor(n,i,a,o){super(n,i,a,o),this.data=a.data||[],this.has_more=a.has_more||!1,this.first_id=a.first_id||null,this.last_id=a.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const i=this.first_id;return i?{...this.options,query:{...$p(this.options.query),before_id:i}}:null}const n=this.last_id;return n?{...this.options,query:{...$p(this.options.query),after_id:n}}:null}}class TS extends CS{constructor(n,i,a,o){super(n,i,a,o),this.data=a.data||[],this.has_more=a.has_more||!1,this.next_page=a.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const n=this.next_page;return n?{...this.options,query:{...$p(this.options.query),page:n}}:null}}const MS=()=>{if(typeof File>"u"){const{process:e}=globalThis,n=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function al(e,n,i){return MS(),new File(e,n??"unknown_file",i)}function kc(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const AS=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Cm=async(e,n)=>({...e,body:await W5(e.body,n)}),o1=new WeakMap;function J5(e){const n=typeof e=="function"?e:e.fetch,i=o1.get(n);if(i)return i;const a=(async()=>{try{const o="Response"in n?n.Response:(await n("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return o1.set(n,a),a}const W5=async(e,n)=>{if(!await J5(n))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const i=new FormData;return await Promise.all(Object.entries(e||{}).map(([a,o])=>Vp(i,a,o))),i},ez=e=>e instanceof Blob&&"name"in e,Vp=async(e,n,i)=>{if(i!==void 0){if(i==null)throw new TypeError(`Received null for "${n}"; to pass null in FormData, you must use the string 'null'`);if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")e.append(n,String(i));else if(i instanceof Response){let a={};const o=i.headers.get("Content-Type");o&&(a={type:o}),e.append(n,al([await i.blob()],kc(i),a))}else if(AS(i))e.append(n,al([await new Response(kS(i)).blob()],kc(i)));else if(ez(i))e.append(n,al([i],kc(i),{type:i.type}));else if(Array.isArray(i))await Promise.all(i.map(a=>Vp(e,n+"[]",a)));else if(typeof i=="object")await Promise.all(Object.entries(i).map(([a,o])=>Vp(e,`${n}[${a}]`,o)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${i} instead`)}},zS=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",tz=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&zS(e),nz=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function iz(e,n,i){if(MS(),e=await e,n||(n=kc(e)),tz(e))return e instanceof File&&n==null&&i==null?e:al([await e.arrayBuffer()],n??e.name,{type:e.type,lastModified:e.lastModified,...i});if(nz(e)){const o=await e.blob();return n||(n=new URL(e.url).pathname.split(/[\\/]/).pop()),al(await Pp(o),n,i)}const a=await Pp(e);if(!i?.type){const o=a.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(i={...i,type:o})}return al(a,n,i)}async function Pp(e){let n=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)n.push(e);else if(zS(e))n.push(e instanceof Blob?e:await e.arrayBuffer());else if(AS(e))for await(const i of e)n.push(...await Pp(i));else{const i=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${i?`; constructor: ${i}`:""}${rz(e)}`)}return n}function rz(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(i=>`"${i}"`).join(", ")}]`}class Fn{constructor(n){this._client=n}}const DS=Symbol.for("brand.privateNullableHeaders");function*az(e){if(!e)return;if(DS in e){const{values:a,nulls:o}=e;yield*a.entries();for(const s of o)yield[s,null];return}let n=!1,i;e instanceof Headers?i=e.entries():Jb(e)?i=e:(n=!0,i=Object.entries(e??{}));for(let a of i){const o=a[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");const s=Jb(a[1])?a[1]:[a[1]];let u=!1;for(const f of s)f!==void 0&&(n&&!u&&(u=!0,yield[o,null]),yield[o,f])}}const Ve=e=>{const n=new Headers,i=new Set;for(const a of e){const o=new Set;for(const[s,u]of az(a)){const f=s.toLowerCase();o.has(f)||(n.delete(s),o.add(f)),u===null?(n.delete(s),i.add(f)):(n.append(s,u),i.delete(f))}}return{[DS]:!0,values:n,nulls:i}};function jS(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const s1=Object.freeze(Object.create(null)),lz=(e=jS)=>function(i,...a){if(i.length===1)return i[0];let o=!1;const s=[],u=i.reduce((g,m,x)=>{/[?#]/.test(m)&&(o=!0);const b=a[x];let w=(o?encodeURIComponent:e)(""+b);return x!==a.length&&(b==null||typeof b=="object"&&b.toString===Object.getPrototypeOf(Object.getPrototypeOf(b.hasOwnProperty??s1)??s1)?.toString)&&(w=b+"",s.push({start:g.length+m.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(b).slice(8,-1)} is not a valid path parameter`})),g+m+(x===a.length?"":w)},""),f=u.split(/[?#]/,1)[0],h=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let d;for(;(d=h.exec(f))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((g,m)=>g.start-m.start),s.length>0){let g=0;const m=s.reduce((x,b)=>{const w=" ".repeat(b.start-g),E="^".repeat(b.length);return g=b.start+b.length,x+w+E},"");throw new Me(`Path parameters result in path with invalid segments:
20
- ${s.map(x=>x.error).join(`
21
- `)}
22
- ${u}
23
- ${m}`)}return u},Ot=lz(jS);class RS extends Fn{list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/files",ms,{query:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])})}delete(n,i={},a){const{betas:o}=i??{};return this._client.delete(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},a?.headers])})}download(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/files/${n}/content`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},a?.headers]),__binaryResponse:!0})}retrieveMetadata(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/files/${n}`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},a?.headers])})}upload(n,i){const{betas:a,...o}=n;return this._client.post("/v1/files",Cm({body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])},this._client))}}let OS=class extends Fn{retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/models/${n}?beta=true`,{...a,headers:Ve([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/models?beta=true",ms,{query:o,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}};const LS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function u1(e,n,i){return!n||!("parse"in(n.output_format??{}))?{...e,content:e.content.map(a=>{if(a.type==="text"){const o=Object.defineProperty({...a},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return a}),parsed_output:null}:HS(e,n,i)}function HS(e,n,i){let a=null;const o=e.content.map(s=>{if(s.type==="text"){const u=oz(n,s.text);a===null&&(a=u);const f=Object.defineProperty({...s},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return i.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return s});return{...e,content:o,parsed_output:a}}function oz(e,n){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(n):JSON.parse(n)}catch(i){throw new Me(`Failed to parse structured output: ${i}`)}}const sz=e=>{let n=0,i=[];for(;n<e.length;){let a=e[n];if(a==="\\"){n++;continue}if(a==="{"){i.push({type:"brace",value:"{"}),n++;continue}if(a==="}"){i.push({type:"brace",value:"}"}),n++;continue}if(a==="["){i.push({type:"paren",value:"["}),n++;continue}if(a==="]"){i.push({type:"paren",value:"]"}),n++;continue}if(a===":"){i.push({type:"separator",value:":"}),n++;continue}if(a===","){i.push({type:"delimiter",value:","}),n++;continue}if(a==='"'){let f="",h=!1;for(a=e[++n];a!=='"';){if(n===e.length){h=!0;break}if(a==="\\"){if(n++,n===e.length){h=!0;break}f+=a+e[n],a=e[++n]}else f+=a,a=e[++n]}a=e[++n],h||i.push({type:"string",value:f});continue}if(a&&/\s/.test(a)){n++;continue}let s=/[0-9]/;if(a&&s.test(a)||a==="-"||a==="."){let f="";for(a==="-"&&(f+=a,a=e[++n]);a&&s.test(a)||a===".";)f+=a,a=e[++n];i.push({type:"number",value:f});continue}let u=/[a-z]/i;if(a&&u.test(a)){let f="";for(;a&&u.test(a)&&n!==e.length;)f+=a,a=e[++n];if(f=="true"||f=="false"||f==="null")i.push({type:"name",value:f});else{n++;continue}continue}n++}return i},Ka=e=>{if(e.length===0)return e;let n=e[e.length-1];switch(n.type){case"separator":return e=e.slice(0,e.length-1),Ka(e);case"number":let i=n.value[n.value.length-1];if(i==="."||i==="-")return e=e.slice(0,e.length-1),Ka(e);case"string":let a=e[e.length-2];if(a?.type==="delimiter")return e=e.slice(0,e.length-1),Ka(e);if(a?.type==="brace"&&a.value==="{")return e=e.slice(0,e.length-1),Ka(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ka(e)}return e},uz=e=>{let n=[];return e.map(i=>{i.type==="brace"&&(i.value==="{"?n.push("}"):n.splice(n.lastIndexOf("}"),1)),i.type==="paren"&&(i.value==="["?n.push("]"):n.splice(n.lastIndexOf("]"),1))}),n.length>0&&n.reverse().map(i=>{i==="}"?e.push({type:"brace",value:"}"}):i==="]"&&e.push({type:"paren",value:"]"})}),e},cz=e=>{let n="";return e.map(i=>{i.type==="string"?n+='"'+i.value+'"':n+=i.value}),n},BS=e=>JSON.parse(cz(uz(Ka(sz(e)))));var zn,yr,Xa,vo,tc,wo,So,nc,_o,zi,ko,ic,rc,Pr,ac,lc,Eo,Qh,c1,oc,Kh,Jh,Wh,f1;const d1="__json_buf";function h1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class Ic{constructor(n,i){zn.add(this),this.messages=[],this.receivedMessages=[],yr.set(this,void 0),Xa.set(this,null),this.controller=new AbortController,vo.set(this,void 0),tc.set(this,()=>{}),wo.set(this,()=>{}),So.set(this,void 0),nc.set(this,()=>{}),_o.set(this,()=>{}),zi.set(this,{}),ko.set(this,!1),ic.set(this,!1),rc.set(this,!1),Pr.set(this,!1),ac.set(this,void 0),lc.set(this,void 0),Eo.set(this,void 0),oc.set(this,a=>{if(ge(this,ic,!0),is(a)&&(a=new Pn),a instanceof Pn)return ge(this,rc,!0),this._emit("abort",a);if(a instanceof Me)return this._emit("error",a);if(a instanceof Error){const o=new Me(a.message);return o.cause=a,this._emit("error",o)}return this._emit("error",new Me(String(a)))}),ge(this,vo,new Promise((a,o)=>{ge(this,tc,a,"f"),ge(this,wo,o,"f")})),ge(this,So,new Promise((a,o)=>{ge(this,nc,a,"f"),ge(this,_o,o,"f")})),ne(this,vo,"f").catch(()=>{}),ne(this,So,"f").catch(()=>{}),ge(this,Xa,n),ge(this,Eo,i?.logger??console)}get response(){return ne(this,ac,"f")}get request_id(){return ne(this,lc,"f")}async withResponse(){ge(this,Pr,!0);const n=await ne(this,vo,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new Ic(null);return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a,{logger:o}={}){const s=new Ic(i,{logger:o});for(const u of i.messages)s._addMessageParam(u);return ge(s,Xa,{...i,stream:!0}),s._run(()=>s._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,oc,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const o=a?.signal;let s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ne(this,zn,"m",Kh).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,zn,"m",Jh).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",Wh).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(ge(this,ac,n),ge(this,lc,n?.headers.get("request-id")),ne(this,tc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,ko,"f")}get errored(){return ne(this,ic,"f")}get aborted(){return ne(this,rc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,zi,"f")[n];if(!a)return this;const o=a.findIndex(s=>s.listener===i);return o>=0&&a.splice(o,1),this}once(n,i){return(ne(this,zi,"f")[n]||(ne(this,zi,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Pr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Pr,!0),await ne(this,So,"f")}get currentMessage(){return ne(this,yr,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",Qh).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",c1).call(this)}_emit(n,...i){if(ne(this,ko,"f"))return;n==="end"&&(ge(this,ko,!0),ne(this,nc,"f").call(this));const a=ne(this,zi,"f")[n];if(a&&(ne(this,zi,"f")[n]=a.filter(o=>!o.once),a.forEach(({listener:o})=>o(...i))),n==="abort"){const o=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(o),ne(this,wo,"f").call(this,o),ne(this,_o,"f").call(this,o),this._emit("end");return}if(n==="error"){const o=i[0];!ne(this,Pr,"f")&&!a?.length&&Promise.reject(o),ne(this,wo,"f").call(this,o),ne(this,_o,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",Qh).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let o;a&&(a.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),a.addEventListener("abort",o));try{ne(this,zn,"m",Kh).call(this),this._connected(null);const s=ni.fromReadableStream(n,this.controller);for await(const u of s)ne(this,zn,"m",Jh).call(this,u);if(s.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",Wh).call(this)}finally{a&&o&&a.removeEventListener("abort",o)}}[(yr=new WeakMap,Xa=new WeakMap,vo=new WeakMap,tc=new WeakMap,wo=new WeakMap,So=new WeakMap,nc=new WeakMap,_o=new WeakMap,zi=new WeakMap,ko=new WeakMap,ic=new WeakMap,rc=new WeakMap,Pr=new WeakMap,ac=new WeakMap,lc=new WeakMap,Eo=new WeakMap,oc=new WeakMap,zn=new WeakSet,Qh=function(){if(this.receivedMessages.length===0)throw new Me("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},c1=function(){if(this.receivedMessages.length===0)throw new Me("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Me("stream ended without producing a content block with type=text");return i.join(" ")},Kh=function(){this.ended||ge(this,yr,void 0)},Jh=function(i){if(this.ended)return;const a=ne(this,zn,"m",f1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const o=a.content.at(-1);switch(i.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",i.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",i.delta.citation,o.citations??[]);break}case"input_json_delta":{h1(o)&&o.input&&this._emit("inputJson",i.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",i.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(u1(a,ne(this,Xa,"f"),{logger:ne(this,Eo,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,yr,a);break}}},Wh=function(){if(this.ended)throw new Me("stream has ended, this shouldn't happen");const i=ne(this,yr,"f");if(!i)throw new Me("request ended without sending any chunks");return ge(this,yr,void 0),u1(i,ne(this,Xa,"f"),{logger:ne(this,Eo,"f")})},f1=function(i){let a=ne(this,yr,"f");if(i.type==="message_start"){if(a)throw new Me(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Me(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.container=i.delta.container,a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,a.context_management=i.context_management,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push(i.content_block),a;case"content_block_delta":{const o=a.content.at(i.index);switch(i.delta.type){case"text_delta":{o?.type==="text"&&(a.content[i.index]={...o,text:(o.text||"")+i.delta.text});break}case"citations_delta":{o?.type==="text"&&(a.content[i.index]={...o,citations:[...o.citations??[],i.delta.citation]});break}case"input_json_delta":{if(o&&h1(o)){let s=o[d1]||"";s+=i.delta.partial_json;const u={...o};if(Object.defineProperty(u,d1,{value:s,enumerable:!1,writable:!0}),s)try{u.input=BS(s)}catch(f){const h=new Me(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${s}`);ne(this,oc,"f").call(this,h)}a.content[i.index]=u}break}case"thinking_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,thinking:o.thinking+i.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",o=>{const s=i.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{a=!0;for(const o of i)o.resolve(void 0);i.length=0}),this.on("abort",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),this.on("error",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((s,u)=>i.push({resolve:s,reject:u})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const fz=1e5,dz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
24
- 1. Task Overview
25
- The user's core request and success criteria
26
- Any clarifications or constraints they specified
27
- 2. Current State
28
- What has been completed so far
29
- Files created, modified, or analyzed (with paths if relevant)
30
- Key outputs or artifacts produced
31
- 3. Important Discoveries
32
- Technical constraints or requirements uncovered
33
- Decisions made and their rationale
34
- Errors encountered and how they were resolved
35
- What approaches were tried that didn't work (and why)
36
- 4. Next Steps
37
- Specific actions needed to complete the task
38
- Any blockers or open questions to resolve
39
- Priority order if multiple steps remain
40
- 5. Context to Preserve
41
- User preferences or style requirements
42
- Domain-specific details that aren't obvious
43
- Any promises made to the user
44
- Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
45
- Wrap your summary in <summary></summary> tags.`;var No,Fa,Yr,Tt,Co,gn,ji,xr,To,p1,Yp;function m1(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}class US{constructor(n,i,a){No.add(this),this.client=n,Fa.set(this,!1),Yr.set(this,!1),Tt.set(this,void 0),Co.set(this,void 0),gn.set(this,void 0),ji.set(this,void 0),xr.set(this,void 0),To.set(this,0),ge(this,Tt,{params:{...i,messages:structuredClone(i.messages)}}),ge(this,Co,{...a,headers:Ve([{"x-stainless-helper":"BetaToolRunner"},a?.headers])}),ge(this,xr,m1())}async*[(Fa=new WeakMap,Yr=new WeakMap,Tt=new WeakMap,Co=new WeakMap,gn=new WeakMap,ji=new WeakMap,xr=new WeakMap,To=new WeakMap,No=new WeakSet,p1=async function(){const i=ne(this,Tt,"f").params.compactionControl;if(!i||!i.enabled)return!1;let a=0;if(ne(this,gn,"f")!==void 0)try{const d=await ne(this,gn,"f");a=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}const o=i.contextTokenThreshold??fz;if(a<o)return!1;const s=i.model??ne(this,Tt,"f").params.model,u=i.summaryPrompt??dz,f=ne(this,Tt,"f").params.messages;if(f[f.length-1].role==="assistant"){const d=f[f.length-1];if(Array.isArray(d.content)){const g=d.content.filter(m=>m.type!=="tool_use");g.length===0?f.pop():d.content=g}}const h=await this.client.beta.messages.create({model:s,messages:[...f,{role:"user",content:[{type:"text",text:u}]}],max_tokens:ne(this,Tt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(h.content[0]?.type!=="text")throw new Me("Expected text response for compaction");return ne(this,Tt,"f").params.messages=[{role:"user",content:h.content}],!0},Symbol.asyncIterator)](){var n;if(ne(this,Fa,"f"))throw new Me("Cannot iterate over a consumed stream");ge(this,Fa,!0),ge(this,Yr,!0),ge(this,ji,void 0);try{for(;;){let i;try{if(ne(this,Tt,"f").params.max_iterations&&ne(this,To,"f")>=ne(this,Tt,"f").params.max_iterations)break;ge(this,Yr,!1,"f"),ge(this,ji,void 0,"f"),ge(this,To,(n=ne(this,To,"f"),n++,n),"f"),ge(this,gn,void 0,"f");const{max_iterations:a,compactionControl:o,...s}=ne(this,Tt,"f").params;if(s.stream?(i=this.client.beta.messages.stream({...s},ne(this,Co,"f")),ge(this,gn,i.finalMessage(),"f"),ne(this,gn,"f").catch(()=>{}),yield i):(ge(this,gn,this.client.beta.messages.create({...s,stream:!1},ne(this,Co,"f")),"f"),yield ne(this,gn,"f")),!await ne(this,No,"m",p1).call(this)){if(!ne(this,Yr,"f")){const{role:h,content:d}=await ne(this,gn,"f");ne(this,Tt,"f").params.messages.push({role:h,content:d})}const f=await ne(this,No,"m",Yp).call(this,ne(this,Tt,"f").params.messages.at(-1));if(f)ne(this,Tt,"f").params.messages.push(f);else if(!ne(this,Yr,"f"))break}}finally{i&&i.abort()}}if(!ne(this,gn,"f"))throw new Me("ToolRunner concluded without a message from the server");ne(this,xr,"f").resolve(await ne(this,gn,"f"))}catch(i){throw ge(this,Fa,!1),ne(this,xr,"f").promise.catch(()=>{}),ne(this,xr,"f").reject(i),ge(this,xr,m1()),i}}setMessagesParams(n){typeof n=="function"?ne(this,Tt,"f").params=n(ne(this,Tt,"f").params):ne(this,Tt,"f").params=n,ge(this,Yr,!0),ge(this,ji,void 0)}async generateToolResponse(){const n=await ne(this,gn,"f")??this.params.messages.at(-1);return n?ne(this,No,"m",Yp).call(this,n):null}done(){return ne(this,xr,"f").promise}async runUntilDone(){if(!ne(this,Fa,"f"))for await(const n of this);return this.done()}get params(){return ne(this,Tt,"f").params}pushMessages(...n){this.setMessagesParams(i=>({...i,messages:[...i.messages,...n]}))}then(n,i){return this.runUntilDone().then(n,i)}}Yp=async function(n){return ne(this,ji,"f")!==void 0?ne(this,ji,"f"):(ge(this,ji,hz(ne(this,Tt,"f").params,n)),ne(this,ji,"f"))};async function hz(e,n=e.messages.at(-1)){if(!n||n.role!=="assistant"||!n.content||typeof n.content=="string")return null;const i=n.content.filter(o=>o.type==="tool_use");return i.length===0?null:{role:"user",content:await Promise.all(i.map(async o=>{const s=e.tools.find(u=>("name"in u?u.name:u.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let u=o.input;"parse"in s&&s.parse&&(u=s.parse(u));const f=await s.run(u);return{type:"tool_result",tool_use_id:o.id,content:f}}catch(u){return{type:"tool_result",tool_use_id:o.id,content:`Error: ${u instanceof Error?u.message:String(u)}`,is_error:!0}}}))}}class df{constructor(n,i){this.iterator=n,this.controller=i}async*decoder(){const n=new ps;for await(const i of this.iterator)for(const a of n.decode(i))yield JSON.parse(a);for(const i of n.flush())yield JSON.parse(i)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(n,i){if(!n.body)throw i.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Me("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Me("Attempted to iterate over a response with no body");return new df(Em(n.body),i)}}let IS=class extends Fn{create(n,i){const{betas:a,...o}=n;return this._client.post("/v1/messages/batches?beta=true",{body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},i?.headers])})}retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/messages/batches/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/messages/batches?beta=true",ms,{query:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},i?.headers])})}delete(n,i={},a){const{betas:o}=i??{};return this._client.delete(Ot`/v1/messages/batches/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},a?.headers])})}cancel(n,i={},a){const{betas:o}=i??{};return this._client.post(Ot`/v1/messages/batches/${n}/cancel?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},a?.headers])})}async results(n,i={},a){const o=await this.retrieve(n);if(!o.results_url)throw new Me(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);const{betas:s}=i??{};return this._client.get(o.results_url,{...a,headers:Ve([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},a?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((u,f)=>df.fromResponse(f.response,f.controller))}};const g1={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};let hf=class extends Fn{constructor(){super(...arguments),this.batches=new IS(this._client)}create(n,i){const{betas:a,...o}=n;o.model in g1&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${g1[o.model]}
46
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let s=this._client._options.timeout;if(!o.stream&&s==null){const u=LS[o.model]??void 0;s=this._client.calculateNonstreamingTimeout(o.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:o,timeout:s??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}parse(n,i){return i={...i,headers:Ve([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-11-13"].toString()},i?.headers])},this.create(n,i).then(a=>HS(a,n,{logger:this._client.logger??console}))}stream(n,i){return Ic.createMessage(this,n,i)}countTokens(n,i){const{betas:a,...o}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"token-counting-2024-11-01"].toString()},i?.headers])})}toolRunner(n,i){return new US(this._client,n,i)}};hf.Batches=IS;hf.BetaToolRunner=US;class qS extends Fn{create(n,i={},a){const{betas:o,...s}=i??{};return this._client.post(Ot`/v1/skills/${n}/versions?beta=true`,Cm({body:s,...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])},this._client))}retrieve(n,i,a){const{skill_id:o,betas:s}=i;return this._client.get(Ot`/v1/skills/${o}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n,i={},a){const{betas:o,...s}=i??{};return this._client.getAPIList(Ot`/v1/skills/${n}/versions?beta=true`,TS,{query:s,...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}delete(n,i,a){const{skill_id:o,betas:s}=i;return this._client.delete(Ot`/v1/skills/${o}/versions/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},a?.headers])})}}class Tm extends Fn{constructor(){super(...arguments),this.versions=new qS(this._client)}create(n={},i){const{betas:a,...o}=n??{};return this._client.post("/v1/skills?beta=true",Cm({body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])},this._client))}retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/skills?beta=true",TS,{query:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},i?.headers])})}delete(n,i={},a){const{betas:o}=i??{};return this._client.delete(Ot`/v1/skills/${n}?beta=true`,{...a,headers:Ve([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},a?.headers])})}}Tm.Versions=qS;class yl extends Fn{constructor(){super(...arguments),this.models=new OS(this._client),this.messages=new hf(this._client),this.files=new RS(this._client),this.skills=new Tm(this._client)}}yl.Models=OS;yl.Messages=hf;yl.Files=RS;yl.Skills=Tm;class $S extends Fn{create(n,i){const{betas:a,...o}=n;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers]),stream:n.stream??!1})}}var Dn,br,Mo,sc,Ao,zo,uc,Do,Di,jo,cc,fc,Xr,dc,hc,ep,y1,tp,np,ip,rp,x1;const b1="__json_buf";function v1(e){return e.type==="tool_use"||e.type==="server_tool_use"}class qc{constructor(){Dn.add(this),this.messages=[],this.receivedMessages=[],br.set(this,void 0),this.controller=new AbortController,Mo.set(this,void 0),sc.set(this,()=>{}),Ao.set(this,()=>{}),zo.set(this,void 0),uc.set(this,()=>{}),Do.set(this,()=>{}),Di.set(this,{}),jo.set(this,!1),cc.set(this,!1),fc.set(this,!1),Xr.set(this,!1),dc.set(this,void 0),hc.set(this,void 0),tp.set(this,n=>{if(ge(this,cc,!0),is(n)&&(n=new Pn),n instanceof Pn)return ge(this,fc,!0),this._emit("abort",n);if(n instanceof Me)return this._emit("error",n);if(n instanceof Error){const i=new Me(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Me(String(n)))}),ge(this,Mo,new Promise((n,i)=>{ge(this,sc,n,"f"),ge(this,Ao,i,"f")})),ge(this,zo,new Promise((n,i)=>{ge(this,uc,n,"f"),ge(this,Do,i,"f")})),ne(this,Mo,"f").catch(()=>{}),ne(this,zo,"f").catch(()=>{})}get response(){return ne(this,dc,"f")}get request_id(){return ne(this,hc,"f")}async withResponse(){ge(this,Xr,!0);const n=await ne(this,Mo,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id")}}static fromReadableStream(n){const i=new qc;return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a){const o=new qc;for(const s of i.messages)o._addMessageParam(s);return o._run(()=>o._createMessage(n,{...i,stream:!0},{...a,headers:{...a?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},ne(this,tp,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,i=!0){this.receivedMessages.push(n),i&&this._emit("message",n)}async _createMessage(n,i,a){const o=a?.signal;let s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ne(this,Dn,"m",np).call(this);const{response:u,data:f}=await n.create({...i,stream:!0},{...a,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,Dn,"m",ip).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,Dn,"m",rp).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(ge(this,dc,n),ge(this,hc,n?.headers.get("request-id")),ne(this,sc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,jo,"f")}get errored(){return ne(this,cc,"f")}get aborted(){return ne(this,fc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,Di,"f")[n]||(ne(this,Di,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,Di,"f")[n];if(!a)return this;const o=a.findIndex(s=>s.listener===i);return o>=0&&a.splice(o,1),this}once(n,i){return(ne(this,Di,"f")[n]||(ne(this,Di,"f")[n]=[])).push({listener:i,once:!0}),this}emitted(n){return new Promise((i,a)=>{ge(this,Xr,!0),n!=="error"&&this.once("error",a),this.once(n,i)})}async done(){ge(this,Xr,!0),await ne(this,zo,"f")}get currentMessage(){return ne(this,br,"f")}async finalMessage(){return await this.done(),ne(this,Dn,"m",ep).call(this)}async finalText(){return await this.done(),ne(this,Dn,"m",y1).call(this)}_emit(n,...i){if(ne(this,jo,"f"))return;n==="end"&&(ge(this,jo,!0),ne(this,uc,"f").call(this));const a=ne(this,Di,"f")[n];if(a&&(ne(this,Di,"f")[n]=a.filter(o=>!o.once),a.forEach(({listener:o})=>o(...i))),n==="abort"){const o=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(o),ne(this,Ao,"f").call(this,o),ne(this,Do,"f").call(this,o),this._emit("end");return}if(n==="error"){const o=i[0];!ne(this,Xr,"f")&&!a?.length&&Promise.reject(o),ne(this,Ao,"f").call(this,o),ne(this,Do,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,Dn,"m",ep).call(this))}async _fromReadableStream(n,i){const a=i?.signal;let o;a&&(a.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),a.addEventListener("abort",o));try{ne(this,Dn,"m",np).call(this),this._connected(null);const s=ni.fromReadableStream(n,this.controller);for await(const u of s)ne(this,Dn,"m",ip).call(this,u);if(s.controller.signal?.aborted)throw new Pn;ne(this,Dn,"m",rp).call(this)}finally{a&&o&&a.removeEventListener("abort",o)}}[(br=new WeakMap,Mo=new WeakMap,sc=new WeakMap,Ao=new WeakMap,zo=new WeakMap,uc=new WeakMap,Do=new WeakMap,Di=new WeakMap,jo=new WeakMap,cc=new WeakMap,fc=new WeakMap,Xr=new WeakMap,dc=new WeakMap,hc=new WeakMap,tp=new WeakMap,Dn=new WeakSet,ep=function(){if(this.receivedMessages.length===0)throw new Me("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},y1=function(){if(this.receivedMessages.length===0)throw new Me("stream ended without producing a Message with role=assistant");const i=this.receivedMessages.at(-1).content.filter(a=>a.type==="text").map(a=>a.text);if(i.length===0)throw new Me("stream ended without producing a content block with type=text");return i.join(" ")},np=function(){this.ended||ge(this,br,void 0)},ip=function(i){if(this.ended)return;const a=ne(this,Dn,"m",x1).call(this,i);switch(this._emit("streamEvent",i,a),i.type){case"content_block_delta":{const o=a.content.at(-1);switch(i.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",i.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",i.delta.citation,o.citations??[]);break}case"input_json_delta":{v1(o)&&o.input&&this._emit("inputJson",i.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",i.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:i.delta}break}case"message_stop":{this._addMessageParam(a),this._addMessage(a,!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,br,a);break}}},rp=function(){if(this.ended)throw new Me("stream has ended, this shouldn't happen");const i=ne(this,br,"f");if(!i)throw new Me("request ended without sending any chunks");return ge(this,br,void 0),i},x1=function(i){let a=ne(this,br,"f");if(i.type==="message_start"){if(a)throw new Me(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Me(`Unexpected event order, got ${i.type} before "message_start"`);switch(i.type){case"message_stop":return a;case"message_delta":return a.stop_reason=i.delta.stop_reason,a.stop_sequence=i.delta.stop_sequence,a.usage.output_tokens=i.usage.output_tokens,i.usage.input_tokens!=null&&(a.usage.input_tokens=i.usage.input_tokens),i.usage.cache_creation_input_tokens!=null&&(a.usage.cache_creation_input_tokens=i.usage.cache_creation_input_tokens),i.usage.cache_read_input_tokens!=null&&(a.usage.cache_read_input_tokens=i.usage.cache_read_input_tokens),i.usage.server_tool_use!=null&&(a.usage.server_tool_use=i.usage.server_tool_use),a;case"content_block_start":return a.content.push({...i.content_block}),a;case"content_block_delta":{const o=a.content.at(i.index);switch(i.delta.type){case"text_delta":{o?.type==="text"&&(a.content[i.index]={...o,text:(o.text||"")+i.delta.text});break}case"citations_delta":{o?.type==="text"&&(a.content[i.index]={...o,citations:[...o.citations??[],i.delta.citation]});break}case"input_json_delta":{if(o&&v1(o)){let s=o[b1]||"";s+=i.delta.partial_json;const u={...o};Object.defineProperty(u,b1,{value:s,enumerable:!1,writable:!0}),s&&(u.input=BS(s)),a.content[i.index]=u}break}case"thinking_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,thinking:o.thinking+i.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(a.content[i.index]={...o,signature:i.delta.signature});break}default:i.delta}return a}case"content_block_stop":return a}},Symbol.asyncIterator)](){const n=[],i=[];let a=!1;return this.on("streamEvent",o=>{const s=i.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{a=!0;for(const o of i)o.resolve(void 0);i.length=0}),this.on("abort",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),this.on("error",o=>{a=!0;for(const s of i)s.reject(o);i.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:a?{value:void 0,done:!0}:new Promise((s,u)=>i.push({resolve:s,reject:u})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ni(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class VS extends Fn{create(n,i){return this._client.post("/v1/messages/batches",{body:n,...i})}retrieve(n,i){return this._client.get(Ot`/v1/messages/batches/${n}`,i)}list(n={},i){return this._client.getAPIList("/v1/messages/batches",ms,{query:n,...i})}delete(n,i){return this._client.delete(Ot`/v1/messages/batches/${n}`,i)}cancel(n,i){return this._client.post(Ot`/v1/messages/batches/${n}/cancel`,i)}async results(n,i){const a=await this.retrieve(n);if(!a.results_url)throw new Me(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);return this._client.get(a.results_url,{...i,headers:Ve([{Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>df.fromResponse(s.response,s.controller))}}class Mm extends Fn{constructor(){super(...arguments),this.batches=new VS(this._client)}create(n,i){n.model in w1&&console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${w1[n.model]}
47
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!n.stream&&a==null){const o=LS[n.model]??void 0;a=this._client.calculateNonstreamingTimeout(n.max_tokens,o)}return this._client.post("/v1/messages",{body:n,timeout:a??6e5,...i,stream:n.stream??!1})}stream(n,i){return qc.createMessage(this,n,i)}countTokens(n,i){return this._client.post("/v1/messages/count_tokens",{body:n,...i})}}const w1={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};Mm.Batches=VS;class PS extends Fn{retrieve(n,i={},a){const{betas:o}=i??{};return this._client.get(Ot`/v1/models/${n}`,{...a,headers:Ve([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},a?.headers])})}list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/models",ms,{query:o,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}var pz={};const pc=e=>{if(typeof globalThis.process<"u")return pz?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var Xp,Am,Ec,YS;const mz="\\n\\nHuman:",gz="\\n\\nAssistant:";class kt{constructor({baseURL:n=pc("ANTHROPIC_BASE_URL"),apiKey:i=pc("ANTHROPIC_API_KEY")??null,authToken:a=pc("ANTHROPIC_AUTH_TOKEN")??null,...o}={}){Xp.add(this),Ec.set(this,void 0);const s={apiKey:i,authToken:a,...o,baseURL:n||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&O5())throw new Me(`It looks like you're running in a browser-like environment.
48
-
49
- This is disabled by default, as it risks exposing your secret API credentials to attackers.
50
- If you understand the risks and have appropriate mitigations in place,
51
- you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
52
-
53
- new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
54
- `);this.baseURL=s.baseURL,this.timeout=s.timeout??Am.DEFAULT_TIMEOUT,this.logger=s.logger??console;const u="warn";this.logLevel=u,this.logLevel=a1(s.logLevel,"ClientOptions.logLevel",this)??a1(pc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??I5(),ge(this,Ec,$5),this._options=s,this.apiKey=typeof i=="string"?i:null,this.authToken=a}withOptions(n){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...n})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:i}){if(!(n.get("x-api-key")||n.get("authorization"))&&!(this.apiKey&&n.get("x-api-key"))&&!i.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!i.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(n){return Ve([await this.apiKeyAuth(n),await this.bearerAuth(n)])}async apiKeyAuth(n){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return Object.entries(n).filter(([i,a])=>typeof a<"u").map(([i,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(i)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(i)}=`;throw new Me(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${Qa}`}defaultIdempotencyKey(){return`stainless-node-retry-${dS()}`}makeStatusError(n,i,a,o){return qt.generate(n,i,a,o)}buildURL(n,i,a){const o=!ne(this,Xp,"m",YS).call(this)&&a||this.baseURL,s=A5(n)?new URL(n):new URL(o+(o.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery();return z5(u)||(i={...u,...i}),typeof i=="object"&&i&&!Array.isArray(i)&&(s.search=this.stringifyQuery(i)),s.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Me("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:i,options:a}){}get(n,i){return this.methodRequest("get",n,i)}post(n,i){return this.methodRequest("post",n,i)}patch(n,i){return this.methodRequest("patch",n,i)}put(n,i){return this.methodRequest("put",n,i)}delete(n,i){return this.methodRequest("delete",n,i)}methodRequest(n,i,a){return this.request(Promise.resolve(a).then(o=>({method:n,path:i,...o})))}request(n,i=null){return new ff(this,this.makeRequest(n,i,void 0))}async makeRequest(n,i,a){const o=await n,s=o.maxRetries??this.maxRetries;i==null&&(i=s),await this.prepareOptions(o);const{req:u,url:f,timeout:h}=await this.buildRequest(o,{retryCount:s-i});await this.prepareRequest(u,{url:f,options:o});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=a===void 0?"":`, retryOf: ${a}`,m=Date.now();if(Yt(this).debug(`[${d}] sending request`,Zr({retryOfRequestLogID:a,method:o.method,url:f,options:o,headers:u.headers})),o.signal?.aborted)throw new Pn;const x=new AbortController,b=await this.fetchWithTimeout(f,u,h,x).catch(Ip),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${i} attempts remaining`;if(o.signal?.aborted)throw new Pn;const j=is(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(i)return Yt(this).info(`[${d}] connection ${j?"timed out":"failed"} - ${_}`),Yt(this).debug(`[${d}] connection ${j?"timed out":"failed"} (${_})`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),this.retryRequest(o,i,a??d);throw Yt(this).info(`[${d}] connection ${j?"timed out":"failed"} - error; no more retries left`),Yt(this).debug(`[${d}] connection ${j?"timed out":"failed"} (error; no more retries left)`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),j?new hS:new cf({cause:b})}const E=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,j])=>", "+_+": "+JSON.stringify(j)).join(""),N=`[${d}${g}${E}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const _=await this.shouldRetry(b);if(i&&_){const H=`retrying, ${i} attempts remaining`;return await q5(b.body),Yt(this).info(`${N} - ${H}`),Yt(this).debug(`[${d}] response error (${H})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(o,i,a??d,b.headers)}const j=_?"error; no more retries left":"error; not retryable";Yt(this).info(`${N} - ${j}`);const k=await b.text().catch(H=>Ip(H).message),C=SS(k),L=C?void 0:k;throw Yt(this).debug(`[${d}] response error (${j})`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,message:L,durationMs:Date.now()-m})),this.makeStatusError(b.status,C,L,b.headers)}return Yt(this).info(N),Yt(this).debug(`[${d}] response start`,Zr({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:o,controller:x,requestLogID:d,retryOfRequestLogID:a,startTime:m}}getAPIList(n,i,a){return this.requestAPIList(i,{method:"get",path:n,...a})}requestAPIList(n,i){const a=this.makeRequest(i,null,void 0);return new K5(this,a,n)}async fetchWithTimeout(n,i,a,o){const{signal:s,method:u,...f}=i||{};s&&s.addEventListener("abort",()=>o.abort());const h=setTimeout(()=>o.abort(),a),d=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:o.signal,...d?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,n,g)}finally{clearTimeout(h)}}async shouldRetry(n){const i=n.headers.get("x-should-retry");return i==="true"?!0:i==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,i,a,o){let s;const u=o?.get("retry-after-ms");if(u){const h=parseFloat(u);Number.isNaN(h)||(s=h)}const f=o?.get("retry-after");if(f&&!s){const h=parseFloat(f);Number.isNaN(h)?s=Date.parse(f)-Date.now():s=h*1e3}if(!(s&&0<=s&&s<60*1e3)){const h=n.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(i,h)}return await R5(s),this.makeRequest(n,i-1,a)}calculateDefaultRetryTimeoutMillis(n,i){const s=i-n,u=Math.min(.5*Math.pow(2,s),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(n,i){if(36e5*n/128e3>6e5||i!=null&&n>i)throw new Me("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:i=0}={}){const a={...n},{method:o,path:s,query:u,defaultBaseURL:f}=a,h=this.buildURL(s,u,f);"timeout"in a&&j5("timeout",a.timeout),a.timeout=a.timeout??this.timeout;const{bodyHeaders:d,body:g}=this.buildBody({options:a}),m=await this.buildHeaders({options:n,method:o,bodyHeaders:d,retryCount:i});return{req:{method:o,headers:m,...a.signal&&{signal:a.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...a.fetchOptions??{}},url:h,timeout:a.timeout}}async buildHeaders({options:n,method:i,bodyHeaders:a,retryCount:o}){let s={};this.idempotencyHeader&&i!=="get"&&(n.idempotencyKey||(n.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=n.idempotencyKey);const u=Ve([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...n.timeout?{"X-Stainless-Timeout":String(Math.trunc(n.timeout/1e3))}:{},...U5(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,a,n.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:n,headers:i}}){if(!n)return{bodyHeaders:void 0,body:void 0};const a=Ve([i]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&a.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:typeof n=="object"&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")?{bodyHeaders:void 0,body:kS(n)}:ne(this,Ec,"f").call(this,{body:n,headers:a})}}Am=kt,Ec=new WeakMap,Xp=new WeakSet,YS=function(){return this.baseURL!=="https://api.anthropic.com"};kt.Anthropic=Am;kt.HUMAN_PROMPT=mz;kt.AI_PROMPT=gz;kt.DEFAULT_TIMEOUT=6e5;kt.AnthropicError=Me;kt.APIError=qt;kt.APIConnectionError=cf;kt.APIConnectionTimeoutError=hS;kt.APIUserAbortError=Pn;kt.NotFoundError=yS;kt.ConflictError=xS;kt.RateLimitError=vS;kt.BadRequestError=pS;kt.AuthenticationError=mS;kt.InternalServerError=wS;kt.PermissionDeniedError=gS;kt.UnprocessableEntityError=bS;kt.toFile=iz;class gs extends kt{constructor(){super(...arguments),this.completions=new $S(this),this.messages=new Mm(this),this.models=new PS(this),this.beta=new yl(this)}}gs.Completions=$S;gs.Messages=Mm;gs.Models=PS;gs.Beta=yl;let ap=null;function XS(){return ap||(ap=localStorage.getItem("claude_api_key")),ap}async function yz(e,n,i="sonnet"){const a=XS();if(!a)throw new Error("API key not set. Please configure your Claude API key.");const o=new gs({apiKey:a,dangerouslyAllowBrowser:!0}),s={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await o.messages.create({model:s[i],max_tokens:4096,system:e,messages:[{role:"user",content:n}]})).content.find(h=>h.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function xz(){return!!XS()}function bz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,o=new Map;e.forEach(f=>{a.set(f.id,0),o.set(f.id,[])}),n.forEach(f=>{o.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const s=[];a.forEach((f,h)=>{f===0&&s.push(h)});const u=[];for(;s.length>0;){const f=s.shift(),h=i.get(f);h&&u.push(h),o.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&s.push(d)})}return u}function vz(e,n,i){const a=n.filter(s=>s.target===e),o=[];for(const s of a){const u=i.get(s.source);u!==void 0&&o.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return o.join(`
55
-
56
- ---
57
-
58
- `)}async function wz(e,n){const i=e.data;n.onNodeProgress(e.id,50);const a=i.value||i.placeholder||"User input placeholder";return n.onNodeProgress(e.id,100),n.onLog("info",`Input received: ${a.slice(0,50)}...`,e.id),a}async function Sz(e,n,i){const a=e.data;if(!xz())throw new Error("API key not configured. Please set your Claude API key.");i.onNodeProgress(e.id,20),i.onLog("info",`Starting AI agent: ${a.label}`,e.id);const o=a.systemPrompt||`You are an AI assistant. ${a.description||""}`,s=n||"Please help me with the following task.";i.onNodeProgress(e.id,50);try{const u=await yz(o,s,a.model||"sonnet");return i.onNodeProgress(e.id,100),i.onLog("success",`Agent completed: ${u.slice(0,100)}...`,e.id),u}catch(u){throw new Error(`Subagent execution failed: ${u instanceof Error?u.message:"Unknown error"}`)}}async function _z(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Executing skill: ${a.label}`,e.id);const o=`# Skill: ${a.label}
59
-
60
- Category: ${a.category||"general"}
61
- Skill ID: ${a.skillId||"custom-skill"}
62
-
63
- ## Description
64
- ${a.description||"Custom skill"}
65
-
66
- ## Input
67
- ${n}
68
-
69
- ## Output
70
- Skill executed successfully with the provided input.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Skill ${a.label} completed`,e.id),o}async function kz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Connecting to MCP server: ${a.serverName||"unnamed"}`,e.id);const o=`# MCP Server Configuration
71
-
72
- Server: ${a.serverName||"mcp-server"}
73
- Type: ${a.serverType||"stdio"}
74
-
75
- ## Input
76
- ${n}
77
-
78
- ## Configuration
79
- ${JSON.stringify(a.serverConfig||{},null,2)}
80
-
81
- ## Status
82
- MCP server connection simulated. In production, this would connect to the actual server.`;return i.onNodeProgress(e.id,100),i.onLog("success",`MCP server ${a.serverName||"unnamed"} connected`,e.id),o}async function Ez(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Preparing output: ${a.label}`,e.id);const o=`# Workflow Output
83
-
84
- ## Result
85
- ${n}
86
-
87
- ## Output Type
88
- ${a.outputType||"auto"}
89
-
90
- ## Generated at
91
- ${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),o}async function Nz(e,n,i){const a={results:new Map,cancelled:!1},o=bz(e,n);i.onLog("info",`Starting workflow execution with ${o.length} nodes`);for(const s of o){i.onNodeStart(s.id);try{const u=vz(s.id,n,a.results);let f;switch(s.type){case"input":f=await wz(s,i);break;case"subagent":f=await Sz(s,u,i);break;case"skill":f=await _z(s,u,i);break;case"mcp":f=await kz(s,u,i);break;case"output":f=await Ez(s,u,i);break;default:f=u}a.results.set(s.id,f),i.onNodeComplete(s.id,f)}catch(u){const f=u instanceof Error?u.message:"Unknown error";throw i.onNodeError(s.id,f),i.onLog("error",`Node ${s.data.label} failed: ${f}`,s.id),u}}return a.results}function FS(){const{nodes:e,edges:n,workflowName:i,updateNodeStatus:a}=Hi(),{isRunning:o,startExecution:s,stopExecution:u,setCurrentNode:f,markNodeCompleted:h,markNodeFailed:d,setWorkflowResults:g,addLog:m,clearLogs:x}=uf(),[b,w]=K.useState([]),E=K.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),s(),w([]),m("info",`워크플로우 "${i}" 실행 시작...`);try{const j=await Nz(e,n,{onNodeStart:L=>{a(L,"running",0),f(L)},onNodeProgress:(L,A)=>{a(L,"running",A)},onNodeComplete:(L,A)=>{a(L,"completed",100),h(L,A)},onNodeError:(L,A)=>{a(L,"error",0),d(L,A)},onLog:(L,A,H)=>{m(L,A,H)}}),k=[],C=[];for(const[L,A]of j){const H=e.find(G=>G.id===L),F=typeof A=="string"?A:JSON.stringify(A,null,2);if(k.push({nodeId:L,label:H?.data.label||L,success:!0,result:F}),H?.type==="output"){const G=`${i.replace(/\s+/g,"_")}_${H.data.label.replace(/\s+/g,"_")}.md`;C.push({name:G,content:F})}}w(C),g(k),u(),m("success","워크플로우 실행 완료!"),C.length>0&&(m("info",`${C.length}개 파일 생성됨`),C.forEach(L=>{m("info",` - ${L.name}`)}))}catch(j){const k=j instanceof Error?j.message:"Unknown error";u(),m("error",`실행 오류: ${k}`)}},[e,n,i,m,x,s,u,a,f,h,d,g]),N=K.useCallback((j,k)=>{const C=new Blob([k],{type:"text/markdown;charset=utf-8"}),L=URL.createObjectURL(C),A=document.createElement("a");A.href=L,A.download=j,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(L),m("info",`파일 다운로드: ${j}`)},[m]),_=K.useCallback(()=>{b.forEach(j=>{N(j.name,j.content)})},[b,N]);return{isRunning:o,execute:E,generatedFiles:b,downloadFile:N,downloadAllFiles:_}}function Cz(e,n,i,a="local"){const o=a==="global"?"~/.claude":".claude",s=Tz(n,o),u=Mz(n,o),f=Az(e,n,i,o),h=zz(n);return{skills:s,commands:f,agents:u,mcpSettings:h}}function Tz(e,n){return e.filter(a=>a.type==="skill").filter(a=>a.data.skillType==="custom").map(a=>{const o=a.data,s=xl(o.skillId||o.label),u=`${n}/skills/${s}/SKILL.md`,f=Dz(o);return{name:s,path:u,content:f}})}function Mz(e,n){return e.filter(a=>a.type==="subagent").map(a=>{const o=a.data,s=xl(o.label),u=`${n}/agents/${s}.md`,f=jz(o);return{name:s,path:u,content:f}})}function Az(e,n,i,a){if(n.length===0)return[];const o=xl(e),s=`${a}/commands/${o}.md`,u=Rz(e,n,i);return[{name:o,path:s,content:u}]}function zz(e){const n=e.filter(a=>a.type==="mcp");if(n.length===0)return null;const i={};return n.forEach(a=>{const o=a.data;i[o.serverName]={type:o.serverType,command:o.serverConfig.command,args:o.serverConfig.args,url:o.serverConfig.url,env:o.serverConfig.env}}),{mcpServers:i}}function Dz(e){if(e.skillContent)return e.skillContent;const n=xl(e.skillId||e.label),i=e.description||e.label,a=["---",`name: ${n}`,`description: ${i}`,"---","",`# ${e.label}`,""];return e.mdContent?a.push(e.mdContent):a.push(`Execute the ${e.label} skill.`),a.join(`
92
- `)}function jz(e){const n=xl(e.label),i=e.description||e.label,a=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",o=e.model||"sonnet",s=["---",`name: ${n}`,`description: ${i}`,`tools: ${a}`,`model: ${o}`,"---",""];return e.systemPrompt?s.push(e.systemPrompt):e.mdContent?s.push(e.mdContent):(s.push(`# ${e.label}`),s.push(""),s.push(`This agent performs the ${e.role} role.`)),s.join(`
93
- `)}function Rz(e,n,i){const a=n.filter(g=>g.type==="input"),o=n.filter(g=>g.type==="output"),s=a.map(g=>`<${xl(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];s&&f.push(`argument-hint: ${s}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),a.length>0&&(f.push("## Inputs"),f.push(""),a.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.description||m.placeholder||"User input"}`)}),f.push("")),f.push("## Workflow Steps"),f.push("");const h=Oz(n,i);let d=1;return h.forEach(g=>{if(g.type!=="input"){if(f.push(`${d}. **${g.data.label}**`),g.data.description&&f.push(` ${g.data.description}`),g.type==="subagent"){const m=g.data;m.systemPrompt&&f.push(` - Prompt: ${m.systemPrompt.substring(0,100)}${m.systemPrompt.length>100?"...":""}`),m.tools.length>0&&f.push(` - Tools: ${m.tools.join(", ")}`)}if(g.type==="skill"){const m=g.data;m.skillId&&f.push(` - Invoke skill: ${m.skillId}`)}if(g.type==="mcp"){const m=g.data;f.push(` - MCP Server: ${m.serverName}`)}f.push(""),d++}}),o.length>0&&(f.push("## Outputs"),f.push(""),o.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.outputType} format`)})),f.join(`
94
- `)}function xl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Oz(e,n){const i=new Map(e.map(f=>[f.id,f])),a=new Map,o=new Map;e.forEach(f=>{a.set(f.id,0),o.set(f.id,[])}),n.forEach(f=>{o.get(f.source)?.push(f.target),a.set(f.target,(a.get(f.target)||0)+1)});const s=[];a.forEach((f,h)=>{f===0&&s.push(h)});const u=[];for(;s.length>0;){const f=s.shift(),h=i.get(f);h&&u.push(h),o.get(f)?.forEach(d=>{const g=(a.get(d)||0)-1;a.set(d,g),g===0&&s.push(d)})}return u}function GS(e){var n,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(i=GS(e[n]))&&(a&&(a+=" "),a+=i)}else for(i in e)e[i]&&(a&&(a+=" "),a+=i);return a}function Xt(){for(var e,n,i=0,a="",o=arguments.length;i<o;i++)(e=arguments[i])&&(n=GS(e))&&(a&&(a+=" "),a+=n);return a}const ZS="http://localhost:3001/api";async function Lz(e,n){const i=await fetch(`${ZS}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:n})});if(!i.ok){const a=await i.json().catch(()=>({}));throw new Error(a.message||"Failed to save workflow")}return i.json()}async function Hz(){const e=await fetch(`${ZS}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Bz(e,n){const i=[];return n.includeSkills&&e.skills.forEach(a=>{i.push({path:a.path,content:a.content,type:"skill"})}),n.includeCommands&&e.commands.forEach(a=>{i.push({path:a.path,content:a.content,type:"command"})}),n.includeAgents&&e.agents.forEach(a=>{i.push({path:a.path,content:a.content,type:"agent"})}),n.includeMcpSettings&&e.mcpSettings&&i.push({path:n.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function Uz({isOpen:e,onClose:n,config:i}){const[a,o]=K.useState("local"),[s,u]=K.useState(!0),[f,h]=K.useState(!0),[d,g]=K.useState(!0),[m,x]=K.useState(!0),[b,w]=K.useState(""),[E,N]=K.useState([]),[_,j]=K.useState(null),[k,C]=K.useState(!1),[L,A]=K.useState(null),[H,F]=K.useState(null);K.useEffect(()=>{e&&Hz().then(w).catch(()=>w("."))},[e]),K.useEffect(()=>{if(!e)return;Bz(i,{location:a,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!_&&j(te[0])})},[e,i,a,s,f,d,m]);const G=async()=>{C(!0),F(null),A(null);const P={location:a,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const te=await Lz(i,P);A(te),te.success&&setTimeout(()=>n(),2e3)}catch(te){F(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},q=P=>{switch(P){case"skill":return v.jsx(rl,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(C3,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(Bc,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(uS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(rl,{className:"w-4 h-4 text-gray-400"})}},V=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(il,{className:"w-5 h-5 text-accent"}),v.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),v.jsx("button",{onClick:n,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(cS,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("button",{onClick:()=>o("local"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Zb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Local"}),v.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),v.jsxs("button",{onClick:()=>o("global"),className:Xt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",a==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[v.jsx(Zb,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Global"}),v.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:s,onChange:P=>u(P.target.checked),disabled:i.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:P=>h(P.target.checked),disabled:i.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:P=>g(P.target.checked),disabled:i.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Xt("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:P=>x(P.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:Xt("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),v.jsxs("div",{className:"pt-4 border-t border-border",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),v.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:b,children:b||"Loading..."})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((P,te)=>v.jsxs("button",{onClick:()=>j(P),className:Xt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",_===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[q(P.type),v.jsx("span",{children:P.path.split("/").pop()})]},te)),E.length===0&&v.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:_?v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-xs text-gray-500 font-mono",children:_.path}),v.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:_.content})]}):v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[L&&L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[v.jsx(A3,{className:"w-4 h-4"}),v.jsx("span",{children:"Saved successfully!"})]}),L&&!L.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Hp,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),H&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(Hp,{className:"w-4 h-4"}),v.jsx("span",{children:H})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:G,disabled:k||E.length===0||!V,className:Xt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||E.length===0||!V?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(il,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}function Iz(){const{workflowName:e,setWorkflowName:n,isDraft:i,nodes:a,edges:o}=Hi(),{isRunning:s,execute:u}=FS(),[f,h]=K.useState(!1),[d,g]=K.useState(null),m=()=>{const w=Cz(e,a,o,"local");g(w),h(!0)},x=()=>{h(!1),g(null)},b=()=>{s||u()};return v.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(E3,{className:"w-5 h-5 text-gray-400"})}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"text",value:e,onChange:w=>n(w.target.value),className:"bg-transparent border-none text-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-accent rounded px-2 py-1"}),i&&v.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),v.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),v.jsxs("button",{onClick:b,disabled:s,className:`
95
- flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
96
- ${s?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
97
- `,children:[v.jsx(Sm,{className:"w-4 h-4"}),s?"Running...":"Run"]}),v.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[v.jsx(il,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(o5,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(uS,{className:"w-5 h-5 text-gray-400"})})]}),d&&v.jsx(Uz,{isOpen:f,onClose:x,config:d})]})}const qz=[{type:"input",label:"User Input",icon:v.jsx(of,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:v.jsx(hs,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:v.jsx(sf,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"mcp",label:"MCP",icon:v.jsx(_m,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:v.jsx(lf,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function $z(e){const n=ml(),i={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:n,type:"input",position:i,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"subagent":return{id:n,type:"subagent",position:i,data:{label:"Sub Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:n,type:"skill",position:i,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"mcp":return{id:n,type:"mcp",position:i,data:{label:"MCP Server",description:"Connect to external service...",serverType:"stdio",serverName:"",serverConfig:{},status:"idle",usedInputs:[]}};case"output":return{id:n,type:"output",position:i,data:{label:"Output",description:"Select to edit in editor",outputType:"auto",status:"idle",usedInputs:[]}}}}function Vz(){const e=Hi(i=>i.addNode),n=i=>{const a=$z(i);e(a)};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:qz.map(i=>v.jsxs("button",{onClick:()=>n(i.type),className:`
98
- flex items-center gap-2 px-4 py-2 rounded-lg
99
- bg-surface border border-border
100
- ${i.hoverColor}
101
- transition-all duration-200
102
- hover:border-gray-500
103
- `,children:[v.jsx("span",{className:i.color,children:i.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function Pz({status:e}){switch(e){case"running":return v.jsx(sS,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(B3,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(Hp,{className:"w-4 h-4 text-red-400"});default:return v.jsx(Sm,{className:"w-4 h-4"})}}function Yz({data:e,selected:n,children:i,headerIcon:a,headerColor:o="bg-gray-700",showSourceHandle:s=!0,showTargetHandle:u=!0}){const f=()=>{switch(e.status){case"running":return"border-indigo-500 animate-pulse-border";case"completed":return"border-green-500";case"error":return"border-red-500";default:return""}};return v.jsxs("div",{className:Xt("workflow-node",n&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Xt("node-header flex items-center justify-between",o),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[a,v.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(Pz,{status:e.status})})]}),v.jsxs("div",{className:"node-content",children:[e.description&&v.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&v.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[v.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>v.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-gray-700/50 border border-gray-600 text-gray-300",children:[v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&v.jsx(pl,{type:"target",position:be.Left}),s&&v.jsx(pl,{type:"source",position:be.Right})]})}const ys=K.memo(Yz);function Xz({data:e,selected:n}){return v.jsx(ys,{data:e,selected:n,headerIcon:v.jsx(of,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:v.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&v.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&v.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&v.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(i=>v.jsx("option",{value:i,children:i},i))})]})})}const Fz=K.memo(Xz);function Gz({data:e,selected:n}){return v.jsx(ys,{data:e,selected:n,headerIcon:v.jsx(hs,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>v.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:i},i)),e.tools.length>3&&v.jsxs("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:["+",e.tools.length-3]})]}),e.model&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const Zz=K.memo(Gz);function Qz({data:e,selected:n}){return v.jsx(ys,{data:e,selected:n,headerIcon:v.jsx(sf,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-cyan-900/50 text-cyan-300 rounded",children:e.skillId}),e.skillCategory&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const Kz=K.memo(Qz);function Jz({data:e,selected:n}){return v.jsx(ys,{data:e,selected:n,headerIcon:v.jsx(_m,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.serverName&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.serverName}),v.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",e.serverType]})]})})}const Wz=K.memo(Jz);function eD(e){switch(e){case"markdown":case"document":return v.jsx(rl,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(oS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(X3,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(K3,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(lf,{className:"w-4 h-4 text-emerald-100"})}}function tD({data:e,selected:n}){return v.jsx(ys,{data:e,selected:n,headerIcon:eD(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:v.jsxs("div",{className:"space-y-2",children:[e.layoutType&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-emerald-900/50 text-emerald-300 rounded",children:e.layoutType}),e.result&&v.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const nD=K.memo(tD),zm=km(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:n=>e({activeTab:n}),toggleCollapsed:()=>e(n=>({isCollapsed:!n.isCollapsed})),setWidth:n=>e({width:Math.max(300,Math.min(600,n))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1})}));function iD(e,n){const{source:i,target:a}=e;if(i===a)return!1;const o=n.find(u=>u.id===i),s=n.find(u=>u.id===a);return!o||!s?!1:o.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):s.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const rD={input:Fz,subagent:Zz,skill:Kz,mcp:Wz,output:nD};function aD(){const{nodes:e,edges:n,setNodes:i,setEdges:a,addEdge:o,setSelectedNode:s}=Hi(),u=zm(x=>x.openStepPanel),f=K.useCallback(x=>{i(Tw(x,e))},[e,i]),h=K.useCallback(x=>{a(Mw(x,n))},[n,a]),d=K.useCallback(x=>{iD(x,e)&&(a(uw({...x,animated:!0},n)),o({id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0}))},[e,n,a,o]),g=K.useCallback((x,b)=>{s(b.id),u()},[s,u]),m=K.useCallback(()=>{s(null)},[s]);return v.jsxs(PA,{nodes:e,edges:n,onNodesChange:f,onEdgesChange:h,onConnect:d,onNodeClick:g,onPaneClick:m,nodeTypes:rD,fitView:!0,fitViewOptions:{padding:.2},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(ZA,{variant:Oi.Dots,gap:20,size:1,color:"#333333"}),v.jsx(n3,{}),v.jsx(m3,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"mcp":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function lD(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const oD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uD={};function S1(e,n){return(uD.jsx?sD:oD).test(e)}const cD=/[ \t\n\f\r]/g;function fD(e){return typeof e=="object"?e.type==="text"?_1(e.value):!1:_1(e)}function _1(e){return e.replace(cD,"")===""}class xs{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}xs.prototype.normal={};xs.prototype.property={};xs.prototype.space=void 0;function QS(e,n){const i={},a={};for(const o of e)Object.assign(i,o.property),Object.assign(a,o.normal);return new xs(i,a,n)}function Fp(e){return e.toLowerCase()}class ln{constructor(n,i){this.attribute=i,this.property=n}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let dD=0;const De=ra(),St=ra(),Gp=ra(),de=ra(),at=ra(),ll=ra(),bn=ra();function ra(){return 2**++dD}const Zp=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:St,commaOrSpaceSeparated:bn,commaSeparated:ll,number:de,overloadedBoolean:Gp,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),lp=Object.keys(Zp);class Dm extends ln{constructor(n,i,a,o){let s=-1;if(super(n,i),k1(this,"space",o),typeof a=="number")for(;++s<lp.length;){const u=lp[s];k1(this,lp[s],(a&Zp[u])===Zp[u])}}}Dm.prototype.defined=!0;function k1(e,n,i){i&&(e[n]=i)}function bl(e){const n={},i={};for(const[a,o]of Object.entries(e.properties)){const s=new Dm(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(s.mustUseProperty=!0),n[a]=s,i[Fp(a)]=a,i[Fp(s.attribute)]=a}return new xs(n,i,e.space)}const KS=bl({properties:{ariaActiveDescendant:null,ariaAtomic:St,ariaAutoComplete:null,ariaBusy:St,ariaChecked:St,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:St,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:St,ariaFlowTo:at,ariaGrabbed:St,ariaHasPopup:null,ariaHidden:St,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:St,ariaMultiLine:St,ariaMultiSelectable:St,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:St,ariaReadOnly:St,ariaRelevant:null,ariaRequired:St,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:St,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function JS(e,n){return n in e?e[n]:n}function WS(e,n){return JS(e,n.toLowerCase())}const hD=bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ll,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:at,autoFocus:De,autoPlay:De,blocking:at,capture:null,charSet:null,checked:De,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:St,controls:De,controlsList:at,coords:de|ll,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Gp,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:at,height:de,hidden:Gp,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:at,itemRef:at,itemScope:De,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:at,required:De,reversed:De,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:St,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:St,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:St,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:WS}),pD=bl({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:bn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:at,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:ll,g2:ll,glyphName:ll,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:JS}),e2=bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),t2=bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WS}),n2=bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),mD={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"},gD=/[A-Z]/g,E1=/-[a-z]/g,yD=/^data[-\w.:]+$/i;function xD(e,n){const i=Fp(n);let a=n,o=ln;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&yD.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(E1,vD);a="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!E1.test(s)){let u=s.replace(gD,bD);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=Dm}return new o(a,n)}function bD(e){return"-"+e.toLowerCase()}function vD(e){return e.charAt(1).toUpperCase()}const wD=QS([KS,hD,e2,t2,n2],"html"),jm=QS([KS,pD,e2,t2,n2],"svg");function SD(e){return e.join(" ").trim()}var Ga={},op,N1;function _D(){if(N1)return op;N1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
104
- `,d="/",g="*",m="",x="comment",b="declaration";function w(N,_){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];_=_||{};var j=1,k=1;function C(O){var B=O.match(n);B&&(j+=B.length);var D=O.lastIndexOf(h);k=~D?O.length-D:k+O.length}function L(){var O={line:j,column:k};return function(B){return B.position=new A(O),G(),B}}function A(O){this.start=O,this.end={line:j,column:k},this.source=_.source}A.prototype.content=N;function H(O){var B=new Error(_.source+":"+j+":"+k+": "+O);if(B.reason=O,B.filename=_.source,B.line=j,B.column=k,B.source=N,!_.silent)throw B}function F(O){var B=O.exec(N);if(B){var D=B[0];return C(D),N=N.slice(D.length),B}}function G(){F(i)}function q(O){var B;for(O=O||[];B=V();)B!==!1&&O.push(B);return O}function V(){var O=L();if(!(d!=N.charAt(0)||g!=N.charAt(1))){for(var B=2;m!=N.charAt(B)&&(g!=N.charAt(B)||d!=N.charAt(B+1));)++B;if(B+=2,m===N.charAt(B-1))return H("End of comment missing");var D=N.slice(2,B-2);return k+=2,C(D),N=N.slice(B),k+=2,O({type:x,comment:D})}}function P(){var O=L(),B=F(a);if(B){if(V(),!F(o))return H("property missing ':'");var D=F(s),U=O({type:b,property:E(B[0].replace(e,m)),value:D?E(D[0].replace(e,m)):m});return F(u),U}}function te(){var O=[];q(O);for(var B;B=P();)B!==!1&&(O.push(B),q(O));return O}return G(),te()}function E(N){return N?N.replace(f,m):m}return op=w,op}var C1;function kD(){if(C1)return Ga;C1=1;var e=Ga&&Ga.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.default=i;const n=e(_D());function i(a,o){let s=null;if(!a||typeof a!="string")return s;const u=(0,n.default)(a),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;f?o(d,g,h):g&&(s=s||{},s[d]=g)}),s}return Ga}var Ro={},T1;function ED(){if(T1)return Ro;T1=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),s(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(o,f):d=d.replace(a,f),d.replace(n,u))};return Ro.camelCase=h,Ro}var Oo,M1;function ND(){if(M1)return Oo;M1=1;var e=Oo&&Oo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(kD()),i=ED();function a(o,s){var u={};return!o||typeof o!="string"||(0,n.default)(o,function(f,h){f&&h&&(u[(0,i.camelCase)(f,s)]=h)}),u}return a.default=a,Oo=a,Oo}var CD=ND();const TD=Xc(CD),i2=r2("end"),Rm=r2("start");function r2(e){return n;function n(i){const a=i&&i.position&&i.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 MD(e){const n=Rm(e),i=i2(e);if(n&&i)return{start:n,end:i}}function Yo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A1(e.position):"start"in e||"end"in e?A1(e):"line"in e||"column"in e?Qp(e):""}function Qp(e){return z1(e&&e.line)+":"+z1(e&&e.column)}function A1(e){return Qp(e&&e.start)+"-"+Qp(e&&e.end)}function z1(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(n,i,a){super(),typeof i=="string"&&(a=i,i=void 0);let o="",s={},u=!1;if(i&&("line"in i&&"column"in i?s={place:i}:"start"in i&&"end"in i?s={place:i}:"type"in i?s={ancestors:[i],place:i.position}:s={...i}),typeof n=="string"?o=n:!s.cause&&n&&(u=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?s.ruleId=a:(s.source=a.slice(0,h),s.ruleId=a.slice(h+1))}if(!s.place&&s.ancestors&&s.ancestors){const h=s.ancestors[s.ancestors.length-1];h&&(s.place=h.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.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=Yo(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const Om={}.hasOwnProperty,AD=new Map,zD=/[A-Z]/g,DD=new Set(["table","tbody","thead","tfoot","tr"]),jD=new Set(["td","th"]),a2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function RD(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let a;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=$D(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=qD(i,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:a,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?jm:wD,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=l2(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function l2(e,n,i){if(n.type==="element")return OD(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return LD(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return BD(e,n,i);if(n.type==="mdxjsEsm")return HD(e,n);if(n.type==="root")return UD(e,n,i);if(n.type==="text")return ID(e,n)}function OD(e,n,i){const a=e.schema;let o=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=jm,e.schema=o),e.ancestors.push(n);const s=s2(e,n.tagName,!1),u=VD(e,n);let f=Hm(e,n);return DD.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!fD(h):!0})),o2(e,u,s,n),Lm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,s,u,i)}function LD(e,n){if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}rs(e,n.position)}function HD(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);rs(e,n.position)}function BD(e,n,i){const a=e.schema;let o=a;n.name==="svg"&&a.space==="html"&&(o=jm,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:s2(e,n.name,!0),u=PD(e,n),f=Hm(e,n);return o2(e,u,s,n),Lm(u,f),e.ancestors.pop(),e.schema=a,e.create(n,s,u,i)}function UD(e,n,i){const a={};return Lm(a,Hm(e,n)),e.create(n,e.Fragment,a,i)}function ID(e,n){return n.value}function o2(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function Lm(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function qD(e,n,i){return a;function a(o,s,u,f){const d=Array.isArray(u.children)?i:n;return f?d(s,u,f):d(s,u)}}function $D(e,n){return i;function i(a,o,s,u){const f=Array.isArray(s.children),h=Rm(a);return n(o,s,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function VD(e,n){const i={};let a,o;for(o in n.properties)if(o!=="children"&&Om.call(n.properties,o)){const s=YD(e,o,n.properties[o]);if(s){const[u,f]=s;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&jD.has(n.tagName)?a=f:i[u]=f}}if(a){const s=i.style||(i.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return i}function PD(e,n){const i={};for(const a of n.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const s=a.data.estree.body[0];s.type;const u=s.expression;u.type;const f=u.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else rs(e,n.position);else{const o=a.name;let s;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,s=e.evaluater.evaluateExpression(f.expression)}else rs(e,n.position);else s=a.value===null?!0:a.value;i[o]=s}return i}function Hm(e,n){const i=[];let a=-1;const o=e.passKeys?new Map:AD;for(;++a<n.children.length;){const s=n.children[a];let u;if(e.passKeys){const h=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(h){const d=o.get(h)||0;u=h+"-"+d,o.set(h,d+1)}}const f=l2(e,s,u);f!==void 0&&i.push(f)}return i}function YD(e,n,i){const a=xD(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?lD(i):SD(i)),a.property==="style"){let o=typeof i=="object"?i:XD(e,String(i));return e.stylePropertyNameCase==="css"&&(o=FD(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?mD[a.property]||a.property:a.attribute,i]}}function XD(e,n){try{return TD(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const a=i,o=new $t("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=a2+"#cannot-parse-style-attribute",o}}function s2(e,n,i){let a;if(!i)a={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,u;for(;++s<o.length;){const f=S1(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}a=u}else a=S1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const o=a.value;return Om.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);rs(e)}function rs(e,n){const i=new $t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=a2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function FD(e){const n={};let i;for(i in e)Om.call(e,i)&&(n[GD(i)]=e[i]);return n}function GD(e){let n=e.replace(zD,ZD);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function ZD(e){return"-"+e.toLowerCase()}const sp={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"]},QD={};function Bm(e,n){const i=QD,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return u2(e,a,o)}function u2(e,n,i){if(KD(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return D1(e.children,n,i)}return Array.isArray(e)?D1(e,n,i):""}function D1(e,n,i){const a=[];let o=-1;for(;++o<e.length;)a[o]=u2(e[o],n,i);return a.join("")}function KD(e){return!!(e&&typeof e=="object")}const j1=document.createElement("i");function Um(e){const n="&"+e+";";j1.innerHTML=n;const i=j1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function wn(e,n,i,a){const o=e.length;let s=0,u;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,i=i>0?i:0,a.length<1e4)u=Array.from(a),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);s<a.length;)u=a.slice(s,s+1e4),u.unshift(n,0),e.splice(...u),s+=1e4,n+=1e4}function jn(e,n){return e.length>0?(wn(e,e.length,0,n),e):n}const R1={}.hasOwnProperty;function c2(e){const n={};let i=-1;for(;++i<e.length;)JD(n,e[i]);return n}function JD(e,n){let i;for(i in n){const o=(R1.call(e,i)?e[i]:void 0)||(e[i]={}),s=n[i];let u;if(s)for(u in s){R1.call(o,u)||(o[u]=[]);const f=s[u];WD(o[u],Array.isArray(f)?f:f?[f]:[])}}}function WD(e,n){let i=-1;const a=[];for(;++i<n.length;)(n[i].add==="after"?e:a).push(n[i]);wn(e,0,0,a)}function f2(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Yn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=Sr(/[A-Za-z]/),It=Sr(/[\dA-Za-z]/),ej=Sr(/[#-'*+\--9=?A-Z^-~]/);function $c(e){return e!==null&&(e<32||e===127)}const Kp=Sr(/\d/),tj=Sr(/[\dA-Fa-f]/),nj=Sr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const pf=Sr(new RegExp("\\p{P}|\\p{S}","u")),ia=Sr(/\s/);function Sr(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function vl(e){const n=[];let i=-1,a=0,o=0;for(;++i<e.length;){const s=e.charCodeAt(i);let u="";if(s===37&&It(e.charCodeAt(i+1))&&It(e.charCodeAt(i+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(i+1);s<56320&&f>56319&&f<57344?(u=String.fromCharCode(s,f),o=1):u="�"}else u=String.fromCharCode(s);u&&(n.push(e.slice(a,i),encodeURIComponent(u)),a=i+o+1,u=""),o&&(i+=o,o=0)}return n.join("")+e.slice(a)}function Pe(e,n,i,a){const o=a?a-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(h){return He(h)?(e.enter(i),f(h)):n(h)}function f(h){return He(h)&&s++<o?(e.consume(h),f):(e.exit(i),n(h))}}const ij={tokenize:rj};function rj(e){const n=e.attempt(this.parser.constructs.contentInitial,a,o);let i;return n;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Pe(e,n,"linePrefix")}function o(f){return e.enter("paragraph"),s(f)}function s(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Se(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),u)}}const aj={tokenize:lj},O1={tokenize:oj};function lj(e){const n=this,i=[];let a=0,o,s,u;return f;function f(k){if(a<i.length){const C=i[a];return n.containerState=C[1],e.attempt(C[0].continuation,h,d)(k)}return d(k)}function h(k){if(a++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&j();const C=n.events.length;let L=C,A;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){A=n.events[L][1].end;break}_(a);let H=C;for(;H<n.events.length;)n.events[H][1].end={...A},H++;return wn(n.events,L+1,0,n.events.slice(C)),n.events.length=H,d(k)}return f(k)}function d(k){if(a===i.length){if(!o)return x(k);if(o.currentConstruct&&o.currentConstruct.concrete)return w(k);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(O1,g,m)(k)}function g(k){return o&&j(),_(a),x(k)}function m(k){return n.parser.lazy[n.now().line]=a!==i.length,u=n.now().offset,w(k)}function x(k){return n.containerState={},e.attempt(O1,b,w)(k)}function b(k){return a++,i.push([n.currentConstruct,n.containerState]),x(k)}function w(k){if(k===null){o&&j(),_(0),e.consume(k);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),E(k)}function E(k){if(k===null){N(e.exit("chunkFlow"),!0),_(0),e.consume(k);return}return Se(k)?(e.consume(k),N(e.exit("chunkFlow")),a=0,n.interrupt=void 0,f):(e.consume(k),E)}function N(k,C){const L=n.sliceStream(k);if(C&&L.push(null),k.previous=s,s&&(s.next=k),s=k,o.defineSkip(k.start),o.write(L),n.parser.lazy[k.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<u&&(!o.events[A][1].end||o.events[A][1].end.offset>u))return;const H=n.events.length;let F=H,G,q;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(G){q=n.events[F][1].end;break}G=!0}for(_(a),A=H;A<n.events.length;)n.events[A][1].end={...q},A++;wn(n.events,F+1,0,n.events.slice(H)),n.events.length=A}}function _(k){let C=i.length;for(;C-- >k;){const L=i[C];n.containerState=L[1],L[0].exit.call(n,e)}i.length=k}function j(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function oj(e,n,i){return Pe(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gl(e){if(e===null||rt(e)||ia(e))return 1;if(pf(e))return 2}function mf(e,n,i){const a=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!a.includes(s)&&(n=s(n,i),a.push(s))}return n}const Jp={name:"attention",resolveAll:sj,tokenize:uj};function sj(e,n){let i=-1,a,o,s,u,f,h,d,g;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(a=i;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&n.sliceSerialize(e[a][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[a][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const m={...e[a][1].end},x={...e[i][1].start};L1(m,-h),L1(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:x},s={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[i][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[i][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=jn(d,[["enter",e[a][1],n],["exit",e[a][1],n]])),d=jn(d,[["enter",o,n],["enter",u,n],["exit",u,n],["enter",s,n]]),d=jn(d,mf(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),d=jn(d,[["exit",s,n],["enter",f,n],["exit",f,n],["exit",o,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=jn(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,wn(e,a-1,i-a+3,d),i=a+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function uj(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,o=gl(a);let s;return u;function u(h){return s=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===s)return e.consume(h),f;const d=e.exit("attentionSequence"),g=gl(h),m=!g||g===2&&o||i.includes(h),x=!o||o===2&&g||i.includes(a);return d._open=!!(s===42?m:m&&(o||!x)),d._close=!!(s===42?x:x&&(g||!m)),n(h)}}function L1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const cj={name:"autolink",tokenize:fj};function fj(e,n,i){let a=0;return o;function o(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(b){return Ft(b)?(e.consume(b),u):b===64?i(b):d(b)}function u(b){return b===43||b===45||b===46||It(b)?(a=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||It(b))&&a++<32?(e.consume(b),f):(a=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||$c(b)?i(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),g):ej(b)?(e.consume(b),d):i(b)}function g(b){return It(b)?m(b):i(b)}function m(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||It(b))&&a++<63){const w=b===45?x:m;return e.consume(b),w}return i(b)}}const bs={partial:!0,tokenize:dj};function dj(e,n,i){return a;function a(s){return He(s)?Pe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Se(s)?n(s):i(s)}}const d2={continuation:{tokenize:pj},exit:mj,name:"blockQuote",tokenize:hj};function hj(e,n,i){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"),s}return i(u)}function s(u){return He(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function pj(e,n,i){const a=this;return o;function o(u){return He(u)?Pe(e,s,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(d2,n,i)(u)}}function mj(e){e.exit("blockQuote")}const h2={name:"characterEscape",tokenize:gj};function gj(e,n,i){return a;function a(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return nj(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(s)}}const p2={name:"characterReference",tokenize:yj};function yj(e,n,i){const a=this;let o=0,s,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,u=It,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=tj,g):(e.enter("characterReferenceValue"),s=7,u=Kp,g(m))}function g(m){if(m===59&&o){const x=e.exit("characterReferenceValue");return u===It&&!Um(a.sliceSerialize(x))?i(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(m)&&o++<s?(e.consume(m),g):i(m)}}const H1={partial:!0,tokenize:bj},B1={concrete:!0,name:"codeFenced",tokenize:xj};function xj(e,n,i){const a=this,o={partial:!0,tokenize:L};let s=0,u=0,f;return h;function h(A){return d(A)}function d(A){const H=a.events[a.events.length-1];return s=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,f=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(A)}function g(A){return A===f?(u++,e.consume(A),g):u<3?i(A):(e.exit("codeFencedFenceSequence"),He(A)?Pe(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Se(A)?(e.exit("codeFencedFence"),a.interrupt?n(A):e.check(H1,E,C)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):He(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pe(e,b,"whitespace")(A)):A===96&&A===f?i(A):(e.consume(A),x)}function b(A){return A===null||Se(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||Se(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===f?i(A):(e.consume(A),w)}function E(A){return e.attempt(o,C,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),_}function _(A){return s>0&&He(A)?Pe(e,j,"linePrefix",s+1)(A):j(A)}function j(A){return A===null||Se(A)?e.check(H1,E,C)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Se(A)?(e.exit("codeFlowValue"),j(A)):(e.consume(A),k)}function C(A){return e.exit("codeFenced"),n(A)}function L(A,H,F){let G=0;return q;function q(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),V}function V(B){return A.enter("codeFencedFence"),He(B)?Pe(A,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return B===f?(A.enter("codeFencedFenceSequence"),te(B)):F(B)}function te(B){return B===f?(G++,A.consume(B),te):G>=u?(A.exit("codeFencedFenceSequence"),He(B)?Pe(A,O,"whitespace")(B):O(B)):F(B)}function O(B){return B===null||Se(B)?(A.exit("codeFencedFence"),H(B)):F(B)}}}function bj(e,n,i){const a=this;return o;function o(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s)}function s(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}const up={name:"codeIndented",tokenize:wj},vj={partial:!0,tokenize:Sj};function wj(e,n,i){const a=this;return o;function o(d){return e.enter("codeIndented"),Pe(e,s,"linePrefix",5)(d)}function s(d){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?h(d):Se(d)?e.attempt(vj,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Se(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),n(d)}}function Sj(e,n,i){const a=this;return o;function o(u){return a.parser.lazy[a.now().line]?i(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Pe(e,s,"linePrefix",5)(u)}function s(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Se(u)?o(u):i(u)}}const _j={name:"codeText",previous:Ej,resolve:kj,tokenize:Nj};function kj(e){let n=e.length-4,i=3,a,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(a=i;++a<n;)if(e[a][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(a=i-1,n++;++a<=n;)o===void 0?a!==n&&e[a][1].type!=="lineEnding"&&(o=a):(a===n||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),n-=a-o-2,a=o+2),o=void 0);return e}function Ej(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Nj(e,n,i){let a=0,o,s;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),a++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?i(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(s=e.enter("codeTextSequence"),o=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),o++,g):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(s.type="codeTextData",d(m))}}class Cj{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(n,a):n>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(n,i,a){const o=i||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&Lo(this.left,a),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Lo(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Lo(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);Lo(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Lo(this.left,i.reverse())}}}function Lo(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function m2(e){const n={};let i=-1,a,o,s,u,f,h,d;const g=new Cj(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(a=g.get(i),i&&a[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,s=0,s<h.length&&h[s][1].type==="lineEndingBlank"&&(s+=2),s<h.length&&h[s][1].type==="content"))for(;++s<h.length&&h[s][1].type!=="content";)h[s][1].type==="chunkText"&&(h[s][1]._isInFirstContentOfListItem=!0,s++);if(a[0]==="enter")a[1].contentType&&(Object.assign(n,Tj(g,i)),i=n[i],d=!0);else if(a[1]._container){for(s=i,o=void 0;s--;)if(u=g.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(g.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=s);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(a[1].end={...g.get(o)[1].start},f=g.slice(o,i),f.unshift(a),g.splice(o,i-o+1,f))}}return wn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function Tj(e,n){const i=e.get(n)[1],a=e.get(n)[2];let o=n-1;const s=[];let u=i._tokenizer;u||(u=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,m,x=-1,b=i,w=0,E=0;const N=[E];for(;b;){for(;e.get(++o)[1]!==b;);s.push(o),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),m&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=i;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(E=x+1,N.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const _=f.slice(N[x],N[x+1]),j=s.pop();h.push([j,j+_.length-1]),e.splice(j,2,_)}for(h.reverse(),x=-1;++x<h.length;)d[w+h[x][0]]=w+h[x][1],w+=h[x][1]-h[x][0]-1;return d}const Mj={resolve:zj,tokenize:Dj},Aj={partial:!0,tokenize:jj};function zj(e){return m2(e),e}function Dj(e,n){let i;return a;function a(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?s(f):Se(f)?e.check(Aj,u,s)(f):(e.consume(f),o)}function s(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function jj(e,n,i){const a=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Pe(e,s,"linePrefix")}function s(u){if(u===null||Se(u))return i(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?n(u):e.interrupt(a.parser.constructs.flow,i,n)(u)}}function g2(e,n,i,a,o,s,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(_){return _===60?(e.enter(a),e.enter(o),e.enter(s),e.consume(_),e.exit(s),x):_===null||_===32||_===41||$c(_)?i(_):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(_))}function x(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(o),e.exit(a),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Se(_)?i(_):(e.consume(_),_===92?w:b)}function w(_){return _===60||_===62||_===92?(e.consume(_),b):b(_)}function E(_){return!g&&(_===null||_===41||rt(_))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),n(_)):g<d&&_===40?(e.consume(_),g++,E):_===41?(e.consume(_),g--,E):_===null||_===32||_===40||$c(_)?i(_):(e.consume(_),_===92?N:E)}function N(_){return _===40||_===41||_===92?(e.consume(_),E):E(_)}}function y2(e,n,i,a,o,s){const u=this;let f=0,h;return d;function d(b){return e.enter(a),e.enter(o),e.consume(b),e.exit(o),e.enter(s),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(b):b===93?(e.exit(s),e.enter(o),e.consume(b),e.exit(o),e.exit(a),n):Se(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Se(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!He(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function x2(e,n,i,a,o,s){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(o),e.consume(x),e.exit(o),u=x===40?41:x,h):i(x)}function h(x){return x===u?(e.enter(o),e.consume(x),e.exit(o),e.exit(a),n):(e.enter(s),d(x))}function d(x){return x===u?(e.exit(s),h(u)):x===null?i(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Pe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function Xo(e,n){let i;return a;function a(o){return Se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,a):He(o)?Pe(e,a,i?"linePrefix":"lineSuffix")(o):n(o)}}const Rj={name:"definition",tokenize:Lj},Oj={partial:!0,tokenize:Hj};function Lj(e,n,i){const a=this;let o;return s;function s(b){return e.enter("definition"),u(b)}function u(b){return y2.call(a,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return o=Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):i(b)}function h(b){return rt(b)?Xo(e,d)(b):d(b)}function d(b){return g2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(Oj,m,m)(b)}function m(b){return He(b)?Pe(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),a.parser.defined.push(o),n(b)):i(b)}}function Hj(e,n,i){return a;function a(f){return rt(f)?Xo(e,o)(f):i(f)}function o(f){return x2(e,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return He(f)?Pe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?n(f):i(f)}}const Bj={name:"hardBreakEscape",tokenize:Uj};function Uj(e,n,i){return a;function a(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Se(s)?(e.exit("hardBreakEscape"),n(s)):i(s)}}const Ij={name:"headingAtx",resolve:qj,tokenize:$j};function qj(e,n){let i=e.length-2,a=3,o,s;return e[a][1].type==="whitespace"&&(a+=2),i-2>a&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&e[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},s={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},wn(e,a,i-a+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function $j(e,n,i){let a=0;return o;function o(g){return e.enter("atxHeading"),s(g)}function s(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&a++<6?(e.consume(g),u):g===null||rt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Se(g)?(e.exit("atxHeading"),n(g)):He(g)?Pe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||rt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const Vj=["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"],U1=["pre","script","style","textarea"],Pj={concrete:!0,name:"htmlFlow",resolveTo:Fj,tokenize:Gj},Yj={partial:!0,tokenize:Qj},Xj={partial:!0,tokenize:Zj};function Fj(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Gj(e,n,i){const a=this;let o,s,u,f,h;return d;function d(M){return g(M)}function g(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),x):M===47?(e.consume(M),s=!0,E):M===63?(e.consume(M),o=3,a.interrupt?n:z):Ft(M)?(e.consume(M),u=String.fromCharCode(M),N):i(M)}function x(M){return M===45?(e.consume(M),o=2,b):M===91?(e.consume(M),o=5,f=0,w):Ft(M)?(e.consume(M),o=4,a.interrupt?n:z):i(M)}function b(M){return M===45?(e.consume(M),a.interrupt?n:z):i(M)}function w(M){const ie="CDATA[";return M===ie.charCodeAt(f++)?(e.consume(M),f===ie.length?a.interrupt?n:P:w):i(M)}function E(M){return Ft(M)?(e.consume(M),u=String.fromCharCode(M),N):i(M)}function N(M){if(M===null||M===47||M===62||rt(M)){const ie=M===47,ce=u.toLowerCase();return!ie&&!s&&U1.includes(ce)?(o=1,a.interrupt?n(M):P(M)):Vj.includes(u.toLowerCase())?(o=6,ie?(e.consume(M),_):a.interrupt?n(M):P(M)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(M):s?j(M):k(M))}return M===45||It(M)?(e.consume(M),u+=String.fromCharCode(M),N):i(M)}function _(M){return M===62?(e.consume(M),a.interrupt?n:P):i(M)}function j(M){return He(M)?(e.consume(M),j):q(M)}function k(M){return M===47?(e.consume(M),q):M===58||M===95||Ft(M)?(e.consume(M),C):He(M)?(e.consume(M),k):q(M)}function C(M){return M===45||M===46||M===58||M===95||It(M)?(e.consume(M),C):L(M)}function L(M){return M===61?(e.consume(M),A):He(M)?(e.consume(M),L):k(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?i(M):M===34||M===39?(e.consume(M),h=M,H):He(M)?(e.consume(M),A):F(M)}function H(M){return M===h?(e.consume(M),h=null,G):M===null||Se(M)?i(M):(e.consume(M),H)}function F(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||rt(M)?L(M):(e.consume(M),F)}function G(M){return M===47||M===62||He(M)?k(M):i(M)}function q(M){return M===62?(e.consume(M),V):i(M)}function V(M){return M===null||Se(M)?P(M):He(M)?(e.consume(M),V):i(M)}function P(M){return M===45&&o===2?(e.consume(M),D):M===60&&o===1?(e.consume(M),U):M===62&&o===4?(e.consume(M),R):M===63&&o===3?(e.consume(M),z):M===93&&o===5?(e.consume(M),Q):Se(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Yj,$,te)(M)):M===null||Se(M)?(e.exit("htmlFlowData"),te(M)):(e.consume(M),P)}function te(M){return e.check(Xj,O,$)(M)}function O(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),B}function B(M){return M===null||Se(M)?te(M):(e.enter("htmlFlowData"),P(M))}function D(M){return M===45?(e.consume(M),z):P(M)}function U(M){return M===47?(e.consume(M),u="",Y):P(M)}function Y(M){if(M===62){const ie=u.toLowerCase();return U1.includes(ie)?(e.consume(M),R):P(M)}return Ft(M)&&u.length<8?(e.consume(M),u+=String.fromCharCode(M),Y):P(M)}function Q(M){return M===93?(e.consume(M),z):P(M)}function z(M){return M===62?(e.consume(M),R):M===45&&o===2?(e.consume(M),z):P(M)}function R(M){return M===null||Se(M)?(e.exit("htmlFlowData"),$(M)):(e.consume(M),R)}function $(M){return e.exit("htmlFlow"),n(M)}}function Zj(e,n,i){const a=this;return o;function o(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):i(u)}function s(u){return a.parser.lazy[a.now().line]?i(u):n(u)}}function Qj(e,n,i){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(bs,n,i)}}const Kj={name:"htmlText",tokenize:Jj};function Jj(e,n,i){const a=this;let o,s,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),L):z===63?(e.consume(z),k):Ft(z)?(e.consume(z),F):i(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),s=0,w):Ft(z)?(e.consume(z),j):i(z)}function g(z){return z===45?(e.consume(z),b):i(z)}function m(z){return z===null?i(z):z===45?(e.consume(z),x):Se(z)?(u=m,U(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),b):m(z)}function b(z){return z===62?D(z):z===45?x(z):m(z)}function w(z){const R="CDATA[";return z===R.charCodeAt(s++)?(e.consume(z),s===R.length?E:w):i(z)}function E(z){return z===null?i(z):z===93?(e.consume(z),N):Se(z)?(u=E,U(z)):(e.consume(z),E)}function N(z){return z===93?(e.consume(z),_):E(z)}function _(z){return z===62?D(z):z===93?(e.consume(z),_):E(z)}function j(z){return z===null||z===62?D(z):Se(z)?(u=j,U(z)):(e.consume(z),j)}function k(z){return z===null?i(z):z===63?(e.consume(z),C):Se(z)?(u=k,U(z)):(e.consume(z),k)}function C(z){return z===62?D(z):k(z)}function L(z){return Ft(z)?(e.consume(z),A):i(z)}function A(z){return z===45||It(z)?(e.consume(z),A):H(z)}function H(z){return Se(z)?(u=H,U(z)):He(z)?(e.consume(z),H):D(z)}function F(z){return z===45||It(z)?(e.consume(z),F):z===47||z===62||rt(z)?G(z):i(z)}function G(z){return z===47?(e.consume(z),D):z===58||z===95||Ft(z)?(e.consume(z),q):Se(z)?(u=G,U(z)):He(z)?(e.consume(z),G):D(z)}function q(z){return z===45||z===46||z===58||z===95||It(z)?(e.consume(z),q):V(z)}function V(z){return z===61?(e.consume(z),P):Se(z)?(u=V,U(z)):He(z)?(e.consume(z),V):G(z)}function P(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),o=z,te):Se(z)?(u=P,U(z)):He(z)?(e.consume(z),P):(e.consume(z),O)}function te(z){return z===o?(e.consume(z),o=void 0,B):z===null?i(z):Se(z)?(u=te,U(z)):(e.consume(z),te)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||rt(z)?G(z):(e.consume(z),O)}function B(z){return z===47||z===62||rt(z)?G(z):i(z)}function D(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),n):i(z)}function U(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Y}function Y(z){return He(z)?Pe(e,Q,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Q(z)}function Q(z){return e.enter("htmlTextData"),u(z)}}const Im={name:"labelEnd",resolveAll:nR,resolveTo:iR,tokenize:rR},Wj={tokenize:aR},eR={tokenize:lR},tR={tokenize:oR};function nR(e){let n=-1;const i=[];for(;++n<e.length;){const a=e[n][1];if(i.push(e[n]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",n+=o}}return e.length!==i.length&&wn(e,0,e.length,i),e}function iR(e,n){let i=e.length,a=0,o,s,u,f;for(;i--;)if(o=e[i][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[i][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=i,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(u=i);const h={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[s+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",d,n]],f=jn(f,e.slice(s+1,s+a+3)),f=jn(f,[["enter",g,n]]),f=jn(f,mf(n.parser.constructs.insideSpan.null,e.slice(s+a+4,u-3),n)),f=jn(f,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),f=jn(f,e.slice(u+1)),f=jn(f,[["exit",h,n]]),wn(e,s,e.length,f),e}function rR(e,n,i){const a=this;let o=a.events.length,s,u;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){s=a.events[o][1];break}return f;function f(x){return s?s._inactive?m(x):(u=a.parser.defined.includes(Yn(a.sliceSerialize({start:s.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):i(x)}function h(x){return x===40?e.attempt(Wj,g,u?g:m)(x):x===91?e.attempt(eR,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(tR,g,m)(x)}function g(x){return n(x)}function m(x){return s._balanced=!0,i(x)}}function aR(e,n,i){return a;function a(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return rt(m)?Xo(e,s)(m):s(m)}function s(m){return m===41?g(m):g2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return rt(m)?Xo(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?x2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return rt(m)?Xo(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):i(m)}}function lR(e,n,i){const a=this;return o;function o(f){return y2.call(a,e,s,u,"reference","referenceMarker","referenceString")(f)}function s(f){return a.parser.defined.includes(Yn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function u(f){return i(f)}}function oR(e,n,i){return a;function a(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):i(s)}}const sR={name:"labelStartImage",resolveAll:Im.resolveAll,tokenize:uR};function uR(e,n,i){const a=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),s}function s(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):i(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(f):n(f)}}const cR={name:"labelStartLink",resolveAll:Im.resolveAll,tokenize:fR};function fR(e,n,i){const a=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(u):n(u)}}const cp={name:"lineEnding",tokenize:dR};function dR(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pe(e,n,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:hR};function hR(e,n,i){let a=0,o;return s;function s(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||Se(d))?(e.exit("thematicBreak"),n(d)):i(d)}function h(d){return d===o?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),He(d)?Pe(e,f,"whitespace")(d):f(d))}}const rn={continuation:{tokenize:yR},exit:bR,name:"list",tokenize:gR},pR={partial:!0,tokenize:vR},mR={partial:!0,tokenize:xR};function gR(e,n,i){const a=this,o=a.events[a.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(b){const w=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Kp(b)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Nc,i,d)(b):d(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return i(b)}function h(b){return Kp(b)&&++u<10?(e.consume(b),h):(!a.interrupt||u<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):i(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(bs,a.interrupt?i:g,e.attempt(pR,x,m))}function g(b){return a.containerState.initialBlankLine=!0,s++,x(b)}function m(b){return He(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):i(b)}function x(b){return a.containerState.size=s+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function yR(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(bs,o,s);function o(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Pe(e,n,"listItemIndent",a.containerState.size+1)(f)}function s(f){return a.containerState.furtherBlankLines||!He(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(mR,n,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,Pe(e,e.attempt(rn,n,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function xR(e,n,i){const a=this;return Pe(e,o,"listItemIndent",a.containerState.size+1);function o(s){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?n(s):i(s)}}function bR(e){e.exit(this.containerState.type)}function vR(e,n,i){const a=this;return Pe(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const u=a.events[a.events.length-1];return!He(s)&&u&&u[1].type==="listItemPrefixWhitespace"?n(s):i(s)}}const I1={name:"setextUnderline",resolveTo:wR,tokenize:SR};function wR(e,n){let i=e.length,a,o,s;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){a=i;break}e[i][1].type==="paragraph"&&(o=i)}else e[i][1].type==="content"&&e.splice(i,1),!s&&e[i][1].type==="definition"&&(s=i);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",u,n]),e.splice(s+1,0,["exit",e[a][1],n]),e[a][1].end={...e[s][1].end}):e[a][1]=u,e.push(["exit",u,n]),e}function SR(e,n,i){const a=this;let o;return s;function s(d){let g=a.events.length,m;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){m=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||m)?(e.enter("setextHeadingLine"),o=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===o?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),He(d)?Pe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const _R={tokenize:kR};function kR(e){const n=this,i=e.attempt(bs,a,e.attempt(this.parser.constructs.flowInitial,o,Pe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Mj,o)),"linePrefix")));return i;function a(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const ER={resolveAll:v2()},NR=b2("string"),CR=b2("text");function b2(e){return{resolveAll:v2(e==="text"?TR:void 0),tokenize:n};function n(i){const a=this,o=this.parser.constructs[e],s=i.attempt(o,u,f);return u;function u(g){return d(g)?s(g):f(g)}function f(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),h}function h(g){return d(g)?(i.exit("data"),s(g)):(i.consume(g),h)}function d(g){if(g===null)return!0;const m=o[g];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function v2(e){return n;function n(i,a){let o=-1,s;for(;++o<=i.length;)s===void 0?i[o]&&i[o][1].type==="data"&&(s=o,o++):(!i[o]||i[o][1].type!=="data")&&(o!==s+2&&(i[s][1].end=i[o-1][1].end,i.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(i,a):i}}function TR(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const a=e[i-1][1],o=n.sliceStream(a);let s=o.length,u=-1,f=0,h;for(;s--;){const d=o[s];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){s++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const d={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?u:a.start._bufferIndex+u,_index:a.start._index+s,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(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const MR={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:d2},AR={91:Rj},zR={[-2]:up,[-1]:up,32:up},DR={35:Ij,42:Nc,45:[I1,Nc],60:Pj,61:I1,95:Nc,96:B1,126:B1},jR={38:p2,92:h2},RR={[-5]:cp,[-4]:cp,[-3]:cp,33:sR,38:p2,42:Jp,60:[cj,Kj],91:cR,92:[Bj,h2],93:Im,95:Jp,96:_j},OR={null:[Jp,ER]},LR={null:[42,95]},HR={null:[]},BR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LR,contentInitial:AR,disable:HR,document:MR,flow:DR,flowInitial:zR,insideSpan:OR,string:jR,text:RR},Symbol.toStringTag,{value:"Module"}));function UR(e,n,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},s=[];let u=[],f=[];const h={attempt:H(L),check:H(A),consume:j,enter:k,exit:C,interrupt:H(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=n.tokenize.call(d,h);return n.resolveAll&&s.push(n),d;function m(V){return u=jn(u,V),N(),u[u.length-1]!==null?[]:(F(n,0),d.events=mf(s,d.events,d),d.events)}function x(V,P){return qR(b(V),P)}function b(V){return IR(u,V)}function w(){const{_bufferIndex:V,_index:P,line:te,column:O,offset:B}=a;return{_bufferIndex:V,_index:P,line:te,column:O,offset:B}}function E(V){o[V.line]=V.column,q()}function N(){let V;for(;a._index<u.length;){const P=u[a._index];if(typeof P=="string")for(V=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===V&&a._bufferIndex<P.length;)_(P.charCodeAt(a._bufferIndex));else _(P)}}function _(V){g=g(V)}function j(V){Se(V)?(a.line++,a.column=1,a.offset+=V===-3?2:1,q()):V!==-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=V}function k(V,P){const te=P||{};return te.type=V,te.start=w(),d.events.push(["enter",te,d]),f.push(te),te}function C(V){const P=f.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function L(V,P){F(V,P.from)}function A(V,P){P.restore()}function H(V,P){return te;function te(O,B,D){let U,Y,Q,z;return Array.isArray(O)?$(O):"tokenize"in O?$([O]):R(O);function R(fe){return he;function he(ue){const me=ue!==null&&fe[ue],Ee=ue!==null&&fe.null,Ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return $(Ce)(ue)}}function $(fe){return U=fe,Y=0,fe.length===0?D:M(fe[Y])}function M(fe){return he;function he(ue){return z=G(),Q=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ie,ce)(ue)}}function ie(fe){return V(Q,z),B}function ce(fe){return z.restore(),++Y<U.length?M(U[Y]):D}}}function F(V,P){V.resolveAll&&!s.includes(V)&&s.push(V),V.resolve&&wn(d.events,P,d.events.length-P,V.resolve(d.events.slice(P),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function G(){const V=w(),P=d.previous,te=d.currentConstruct,O=d.events.length,B=Array.from(f);return{from:O,restore:D};function D(){a=V,d.previous=P,d.currentConstruct=te,d.events.length=O,f=B,q()}}function q(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function IR(e,n){const i=n.start._index,a=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let u;if(i===o)u=[e[i].slice(a,s)];else{if(u=e.slice(i,o),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}s>0&&u.push(e[o].slice(0,s))}return u}function qR(e,n){let i=-1;const a=[];let o;for(;++i<e.length;){const s=e[i];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
105
- `;break}case-3:{u=`\r
106
- `;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,a.push(u)}return a.join("")}function $R(e){const a={constructs:c2([BR,...(e||{}).extensions||[]]),content:o(ij),defined:[],document:o(aj),flow:o(_R),lazy:{},string:o(NR),text:o(CR)};return a;function o(s){return u;function u(f){return UR(a,s,f)}}}function VR(e){for(;!m2(e););return e}const q1=/[\0\t\n\r]/g;function PR(){let e=1,n="",i=!0,a;return o;function o(s,u,f){const h=[];let d,g,m,x,b;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),m=0,n="",i&&(s.charCodeAt(0)===65279&&m++,i=void 0);m<s.length;){if(q1.lastIndex=m,d=q1.exec(s),x=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(x),!d){n=s.slice(m);break}if(b===10&&m===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),m<x&&(h.push(s.slice(m,x)),e+=x-m),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}m=x+1}return f&&(a&&h.push(-5),n&&h.push(n),h.push(null)),h}}const YR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function XR(e){return e.replace(YR,FR)}function FR(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),s=o===120||o===88;return f2(i.slice(s?2:1),s?16:10)}return Um(i)||e}const w2={}.hasOwnProperty;function GR(e,n,i){return typeof n!="string"&&(i=n,n=void 0),ZR(i)(VR($R(i).document().write(PR()(e,n,!0))))}function ZR(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Lt),autolinkProtocol:G,autolinkEmail:G,atxHeading:s(Ze),blockQuote:s(Ee),characterEscape:G,characterReference:G,codeFenced:s(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ce,u),codeText:s(we,u),codeTextData:G,data:G,codeFlowValue:G,definition:s(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(Re),hardBreakEscape:s(Xe),hardBreakTrailing:s(Xe),htmlFlow:s(ht,u),htmlFlowData:G,htmlText:s(ht,u),htmlTextData:G,image:s(on),label:u,link:s(Lt),listItem:s(Rn),listItemValue:x,listOrdered:s(Gt,m),listUnordered:s(Gt),paragraph:s(oi),reference:M,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Ze),strong:s(si),thematicBreak:s(Ii)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:h(N),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:h(_),codeText:h(B),codeTextData:q,data:q,definition:h(),definitionDestinationString:C,definitionLabelString:j,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(te),htmlFlowData:q,htmlText:h(O),htmlTextData:q,image:h(U),label:Q,labelText:Y,lineEnding:V,link:h(D),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:z,resourceTitleString:R,resource:$,setextHeading:h(F),setextHeadingLineSequence:H,setextHeadingText:A,strong:h(),thematicBreak:h()}};S2(n,(e||{}).mdastExtensions||[]);const i={};return a;function a(ae){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:n,enter:f,exit:d,buffer:u,resume:g,data:i},je=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")je.push($e);else{const Vt=je.pop();$e=o(ae,Vt,$e)}for($e=-1;++$e<ae.length;){const Vt=n[ae[$e][0]];w2.call(Vt,ae[$e][1].type)&&Vt[ae[$e][1].type].call(Object.assign({sliceSerialize:ae[$e][2].sliceSerialize},_e),ae[$e][1])}if(_e.tokenStack.length>0){const Vt=_e.tokenStack[_e.tokenStack.length-1];(Vt[1]||$1).call(_e,void 0,Vt[0])}for(pe.position={start:vr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:vr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)pe=n.transforms[$e](pe)||pe;return pe}function o(ae,pe,_e){let je=pe-1,$e=-1,Vt=!1,On,At,pt,Ht;for(;++je<=_e;){const Ke=ae[je];switch(Ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ke[0]==="enter"?$e++:$e--,Ht=void 0;break}case"lineEndingBlank":{Ke[0]==="enter"&&(On&&!Ht&&!$e&&!pt&&(pt=je),Ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ht=void 0}if(!$e&&Ke[0]==="enter"&&Ke[1].type==="listItemPrefix"||$e===-1&&Ke[0]==="exit"&&(Ke[1].type==="listUnordered"||Ke[1].type==="listOrdered")){if(On){let Gn=je;for(At=void 0;Gn--;){const sn=ae[Gn];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;At&&(ae[At][1].type="lineEndingBlank",Vt=!0),sn[1].type="lineEnding",At=Gn}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}pt&&(!At||pt<At)&&(On._spread=!0),On.end=Object.assign({},At?ae[At][1].start:Ke[1].end),ae.splice(At||je,0,["exit",On,Ke[2]]),je++,_e++}if(Ke[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},Ke[1].start),end:void 0};On=Gn,ae.splice(je,0,["enter",Gn,Ke[2]]),je++,_e++,pt=void 0,Ht=!0}}}return ae[pe][1]._spread=Vt,_e}function s(ae,pe){return _e;function _e(je){f.call(this,ae(je),je),pe&&pe.call(this,je)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,pe,_e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([pe,_e||void 0]),ae.position={start:vr(pe.start),end:void 0}}function h(ae){return pe;function pe(_e){ae&&ae.call(this,_e),d.call(this,_e)}}function d(ae,pe){const _e=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==ae.type&&(pe?pe.call(this,ae,je[0]):(je[1]||$1).call(this,ae,je[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Yo({start:ae.start,end:ae.end})+"): it’s not open");_e.position.end=vr(ae.end)}function g(){return Bm(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(ae){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ae}function w(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ae}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae.replace(/(\r?\n|\r)$/g,"")}function j(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase()}function k(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function C(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function L(ae){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(ae).length;pe.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function H(ae){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ae){const _e=this.stack[this.stack.length-1].children;let je=_e[_e.length-1];(!je||je.type!=="text")&&(je=Et(),je.position={start:vr(ae.start),end:void 0},_e.push(je)),this.stack.push(je)}function q(ae){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ae),pe.position.end=vr(ae.end)}function V(ae){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=vr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(G.call(this,ae),q.call(this,ae))}function P(){this.data.atHardBreak=!0}function te(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function O(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function B(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ae}function D(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function U(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=pe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function Y(ae){const pe=this.sliceSerialize(ae),_e=this.stack[this.stack.length-2];_e.label=XR(pe),_e.identifier=Yn(pe).toLowerCase()}function Q(){const ae=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const je=ae.children;_e.children=je}else _e.alt=pe}function z(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ae}function R(){const ae=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ae}function $(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ie(ae){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Yn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function fe(ae){const pe=this.sliceSerialize(ae),_e=this.data.characterReferenceType;let je;_e?(je=f2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Um(pe);const $e=this.stack[this.stack.length-1];$e.value+=je}function he(ae){const pe=this.stack.pop();pe.position.end=vr(ae.end)}function ue(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ae)}function me(ae){q.call(this,ae);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ae)}function Ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function ht(){return{type:"html",value:""}}function on(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function Gt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Rn(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function oi(){return{type:"paragraph",children:[]}}function si(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function Ii(){return{type:"thematicBreak"}}}function vr(e){return{line:e.line,column:e.column,offset:e.offset}}function S2(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?S2(e,a):QR(e,a)}}function QR(e,n){let i;for(i in n)if(w2.call(n,i))switch(i){case"canContainEols":{const a=n[i];a&&e[i].push(...a);break}case"transforms":{const a=n[i];a&&e[i].push(...a);break}case"enter":case"exit":{const a=n[i];a&&Object.assign(e[i],a);break}}}function $1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Yo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Yo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Yo({start:n.start,end:n.end})+") is still open")}function KR(e){const n=this;n.parser=i;function i(a){return GR(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function JR(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function WR(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
107
- `}]}function eO(e,n){const i=n.value?n.value+`
108
- `:"",a={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:a,children:[{type:"text",value:i}]};return n.meta&&(s.data={meta:n.meta}),e.patch(n,s),s=e.applyData(n,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(n,s),s}function tO(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function nO(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function iO(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(n.identifier).toUpperCase(),o=vl(a.toLowerCase()),s=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=s+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,d),e.applyData(n,d)}function rO(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function aO(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function _2(e,n){const i=n.referenceType;let a="]";if(i==="collapsed"?a+="[]":i==="full"&&(a+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+a}];const o=e.all(n),s=o[0];s&&s.type==="text"?s.value="["+s.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 lO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return _2(e,n);const o={src:vl(a.url||""),alt:n.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,s),e.applyData(n,s)}function oO(e,n){const i={src:vl(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,a),e.applyData(n,a)}function sO(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const a={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,a),e.applyData(n,a)}function uO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return _2(e,n);const o={href:vl(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function cO(e,n){const i={href:vl(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function fO(e,n,i){const a=e.all(n),o=i?dO(i):k2(n),s={},u=[];if(typeof n.checked=="boolean"){const g=a[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},a.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(o||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
109
- `}),g.type==="element"&&g.tagName==="p"&&!o?u.push(...g.children):u.push(g)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
110
- `});const d={type:"element",tagName:"li",properties:s,children:u};return e.patch(n,d),e.applyData(n,d)}function dO(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let a=-1;for(;!n&&++a<i.length;)n=k2(i[a])}return n}function k2(e){const n=e.spread;return n??e.children.length>1}function hO(e,n){const i={},a=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.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")){i.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(a,!0)};return e.patch(n,s),e.applyData(n,s)}function pO(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function mO(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function gO(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function yO(e,n){const i=e.all(n),a=i.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(n.children[0],u),o.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=Rm(n.children[1]),h=i2(n.children[n.children.length-1]);f&&h&&(u.position={start:f,end:h}),o.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,s),e.applyData(n,s)}function xO(e,n,i){const a=i?i.children:void 0,s=(a?a.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,f=u?u.length:n.children.length;let h=-1;const d=[];for(;++h<f;){const m=n.children[h],x={},b=u?u[h]:void 0;b&&(x.align=b);let w={type:"element",tagName:s,properties:x,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,g),e.applyData(n,g)}function bO(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const V1=9,P1=32;function vO(e){const n=String(e),i=/\r?\n|\r/g;let a=i.exec(n),o=0;const s=[];for(;a;)s.push(Y1(n.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=i.exec(n);return s.push(Y1(n.slice(o),o>0,!1)),s.join("")}function Y1(e,n,i){let a=0,o=e.length;if(n){let s=e.codePointAt(a);for(;s===V1||s===P1;)a++,s=e.codePointAt(a)}if(i){let s=e.codePointAt(o-1);for(;s===V1||s===P1;)o--,s=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function wO(e,n){const i={type:"text",value:vO(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function SO(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const _O={blockquote:JR,break:WR,code:eO,delete:tO,emphasis:nO,footnoteReference:iO,heading:rO,html:aO,imageReference:lO,image:oO,inlineCode:sO,linkReference:uO,link:cO,listItem:fO,list:hO,paragraph:pO,root:mO,strong:gO,table:yO,tableCell:bO,tableRow:xO,text:wO,thematicBreak:SO,toml:mc,yaml:mc,definition:mc,footnoteDefinition:mc};function mc(){}const E2=-1,gf=0,Fo=1,Vc=2,qm=3,$m=4,Vm=5,Pm=6,N2=7,C2=8,X1=typeof self=="object"?self:globalThis,kO=(e,n)=>{const i=(o,s)=>(e.set(s,o),o),a=o=>{if(e.has(o))return e.get(o);const[s,u]=n[o];switch(s){case gf:case E2:return i(u,o);case Fo:{const f=i([],o);for(const h of u)f.push(a(h));return f}case Vc:{const f=i({},o);for(const[h,d]of u)f[a(h)]=a(d);return f}case qm:return i(new Date(u),o);case $m:{const{source:f,flags:h}=u;return i(new RegExp(f,h),o)}case Vm:{const f=i(new Map,o);for(const[h,d]of u)f.set(a(h),a(d));return f}case Pm:{const f=i(new Set,o);for(const h of u)f.add(a(h));return f}case N2:{const{name:f,message:h}=u;return i(new X1[f](h),o)}case C2:return i(BigInt(u),o);case"BigInt":return i(Object(BigInt(u)),o);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return i(new DataView(f),u)}}return i(new X1[s](u),o)};return a},F1=e=>kO(new Map,e)(0),Za="",{toString:EO}={},{keys:NO}=Object,Ho=e=>{const n=typeof e;if(n!=="object"||!e)return[gf,n];const i=EO.call(e).slice(8,-1);switch(i){case"Array":return[Fo,Za];case"Object":return[Vc,Za];case"Date":return[qm,Za];case"RegExp":return[$m,Za];case"Map":return[Vm,Za];case"Set":return[Pm,Za];case"DataView":return[Fo,i]}return i.includes("Array")?[Fo,i]:i.includes("Error")?[N2,i]:[Vc,i]},gc=([e,n])=>e===gf&&(n==="function"||n==="symbol"),CO=(e,n,i,a)=>{const o=(u,f)=>{const h=a.push(u)-1;return i.set(f,h),h},s=u=>{if(i.has(u))return i.get(u);let[f,h]=Ho(u);switch(f){case gf:{let g=u;switch(h){case"bigint":f=C2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([E2],u)}return o([f,g],u)}case Fo:{if(h){let x=u;return h==="DataView"?x=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(u)),o([h,[...x]],u)}const g=[],m=o([f,g],u);for(const x of u)g.push(s(x));return m}case Vc:{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(n&&"toJSON"in u)return s(u.toJSON());const g=[],m=o([f,g],u);for(const x of NO(u))(e||!gc(Ho(u[x])))&&g.push([s(x),s(u[x])]);return m}case qm:return o([f,u.toISOString()],u);case $m:{const{source:g,flags:m}=u;return o([f,{source:g,flags:m}],u)}case Vm:{const g=[],m=o([f,g],u);for(const[x,b]of u)(e||!(gc(Ho(x))||gc(Ho(b))))&&g.push([s(x),s(b)]);return m}case Pm:{const g=[],m=o([f,g],u);for(const x of u)(e||!gc(Ho(x)))&&g.push(s(x));return m}}const{message:d}=u;return o([f,{name:h,message:d}],u)};return s},G1=(e,{json:n,lossy:i}={})=>{const a=[];return CO(!(n||i),!!n,new Map,a)(e),a},Pc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?F1(G1(e,n)):structuredClone(e):(e,n)=>F1(G1(e,n));function TO(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function MO(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function AO(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||TO,a=e.options.footnoteBackLabel||MO,o=e.options.footnoteLabel||"Footnotes",s=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 g=e.all(d),m=String(d.identifier).toUpperCase(),x=vl(m.toLowerCase());let b=0;const w=[],E=e.footnoteCounts.get(m);for(;E!==void 0&&++b<=E;){w.length>0&&w.push({type:"text",value:" "});let j=typeof i=="string"?i:i(h,b);typeof j=="string"&&(j={type:"text",value:j}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,b),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const j=N.children[N.children.length-1];j&&j.type==="text"?j.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const _={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(g,!0)};e.patch(d,_),f.push(_)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Pc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
111
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
112
- `}]}}const yf=(function(e){if(e==null)return RO;if(typeof e=="function")return xf(e);if(typeof e=="object")return Array.isArray(e)?zO(e):DO(e);if(typeof e=="string")return jO(e);throw new Error("Expected function, string, or object as test")});function zO(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=yf(e[i]);return xf(a);function a(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function DO(e){const n=e;return xf(i);function i(a){const o=a;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function jO(e){return xf(n);function n(i){return i&&i.type===e}}function xf(e){return n;function n(i,a,o){return!!(OO(i)&&e.call(this,i,typeof a=="number"?a:void 0,o||void 0))}}function RO(){return!0}function OO(e){return e!==null&&typeof e=="object"&&"type"in e}const T2=[],LO=!0,Wp=!1,HO="skip";function M2(e,n,i,a){let o;typeof n=="function"&&typeof i!="function"?(a=i,i=n):o=n;const s=yf(o),u=a?-1:1;f(e,void 0,[])();function f(h,d,g){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=T2,w,E,N;if((!n||s(h,d,g[g.length-1]||void 0))&&(b=BO(i(h,g)),b[0]===Wp))return b;if("children"in h&&h.children){const _=h;if(_.children&&b[0]!==HO)for(E=(a?_.children.length:-1)+u,N=g.concat(_);E>-1&&E<_.children.length;){const j=_.children[E];if(w=f(j,E,N)(),w[0]===Wp)return w;E=typeof w[1]=="number"?w[1]:E+u}}return b}}}function BO(e){return Array.isArray(e)?e:typeof e=="number"?[LO,e]:e==null?T2:[e]}function Ym(e,n,i,a){let o,s,u;typeof n=="function"&&typeof i!="function"?(s=void 0,u=n,o=i):(s=n,u=i,o=a),M2(e,s,f,o);function f(h,d){const g=d[d.length-1],m=g?g.children.indexOf(h):void 0;return u(h,m,g)}}const em={}.hasOwnProperty,UO={};function IO(e,n){const i=n||UO,a=new Map,o=new Map,s=new Map,u={..._O,...i.handlers},f={all:d,applyData:$O,definitionById:a,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:h,options:i,patch:qO,wrap:PO};return Ym(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?a:o,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),f;function h(g,m){const x=g.type,b=f.handlers[x];if(em.call(f.handlers,x)&&b)return b(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:E,...N}=g,_=Pc(N);return _.children=f.all(g),_}return Pc(g)}return(f.options.unknownHandler||VO)(f,g,m)}function d(g){const m=[];if("children"in g){const x=g.children;let b=-1;for(;++b<x.length;){const w=f.one(x[b],g);if(w){if(b&&x[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Z1(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=Z1(E.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function qO(e,n){e.position&&(n.position=MD(e))}function $O(e,n){let i=n;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof a=="string")if(i.type==="element")i.tagName=a;else{const u="children"in i?i.children:[i];i={type:"element",tagName:a,properties:{},children:u}}i.type==="element"&&s&&Object.assign(i.properties,Pc(s)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function VO(e,n){const i=n.data||{},a="value"in n&&!(em.call(i,"hProperties")||em.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function PO(e,n){const i=[];let a=-1;for(n&&i.push({type:"text",value:`
113
- `});++a<e.length;)a&&i.push({type:"text",value:`
114
- `}),i.push(e[a]);return n&&e.length>0&&i.push({type:"text",value:`
115
- `}),i}function Z1(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function Q1(e,n){const i=IO(e,n),a=i.one(e,void 0),o=AO(i),s=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
116
- `},o),s}function YO(e,n){return e&&"run"in e?async function(i,a){const o=Q1(i,{file:a,...n});await e.run(o,a)}:function(i,a){return Q1(i,{file:a,...e||n})}}function K1(e){if(e)throw e}var fp,J1;function XO(){if(J1)return fp;J1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},s=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(a)return a(d,g).value}else return;return d[g]};return fp=function h(){var d,g,m,x,b,w,E=arguments[0],N=1,_=arguments.length,j=!1;for(typeof E=="boolean"&&(j=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<_;++N)if(d=arguments[N],d!=null)for(g in d)m=f(E,g),x=f(d,g),E!==x&&(j&&x&&(s(x)||(b=o(x)))?(b?(b=!1,w=m&&o(m)?m:[]):w=m&&s(m)?m:{},u(E,{name:g,newValue:h(j,w,x)})):typeof x<"u"&&u(E,{name:g,newValue:x}));return E},fp}var FO=XO();const dp=Xc(FO);function tm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function GO(){const e=[],n={run:i,use:a};return n;function i(...o){let s=-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 g=e[++s];let m=-1;if(h){u(h);return}for(;++m<o.length;)(d[m]===null||d[m]===void 0)&&(d[m]=o[m]);o=d,g?ZO(g,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),n}}function ZO(e,n){let i;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 g=d;if(f&&i)throw g;return o(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(s,o):h instanceof Error?o(h):s(h))}function o(u,...f){i||(i=!0,n(u,...f))}function s(u){o(null,u)}}const ei={basename:QO,dirname:KO,extname:JO,join:WO,sep:"/"};function QO(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');vs(e);let i=0,a=-1,o=e.length,s;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){i=o+1;break}}else a<0&&(s=!0,a=o+1);return a<0?"":e.slice(i,a)}if(n===e)return"";let u=-1,f=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){i=o+1;break}}else u<0&&(s=!0,u=o+1),f>-1&&(e.codePointAt(o)===n.codePointAt(f--)?f<0&&(a=o):(f=-1,a=u));return i===a?a=u:a<0&&(a=e.length),e.slice(i,a)}function KO(e){if(vs(e),e.length===0)return".";let n=-1,i=e.length,a;for(;--i;)if(e.codePointAt(i)===47){if(a){n=i;break}}else a||(a=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function JO(e){vs(e);let n=e.length,i=-1,a=0,o=-1,s=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){a=n+1;break}continue}i<0&&(u=!0,i=n+1),f===46?o<0?o=n:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||i<0||s===0||s===1&&o===i-1&&o===a+1?"":e.slice(o,i)}function WO(...e){let n=-1,i;for(;++n<e.length;)vs(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":e6(i)}function e6(e){vs(e);const n=e.codePointAt(0)===47;let i=t6(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function t6(e,n){let i="",a=0,o=-1,s=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||s===1))if(o!==u-1&&s===2){if(i.length<2||a!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",a=0):(i=i.slice(0,h),a=i.length-1-i.lastIndexOf("/")),o=u,s=0;continue}}else if(i.length>0){i="",a=0,o=u,s=0;continue}}n&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(o+1,u):i=e.slice(o+1,u),a=u-o-1;o=u,s=0}else f===46&&s>-1?s++:s=-1}return i}function vs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const n6={cwd:i6};function i6(){return"/"}function nm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function r6(e){if(typeof e=="string")e=new URL(e);else if(!nm(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return a6(e)}function a6(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 n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const a=n.codePointAt(i+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(n)}const hp=["history","path","basename","stem","extname","dirname"];class A2{constructor(n){let i;n?nm(n)?i={path:n}:typeof n=="string"||l6(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":n6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<hp.length;){const s=hp[a];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let o;for(o in i)hp.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?ei.basename(this.path):void 0}set basename(n){mp(n,"basename"),pp(n,"basename"),this.path=ei.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ei.dirname(this.path):void 0}set dirname(n){W1(this.basename,"dirname"),this.path=ei.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ei.extname(this.path):void 0}set extname(n){if(pp(n,"extname"),W1(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ei.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){nm(n)&&(n=r6(n)),mp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ei.basename(this.path,this.extname):void 0}set stem(n){mp(n,"stem"),pp(n,"stem"),this.path=ei.join(this.dirname||"",n+(this.extname||""))}fail(n,i,a){const o=this.message(n,i,a);throw o.fatal=!0,o}info(n,i,a){const o=this.message(n,i,a);return o.fatal=void 0,o}message(n,i,a){const o=new $t(n,i,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function pp(e,n){if(e&&e.includes(ei.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ei.sep+"`")}function mp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function W1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function l6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o6=(function(e){const a=this.constructor.prototype,o=a[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,a),s}),s6={}.hasOwnProperty;class Xm extends o6{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=GO()}copy(){const n=new Xm;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(dp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(xp("data",this.frozen),this.namespace[n]=i,this):s6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(xp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=i.call(n,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=yc(n),a=this.parser||this.Parser;return gp("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),gp("process",this.parser||this.Parser),yp("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(s,u){const f=yc(n),h=a.parse(f);a.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const b=m,w=a.stringify(b,x);f6(w)?x.value=w:x.result=w,d(g,x)});function d(g,m){g||!m?u(g):s?s(m):i(void 0,m)}}}processSync(n){let i=!1,a;return this.freeze(),gp("processSync",this.parser||this.Parser),yp("processSync",this.compiler||this.Compiler),this.process(n,o),tv("processSync","process",i),a;function o(s,u){i=!0,K1(s),a=u}}run(n,i,a){ev(n),this.freeze();const o=this.transformers;return!a&&typeof i=="function"&&(a=i,i=void 0),a?s(void 0,a):new Promise(s);function s(u,f){const h=yc(i);o.run(n,h,d);function d(g,m,x){const b=m||n;g?f(g):u?u(b):a(void 0,b,x)}}}runSync(n,i){let a=!1,o;return this.run(n,i,s),tv("runSync","run",a),o;function s(u,f){K1(u),o=f,a=!0}}stringify(n,i){this.freeze();const a=yc(i),o=this.compiler||this.Compiler;return yp("stringify",o),ev(n),o(n,a)}use(n,...i){const a=this.attachers,o=this.namespace;if(xp("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function s(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;h(g,m)}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=dp(!0,o.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];s(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let m=-1,x=-1;for(;++m<a.length;)if(a[m][0]===d){x=m;break}if(x===-1)a.push([d,...g]);else if(g.length>0){let[b,...w]=g;const E=a[x][1];tm(E)&&tm(b)&&(b=dp(!0,E,b)),a[x]=[d,b,...w]}}}}const u6=new Xm().freeze();function gp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ev(e){if(!tm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tv(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function yc(e){return c6(e)?e:new A2(e)}function c6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function f6(e){return typeof e=="string"||d6(e)}function d6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const h6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nv=[],iv={allowDangerousHtml:!0},p6=/^(https?|ircs?|mailto|xmpp)$/i,m6=[{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 rv(e){const n=g6(e),i=y6(e);return x6(n.runSync(n.parse(i),i),e)}function g6(e){const n=e.rehypePlugins||nv,i=e.remarkPlugins||nv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...iv}:iv;return u6().use(KR).use(i).use(YO,a).use(n)}function y6(e){const n=e.children||"",i=new A2;return typeof n=="string"&&(i.value=n),i}function x6(e,n){const i=n.allowedElements,a=n.allowElement,o=n.components,s=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||b6;for(const g of m6)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+h6+g.id,void 0);return Ym(e,d),RD(e,{Fragment:v.Fragment,components:o,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return u?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in sp)if(Object.hasOwn(sp,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=sp[b];(E===null||E.includes(g.tagName))&&(g.properties[b]=h(String(w||""),b,g))}}if(g.type==="element"){let b=i?!i.includes(g.tagName):s?s.includes(g.tagName):!1;if(!b&&a&&typeof m=="number"&&(b=!a(g,m,x)),b&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function b6(e){const n=e.indexOf(":"),i=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||i!==-1&&n>i||a!==-1&&n>a||p6.test(e.slice(0,n))?e:""}function av(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let a=0,o=i.indexOf(n);for(;o!==-1;)a++,o=i.indexOf(n,o+n.length);return a}function v6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function w6(e,n,i){const o=yf((i||{}).ignore||[]),s=S6(n);let u=-1;for(;++u<s.length;)M2(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(o(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=s[u][0],b=s[u][1];let w=0;const N=m.children.indexOf(d);let _=!1,j=[];x.lastIndex=0;let k=x.exec(d.value);for(;k;){const C=k.index,L={index:k.index,input:k.input,stack:[...g,d]};let A=b(...k,L);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=C+1:(w!==C&&j.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(A)?j.push(...A):A&&j.push(A),w=C+k[0].length,_=!0),!x.global)break;k=x.exec(d.value)}return _?(w<d.value.length&&j.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...j)):j=[d],N+j.length}}function S6(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<i.length;){const o=i[a];n.push([_6(o[0]),k6(o[1])])}return n}function _6(e){return typeof e=="string"?new RegExp(v6(e),"g"):e}function k6(e){return typeof e=="function"?e:function(){return e}}const bp="phrasing",vp=["autolink","link","image","label"];function E6(){return{transforms:[D6],enter:{literalAutolink:C6,literalAutolinkEmail:wp,literalAutolinkHttp:wp,literalAutolinkWww:wp},exit:{literalAutolink:z6,literalAutolinkEmail:A6,literalAutolinkHttp:T6,literalAutolinkWww:M6}}}function N6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bp,notInConstruct:vp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bp,notInConstruct:vp},{character:":",before:"[ps]",after:"\\/",inConstruct:bp,notInConstruct:vp}]}}function C6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wp(e){this.config.enter.autolinkProtocol.call(this,e)}function T6(e){this.config.exit.autolinkProtocol.call(this,e)}function M6(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function A6(e){this.config.exit.autolinkEmail.call(this,e)}function z6(e){this.exit(e)}function D6(e){w6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,j6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),R6]],{ignore:["link","linkReference"]})}function j6(e,n,i,a,o){let s="";if(!z2(o)||(/^w/i.test(n)&&(i=n+i,n="",s="http://"),!O6(i)))return!1;const u=L6(i+a);if(!u[0])return!1;const f={type:"link",title:null,url:s+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function R6(e,n,i,a){return!z2(a,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function O6(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function L6(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],a=i.indexOf(")");const o=av(e,"(");let s=av(e,")");for(;a!==-1&&o>s;)e+=i.slice(0,a+1),i=i.slice(a+1),a=i.indexOf(")"),s++;return[e,i]}function z2(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||ia(i)||pf(i))&&(!n||i!==47)}D2.peek=Y6;function H6(){this.buffer()}function B6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function U6(){this.buffer()}function I6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function q6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function $6(e){this.exit(e)}function V6(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Yn(this.sliceSerialize(e)).toLowerCase(),i.label=n}function P6(e){this.exit(e)}function Y6(){return"["}function D2(e,n,i,a){const o=i.createTracker(a);let s=o.move("[^");const u=i.enter("footnoteReference"),f=i.enter("reference");return s+=o.move(i.safe(i.associationId(e),{after:"]",before:s})),f(),u(),s+=o.move("]"),s}function X6(){return{enter:{gfmFootnoteCallString:H6,gfmFootnoteCall:B6,gfmFootnoteDefinitionLabelString:U6,gfmFootnoteDefinition:I6},exit:{gfmFootnoteCallString:q6,gfmFootnoteCall:$6,gfmFootnoteDefinitionLabelString:V6,gfmFootnoteDefinition:P6}}}function F6(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:D2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(a,o,s,u){const f=s.createTracker(u);let h=f.move("[^");const d=s.enter("footnoteDefinition"),g=s.enter("label");return h+=f.move(s.safe(s.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((n?`
117
- `:" ")+s.indentLines(s.containerFlow(a,f.current()),n?j2:G6))),d(),h}}function G6(e,n,i){return n===0?e:j2(e,n,i)}function j2(e,n,i){return(i?"":" ")+e}const Z6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];R2.peek=e8;function Q6(){return{canContainEols:["delete"],enter:{strikethrough:J6},exit:{strikethrough:W6}}}function K6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Z6}],handlers:{delete:R2}}}function J6(e){this.enter({type:"delete",children:[]},e)}function W6(e){this.exit(e)}function R2(e,n,i,a){const o=i.createTracker(a),s=i.enter("strikethrough");let u=o.move("~~");return u+=i.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function e8(){return"~"}function t8(e){return e.length}function n8(e,n){const i=n||{},a=(i.align||[]).concat(),o=i.stringLength||t8,s=[],u=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const E=[],N=[];let _=-1;for(e[g].length>d&&(d=e[g].length);++_<e[g].length;){const j=i8(e[g][_]);if(i.alignDelimiters!==!1){const k=o(j);N[_]=k,(h[_]===void 0||k>h[_])&&(h[_]=k)}E.push(j)}u[g]=E,f[g]=N}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<d;)s[m]=lv(a[m]);else{const E=lv(a);for(;++m<d;)s[m]=E}m=-1;const x=[],b=[];for(;++m<d;){const E=s[m];let N="",_="";E===99?(N=":",_=":"):E===108?N=":":E===114&&(_=":");let j=i.alignDelimiters===!1?1:Math.max(1,h[m]-N.length-_.length);const k=N+"-".repeat(j)+_;i.alignDelimiters!==!1&&(j=N.length+j+_.length,j>h[m]&&(h[m]=j),b[m]=j),x[m]=k}u.splice(1,0,x),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const E=u[g],N=f[g];m=-1;const _=[];for(;++m<d;){const j=E[m]||"";let k="",C="";if(i.alignDelimiters!==!1){const L=h[m]-(N[m]||0),A=s[m];A===114?k=" ".repeat(L):A===99?L%2?(k=" ".repeat(L/2+.5),C=" ".repeat(L/2-.5)):(k=" ".repeat(L/2),C=k):C=" ".repeat(L)}i.delimiterStart!==!1&&!m&&_.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&j==="")&&(i.delimiterStart!==!1||m)&&_.push(" "),i.alignDelimiters!==!1&&_.push(k),_.push(j),i.alignDelimiters!==!1&&_.push(C),i.padding!==!1&&_.push(" "),(i.delimiterEnd!==!1||m!==d-1)&&_.push("|")}w.push(i.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return w.join(`
118
- `)}function i8(e){return e==null?"":String(e)}function lv(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function r8(e,n,i,a){const o=i.enter("blockquote"),s=i.createTracker(a);s.move("> "),s.shift(2);const u=i.indentLines(i.containerFlow(e,s.current()),a8);return o(),u}function a8(e,n,i){return">"+(i?"":" ")+e}function l8(e,n){return ov(e,n.inConstruct,!0)&&!ov(e,n.notInConstruct,!1)}function ov(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let a=-1;for(;++a<n.length;)if(e.includes(n[a]))return!0;return!1}function sv(e,n,i,a){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
119
- `&&l8(i.stack,i.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
120
- `}function o8(e,n){const i=String(e);let a=i.indexOf(n),o=a,s=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++s>u&&(u=s):s=1,o=a+n.length,a=i.indexOf(n,o);return u}function s8(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function u8(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function c8(e,n,i,a){const o=u8(i),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(s8(e,i)){const m=i.enter("codeIndented"),x=i.indentLines(s,f8);return m(),x}const f=i.createTracker(a),h=o.repeat(Math.max(o8(s,o)+1,3)),d=i.enter("codeFenced");let g=f.move(h);if(e.lang){const m=i.enter(`codeFencedLang${u}`);g+=f.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=i.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(i.safe(e.meta,{before:g,after:`
121
- `,encode:["`"],...f.current()})),m()}return g+=f.move(`
122
- `),s&&(g+=f.move(s+`
123
- `)),g+=f.move(h),d(),g}function f8(e,n,i){return(i?"":" ")+e}function Fm(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function d8(e,n,i,a){const o=Fm(i),s=o==='"'?"Quote":"Apostrophe",u=i.enter("definition");let f=i.enter("label");const h=i.createTracker(a);let d=h.move("[");return d+=h.move(i.safe(i.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":`
124
- `,...h.current()}))),f(),e.title&&(f=i.enter(`title${s}`),d+=h.move(" "+o),d+=h.move(i.safe(e.title,{before:d,after:o,...h.current()})),d+=h.move(o),f()),u(),d}function h8(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function as(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Yc(e,n,i){const a=gl(e),o=gl(n);return a===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}O2.peek=p8;function O2(e,n,i,a){const o=h8(i),s=i.enter("emphasis"),u=i.createTracker(a),f=u.move(o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const d=h.charCodeAt(0),g=Yc(a.before.charCodeAt(a.before.length-1),d,o);g.inside&&(h=as(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Yc(a.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+as(m));const b=u.move(o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function p8(e,n,i){return i.options.emphasis||"*"}function m8(e,n){let i=!1;return Ym(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return i=!0,Wp}),!!((!e.depth||e.depth<3)&&Bm(e)&&(n.options.setext||i))}function g8(e,n,i,a){const o=Math.max(Math.min(6,e.depth||1),1),s=i.createTracker(a);if(m8(e,i)){const g=i.enter("headingSetext"),m=i.enter("phrasing"),x=i.containerPhrasing(e,{...s.current(),before:`
125
- `,after:`
126
- `});return m(),g(),x+`
127
- `+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
128
- `))+1))}const u="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");s.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
129
- `,...s.current()});return/^[\t ]/.test(d)&&(d=as(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),h(),f(),d}L2.peek=y8;function L2(e){return e.value||""}function y8(){return"<"}H2.peek=x8;function H2(e,n,i,a){const o=Fm(i),s=o==='"'?"Quote":"Apostrophe",u=i.enter("image");let f=i.enter("label");const h=i.createTracker(a);let d=h.move("![");return d+=h.move(i.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(i.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=i.enter("destinationRaw"),d+=h.move(i.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${s}`),d+=h.move(" "+o),d+=h.move(i.safe(e.title,{before:d,after:o,...h.current()})),d+=h.move(o),f()),d+=h.move(")"),u(),d}function x8(){return"!"}B2.peek=b8;function B2(e,n,i,a){const o=e.referenceType,s=i.enter("imageReference");let u=i.enter("label");const f=i.createTracker(a);let h=f.move("![");const d=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,s(),o==="full"||!d||d!==m?h+=f.move(m+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function b8(){return"!"}U2.peek=v8;function U2(e,n,i){let a=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++s<i.unsafe.length;){const u=i.unsafe[s],f=i.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(a);){let d=h.index;a.charCodeAt(d)===10&&a.charCodeAt(d-1)===13&&d--,a=a.slice(0,d)+" "+a.slice(h.index+1)}}return o+a+o}function v8(){return"`"}function I2(e,n){const i=Bm(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}q2.peek=w8;function q2(e,n,i,a){const o=Fm(i),s=o==='"'?"Quote":"Apostrophe",u=i.createTracker(a);let f,h;if(I2(e,i)){const g=i.stack;i.stack=[],f=i.enter("autolink");let m=u.move("<");return m+=u.move(i.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),f(),i.stack=g,m}f=i.enter("link"),h=i.enter("label");let d=u.move("[");return d+=u.move(i.containerPhrasing(e,{before:d,after:"](",...u.current()})),d+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(i.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(h=i.enter("destinationRaw"),d+=u.move(i.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=i.enter(`title${s}`),d+=u.move(" "+o),d+=u.move(i.safe(e.title,{before:d,after:o,...u.current()})),d+=u.move(o),h()),d+=u.move(")"),f(),d}function w8(e,n,i){return I2(e,i)?"<":"["}$2.peek=S8;function $2(e,n,i,a){const o=e.referenceType,s=i.enter("linkReference");let u=i.enter("label");const f=i.createTracker(a);let h=f.move("[");const d=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const m=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,s(),o==="full"||!d||d!==m?h+=f.move(m+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function S8(){return"["}function Gm(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function _8(e){const n=Gm(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function k8(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function V2(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function E8(e,n,i,a){const o=i.enter("list"),s=i.bulletCurrent;let u=e.ordered?k8(i):Gm(i);const f=e.ordered?u==="."?")":".":_8(i);let h=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),V2(i)===u&&g){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),i.bulletCurrent=u;const d=i.containerFlow(e,a);return i.bulletLastUsed=u,i.bulletCurrent=s,o(),d}function N8(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function C8(e,n,i,a){const o=N8(i);let s=i.bulletCurrent||Gm(i);n&&n.type==="list"&&n.ordered&&(s=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+s);let u=s.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=i.createTracker(a);f.move(s+" ".repeat(u-s.length)),f.shift(u);const h=i.enter("listItem"),d=i.indentLines(i.containerFlow(e,f.current()),g);return h(),d;function g(m,x,b){return x?(b?"":" ".repeat(u))+m:(b?s:s+" ".repeat(u-s.length))+m}}function T8(e,n,i,a){const o=i.enter("paragraph"),s=i.enter("phrasing"),u=i.containerPhrasing(e,a);return s(),o(),u}const M8=yf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function A8(e,n,i,a){return(e.children.some(function(u){return M8(u)})?i.containerPhrasing:i.containerFlow).call(i,e,a)}function z8(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}P2.peek=D8;function P2(e,n,i,a){const o=z8(i),s=i.enter("strong"),u=i.createTracker(a),f=u.move(o+o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const d=h.charCodeAt(0),g=Yc(a.before.charCodeAt(a.before.length-1),d,o);g.inside&&(h=as(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Yc(a.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+as(m));const b=u.move(o+o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function D8(e,n,i){return i.options.strong||"*"}function j8(e,n,i,a){return i.safe(e.value,a)}function R8(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function O8(e,n,i){const a=(V2(i)+(i.options.ruleSpaces?" ":"")).repeat(R8(i));return i.options.ruleSpaces?a.slice(0,-1):a}const Y2={blockquote:r8,break:sv,code:c8,definition:d8,emphasis:O2,hardBreak:sv,heading:g8,html:L2,image:H2,imageReference:B2,inlineCode:U2,link:q2,linkReference:$2,list:E8,listItem:C8,paragraph:T8,root:A8,strong:P2,text:j8,thematicBreak:O8};function L8(){return{enter:{table:H8,tableData:uv,tableHeader:uv,tableRow:U8},exit:{codeText:I8,table:B8,tableData:Sp,tableHeader:Sp,tableRow:Sp}}}function H8(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function B8(e){this.exit(e),this.data.inTable=void 0}function U8(e){this.enter({type:"tableRow",children:[]},e)}function Sp(e){this.exit(e)}function uv(e){this.enter({type:"tableCell",children:[]},e)}function I8(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,q8));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function q8(e,n){return n==="|"?n:e}function $8(e){const n=e||{},i=n.tableCellPadding,a=n.tablePipeAlign,o=n.stringLength,s=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
130
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:h,tableRow:f}};function u(b,w,E,N){return d(g(b,E,N),b.align)}function f(b,w,E,N){const _=m(b,E,N),j=d([_]);return j.slice(0,j.indexOf(`
131
- `))}function h(b,w,E,N){const _=E.enter("tableCell"),j=E.enter("phrasing"),k=E.containerPhrasing(b,{...N,before:s,after:s});return j(),_(),k}function d(b,w){return n8(b,{align:w,alignDelimiters:a,padding:i,stringLength:o})}function g(b,w,E){const N=b.children;let _=-1;const j=[],k=w.enter("table");for(;++_<N.length;)j[_]=m(N[_],w,E);return k(),j}function m(b,w,E){const N=b.children;let _=-1;const j=[],k=w.enter("tableRow");for(;++_<N.length;)j[_]=h(N[_],b,w,E);return k(),j}function x(b,w,E){let N=Y2.inlineCode(b,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function V8(){return{exit:{taskListCheckValueChecked:cv,taskListCheckValueUnchecked:cv,paragraph:Y8}}}function P8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:X8}}}function cv(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Y8(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const a=i.children[0];if(a&&a.type==="text"){const o=n.children;let s=-1,u;for(;++s<o.length;){const f=o[s];if(f.type==="paragraph"){u=f;break}}u===i&&(a.value=a.value.slice(1),a.value.length===0?i.children.shift():i.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,i.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function X8(e,n,i,a){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(a);s&&f.move(u);let h=Y2.listItem(e,n,i,{...a,...f.current()});return s&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function F8(){return[E6(),X6(),Q6(),L8(),V8()]}function G8(e){return{extensions:[N6(),F6(e),K6(),$8(e),P8()]}}const Z8={tokenize:tL,partial:!0},X2={tokenize:nL,partial:!0},F2={tokenize:iL,partial:!0},G2={tokenize:rL,partial:!0},Q8={tokenize:aL,partial:!0},Z2={name:"wwwAutolink",tokenize:W8,previous:K2},Q2={name:"protocolAutolink",tokenize:eL,previous:J2},Ui={name:"emailAutolink",tokenize:J8,previous:W2},li={};function K8(){return{text:li}}let Fr=48;for(;Fr<123;)li[Fr]=Ui,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);li[43]=Ui;li[45]=Ui;li[46]=Ui;li[95]=Ui;li[72]=[Ui,Q2];li[104]=[Ui,Q2];li[87]=[Ui,Z2];li[119]=[Ui,Z2];function J8(e,n,i){const a=this;let o,s;return u;function u(m){return!im(m)||!W2.call(a,a.previous)||Zm(a.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return im(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(Q8,g,d)(m):m===45||m===95||It(m)?(s=!0,e.consume(m),h):g(m)}function d(m){return e.consume(m),o=!0,h}function g(m){return s&&o&&Ft(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):i(m)}}function W8(e,n,i){const a=this;return o;function o(u){return u!==87&&u!==119||!K2.call(a,a.previous)||Zm(a.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Z8,e.attempt(X2,e.attempt(F2,s),i),i)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function eL(e,n,i){const a=this;let o="",s=!1;return u;function u(m){return(m===72||m===104)&&J2.call(a,a.previous)&&!Zm(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),f):i(m)}function f(m){if(Ft(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=o.toLowerCase();if(x==="http"||x==="https")return e.consume(m),h}return i(m)}function h(m){return m===47?(e.consume(m),s?d:(s=!0,h)):i(m)}function d(m){return m===null||$c(m)||rt(m)||ia(m)||pf(m)?i(m):e.attempt(X2,e.attempt(F2,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function tL(e,n,i){let a=0;return o;function o(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),o):u===46&&a===3?(e.consume(u),s):i(u)}function s(u){return u===null?i(u):n(u)}}function nL(e,n,i){let a,o,s;return u;function u(d){return d===46||d===95?e.check(G2,h,f)(d):d===null||rt(d)||ia(d)||d!==45&&pf(d)?h(d):(s=!0,e.consume(d),u)}function f(d){return d===95?a=!0:(o=a,a=void 0),e.consume(d),u}function h(d){return o||a||!s?i(d):n(d)}}function iL(e,n){let i=0,a=0;return o;function o(u){return u===40?(i++,e.consume(u),o):u===41&&a<i?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(G2,n,s)(u):u===null||rt(u)||ia(u)?n(u):(e.consume(u),o)}function s(u){return u===41&&a++,e.consume(u),o}}function rL(e,n,i){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),s):f===93?(e.consume(f),o):f===60||f===null||rt(f)||ia(f)?n(f):i(f)}function o(f){return f===null||f===40||f===91||rt(f)||ia(f)?n(f):a(f)}function s(f){return Ft(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),a):Ft(f)?(e.consume(f),u):i(f)}}function aL(e,n,i){return a;function a(s){return e.consume(s),o}function o(s){return It(s)?i(s):n(s)}}function K2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function J2(e){return!Ft(e)}function W2(e){return!(e===47||im(e))}function im(e){return e===43||e===45||e===46||e===95||It(e)}function Zm(e){let n=e.length,i=!1;for(;n--;){const a=e[n][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){i=!0;break}if(a._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const lL={tokenize:pL,partial:!0};function oL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fL,continuation:{tokenize:dL},exit:hL}},text:{91:{name:"gfmFootnoteCall",tokenize:cL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sL,resolveTo:uL}}}}function sL(e,n,i){const a=this;let o=a.events.length;const s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;o--;){const h=a.events[o][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return i(h);const d=Yn(a.sliceSerialize({start:u.end,end:a.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function uL(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},f=[e[i+1],e[i+2],["enter",a,n],e[i+3],e[i+4],["enter",o,n],["exit",o,n],["enter",s,n],["enter",u,n],["exit",u,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",a,n]];return e.splice(i,e.length-i+1,...f),e}function cL(e,n,i){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?i(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(s>999||m===93&&!u||m===null||m===91||rt(m))return i(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(Yn(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(m)}return rt(m)||(u=!0),s++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function fL(e,n,i){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||rt(w))return i(w);if(w===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return s=Yn(a.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return rt(w)||(f=!0),u++,e.consume(w),w===92?m:g}function m(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(s)||o.push(s),Pe(e,b,"gfmFootnoteDefinitionWhitespace")):i(w)}function b(w){return n(w)}}function dL(e,n,i){return e.check(bs,n,e.attempt(lL,n,i))}function hL(e){e.exit("gfmFootnoteDefinition")}function pL(e,n,i){const a=this;return Pe(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(s):i(s)}}function mL(e){let i=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:s,resolveAll:o};return i==null&&(i=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let d=h;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[h][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[h][1].end)},m={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},x=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&wn(x,x.length,0,mf(b,u.slice(d+1,h),f)),wn(x,x.length,0,[["exit",m,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),wn(u,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function s(u,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const E=gl(d);if(w===126)return m>1?h(w):(u.consume(w),m++,b);if(m<2&&!i)return h(w);const N=u.exit("strikethroughSequenceTemporary"),_=gl(w);return N._open=!_||_===2&&!!E,N._close=!E||E===2&&!!_,f(w)}}}class gL{constructor(){this.map=[]}add(n,i,a){yL(this,n,i,a)}consume(n){if(this.map.sort(function(s,u){return s[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const a=[];for(;i>0;)i-=1,a.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];a.push(n.slice()),n.length=0;let o=a.pop();for(;o;){for(const s of o)n.push(s);o=a.pop()}this.map.length=0}}function yL(e,n,i,a){let o=0;if(!(i===0&&a.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=i,e.map[o][2].push(...a);return}o+=1}e.map.push([n,i,a])}}function xL(e,n){let i=!1;const a=[];for(;n<e.length;){const o=e[n];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=a.length-1;a[s]=a[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return a}function bL(){return{flow:{null:{name:"table",tokenize:vL,resolveAll:wL}}}}function vL(e,n,i){const a=this;let o=0,s=0,u;return f;function f(q){let V=a.events.length-1;for(;V>-1;){const O=a.events[V][1].type;if(O==="lineEnding"||O==="linePrefix")V--;else break}const P=V>-1?a.events[V][1].type:null,te=P==="tableHead"||P==="tableRow"?A:h;return te===A&&a.parser.lazy[a.now().line]?i(q):te(q)}function h(q){return e.enter("tableHead"),e.enter("tableRow"),d(q)}function d(q){return q===124||(u=!0,s+=1),g(q)}function g(q){return q===null?i(q):Se(q)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),b):i(q):He(q)?Pe(e,g,"whitespace")(q):(s+=1,u&&(u=!1,o+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(q)))}function m(q){return q===null||q===124||rt(q)?(e.exit("data"),g(q)):(e.consume(q),q===92?x:m)}function x(q){return q===92||q===124?(e.consume(q),m):m(q)}function b(q){return a.interrupt=!1,a.parser.lazy[a.now().line]?i(q):(e.enter("tableDelimiterRow"),u=!1,He(q)?Pe(e,w,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):w(q))}function w(q){return q===45||q===58?N(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),E):L(q)}function E(q){return He(q)?Pe(e,N,"whitespace")(q):N(q)}function N(q){return q===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),_):q===45?(s+=1,_(q)):q===null||Se(q)?C(q):L(q)}function _(q){return q===45?(e.enter("tableDelimiterFiller"),j(q)):L(q)}function j(q){return q===45?(e.consume(q),j):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(q))}function k(q){return He(q)?Pe(e,C,"whitespace")(q):C(q)}function C(q){return q===124?w(q):q===null||Se(q)?!u||o!==s?L(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(q)):L(q)}function L(q){return i(q)}function A(q){return e.enter("tableRow"),H(q)}function H(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),H):q===null||Se(q)?(e.exit("tableRow"),n(q)):He(q)?Pe(e,H,"whitespace")(q):(e.enter("data"),F(q))}function F(q){return q===null||q===124||rt(q)?(e.exit("data"),H(q)):(e.consume(q),q===92?G:F)}function G(q){return q===92||q===124?(e.consume(q),F):F(q)}}function wL(e,n){let i=-1,a=!0,o=0,s=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,m;const x=new gL;for(;++i<e.length;){const b=e[i],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(fv(x,n,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",d,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(a=!0,m=void 0,s=[0,0,0,0],u=[0,i+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(i,0,[["enter",g,n]])),o=w.type==="tableDelimiterRow"?2:g?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(s[1]!==0&&(u[0]=u[1],m=xc(x,n,s,o,void 0,m),s=[0,0,0,0]),u[2]=i)):w.type==="tableCellDivider"&&(a?a=!1:(s[1]!==0&&(u[0]=u[1],m=xc(x,n,s,o,void 0,m)),s=u,u=[s[1],i,0,0])):w.type==="tableHead"?(f=!0,h=i):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=i,s[1]!==0?(u[0]=u[1],m=xc(x,n,s,o,i,m)):u[1]!==0&&(m=xc(x,n,u,o,i,m)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&fv(x,n,h,d,g),x.consume(n.events),i=-1;++i<n.events.length;){const b=n.events[i];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=xL(n.events,i))}return e}function xc(e,n,i,a,o,s){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(s.end=Object.assign({},Ja(n.events,i[0])),e.add(i[0],0,[["exit",s,n]]));const h=Ja(n.events,i[1]);if(s={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",s,n]]),i[2]!==0){const d=Ja(n.events,i[2]),g=Ja(n.events,i[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",m,n]]),a!==2){const x=n.events[i[2]],b=n.events[i[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",i[3]>i[2]+1){const w=i[2]+1,E=i[3]-i[2]-1;e.add(w,E,[])}}e.add(i[3]+1,0,[["exit",m,n]])}return o!==void 0&&(s.end=Object.assign({},Ja(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function fv(e,n,i,a,o){const s=[],u=Ja(n.events,i);o&&(o.end=Object.assign({},u),s.push(["exit",o,n])),a.end=Object.assign({},u),s.push(["exit",a,n]),e.add(i+1,0,s)}function Ja(e,n){const i=e[n],a=i[0]==="enter"?"start":"end";return i[1][a]}const SL={name:"tasklistCheck",tokenize:kL};function _L(){return{text:{91:SL}}}function kL(e,n,i){const a=this;return o;function o(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),s)}function s(h){return rt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):i(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Se(h)?n(h):He(h)?e.check({tokenize:EL},n,i)(h):i(h)}}function EL(e,n,i){return Pe(e,a,"whitespace");function a(o){return o===null?i(o):n(o)}}function NL(e){return c2([K8(),oL(),mL(e),bL(),_L()])}const CL={};function dv(e){const n=this,i=e||CL,a=n.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(NL(i)),s.push(F8()),u.push(G8(i))}function TL(){const{isRunning:e,results:n,workflowResults:i,logs:a}=uf(),{nodes:o,selectedNodeId:s,updateNode:u}=Hi(),f=Hi(fS),{execute:h,generatedFiles:d,downloadFile:g,downloadAllFiles:m}=FS(),[x,b]=K.useState("");K.useEffect(()=>{if(f?.type==="input"){const C=f.data;b(C.value||"")}},[s,f]);const w=o.filter(C=>C.type==="output"),E=w.length>0?n.get(w[0].id):null,N=f?.type==="input",_=N?f.data:null,j=C=>{b(C),s&&u(s,{value:C})},k=()=>{h()};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx($3,{className:"w-5 h-5 text-gray-400"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&v.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&v.jsx("div",{className:"p-4 border-b border-border",children:v.jsx("div",{className:"space-y-3",children:o.map(C=>v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${C.data.status==="completed"?"bg-green-500":C.data.status==="running"?"bg-blue-500 animate-pulse":C.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),v.jsx("span",{className:"text-sm text-gray-300",children:C.data.label}),C.data.status==="running"&&C.data.progress!==void 0&&v.jsxs("span",{className:"text-xs text-gray-500",children:[C.data.progress,"%"]})]},C.id))})}),v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsxs("button",{onClick:k,disabled:e||o.length===0,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-amber-600 hover:bg-amber-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors",children:[v.jsx(Sm,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),o.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[N&&_&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(of,{className:"w-5 h-5 text-amber-500"}),v.jsx("h4",{className:"text-md font-medium text-white",children:_.label})]}),_.inputType==="text"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Enter your input"}),v.jsx("textarea",{className:"w-full h-32 px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent resize-none",placeholder:_.placeholder||"Type your message here...",value:x||_.value||"",onChange:C=>j(C.target.value)})]}),_.inputType==="file"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Upload a file"}),v.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-gray-600 rounded-lg hover:border-amber-500 transition-colors cursor-pointer",children:[v.jsx(b5,{className:"w-8 h-8 text-gray-500 mb-2"}),v.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),_.fileTypes&&v.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",_.fileTypes.join(", ")]})]})]}),_.inputType==="select"&&_.options&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:_.description||"Select an option"}),v.jsxs("select",{className:"w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-amber-500",value:x||_.value||"",onChange:C=>j(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),_.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),d.length>0&&v.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("h4",{className:"text-sm font-medium text-green-300",children:"생성된 파일"}),v.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1 text-xs bg-green-600 hover:bg-green-700 text-white rounded transition-colors",children:[v.jsx(il,{className:"w-3 h-3"}),"전체 다운로드"]})]}),v.jsx("div",{className:"space-y-2",children:d.map((C,L)=>v.jsxs("div",{className:"flex items-center justify-between p-2 bg-surface rounded",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsx("span",{className:"text-sm text-white",children:C.name})]}),v.jsx("button",{onClick:()=>g(C.name,C.content),className:"p-1 hover:bg-surface-hover rounded transition-colors",children:v.jsx(il,{className:"w-4 h-4 text-gray-400"})})]},L))})]}),i.length>0?v.jsx("div",{className:"space-y-4",children:i.map(C=>v.jsxs("div",{className:`p-4 rounded-lg border ${C.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[C.success?v.jsx(aS,{className:"w-5 h-5 text-green-500"}):v.jsx(lS,{className:"w-5 h-5 text-red-500"}),v.jsx("h5",{className:"text-sm font-medium text-white",children:C.label})]}),C.error&&v.jsx("p",{className:"text-sm text-red-400 mb-3",children:C.error}),C.files&&C.files.length>0&&v.jsxs("div",{className:"space-y-2 mb-3",children:[v.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),C.files.map((L,A)=>v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[L.type==="image"?v.jsx(oS,{className:"w-4 h-4 text-purple-400"}):v.jsx(rl,{className:"w-4 h-4 text-blue-400"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-sm text-white truncate",children:L.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:L.path})]})]},A))]}),C.result&&v.jsxs("details",{className:"group",open:!0,children:[v.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),v.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:v.jsx("div",{className:"markdown-content text-sm",children:v.jsx(rv,{remarkPlugins:[dv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):E?v.jsx("div",{className:"markdown-content",children:v.jsx(rv,{remarkPlugins:[dv],children:typeof E=="string"?E:JSON.stringify(E,null,2)})}):a.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),a.slice(-20).map(C=>v.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[v.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(C.timestamp).toLocaleTimeString("ko-KR")}),v.jsx("span",{className:C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="success"?"text-green-400":"text-gray-300",children:C.message})]},C.id))]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx(rl,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),v.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]}),(E||d.length>0)&&v.jsx("div",{className:"flex items-center gap-2 p-4 border-t border-border",children:v.jsxs("button",{onClick:m,disabled:d.length===0,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover rounded-lg text-sm hover:bg-border transition-colors disabled:opacity-50",children:[v.jsx(il,{className:"w-4 h-4"}),"Download .md"]})})]})}function hv({level:e}){switch(e){case"success":return v.jsx(aS,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(lS,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(y5,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(Z3,{className:"w-4 h-4 text-blue-400"})}}function pv(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function e_({isOpen:e=!0,onClose:n,embedded:i=!1}){const{logs:a,clearLogs:o,isRunning:s}=uf(),[u,f]=K.useState(!1),[h,d]=K.useState(250),g=K.useRef(null);K.useEffect(()=>{g.current&&!u&&g.current.scrollIntoView({behavior:"smooth"})},[a,u]);const m=x=>{x.preventDefault();const b=x.clientY,w=h,E=_=>{const j=b-_.clientY,k=Math.min(Math.max(w+j,100),500);d(k)},N=()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",N)};document.addEventListener("mousemove",E),document.addEventListener("mouseup",N)};return e?i?v.jsxs("div",{className:"flex flex-col h-full bg-[#1a1a1a]",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Bc,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),s&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",a.length," logs)"]})]}),v.jsx("button",{onClick:o,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(Bp,{className:"w-4 h-4 text-gray-400"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto font-mono text-sm p-3",children:a.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[a.map(x=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",x.level==="error"&&"bg-red-500/10",x.level==="warning"&&"bg-yellow-500/10",x.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",pv(x.timestamp),"]"]}),v.jsx(hv,{level:x.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",x.level==="error"&&"text-red-400",x.level==="warning"&&"text-yellow-400",x.level==="success"&&"text-green-400",x.level==="info"&&"text-gray-300"),children:x.message}),x.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",x.nodeId.slice(0,8),"]"]}),x.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof x.details=="string"?x.details:JSON.stringify(x.details,null,2)})]})]},x.id)),v.jsx("div",{ref:g})]})})]}):v.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:u?40:h},children:[!u&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:m}),v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Bc,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),s&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",a.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:o,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(Bp,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>f(!u),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:u?"Expand":"Minimize",children:u?v.jsx(R3,{className:"w-4 h-4 text-gray-400"}):v.jsx(D3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>d(h===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:h>250?v.jsx(i5,{className:"w-4 h-4 text-gray-400"}):v.jsx(e5,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:n,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(cS,{className:"w-4 h-4 text-gray-400"})})]})]}),!u&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:h-44},children:a.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[a.map(x=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",x.level==="error"&&"bg-red-500/10",x.level==="warning"&&"bg-yellow-500/10",x.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",pv(x.timestamp),"]"]}),v.jsx(hv,{level:x.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",x.level==="error"&&"text-red-400",x.level==="warning"&&"text-yellow-400",x.level==="success"&&"text-green-400",x.level==="info"&&"text-gray-300"),children:x.message}),x.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",x.nodeId.slice(0,8),"]"]}),x.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof x.details=="string"?x.details:JSON.stringify(x.details,null,2)})]})]},x.id)),v.jsx("div",{ref:g})]})})]}):null}const ML=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],AL=[{id:"sonnet",name:"Claude 4 Sonnet",description:"Fast, cost-efficient"},{id:"opus",name:"Claude 4.5 Opus",description:"Best for complex tasks"},{id:"haiku",name:"Claude 3.5 Haiku",description:"Fastest, for simple tasks"}];function zL(e){switch(e){case"input":return v.jsx(of,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(hs,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(sf,{className:"w-5 h-5 text-cyan-400"});case"mcp":return v.jsx(_m,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(lf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function DL(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"mcp":return"MCP Server";case"output":return"Output";default:return"Node"}}function jL({node:e}){const{updateNode:n,removeNode:i}=Hi();if(!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(f5,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const a=()=>{i(e.id)},o=u=>{n(e.id,{label:u})},s=u=>{n(e.id,{description:u})};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-lg bg-surface",children:zL(e.type)}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),v.jsx("p",{className:"text-xs text-gray-500",children:DL(e.type)})]})]}),v.jsx("button",{onClick:a,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:v.jsx(Bp,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),v.jsx("input",{type:"text",value:e.data.label,onChange:u=>o(u.target.value),className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),v.jsx("textarea",{value:e.data.description||"",onChange:u=>s(u.target.value),rows:4,placeholder:e.type==="subagent"?"Enter instructions for this agent...":"Describe what this step does...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all resize-none"})]}),e.type==="input"&&v.jsx(RL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="subagent"&&v.jsx(OL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="skill"&&v.jsx(LL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="mcp"&&v.jsx(HL,{data:e.data,onUpdate:u=>n(e.id,u)}),e.type==="output"&&v.jsx(BL,{onUpdate:u=>n(e.id,u)})]})]})}function RL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>v.jsx("button",{onClick:()=>n({inputType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.charAt(0).toUpperCase()+i.slice(1)},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),v.jsx("textarea",{value:e.value||"",onChange:i=>n({value:i.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function OL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),v.jsx("div",{className:"space-y-2",children:AL.map(i=>v.jsxs("button",{onClick:()=>n({model:i.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===i.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[v.jsx(hs,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:ML.map(i=>v.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[v.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:a=>{const o=a.target.checked?[...e.tools||[],i]:(e.tools||[]).filter(s=>s!==i);n({tools:o})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),v.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),v.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>n({systemPrompt:i.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function LL({data:e,onUpdate:n}){const i=[{id:"ppt-generator",name:"PPT Generator",description:"Create PowerPoint presentations"},{id:"image-gen-nanobanana",name:"Image Generator",description:"Generate images with AI"},{id:"pdf",name:"PDF Processor",description:"Process and create PDF documents"},{id:"xlsx",name:"Excel Processor",description:"Work with spreadsheets"},{id:"docx",name:"Word Processor",description:"Create and edit documents"}];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(a=>v.jsx("button",{onClick:()=>n({skillType:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a.charAt(0).toUpperCase()+a.slice(1)},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),v.jsx("div",{className:"space-y-2",children:i.map(a=>v.jsxs("button",{onClick:()=>n({skillId:a.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===a.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(sf,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:a.name}),v.jsx("div",{className:"text-xs text-gray-500",children:a.description})]})]},a.id))})]})]})}function HL({data:e,onUpdate:n}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:["stdio","sse"].map(i=>v.jsx("button",{onClick:()=>n({serverType:i}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.serverType===i?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:i.toUpperCase()},i))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Name"}),v.jsx("input",{type:"text",value:e.serverName||"",onChange:i=>n({serverName:i.target.value}),placeholder:"e.g., my-mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Server Command (for stdio)"}),v.jsx("input",{type:"text",value:e.serverConfig?.command||"",onChange:i=>n({serverConfig:{...e.serverConfig,command:i.target.value}}),placeholder:"e.g., npx @anthropic/mcp-server",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]})]})}function BL({onUpdate:e}){const n=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),v.jsx("div",{className:"space-y-2",children:n.map(i=>v.jsxs("button",{onClick:()=>e({layoutType:i.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[v.jsx(lf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:i.name}),v.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const UL=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function IL(){const{activeTab:e,setActiveTab:n}=zm(),i=Hi(fS);return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:UL.map(a=>v.jsx("button",{onClick:()=>n(a.id),className:Xt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===a.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:a.label},a.id))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(TL,{}),e==="console"&&v.jsx(e_,{embedded:!0}),e==="step"&&v.jsx(jL,{node:i}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}const qL=[{keywords:["research","find","search","look up","investigate"],steps:[{type:"input",label:"Research Topic",description:"Enter the topic to research"},{type:"subagent",label:"Research Agent",description:"Conduct comprehensive research on the topic",config:{role:"researcher",tools:["WebSearch","WebFetch","Read"]}},{type:"output",label:"Research Results",description:"Compiled research findings",config:{outputType:"markdown"}}]},{keywords:["write","create","generate","draft","compose"],steps:[{type:"input",label:"Content Brief",description:"Describe what content you want to create"},{type:"subagent",label:"Content Writer",description:"Create high-quality content based on the brief",config:{role:"writer",tools:["Read","Write"]}},{type:"output",label:"Written Content",description:"Final written output",config:{outputType:"markdown"}}]},{keywords:["analyze","review","evaluate","assess","examine"],steps:[{type:"input",label:"Analysis Input",description:"Data or content to analyze"},{type:"subagent",label:"Analysis Agent",description:"Perform detailed analysis",config:{role:"analyst",tools:["Read","Grep","Glob"]}},{type:"output",label:"Analysis Report",description:"Structured analysis findings",config:{outputType:"markdown"}}]},{keywords:["code","develop","implement","build","program"],steps:[{type:"input",label:"Requirements",description:"Describe what you want to build"},{type:"subagent",label:"Developer Agent",description:"Write code based on requirements",config:{role:"coder",tools:["Read","Write","Edit","Bash","Glob","Grep"]}},{type:"output",label:"Generated Code",description:"Implementation output",config:{outputType:"auto"}}]},{keywords:["html","webpage","website","page","landing"],steps:[{type:"input",label:"Page Requirements",description:"Describe the webpage you want"},{type:"subagent",label:"Web Developer",description:"Create HTML/CSS for the webpage",config:{role:"coder",tools:["Write"]}},{type:"skill",label:"Image Generator",description:"Generate images for the page",config:{skillType:"official",skillId:"image-gen"}},{type:"output",label:"Complete Webpage",description:"HTML page with images",config:{outputType:"auto"}}]},{keywords:["image","picture","illustration","graphic","visual"],steps:[{type:"input",label:"Image Description",description:"Describe the image you want"},{type:"skill",label:"Image Generator",description:"Generate image based on description",config:{skillType:"official",skillId:"image-gen-nanobanana"}},{type:"output",label:"Generated Image",description:"Final image output",config:{outputType:"auto"}}]},{keywords:["ppt","presentation","slides","powerpoint"],steps:[{type:"input",label:"Presentation Topic",description:"Topic and outline for presentation"},{type:"subagent",label:"Content Planner",description:"Plan presentation structure and content",config:{role:"writer",tools:["Read"]}},{type:"skill",label:"PPT Generator",description:"Create PowerPoint presentation",config:{skillType:"official",skillId:"ppt-generator"}},{type:"output",label:"Presentation",description:"Final PowerPoint file",config:{outputType:"auto"}}]}],$L=[{type:"input",label:"User Input",description:"Enter your input"},{type:"subagent",label:"AI Assistant",description:"Process the input and generate response",config:{role:"custom",tools:["Read","Write"]}},{type:"output",label:"Output",description:"Final output",config:{outputType:"auto"}}];function VL(e){const n=e.toLowerCase();for(const i of qL)if(i.keywords.some(a=>n.includes(a)))return i.steps;return $L}function PL(e,n,i,a){const o=ml(),h={x:100+n*300,y:200},d={label:e.label,description:e.description,status:"idle",usedInputs:n>0?a:[]};switch(e.type){case"input":return{id:o,type:"input",position:h,data:{...d,inputType:"text",placeholder:e.description}};case"subagent":return{id:o,type:"subagent",position:h,data:{...d,role:e.config?.role||"custom",tools:e.config?.tools||["Read"],model:"sonnet"}};case"skill":return{id:o,type:"skill",position:h,data:{...d,skillType:e.config?.skillType||"official",skillId:e.config?.skillId||void 0}};case"mcp":return{id:o,type:"mcp",position:h,data:{...d,serverType:"stdio",serverName:e.config?.serverName||"",serverConfig:{}}};case"output":return{id:o,type:"output",position:h,data:{...d,outputType:e.config?.outputType||"auto"}}}}function YL(e){const n=VL(e),i=[],a=[];let o=[];return n.forEach((u,f)=>{const h=PL(u,f,n.length,[...o]);i.push(h),f>0&&i[f-1]&&a.push({id:`e-${i[f-1].id}-${h.id}`,source:i[f-1].id,target:h.id,animated:!0}),o.push(h.id)}),{nodes:t_(i,a),edges:a}}function XL(e,n){return{nodes:e.nodes.map(a=>{if(a.type==="input")return{...a,data:{...a.data,value:n}};if(a.type==="subagent"){const o=a.data;return{...a,data:{...o,systemPrompt:`Based on the user's request: "${n}"
132
-
133
- ${o.description}`}}}return a}),edges:e.edges}}function FL(e){const n=YL(e);return XL(n,e)}async function GL(e){const n=await fetch("/api/generate/workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});if(!n.ok){const o=await n.json();throw new Error(o.message||"Failed to generate workflow")}const i=await n.json();return{workflow:ZL(i),workflowName:i.workflowName}}function t_(e,n){if(e.length===0)return e;const i=300,a=150,o=100,s=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),n.forEach(w=>{const E=u.get(w.target)||[];E.push(w.source),u.set(w.target,E);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const h=e.filter(w=>(u.get(w.id)||[]).length===0),d=new Map,g=[];for(h.forEach(w=>{d.set(w.id,0),g.push({id:w.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(N=>{const _=d.get(N),j=w.depth+1;(_===void 0||j>_)&&(d.set(N,j),g.push({id:N,depth:j}))})}const m=new Map;d.forEach((w,E)=>{const N=m.get(w)||[];N.push(E),m.set(w,N)});const x=Math.max(...Array.from(d.values()),0),b=new Map;for(let w=0;w<=x;w++){const E=m.get(w)||[],_=(E.length-1)*a,j=s+(300-_)/2;E.forEach((k,C)=>{b.set(k,{x:o+w*i,y:j+C*a})})}return e.map(w=>{const E=b.get(w.id)||w.position;return{...w,position:E}})}function ZL(e){const n=[],i=new Map,a={x:0,y:0};e.nodes.forEach((u,f)=>{const h=ml();i.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":n.push({id:h,type:"input",position:{...a},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":n.push({id:h,type:"subagent",position:{...a},data:{...d,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":n.push({id:h,type:"skill",position:{...a},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"mcp":n.push({id:h,type:"mcp",position:{...a},data:{...d,serverType:"stdio",serverName:u.label,serverConfig:{}}});break;case"output":n.push({id:h,type:"output",position:{...a},data:{...d,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=i.get(u.to),h=i.get(u.from);if(f&&h){const d=n.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const o=e.edges.map(u=>{const f=i.get(u.from),h=i.get(u.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(u=>u!==null);return{nodes:t_(n,o),edges:o}}function QL(){const[e,n]=K.useState(""),[i,a]=K.useState(!1),[o,s]=K.useState(null),{loadWorkflow:u}=Hi(),f=async()=>{if(!(!e.trim()||i)){a(!0),s(null);try{const{workflow:d,workflowName:g}=await GL(e);u({nodes:d.nodes,edges:d.edges,name:g}),n("")}catch(d){console.error("AI workflow generation failed, falling back to pattern matching:",d);try{const g=FL(e);u({nodes:g.nodes,edges:g.edges,name:e.slice(0,30)}),n("")}catch(g){console.error("Fallback generation also failed:",g),s("워크플로우 생성에 실패했습니다. 다시 시도해주세요.")}}finally{a(!1)}}},h=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),f())};return v.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[v.jsx(hs,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:d=>n(d.target.value),onKeyDown:h,placeholder:"Describe your workflow... (e.g., 'Create an HTML page with images')",className:"flex-1 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm",disabled:i}),v.jsx("button",{onClick:f,disabled:!e.trim()||i,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!i?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:i?v.jsx(sS,{className:"w-5 h-5 animate-spin"}):v.jsx(u5,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs",children:o?v.jsx("span",{className:"text-red-400",children:o}):i?v.jsx("span",{className:"text-accent",children:"AI가 워크플로우를 생성하고 있습니다..."}):v.jsx("span",{className:"text-gray-600",children:"AI가 워크플로우를 자동 생성합니다"})})]})}function KL(){const{isCollapsed:e,width:n}=zm(),{isRunning:i,logs:a}=uf(),[o,s]=K.useState(!1);return K.useEffect(()=>{i&&s(!0)},[i]),v.jsx(eS,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(Iz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(Vz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(aD,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(QL,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:v.jsx(IL,{})})]}),v.jsxs("button",{onClick:()=>s(!o),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${o?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${o?"opacity-0 pointer-events-none":"opacity-100"}`,children:[v.jsx(Bc,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),a.length>0&&!o&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:a.length}),i&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(e_,{isOpen:o,onClose:()=>s(!1)})]})})}mE.createRoot(document.getElementById("root")).render(v.jsx(K.StrictMode,{children:v.jsx(KL,{})}));