makecc 0.2.7 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-B9j5oIcH.js +150 -0
- package/dist/client/assets/index-v9IFpWkA.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +145 -1
- package/dist/server/services/configLoaderService.js +185 -0
- package/dist/server/services/skillGeneratorService.js +159 -1
- package/package.json +1 -1
- package/server/index.ts +176 -2
- package/server/services/configLoaderService.ts +260 -0
- package/server/services/skillGeneratorService.ts +200 -1
- package/dist/client/assets/index-CclsqEDr.js +0 -147
- package/dist/client/assets/index-DLT8bQFx.css +0 -1
|
@@ -1,147 +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 Gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oh={exports:{}},yo={};var Lx;function fE(){if(Lx)return yo;Lx=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 yo.Fragment=n,yo.jsx=i,yo.jsxs=i,yo}var Hx;function dE(){return Hx||(Hx=1,Oh.exports=fE()),Oh.exports}var v=dE(),Lh={exports:{}},Me={};var Bx;function hE(){if(Bx)return Me;Bx=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,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||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 D(){}D.prototype=_.prototype;function k(R,$,T){this.props=R,this.context=$,this.refs=N,this.updater=T||w}var C=k.prototype=new D;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,$,T){var ie=T.ref;return{$$typeof:e,type:R,key:$,ref:ie!==void 0?ie:null,props:T}}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(T){return $[T]})}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 j(R,$,T,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,j(he(R._payload),$,T,ie,ce)}}if(he)return ce=ce(R),he=ie===""?"."+O(R,0):ie,L(ce)?(T="",he!=null&&(T=he.replace(te,"$&/")+"/"),j(ce,$,T,"",function(Ee){return Ee})):ce!=null&&(V(ce)&&(ce=q(ce,T+(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+=j(ie,$,T,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+=j(ie,$,T,fe,ce);else if(fe==="object"){if(typeof R.then=="function")return j(B(R),$,T,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,$,T){if(R==null)return R;var ie=[],ce=0;return j(R,ie,"","",function(fe){return $.call(T,fe,ce++)}),ie}function Y(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(T){(R._status===0||R._status===-1)&&(R._status=1,R._result=T)},function(T){(R._status===0||R._status===-1)&&(R._status=2,R._result=T)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var K=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,$,T){U(R,function(){$.apply(this,arguments)},T)},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 Me.Activity=m,Me.Children=z,Me.Component=_,Me.Fragment=i,Me.Profiler=o,Me.PureComponent=k,Me.StrictMode=a,Me.Suspense=h,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Me.__COMPILER_RUNTIME={__proto__:null,c:function(R){return H.H.useMemoCache(R)}},Me.cache=function(R){return function(){return R.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(R,$,T){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=T;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)},Me.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},Me.createElement=function(R,$,T){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=T;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)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(R){return{$$typeof:f,render:R}},Me.isValidElement=V,Me.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:Y}},Me.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},Me.startTransition=function(R){var $=H.T,T={};H.T=T;try{var ie=R(),ce=H.S;ce!==null&&ce(T,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(A,K)}catch(fe){K(fe)}finally{$!==null&&T.types!==null&&($.types=T.types),H.T=$}},Me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Me.use=function(R){return H.H.use(R)},Me.useActionState=function(R,$,T){return H.H.useActionState(R,$,T)},Me.useCallback=function(R,$){return H.H.useCallback(R,$)},Me.useContext=function(R){return H.H.useContext(R)},Me.useDebugValue=function(){},Me.useDeferredValue=function(R,$){return H.H.useDeferredValue(R,$)},Me.useEffect=function(R,$){return H.H.useEffect(R,$)},Me.useEffectEvent=function(R){return H.H.useEffectEvent(R)},Me.useId=function(){return H.H.useId()},Me.useImperativeHandle=function(R,$,T){return H.H.useImperativeHandle(R,$,T)},Me.useInsertionEffect=function(R,$){return H.H.useInsertionEffect(R,$)},Me.useLayoutEffect=function(R,$){return H.H.useLayoutEffect(R,$)},Me.useMemo=function(R,$){return H.H.useMemo(R,$)},Me.useOptimistic=function(R,$){return H.H.useOptimistic(R,$)},Me.useReducer=function(R,$,T){return H.H.useReducer(R,$,T)},Me.useRef=function(R){return H.H.useRef(R)},Me.useState=function(R){return H.H.useState(R)},Me.useSyncExternalStore=function(R,$,T){return H.H.useSyncExternalStore(R,$,T)},Me.useTransition=function(){return H.H.useTransition()},Me.version="19.2.3",Me}var Ux;function ss(){return Ux||(Ux=1,Lh.exports=hE()),Lh.exports}var Z=ss();const Io=Gc(Z);var Hh={exports:{}},xo={},Bh={exports:{}},Uh={};var Ix;function pE(){return Ix||(Ix=1,(function(e){function n(j,U){var Y=j.length;j.push(U);e:for(;0<Y;){var K=Y-1>>>1,z=j[K];if(0<o(z,U))j[K]=U,j[Y]=z,Y=K;else break e}}function i(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var U=j[0],Y=j.pop();if(Y!==U){j[0]=Y;e:for(var K=0,z=j.length,R=z>>>1;K<R;){var $=2*(K+1)-1,T=j[$],ie=$+1,ce=j[ie];if(0>o(T,Y))ie<z&&0>o(ce,T)?(j[K]=ce,j[ie]=Y,K=ie):(j[K]=T,j[$]=Y,K=$);else if(ie<z&&0>o(ce,Y))j[K]=ce,j[ie]=Y,K=ie;else break e}}return U}function o(j,U){var Y=j.sortIndex-U.sortIndex;return Y!==0?Y:j.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,D=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function C(j){for(var U=i(d);U!==null;){if(U.callback===null)a(d);else if(U.startTime<=j)a(d),U.sortIndex=U.expirationTime,n(h,U);else break;U=i(d)}}function L(j){if(E=!1,C(j),!w)if(i(h)!==null)w=!0,A||(A=!0,P());else{var U=i(d);U!==null&&B(L,U.startTime-j)}}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 j=e.unstable_now();G=j;var U=!0;try{e:{w=!1,E&&(E=!1,D(H),H=-1),b=!0;var Y=x;try{t:{for(C(j),m=i(h);m!==null&&!(m.expirationTime>j&&q());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var z=K(m.expirationTime<=j);if(j=e.unstable_now(),typeof z=="function"){m.callback=z,C(j),U=!0;break t}m===i(h)&&a(h),C(j)}else a(h);m=i(h)}if(m!==null)U=!0;else{var R=i(d);R!==null&&B(L,R.startTime-j),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(j,U){H=_(function(){j(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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(j){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Y=x;x=U;try{return j()}finally{x=Y}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var Y=x;x=j;try{return U()}finally{x=Y}},e.unstable_scheduleCallback=function(j,U,Y){var K=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?K+Y:K):Y=K,j){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,j={id:g++,callback:U,priorityLevel:j,startTime:Y,expirationTime:z,sortIndex:-1},Y>K?(j.sortIndex=Y,n(d,j),i(h)===null&&j===i(d)&&(E?(D(H),H=-1):E=!0,B(L,Y-K))):(j.sortIndex=z,n(h,j),w||b||(w=!0,A||(A=!0,P()))),j},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(j){var U=x;return function(){var Y=x;x=U;try{return j.apply(this,arguments)}finally{x=Y}}}})(Uh)),Uh}var qx;function mE(){return qx||(qx=1,Bh.exports=pE()),Bh.exports}var Ih={exports:{}},Ut={};var $x;function gE(){if($x)return Ut;$x=1;var e=ss();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 Vx;function yv(){if(Vx)return Ih.exports;Vx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Ih.exports=gE(),Ih.exports}var Px;function yE(){if(Px)return xo;Px=1;var e=mE(),n=ss(),i=yv();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,M=p.child;M;){if(M===l){S=!0,l=p,c=y;break}if(M===c){S=!0,c=p,l=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===l){S=!0,l=y,c=p;break}if(M===c){S=!0,c=y,l=p;break}M=M.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"),D=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 D: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,j=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},K=[],z=-1;function R(t){return{current:t}}function $(t){0>z||(t.current=K[z],K[z]=null,z--)}function T(t,r){z++,K[z]=t.current,t.current=r}var ie=R(null),ce=R(null),fe=R(null),he=R(null);function ue(t,r){switch(T(fe,r),T(ce,t),T(ie,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?ax(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=ax(r),t=lx(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(ie),T(ie,t)}function me(){$(ie),$(ce),$(fe)}function Ee(t){t.memoizedState!==null&&T(he,t);var r=ie.current,l=lx(r,t.type);r!==l&&(T(ce,t),T(ie,l))}function Ce(t){ce.current===t&&($(ie),$(ce)),he.current===t&&($(he),ho._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],M=y[1];if(S&&M){var I=S.split(`
|
|
4
|
-
`),W=M.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,De=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:_f,Gn=Math.log,sn=Math.LN2;function _f(t){return t>>>=0,t===0?32:31-(Gn(t)/sn|0)|0}var la=256,oa=262144,sa=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 ua(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 M=c&134217727;return M!==0?(c=M&~y,c!==0?p=ui(c):(S&=M,S!==0?p=ui(S):l||(l=M&~t,l!==0&&(p=ui(l))))):(M=c&~y,M!==0?p=ui(M):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 kf(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 _s(){var t=sa;return sa<<=1,(sa&62914560)===0&&(sa=4194304),t}function _l(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 Ef(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 M=t.entanglements,I=t.expirationTimes,W=t.hiddenUpdates;for(l=S&~l;0<l;){var le=31-Ke(l),se=1<<le;M[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&&ks(t,c,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function ks(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 Es(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 Ns(t,r){var l=r&-r;return l=(l&42)!==0?1:kl(l),(l&(t.suspendedLanes|r))!==0?0:l}function kl(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 El(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Cs(){var t=U.p;return t!==0?t:(t=window.event,t===void 0?32:Tx(t.type))}function Ms(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,ca="__reactEvents$"+Zn,Ts="__reactListeners$"+Zn,Nf="__reactHandles$"+Zn,As="__reactResources$"+Zn,Er="__reactMarker$"+Zn;function Nl(t){delete t[Nt],delete t[Bt],delete t[ca],delete t[Ts],delete t[Nf]}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=hx(t);t!==null;){if(l=t[Nt])return l;t=hx(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[As];return r||(r=t[As]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function yt(t){t[Er]=!0}var zs=new Set,js={};function fi(t,r){Yi(t,r),Yi(t+"Capture",r)}function Yi(t,r){for(js[t]=r,t=0;t<r.length;t++)zs.add(r[t])}var Cf=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]*$"),Cl={},Ds={};function Mf(t){return Lt.call(Ds,t)?!0:Lt.call(Cl,t)?!1:Cf.test(t)?Ds[t]=!0:(Cl[t]=!0,!1)}function fa(t,r,l){if(Mf(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 da(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 Rs(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Tf(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 ha(t){if(!t._valueTracker){var r=Rs(t)?"checked":"value";t._valueTracker=Tf(t,r,""+t[r])}}function Os(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var l=r.getValue(),c="";return t&&(c=Rs(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 Af=/[\n"\\]/g;function Qt(t){return t.replace(Af,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(t,r,l,c,p,y,S,M){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?Ml(t,S,Zt(r)):l!=null?Ml(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"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Zt(M):t.removeAttribute("name")}function Ls(t,r,l,c,p,y,S,M){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)){ha(t);return}l=l!=null?""+Zt(l):"",r=r!=null?""+Zt(r):l,M||r===t.value||(t.value=r),t.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=M?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),ha(t)}function Ml(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 eg(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 tg(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),ha(t)}function pa(t,r){if(r){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=r;return}}t.textContent=r}var l_=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 ng(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||l_.has(r)?r==="float"?t.cssFloat=l:t[r]=(""+l).trim():t[r]=l+"px"}function ig(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&&ng(t,p,c)}else for(var y in r)r.hasOwnProperty(y)&&ng(t,y,r[y])}function zf(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 o_=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"]]),s_=/^[\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 Hs(t){return s_.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hi(){}var jf=null;function Df(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ma=null,ga=null;function rg(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&&Os(c)}break e;case"textarea":eg(t,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&di(t,!!l.multiple,r,!1)}}}var Rf=!1;function ag(t,r,l){if(Rf)return t(r,l);Rf=!0;try{var c=t(r);return c}finally{if(Rf=!1,(ma!==null||ga!==null)&&(ku(),ma&&(r=ma,t=ga,ga=ma=null,rg(r),t)))for(r=0;r<t.length;r++)rg(t[r])}}function Tl(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"),Of=!1;if(pi)try{var Al={};Object.defineProperty(Al,"passive",{get:function(){Of=!0}}),window.addEventListener("test",Al,Al),window.removeEventListener("test",Al,Al)}catch{Of=!1}var Xi=null,Lf=null,Bs=null;function lg(){if(Bs)return Bs;var t,r=Lf,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 Bs=p.slice(t,1<c?1-c:void 0)}function Us(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 Is(){return!0}function og(){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 M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Is:og,this.isPropagationStopped=og,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=Is)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),r}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=Kt(Mr),zl=m({},Mr,{view:0,detail:0}),u_=Kt(zl),Hf,Bf,jl,$s=m({},zl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:If,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!==jl&&(jl&&t.type==="mousemove"?(Hf=t.screenX-jl.screenX,Bf=t.screenY-jl.screenY):Bf=Hf=0,jl=t),Hf)},movementY:function(t){return"movementY"in t?t.movementY:Bf}}),sg=Kt($s),c_=m({},$s,{dataTransfer:0}),f_=Kt(c_),d_=m({},zl,{relatedTarget:0}),Uf=Kt(d_),h_=m({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),p_=Kt(h_),m_=m({},Mr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),g_=Kt(m_),y_=m({},Mr,{data:0}),ug=Kt(y_),x_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},b_={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"},v_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w_(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=v_[t])?!!r[t]:!1}function If(){return w_}var S_=m({},zl,{key:function(t){if(t.key){var r=x_[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Us(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?b_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:If,charCode:function(t){return t.type==="keypress"?Us(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Us(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),__=Kt(S_),k_=m({},$s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cg=Kt(k_),E_=m({},zl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:If}),N_=Kt(E_),C_=m({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),M_=Kt(C_),T_=m({},$s,{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}),A_=Kt(T_),z_=m({},Mr,{newState:0,oldState:0}),j_=Kt(z_),D_=[9,13,27,32],qf=pi&&"CompositionEvent"in window,Dl=null;pi&&"documentMode"in document&&(Dl=document.documentMode);var R_=pi&&"TextEvent"in window&&!Dl,fg=pi&&(!qf||Dl&&8<Dl&&11>=Dl),dg=" ",hg=!1;function pg(t,r){switch(t){case"keyup":return D_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ya=!1;function O_(t,r){switch(t){case"compositionend":return mg(r);case"keypress":return r.which!==32?null:(hg=!0,dg);case"textInput":return t=r.data,t===dg&&hg?null:t;default:return null}}function L_(t,r){if(ya)return t==="compositionend"||!qf&&pg(t,r)?(t=lg(),Bs=Lf=Xi=null,ya=!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 fg&&r.locale!=="ko"?null:r.data;default:return null}}var H_={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 gg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!H_[t.type]:r==="textarea"}function yg(t,r,l,c){ma?ga?ga.push(c):ga=[c]:ma=c,r=zu(r,"onChange"),0<r.length&&(l=new qs("onChange","change",null,l,c),t.push({event:l,listeners:r}))}var Rl=null,Ol=null;function B_(t){W0(t,0)}function Vs(t){var r=Vi(t);if(Os(r))return t}function xg(t,r){if(t==="change")return r}var bg=!1;if(pi){var $f;if(pi){var Vf="oninput"in document;if(!Vf){var vg=document.createElement("div");vg.setAttribute("oninput","return;"),Vf=typeof vg.oninput=="function"}$f=Vf}else $f=!1;bg=$f&&(!document.documentMode||9<document.documentMode)}function wg(){Rl&&(Rl.detachEvent("onpropertychange",Sg),Ol=Rl=null)}function Sg(t){if(t.propertyName==="value"&&Vs(Ol)){var r=[];yg(r,Ol,t,Df(t)),ag(B_,r)}}function U_(t,r,l){t==="focusin"?(wg(),Rl=r,Ol=l,Rl.attachEvent("onpropertychange",Sg)):t==="focusout"&&wg()}function I_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Vs(Ol)}function q_(t,r){if(t==="click")return Vs(r)}function $_(t,r){if(t==="input"||t==="change")return Vs(r)}function V_(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var un=typeof Object.is=="function"?Object.is:V_;function Ll(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 _g(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function kg(t,r){var l=_g(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=_g(l)}}function Eg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Eg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Ng(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 Pf(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 P_=pi&&"documentMode"in document&&11>=document.documentMode,xa=null,Yf=null,Hl=null,Xf=!1;function Cg(t,r,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Xf||xa==null||xa!==Nr(c)||(c=xa,"selectionStart"in c&&Pf(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}),Hl&&Ll(Hl,c)||(Hl=c,c=zu(Yf,"onSelect"),0<c.length&&(r=new qs("onSelect","select",null,r,l),t.push({event:r,listeners:c}),r.target=xa)))}function Tr(t,r){var l={};return l[t.toLowerCase()]=r.toLowerCase(),l["Webkit"+t]="webkit"+r,l["Moz"+t]="moz"+r,l}var ba={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Ff={},Mg={};pi&&(Mg=document.createElement("div").style,"AnimationEvent"in window||(delete ba.animationend.animation,delete ba.animationiteration.animation,delete ba.animationstart.animation),"TransitionEvent"in window||delete ba.transitionend.transition);function Ar(t){if(Ff[t])return Ff[t];if(!ba[t])return t;var r=ba[t],l;for(l in r)if(r.hasOwnProperty(l)&&l in Mg)return Ff[t]=r[l];return t}var Tg=Ar("animationend"),Ag=Ar("animationiteration"),zg=Ar("animationstart"),Y_=Ar("transitionrun"),X_=Ar("transitionstart"),F_=Ar("transitioncancel"),jg=Ar("transitionend"),Dg=new Map,Gf="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(" ");Gf.push("scrollEnd");function Hn(t,r){Dg.set(t,r),fi(r,[t])}var Ps=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=[],va=0,Zf=0;function Ys(){for(var t=va,r=Zf=va=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&&Rg(l,p,y)}}function Xs(t,r,l,c){_n[va++]=t,_n[va++]=r,_n[va++]=l,_n[va++]=c,Zf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Qf(t,r,l,c){return Xs(t,r,l,c),Fs(t)}function zr(t,r){return Xs(t,null,null,r),Fs(t)}function Rg(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 Fs(t){if(50<ao)throw ao=0,ah=null,Error(a(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var wa={};function G_(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 G_(t,r,l,c)}function Kf(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 Og(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 Gs(t,r,l,c,p,y){var S=0;if(c=t,typeof t=="function")Kf(t)&&(S=1);else if(typeof t=="string")S=Wk(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 jr(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 D: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 jr(t,r,l,c){return t=cn(7,t,c,r),t.lanes=l,t}function Jf(t,r,l){return t=cn(6,t,null,r),t.lanes=l,t}function Lg(t){var r=cn(18,null,null,0);return r.stateNode=t,r}function Wf(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 Hg=new WeakMap;function kn(t,r){if(typeof t=="object"&&t!==null){var l=Hg.get(t);return l!==void 0?l:(r={value:t,source:r,stack:on(r)},Hg.set(t,r),r)}return{value:t,source:r,stack:on(r)}}var Sa=[],_a=0,Zs=null,Bl=0,En=[],Nn=0,Fi=null,Qn=1,Kn="";function gi(t,r){Sa[_a++]=Bl,Sa[_a++]=Zs,Zs=t,Bl=r}function Bg(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 ed(t){t.return!==null&&(gi(t,1),Bg(t,1,0))}function td(t){for(;t===Zs;)Zs=Sa[--_a],Sa[_a]=null,Bl=Sa[--_a],Sa[_a]=null;for(;t===Fi;)Fi=En[--Nn],En[Nn]=null,Kn=En[--Nn],En[Nn]=null,Qn=En[--Nn],En[Nn]=null}function Ug(t,r){En[Nn++]=Qn,En[Nn++]=Kn,En[Nn++]=Fi,Qn=r.id,Kn=r.overflow,Fi=t}var zt=null,lt=null,qe=!1,Gi=null,Cn=!1,nd=Error(a(519));function Zi(t){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ul(kn(r,t)),nd}function Ig(t){var r=t.stateNode,l=t.type,c=t.memoizedProps;switch(r[Nt]=t,r[Bt]=c,l){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(l=0;l<oo.length;l++)He(oo[l],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":He("invalid",r),Ls(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":He("invalid",r);break;case"textarea":He("invalid",r),tg(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||ix(r.textContent,l)?(c.popover!=null&&(He("beforetoggle",r),He("toggle",r)),c.onScroll!=null&&He("scroll",r),c.onScrollEnd!=null&&He("scrollend",r),c.onClick!=null&&(r.onclick=hi),r=!0):r=!1,r||Zi(t,!0)}function qg(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 ka(t){if(t!==zt)return!1;if(!qe)return qg(t),qe=!0,!1;var r=t.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||vh(t.type,t.memoizedProps)),l=!l),l&<&&Zi(t),qg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=dx(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));lt=dx(t)}else r===27?(r=lt,ur(t.type)?(t=Eh,Eh=null,lt=t):lt=r):lt=zt?Tn(t.stateNode.nextSibling):null;return!0}function Dr(){lt=zt=null,qe=!1}function id(){var t=Gi;return t!==null&&(tn===null?tn=t:tn.push.apply(tn,t),Gi=null),t}function Ul(t){Gi===null?Gi=[t]:Gi.push(t)}var rd=R(null),Rr=null,yi=null;function Qi(t,r,l){T(rd,r._currentValue),r._currentValue=l}function xi(t){t._currentValue=rd.current,$(rd)}function ad(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 ld(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 M=y;y=p;for(var I=0;I<r.length;I++)if(M.context===r[I]){y.lanes|=l,M=y.alternate,M!==null&&(M.lanes|=l),ad(y.return,l,t),c||(S=null);break e}y=M.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),ad(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 Ea(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 M=p.type;un(p.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}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(ho):t=[ho])}p=p.return}t!==null&&ld(r,t,l,c),r.flags|=262144}function Qs(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 jt(t){return $g(Rr,t)}function Ks(t,r){return Rr===null&&Or(t),$g(t,r)}function $g(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 Z_=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()})}},Q_=e.unstable_scheduleCallback,K_=e.unstable_NormalPriority,xt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function od(){return{controller:new Z_,data:new Map,refCount:0}}function Il(t){t.refCount--,t.refCount===0&&Q_(K_,function(){t.controller.abort()})}var ql=null,sd=0,Na=0,Ca=null;function J_(t,r){if(ql===null){var l=ql=[];sd=0,Na=fh(),Ca={status:"pending",value:void 0,then:function(c){l.push(c)}}}return sd++,r.then(Vg,Vg),r}function Vg(){if(--sd===0&&ql!==null){Ca!==null&&(Ca.status="fulfilled");var t=ql;ql=null,Na=0,Ca=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function W_(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 Pg=j.S;j.S=function(t,r){C0=Et(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&J_(t,r),Pg!==null&&Pg(t,r)};var Lr=R(null);function ud(){var t=Lr.current;return t!==null?t:it.pooledCache}function Js(t,r){r===null?T(Lr,Lr.current):T(Lr,r.pool)}function Yg(){var t=ud();return t===null?null:{parent:xt._currentValue,pool:t}}var Ma=Error(a(460)),cd=Error(a(474)),Ws=Error(a(542)),eu={then:function(){}};function Xg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Fg(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,Zg(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,Zg(t),t}throw Br=r,Ma}}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,Ma):l}}var Br=null;function Gg(){if(Br===null)throw Error(a(459));var t=Br;return Br=null,t}function Zg(t){if(t===Ma||t===Ws)throw Error(a(483))}var Ta=null,$l=0;function tu(t){var r=$l;return $l+=1,Ta===null&&(Ta=[]),Fg(Ta,t,r)}function Vl(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function nu(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 Qg(t){function r(Q,X){if(t){var J=Q.deletions;J===null?(Q.deletions=[X],Q.flags|=16):J.push(X)}}function l(Q,X){if(!t)return null;for(;X!==null;)r(Q,X),X=X.sibling;return null}function c(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function p(Q,X){return Q=mi(Q,X),Q.index=0,Q.sibling=null,Q}function y(Q,X,J){return Q.index=J,t?(J=Q.alternate,J!==null?(J=J.index,J<X?(Q.flags|=67108866,X):J):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,X,J,oe){return X===null||X.tag!==6?(X=Jf(J,Q.mode,oe),X.return=Q,X):(X=p(X,J),X.return=Q,X)}function I(Q,X,J,oe){var ve=J.type;return ve===E?le(Q,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),Vl(X,J),X.return=Q,X):(X=Gs(J.type,J.key,J.props,null,Q.mode,oe),Vl(X,J),X.return=Q,X)}function W(Q,X,J,oe){return X===null||X.tag!==4||X.stateNode.containerInfo!==J.containerInfo||X.stateNode.implementation!==J.implementation?(X=Wf(J,Q.mode,oe),X.return=Q,X):(X=p(X,J.children||[]),X.return=Q,X)}function le(Q,X,J,oe,ve){return X===null||X.tag!==7?(X=jr(J,Q.mode,oe,ve),X.return=Q,X):(X=p(X,J),X.return=Q,X)}function se(Q,X,J){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Jf(""+X,Q.mode,J),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return J=Gs(X.type,X.key,X.props,null,Q.mode,J),Vl(J,X),J.return=Q,J;case w:return X=Wf(X,Q.mode,J),X.return=Q,X;case F:return X=Hr(X),se(Q,X,J)}if(B(X)||P(X))return X=jr(X,Q.mode,J,null),X.return=Q,X;if(typeof X.then=="function")return se(Q,tu(X),J);if(X.$$typeof===k)return se(Q,Ks(Q,X),J);nu(Q,X)}return null}function ee(Q,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:M(Q,X,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?I(Q,X,J,oe):null;case w:return J.key===ve?W(Q,X,J,oe):null;case F:return J=Hr(J),ee(Q,X,J,oe)}if(B(J)||P(J))return ve!==null?null:le(Q,X,J,oe,null);if(typeof J.then=="function")return ee(Q,X,tu(J),oe);if(J.$$typeof===k)return ee(Q,X,Ks(Q,J),oe);nu(Q,J)}return null}function re(Q,X,J,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Q=Q.get(J)||null,M(X,Q,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Q=Q.get(oe.key===null?J:oe.key)||null,I(X,Q,oe,ve);case w:return Q=Q.get(oe.key===null?J:oe.key)||null,W(X,Q,oe,ve);case F:return oe=Hr(oe),re(Q,X,J,oe,ve)}if(B(oe)||P(oe))return Q=Q.get(J)||null,le(X,Q,oe,ve,null);if(typeof oe.then=="function")return re(Q,X,J,tu(oe),ve);if(oe.$$typeof===k)return re(Q,X,J,Ks(X,oe),ve);nu(X,oe)}return null}function ye(Q,X,J,oe){for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null;xe!==null&&ze<J.length;ze++){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var Ge=ee(Q,xe,J[ze],oe);if(Ge===null){xe===null&&(xe=Ie);break}t&&xe&&Ge.alternate===null&&r(Q,xe),X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge,xe=Ie}if(ze===J.length)return l(Q,xe),qe&&gi(Q,ze),ve;if(xe===null){for(;ze<J.length;ze++)xe=se(Q,J[ze],oe),xe!==null&&(X=y(xe,X,ze),Fe===null?ve=xe:Fe.sibling=xe,Fe=xe);return qe&&gi(Q,ze),ve}for(xe=c(xe);ze<J.length;ze++)Ie=re(xe,Q,ze,J[ze],oe),Ie!==null&&(t&&Ie.alternate!==null&&xe.delete(Ie.key===null?ze:Ie.key),X=y(Ie,X,ze),Fe===null?ve=Ie:Fe.sibling=Ie,Fe=Ie);return t&&xe.forEach(function(pr){return r(Q,pr)}),qe&&gi(Q,ze),ve}function ke(Q,X,J,oe){if(J==null)throw Error(a(151));for(var ve=null,Fe=null,xe=X,ze=X=0,Ie=null,Ge=J.next();xe!==null&&!Ge.done;ze++,Ge=J.next()){xe.index>ze?(Ie=xe,xe=null):Ie=xe.sibling;var pr=ee(Q,xe,Ge.value,oe);if(pr===null){xe===null&&(xe=Ie);break}t&&xe&&pr.alternate===null&&r(Q,xe),X=y(pr,X,ze),Fe===null?ve=pr:Fe.sibling=pr,Fe=pr,xe=Ie}if(Ge.done)return l(Q,xe),qe&&gi(Q,ze),ve;if(xe===null){for(;!Ge.done;ze++,Ge=J.next())Ge=se(Q,Ge.value,oe),Ge!==null&&(X=y(Ge,X,ze),Fe===null?ve=Ge:Fe.sibling=Ge,Fe=Ge);return qe&&gi(Q,ze),ve}for(xe=c(xe);!Ge.done;ze++,Ge=J.next())Ge=re(xe,Q,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(cE){return r(Q,cE)}),qe&&gi(Q,ze),ve}function nt(Q,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(Q,X.sibling),oe=p(X,J.props.children),oe.return=Q,Q=oe;break e}}else if(X.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Hr(ve)===X.type){l(Q,X.sibling),oe=p(X,J.props),Vl(oe,J),oe.return=Q,Q=oe;break e}l(Q,X);break}else r(Q,X);X=X.sibling}J.type===E?(oe=jr(J.props.children,Q.mode,oe,J.key),oe.return=Q,Q=oe):(oe=Gs(J.type,J.key,J.props,null,Q.mode,oe),Vl(oe,J),oe.return=Q,Q=oe)}return S(Q);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(Q,X.sibling),oe=p(X,J.children||[]),oe.return=Q,Q=oe;break e}else{l(Q,X);break}else r(Q,X);X=X.sibling}oe=Wf(J,Q.mode,oe),oe.return=Q,Q=oe}return S(Q);case F:return J=Hr(J),nt(Q,X,J,oe)}if(B(J))return ye(Q,X,J,oe);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(a(150));return J=ve.call(J),ke(Q,X,J,oe)}if(typeof J.then=="function")return nt(Q,X,tu(J),oe);if(J.$$typeof===k)return nt(Q,X,Ks(Q,J),oe);nu(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,X!==null&&X.tag===6?(l(Q,X.sibling),oe=p(X,J),oe.return=Q,Q=oe):(l(Q,X),oe=Jf(J,Q.mode,oe),oe.return=Q,Q=oe),S(Q)):l(Q,X)}return function(Q,X,J,oe){try{$l=0;var ve=nt(Q,X,J,oe);return Ta=null,ve}catch(xe){if(xe===Ma||xe===Ws)throw xe;var Fe=cn(29,xe,null,Q.mode);return Fe.lanes=oe,Fe.return=Q,Fe}}}var Ur=Qg(!0),Kg=Qg(!1),Ki=!1;function fd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dd(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=Fs(t),Rg(t,null,l),r}return Xs(t,c,r,l),Fs(t)}function Pl(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,Es(t,l)}}function hd(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 pd=!1;function Yl(){if(pd){var t=Ca;if(t!==null)throw t}}function Xl(t,r,l,c){pd=!1;var p=t.updateQueue;Ki=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var I=M,W=I.next;I.next=null,S===null?y=W:S.next=W,S=I;var le=t.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==S&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=I))}if(y!==null){var se=p.baseState;S=0,le=W=I=null,M=y;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Na&&(pd=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,ke=M;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=M.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:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=re,I=se):le=le.next=re,S|=ee;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;re=M,M=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 Jg(t,r){if(typeof t!="function")throw Error(a(191,t));t.call(r)}function Wg(t,r){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Jg(l[t],r)}var Aa=R(null),iu=R(0);function ey(t,r){t=Ci,T(iu,t),T(Aa,r),Ci=t|r.baseLanes}function md(){T(iu,Ci),T(Aa,Aa.current)}function gd(){Ci=iu.current,$(Aa),$(iu)}var fn=R(null),Mn=null;function er(t){var r=t.alternate;T(mt,mt.current&1),T(fn,t),Mn===null&&(r===null||Aa.current!==null||r.memoizedState!==null)&&(Mn=t)}function yd(t){T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)}function ty(t){t.tag===22?(T(mt,mt.current),T(fn,t),Mn===null&&(Mn=t)):tr()}function tr(){T(mt,mt.current),T(fn,fn.current)}function dn(t){$(fn),Mn===t&&(Mn=null),$(mt)}var mt=R(0);function ru(t){for(var r=t;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||_h(l)||kh(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,au=!1,za=!1,Ir=!1,lu=0,Fl=0,ja=null,ek=0;function ft(){throw Error(a(321))}function xd(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 bd(t,r,l,c,p,y){return bi=y,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,j.H=t===null||t.memoizedState===null?By:Rd,Ir=!1,y=l(c,p),Ir=!1,za&&(y=iy(r,l,c,p)),ny(t),y}function ny(t){j.H=Ql;var r=et!==null&&et.next!==null;if(bi=0,bt=et=Ae=null,au=!1,Fl=0,ja=null,r)throw Error(a(300));t===null||vt||(t=t.dependencies,t!==null&&Qs(t)&&(vt=!0))}function iy(t,r,l,c){Ae=t;var p=0;do{if(za&&(ja=null),Fl=0,za=!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)}j.H=Uy,y=r(l,c)}while(za);return y}function tk(){var t=j.H,r=t.useState()[0];return r=typeof r.then=="function"?Gl(r):r,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(Ae.flags|=1024),r}function vd(){var t=lu!==0;return lu=0,t}function wd(t,r,l){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~l}function Sd(t){if(au){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}au=!1}bi=0,bt=et=Ae=null,za=!1,Fl=lu=0,ja=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 ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gl(t){var r=Fl;return Fl+=1,ja===null&&(ja=[]),t=Fg(ja,t,r),r=Ae,(bt===null?r.memoizedState:bt.next)===null&&(r=r.alternate,j.H=r===null||r.memoizedState===null?By:Rd),t}function su(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Gl(t);if(t.$$typeof===k)return jt(t)}throw Error(a(438,String(t)))}function _d(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=ou(),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 uu(t){var r=gt();return kd(r,et,t)}function kd(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 M=S=null,I=null,W=r,le=!1;do{var se=W.lane&-536870913;if(se!==W.lane?(Ue&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===Na&&(le=!0);else if((bi&ee)===ee){W=W.next,ee===Na&&(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?(M=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?(M=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=M,!un(y,t.memoizedState)&&(vt=!0,le&&(l=Ca,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 Ed(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 ry(t,r,l){var c=Ae,p=gt(),y=qe;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,Md(oy.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},ly.bind(null,c,p,l,r),null),it===null)throw Error(a(349));y||(bi&127)!==0||ay(c,r,l)}return l}function ay(t,r,l){t.flags|=16384,t={getSnapshot:r,value:l},r=Ae.updateQueue,r===null?(r=ou(),Ae.updateQueue=r,r.stores=[t]):(l=r.stores,l===null?r.stores=[t]:l.push(t))}function ly(t,r,l,c){r.value=l,r.getSnapshot=c,sy(r)&&uy(t)}function oy(t,r,l){return l(function(){sy(r)&&uy(t)})}function sy(t){var r=t.getSnapshot;t=t.value;try{var l=r();return!un(t,l)}catch{return!0}}function uy(t){var r=zr(t,2);r!==null&&nn(r,t,2)}function Nd(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 cy(t,r,l,c){return t.baseState=l,kd(t,et,typeof c=="function"?c:vi)}function nk(t,r,l,c,p){if(du(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)}};j.T!==null?l(!0):y.isTransition=!1,c(y),l=r.pending,l===null?(y.next=r.pending=y,fy(r,y)):(y.next=l.next,r.pending=l.next=y)}}function fy(t,r){var l=r.action,c=r.payload,p=t.state;if(r.isTransition){var y=j.T,S={};j.T=S;try{var M=l(p,c),I=j.S;I!==null&&I(S,M),dy(t,r,M)}catch(W){Cd(t,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),j.T=y}}else try{y=l(p,c),dy(t,r,y)}catch(W){Cd(t,r,W)}}function dy(t,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){hy(t,r,c)},function(c){return Cd(t,r,c)}):hy(t,r,l)}function hy(t,r,l){r.status="fulfilled",r.value=l,py(r),t.state=l,r=t.pending,r!==null&&(l=r.next,l===r?t.pending=null:(l=l.next,r.next=l,fy(t,l)))}function Cd(t,r,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=l,py(r),r=r.next;while(r!==c)}t.action=null}function py(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function my(t,r){return r}function gy(t,r){if(qe){var l=it.formState;if(l!==null){e:{var c=Ae;if(qe){if(lt){t:{for(var p=lt,y=Cn;p.nodeType!==8;){if(!y){p=null;break t}if(p=Tn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=Tn(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:my,lastRenderedState:r},l.queue=c,l=Oy.bind(null,Ae,c),c.dispatch=l,c=Nd(!1),y=Dd.bind(null,Ae,!1,c.queue),c=Pt(),p={state:r,dispatch:null,action:t,pending:null},c.queue=p,l=nk.bind(null,Ae,p,y,l),p.dispatch=l,c.memoizedState=t,[r,l,!1]}function yy(t){var r=gt();return xy(r,et,t)}function xy(t,r,l){if(r=kd(t,r,my)[0],t=uu(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Gl(r)}catch(S){throw S===Ma?Ws: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},ik.bind(null,p,l),null)),[c,y,t]}function ik(t,r){t.action=r}function by(t){var r=gt(),l=et;if(l!==null)return xy(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=ou(),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 vy(){return gt().memoizedState}function cu(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 fu(t,r,l,c){var p=gt();c=c===void 0?null:c;var y=p.memoizedState.inst;et!==null&&c!==null&&xd(c,et.memoizedState.deps)?p.memoizedState=Da(r,y,l,c):(Ae.flags|=t,p.memoizedState=Da(1|r,y,l,c))}function wy(t,r){cu(8390656,8,t,r)}function Md(t,r){fu(2048,8,t,r)}function rk(t){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=ou(),Ae.updateQueue=r,r.events=[t];else{var l=r.events;l===null?r.events=[t]:l.push(t)}}function Sy(t){var r=gt().memoizedState;return rk({ref:r,nextImpl:t}),function(){if((Qe&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function _y(t,r){return fu(4,2,t,r)}function ky(t,r){return fu(4,4,t,r)}function Ey(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 Ny(t,r,l){l=l!=null?l.concat([t]):null,fu(4,4,Ey.bind(null,r,t),l)}function Td(){}function Cy(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;return r!==null&&xd(r,c[1])?c[0]:(l.memoizedState=[t,r],t)}function My(t,r){var l=gt();r=r===void 0?null:r;var c=l.memoizedState;if(r!==null&&xd(r,c[1]))return c[0];if(c=t(),Ir){Ht(!0);try{t()}finally{Ht(!1)}}return l.memoizedState=[c,r],c}function Ad(t,r,l){return l===void 0||(bi&1073741824)!==0&&(Ue&261930)===0?t.memoizedState=r:(t.memoizedState=l,t=T0(),Ae.lanes|=t,rr|=t,l)}function Ty(t,r,l,c){return un(l,r)?l:Aa.current!==null?(t=Ad(t,l,c),un(t,r)||(vt=!0),t):(bi&42)===0||(bi&1073741824)!==0&&(Ue&261930)===0?(vt=!0,t.memoizedState=l):(t=T0(),Ae.lanes|=t,rr|=t,r)}function Ay(t,r,l,c,p){var y=U.p;U.p=y!==0&&8>y?y:8;var S=j.T,M={};j.T=M,Dd(t,!1,r,l);try{var I=p(),W=j.S;if(W!==null&&W(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var le=W_(I,c);Zl(t,r,le,mn(t))}else Zl(t,r,c,mn(t))}catch(se){Zl(t,r,{then:function(){},status:"rejected",reason:se},mn())}finally{U.p=y,S!==null&&M.types!==null&&(S.types=M.types),j.T=S}}function ak(){}function zd(t,r,l,c){if(t.tag!==5)throw Error(a(476));var p=zy(t).queue;Ay(t,p,r,Y,l===null?ak:function(){return jy(t),l(c)})}function zy(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 jy(t){var r=zy(t);r.next===null&&(r=t.alternate.memoizedState),Zl(t,r.next.queue,{},mn())}function jd(){return jt(ho)}function Dy(){return gt().memoizedState}function Ry(){return gt().memoizedState}function lk(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),Pl(c,r,l)),r={cache:od()},t.payload=r;return}r=r.return}}function ok(t,r,l){var c=mn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},du(t)?Ly(r,l):(l=Qf(t,r,l,c),l!==null&&(nn(l,t,c),Hy(l,r,c)))}function Oy(t,r,l){var c=mn();Zl(t,r,l,c)}function Zl(t,r,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(du(t))Ly(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,M=y(S,l);if(p.hasEagerState=!0,p.eagerState=M,un(M,S))return Xs(t,r,p,0),it===null&&Ys(),!1}catch{}if(l=Qf(t,r,p,c),l!==null)return nn(l,t,c),Hy(l,r,c),!0}return!1}function Dd(t,r,l,c){if(c={lane:2,revertLane:fh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},du(t)){if(r)throw Error(a(479))}else r=Qf(t,l,c,2),r!==null&&nn(r,t,2)}function du(t){var r=t.alternate;return t===Ae||r!==null&&r===Ae}function Ly(t,r){za=au=!0;var l=t.pending;l===null?r.next=r:(r.next=l.next,l.next=r),t.pending=r}function Hy(t,r,l){if((l&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,l|=c,r.lanes=l,Es(t,l)}}var Ql={readContext:jt,use:su,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};Ql.useEffectEvent=ft;var By={readContext:jt,use:su,useCallback:function(t,r){return Pt().memoizedState=[t,r===void 0?null:r],t},useContext:jt,useEffect:wy,useImperativeHandle:function(t,r,l){l=l!=null?l.concat([t]):null,cu(4194308,4,Ey.bind(null,r,t),l)},useLayoutEffect:function(t,r){return cu(4194308,4,t,r)},useInsertionEffect:function(t,r){cu(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=ok.bind(null,Ae,t),[c.memoizedState,t]},useRef:function(t){var r=Pt();return t={current:t},r.memoizedState=t},useState:function(t){t=Nd(t);var r=t.queue,l=Oy.bind(null,Ae,r);return r.dispatch=l,[t.memoizedState,l]},useDebugValue:Td,useDeferredValue:function(t,r){var l=Pt();return Ad(l,t,r)},useTransition:function(){var t=Nd(!1);return t=Ay.bind(null,Ae,t.queue,!0,!1),Pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,l){var c=Ae,p=Pt();if(qe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),it===null)throw Error(a(349));(Ue&127)!==0||ay(c,r,l)}p.memoizedState=l;var y={value:l,getSnapshot:r};return p.queue=y,wy(oy.bind(null,c,y,t),[t]),c.flags|=2048,Da(9,{destroy:void 0},ly.bind(null,c,y,l,r),null),l},useId:function(){var t=Pt(),r=it.identifierPrefix;if(qe){var l=Kn,c=Qn;l=(c&~(1<<32-Ke(c)-1)).toString(32)+l,r="_"+r+"R_"+l,l=lu++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=ek++,r="_"+r+"r_"+l.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:jd,useFormState:gy,useActionState:gy,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=Dd.bind(null,Ae,!0,l),l.dispatch=r,[t,r]},useMemoCache:_d,useCacheRefresh:function(){return Pt().memoizedState=lk.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)}}},Rd={readContext:jt,use:su,useCallback:Cy,useContext:jt,useEffect:Md,useImperativeHandle:Ny,useInsertionEffect:_y,useLayoutEffect:ky,useMemo:My,useReducer:uu,useRef:vy,useState:function(){return uu(vi)},useDebugValue:Td,useDeferredValue:function(t,r){var l=gt();return Ty(l,et.memoizedState,t,r)},useTransition:function(){var t=uu(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Gl(t),r]},useSyncExternalStore:ry,useId:Dy,useHostTransitionStatus:jd,useFormState:yy,useActionState:yy,useOptimistic:function(t,r){var l=gt();return cy(l,et,t,r)},useMemoCache:_d,useCacheRefresh:Ry};Rd.useEffectEvent=Sy;var Uy={readContext:jt,use:su,useCallback:Cy,useContext:jt,useEffect:Md,useImperativeHandle:Ny,useInsertionEffect:_y,useLayoutEffect:ky,useMemo:My,useReducer:Ed,useRef:vy,useState:function(){return Ed(vi)},useDebugValue:Td,useDeferredValue:function(t,r){var l=gt();return et===null?Ad(l,t,r):Ty(l,et.memoizedState,t,r)},useTransition:function(){var t=Ed(vi)[0],r=gt().memoizedState;return[typeof t=="boolean"?t:Gl(t),r]},useSyncExternalStore:ry,useId:Dy,useHostTransitionStatus:jd,useFormState:by,useActionState:by,useOptimistic:function(t,r){var l=gt();return et!==null?cy(l,et,t,r):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:_d,useCacheRefresh:Ry};Uy.useEffectEvent=Sy;function Od(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 Ld={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),Pl(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),Pl(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),Pl(r,t,l))}};function Iy(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?!Ll(l,c)||!Ll(p,y):!0}function qy(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&&Ld.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 $y(t){Ps(t)}function Vy(t){console.error(t)}function Py(t){Ps(t)}function hu(t,r){try{var l=t.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function Yy(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 Hd(t,r,l){return l=Ji(l),l.tag=3,l.payload={element:null},l.callback=function(){hu(t,r)},l}function Xy(t){return t=Ji(t),t.tag=3,t}function Fy(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(){Yy(r,l,c)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){Yy(r,l,c),typeof p!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function sk(t,r,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=l.alternate,r!==null&&Ea(r,l,p,!0),l=fn.current,l!==null){switch(l.tag){case 31:case 13:return Mn===null?Eu():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===eu?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([c]):r.add(c),sh(t,c,p)),!1;case 22:return l.flags|=65536,c===eu?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)),sh(t,c,p)),!1}throw Error(a(435,l.tag))}return sh(t,c,p),Eu(),!1}if(qe)return r=fn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==nd&&(t=Error(a(422),{cause:c}),Ul(kn(t,l)))):(c!==nd&&(r=Error(a(423),{cause:c}),Ul(kn(r,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=kn(c,l),p=Hd(t.stateNode,c,p),hd(t,p),dt!==4&&(dt=2)),!1;var y=Error(a(520),{cause:c});if(y=kn(y,l),ro===null?ro=[y]:ro.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=Hd(l.stateNode,c,t),hd(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=Xy(p),Fy(p,t,l,c),hd(l,p),!1}l=l.return}while(l!==null);return!1}var Bd=Error(a(461)),vt=!1;function Dt(t,r,l,c){r.child=t===null?Kg(r,null,l,c):Ur(r,t.child,l,c)}function Gy(t,r,l,c,p){l=l.render;var y=r.ref;if("ref"in c){var S={};for(var M in c)M!=="ref"&&(S[M]=c[M])}else S=c;return Or(r),c=bd(t,r,l,S,y,p),M=vd(),t!==null&&!vt?(wd(t,r,p),wi(t,r,p)):(qe&&M&&ed(r),r.flags|=1,Dt(t,r,c,p),r.child)}function Zy(t,r,l,c,p){if(t===null){var y=l.type;return typeof y=="function"&&!Kf(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,Qy(t,r,y,c,p)):(t=Gs(l.type,null,c,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!Xd(t,p)){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:Ll,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 Qy(t,r,l,c,p){if(t!==null){var y=t.memoizedProps;if(Ll(y,c)&&t.ref===r.ref)if(vt=!1,r.pendingProps=c=y,Xd(t,p))(t.flags&131072)!==0&&(vt=!0);else return r.lanes=t.lanes,wi(t,r,p)}return Ud(t,r,l,c,p)}function Ky(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 Jy(t,r,y,l,c)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Js(r,y!==null?y.cachePool:null),y!==null?ey(r,y):md(),ty(r);else return c=r.lanes=536870912,Jy(t,r,y!==null?y.baseLanes|l:l,l,c)}else y!==null?(Js(r,y.cachePool),ey(r,y),tr(),r.memoizedState=null):(t!==null&&Js(r,null),md(),tr());return Dt(t,r,p,l),r.child}function Kl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Jy(t,r,l,c,p){var y=ud();return y=y===null?null:{parent:xt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},t!==null&&Js(r,null),md(),ty(r),t!==null&&Ea(t,r,c,!0),r.childLanes=p,null}function pu(t,r){return r=gu({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Wy(t,r,l){return Ur(r,t.child,null,l),t=pu(r,r.pendingProps),t.flags|=2,dn(r),r.memoizedState=null,t}function uk(t,r,l){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(qe){if(c.mode==="hidden")return t=pu(r,c),r.lanes=536870912,Kl(null,t);if(yd(r),(t=lt)?(t=fx(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=Lg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return r.lanes=536870912,null}return pu(r,c)}var y=t.memoizedState;if(y!==null){var S=y.dehydrated;if(yd(r),p)if(r.flags&256)r.flags&=-257,r=Wy(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||Ea(t,r,l,!1),p=(l&t.childLanes)!==0,vt||p){if(c=it,c!==null&&(S=Ns(c,l),S!==0&&S!==y.retryLane))throw y.retryLane=S,zr(t,S),nn(c,t,S),Bd;Eu(),r=Wy(t,r,l)}else t=y.treeContext,lt=Tn(S.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Ug(r,t),r=pu(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 mu(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 Ud(t,r,l,c,p){return Or(r),l=bd(t,r,l,c,void 0,p),c=vd(),t!==null&&!vt?(wd(t,r,p),wi(t,r,p)):(qe&&c&&ed(r),r.flags|=1,Dt(t,r,l,p),r.child)}function e0(t,r,l,c,p,y){return Or(r),r.updateQueue=null,l=iy(r,c,l,p),ny(t),c=vd(),t!==null&&!vt?(wd(t,r,y),wi(t,r,y)):(qe&&c&&ed(r),r.flags|=1,Dt(t,r,l,y),r.child)}function t0(t,r,l,c,p){if(Or(r),r.stateNode===null){var y=wa,S=l.contextType;typeof S=="object"&&S!==null&&(y=jt(S)),y=new l(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Ld,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},fd(r),S=l.contextType,y.context=typeof S=="object"&&S!==null?jt(S):wa,y.state=r.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Od(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&&Ld.enqueueReplaceState(y,y.state,null),Xl(r,c,y,p),Yl(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(t===null){y=r.stateNode;var M=r.memoizedProps,I=qr(l,M);y.props=I;var W=y.context,le=l.contextType;S=wa,typeof le=="object"&&le!==null&&(S=jt(le));var se=l.getDerivedStateFromProps;le=typeof se=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&qy(r,y,c,S),Ki=!1;var ee=r.memoizedState;y.state=ee,Xl(r,c,y,p),Yl(),W=r.memoizedState,M||ee!==W||Ki?(typeof se=="function"&&(Od(r,l,se,c),W=r.memoizedState),(I=Ki||Iy(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,dd(t,r),S=r.memoizedProps,le=qr(l,S),y.props=le,se=r.pendingProps,ee=y.context,W=l.contextType,I=wa,typeof W=="object"&&W!==null&&(I=jt(W)),M=l.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==se||ee!==I)&&qy(r,y,c,I),Ki=!1,ee=r.memoizedState,y.state=ee,Xl(r,c,y,p),Yl();var re=r.memoizedState;S!==se||ee!==re||Ki||t!==null&&t.dependencies!==null&&Qs(t.dependencies)?(typeof M=="function"&&(Od(r,l,M,c),re=r.memoizedState),(le=Ki||Iy(r,l,le,c,ee,re,I)||t!==null&&t.dependencies!==null&&Qs(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,mu(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)):Dt(t,r,l,p),r.memoizedState=y.state,t=r.child):t=wi(t,r,p),t}function n0(t,r,l,c){return Dr(),r.flags|=256,Dt(t,r,l,c),r.child}var Id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qd(t){return{baseLanes:t,cachePool:Yg()}}function $d(t,r,l){return t=t!==null?t.childLanes&~l:0,r&&(t|=pn),t}function i0(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(qe){if(p?er(r):tr(),(t=lt)?(t=fx(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=Lg(t),l.return=r,r.child=l,zt=r,lt=null)):t=null,t===null)throw Zi(r);return kh(t)?r.lanes=32:r.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(tr(),p=r.mode,M=gu({mode:"hidden",children:M},p),c=jr(c,p,l,null),M.return=r,c.return=r,M.sibling=c,r.child=M,c=r.child,c.memoizedState=qd(l),c.childLanes=$d(t,S,l),r.memoizedState=Id,Kl(null,c)):(er(r),Vd(r,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(y)r.flags&256?(er(r),r.flags&=-257,r=Pd(t,r,l)):r.memoizedState!==null?(tr(),r.child=t.child,r.flags|=128,r=null):(tr(),M=c.fallback,p=r.mode,c=gu({mode:"visible",children:c.children},p),M=jr(M,p,l,null),M.flags|=2,c.return=r,M.return=r,c.sibling=M,r.child=c,Ur(r,t.child,null,l),c=r.child,c.memoizedState=qd(l),c.childLanes=$d(t,S,l),r.memoizedState=Id,r=Kl(null,c));else if(er(r),kh(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(a(419)),c.stack="",c.digest=S,Ul({value:c,source:null,stack:null}),r=Pd(t,r,l)}else if(vt||Ea(t,r,l,!1),S=(l&t.childLanes)!==0,vt||S){if(S=it,S!==null&&(c=Ns(S,l),c!==0&&c!==I.retryLane))throw I.retryLane=c,zr(t,c),nn(S,t,c),Bd;_h(M)||Eu(),r=Pd(t,r,l)}else _h(M)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,lt=Tn(M.nextSibling),zt=r,qe=!0,Gi=null,Cn=!1,t!==null&&Ug(r,t),r=Vd(r,c.children),r.flags|=4096);return r}return p?(tr(),M=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?M=mi(W,M):(M=jr(M,p,l,null),M.flags|=2),M.return=r,c.return=r,c.sibling=M,r.child=c,Kl(null,c),c=r.child,M=t.child.memoizedState,M===null?M=qd(l):(p=M.cachePool,p!==null?(I=xt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=Yg(),M={baseLanes:M.baseLanes|l,cachePool:p}),c.memoizedState=M,c.childLanes=$d(t,S,l),r.memoizedState=Id,Kl(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 Vd(t,r){return r=gu({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function gu(t,r){return t=cn(22,t,null,r),t.lanes=0,t}function Pd(t,r,l){return Ur(r,t.child,null,l),t=Vd(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function r0(t,r,l){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),ad(t.return,r,l)}function Yd(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 a0(t,r,l){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=mt.current,M=(S&2)!==0;if(M?(S=S&1|2,r.flags|=128):S&=1,T(mt,S),Dt(t,r,c,l),c=qe?Bl:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&r0(t,l,r);else if(t.tag===19)r0(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&&ru(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),Yd(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&&ru(t)===null){r.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}Yd(r,!0,l,null,y,c);break;case"together":Yd(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(Ea(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 Xd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Qs(t)))}function ck(t,r,l){switch(r.tag){case 3:ue(r,r.stateNode.containerInfo),Qi(r,xt,t.memoizedState.cache),Dr();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,yd(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?i0(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||(Ea(t,r,l,!1),c=(l&r.childLanes)!==0),p){if(c)return a0(t,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(mt,mt.current),c)break;return null;case 22:return r.lanes=0,Ky(t,r,l,r.pendingProps);case 24:Qi(r,xt,t.memoizedState.cache)}return wi(t,r,l)}function l0(t,r,l){if(t!==null)if(t.memoizedProps!==r.pendingProps)vt=!0;else{if(!Xd(t,l)&&(r.flags&128)===0)return vt=!1,ck(t,r,l);vt=(t.flags&131072)!==0}else vt=!1,qe&&(r.flags&1048576)!==0&&Bg(r,Bl,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")Kf(t)?(c=qr(t,c),r.tag=1,r=t0(null,r,t,c,l)):(r.tag=0,r=Ud(null,r,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===C){r.tag=11,r=Gy(null,r,t,c,l);break e}else if(p===H){r.tag=14,r=Zy(null,r,t,c,l);break e}}throw r=O(t)||t,Error(a(306,r,""))}}return r;case 0:return Ud(t,r,r.type,r.pendingProps,l);case 1:return c=r.type,p=qr(c,r.pendingProps),t0(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,dd(t,r),Xl(r,c,null,l);var S=r.memoizedState;if(c=S.cache,Qi(r,xt,c),c!==y.cache&&ld(r,[xt],l,!0),Yl(),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=n0(t,r,c,l);break e}else if(c!==p){p=kn(Error(a(424)),r),Ul(p),r=n0(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=Tn(t.firstChild),zt=r,qe=!0,Gi=null,Cn=!0,l=Kg(r,null,c,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Dr(),c===p){r=wi(t,r,l);break e}Dt(t,r,c,l)}r=r.child}return r;case 26:return mu(t,r),t===null?(l=yx(r.type,null,r.pendingProps,null))?r.memoizedState=l:qe||(l=r.type,t=r.pendingProps,c=ju(fe.current).createElement(l),c[Nt]=r,c[Bt]=t,Rt(c,l,t),yt(c),r.stateNode=c):r.memoizedState=yx(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Ee(r),t===null&&qe&&(c=r.stateNode=px(r.type,r.pendingProps,fe.current),zt=r,Cn=!0,p=lt,ur(r.type)?(Eh=p,lt=Tn(c.firstChild)):lt=p),Dt(t,r,r.pendingProps.children,l),mu(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&qe&&((p=c=lt)&&(c=Ik(c,r.type,r.pendingProps,Cn),c!==null?(r.stateNode=c,zt=r,lt=Tn(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,vh(p,y)?c=null:S!==null&&vh(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=bd(t,r,tk,null,null,l),ho._currentValue=p),mu(t,r),Dt(t,r,c,l),r.child;case 6:return t===null&&qe&&((t=l=lt)&&(l=qk(l,r.pendingProps,Cn),l!==null?(r.stateNode=l,zt=r,lt=null,t=!0):t=!1),t||Zi(r)),null;case 13:return i0(t,r,l);case 4:return ue(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=Ur(r,null,c,l):Dt(t,r,c,l),r.child;case 11:return Gy(t,r,r.type,r.pendingProps,l);case 7:return Dt(t,r,r.pendingProps,l),r.child;case 8:return Dt(t,r,r.pendingProps.children,l),r.child;case 12:return Dt(t,r,r.pendingProps.children,l),r.child;case 10:return c=r.pendingProps,Qi(r,r.type,c.value),Dt(t,r,c.children,l),r.child;case 9:return p=r.type._context,c=r.pendingProps.children,Or(r),p=jt(p),c=c(p),r.flags|=1,Dt(t,r,c,l),r.child;case 14:return Zy(t,r,r.type,r.pendingProps,l);case 15:return Qy(t,r,r.type,r.pendingProps,l);case 19:return a0(t,r,l);case 31:return uk(t,r,l);case 22:return Ky(t,r,l,r.pendingProps);case 24:return Or(r),c=jt(xt),t===null?(p=ud(),p===null&&(p=it,y=od(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=l),p=y),r.memoizedState={parent:c,cache:p},fd(r),Qi(r,xt,p)):((t.lanes&l)!==0&&(dd(t,r),Xl(r,null,null,l),Yl()),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&&ld(r,[xt],l,!0))),Dt(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 Fd(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(D0())t.flags|=8192;else throw Br=eu,cd}else t.flags&=-16777217}function o0(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Sx(r))if(D0())t.flags|=8192;else throw Br=eu,cd}function yu(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?_s():536870912,t.lanes|=r,Ha|=r)}function Jl(t,r){if(!qe)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 fk(t,r,l){var c=r.pendingProps;switch(td(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)&&(ka(r)?Si(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,id())),ot(r),null;case 26:var p=r.type,y=r.memoizedState;return t===null?(Si(r),y!==null?(ot(r),o0(r,y)):(ot(r),Fd(r,p,null,c,l))):y?y!==t.memoizedState?(Si(r),ot(r),o0(r,y)):(ot(r),r.flags&=-16777217):(t=t.memoizedProps,t!==c&&Si(r),ot(r),Fd(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,ka(r)?Ig(r):(t=px(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,ka(r))Ig(r);else{var S=ju(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),Fd(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,ka(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||ix(t.nodeValue,l)),t||Zi(r,!0)}else t=ju(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=ka(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 Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),t=!1}else l=id(),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=ka(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 Dr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),p=!1}else p=id(),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),yu(r,r.updateQueue),ot(r),null);case 4:return me(),t===null&&mh(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)Jl(c,!1);else{if(dt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(y=ru(t),y!==null){for(r.flags|=128,Jl(c,!1),t=y.updateQueue,r.updateQueue=t,yu(r,t),r.subtreeFlags=0,t=l,l=r.child;l!==null;)Og(l,t),l=l.sibling;return T(mt,mt.current&1|2),qe&&gi(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&Et()>Su&&(r.flags|=128,p=!0,Jl(c,!1),r.lanes=4194304)}else{if(!p)if(t=ru(y),t!==null){if(r.flags|=128,p=!0,t=t.updateQueue,r.updateQueue=t,yu(r,t),Jl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return ot(r),null}else 2*Et()-c.renderingStartTime>Su&&l!==536870912&&(r.flags|=128,p=!0,Jl(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,T(mt,p?l&1|2:l&1),qe&&gi(r,c.treeForkCount),t):(ot(r),null);case 22:case 23:return dn(r),gd(),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&&yu(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 dk(t,r){switch(td(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));Dr()}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));Dr()}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),gd(),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 s0(t,r){switch(td(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),gd(),t!==null&&$(Lr);break;case 24:xi(xt)}}function Wl(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(M){We(r,r.return,M)}}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,M=S.destroy;if(M!==void 0){S.destroy=void 0,p=r;var I=l,W=M;try{W()}catch(le){We(p,I,le)}}}c=c.next}while(c!==y)}}catch(le){We(r,r.return,le)}}function u0(t){var r=t.updateQueue;if(r!==null){var l=t.stateNode;try{Wg(r,l)}catch(c){We(t,t.return,c)}}}function c0(t,r,l){l.props=qr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){We(t,r,c)}}function eo(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 f0(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 Gd(t,r,l){try{var c=t.stateNode;Rk(c,t.type,l,r),c[Bt]=r}catch(p){We(t,t.return,p)}}function d0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ur(t.type)||t.tag===4}function Zd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||d0(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 Qd(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(Qd(t,r,l),t=t.sibling;t!==null;)Qd(t,r,l),t=t.sibling}function xu(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(xu(t,r,l),t=t.sibling;t!==null;)xu(t,r,l),t=t.sibling}function h0(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,Kd=!1,p0=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function hk(t,r){if(t=t.containerInfo,xh=Uu,t=Ng(t),Pf(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,M=-1,I=-1,W=0,le=0,se=t,ee=null;t:for(;;){for(var re;se!==l||p!==0&&se.nodeType!==3||(M=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&&(M=S),ee===y&&++le===c&&(I=S),(re=se.nextSibling)!==null)break;se=ee,ee=se.parentNode}se=re}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(bh={focusedElem:t,selectionRange:l},Uu=!1,Tt=r;Tt!==null;)if(r=Tt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Tt=t;else for(;Tt!==null;){switch(r=Tt,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)Sh(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Sh(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,Tt=t;break}Tt=r.return}}function m0(t,r,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(t,l),c&4&&Wl(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&&u0(l),c&512&&eo(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{Wg(t,r)}catch(S){We(l,l.return,S)}}break;case 27:r===null&&c&4&&h0(l);case 26:case 5:Ei(t,l),r===null&&c&4&&f0(l),c&512&&eo(l,l.return);break;case 12:Ei(t,l);break;case 31:Ei(t,l),c&4&&x0(t,l);break;case 13:Ei(t,l),c&4&&b0(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Sk.bind(null,l),$k(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 g0(t){var r=t.alternate;r!==null&&(t.alternate=null,g0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&Nl(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;)y0(t,r,l),l=l.sibling}function y0(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),uo(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,ux(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ya(t)):ux(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"&&c0(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 x0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ya(t)}catch(l){We(r,r.return,l)}}}function b0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ya(t)}catch(l){We(r,r.return,l)}}function pk(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new p0),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new p0),r;default:throw Error(a(435,t.tag))}}function bu(t,r){var l=pk(t);r.forEach(function(c){if(!l.has(c)){l.add(c);var p=_k.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,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(ur(M.type)){st=M.stateNode,Jt=!1;break e}break;case 5:st=M.stateNode,Jt=!1;break e;case 3:case 4:st=M.stateNode.containerInfo,Jt=!0;break e}M=M.return}if(st===null)throw Error(a(160));y0(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;)v0(r,t),r=r.sibling}var Bn=null;function v0(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),Wl(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=vx("link","href",p).get(c+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],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(M,1);break t}}y=p.createElement(c),Rt(y,c,l),p.head.appendChild(y);break;case"meta":if(S=vx("meta","content",p).get(c+(l.content||""))){for(M=0;M<S.length;M++)if(y=S[M],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(M,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 wx(p,t.type,t.stateNode);else t.stateNode=bx(p,c,t.memoizedProps);else y!==c?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,c===null?wx(p,t.type,t.stateNode):bx(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Gd(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&&Gd(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{pa(p,"")}catch(ye){We(t,t.return,ye)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,Gd(t,p,l!==null?l.memoizedProps:p)),c&1024&&(Kd=!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(Ou=null,p=Bn,Bn=Du(r.containerInfo),Wt(r,t),Bn=p,en(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Ya(r.containerInfo)}catch(ye){We(t,t.return,ye)}Kd&&(Kd=!1,w0(t));break;case 4:c=Bn,Bn=Du(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,bu(t,c)));break;case 13:Wt(r,t),en(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(wu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,bu(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{M=I.stateNode;var se=I.memoizedProps.style,ee=se!=null&&se.hasOwnProperty("display")?se.display:null;M.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?cx(re,!0):cx(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,bu(t,l))));break;case 19:Wt(r,t),en(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,bu(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(d0(c)){l=c;break}c=c.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,y=Zd(t);xu(t,y,p);break;case 5:var S=l.stateNode;l.flags&32&&(pa(S,""),l.flags&=-33);var M=Zd(t);xu(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,W=Zd(t);Qd(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 w0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;w0(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;)m0(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"&&c0(r,r.return,l),$r(r);break;case 27:uo(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),Wl(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 M=c.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)Jg(I[p],M)}catch(W){We(c,c.return,W)}}l&&S&64&&u0(y),eo(y,y.return);break;case 27:h0(y);case 26:case 5:Ni(p,y,l),l&&c===null&&S&4&&f0(y),eo(y,y.return);break;case 12:Ni(p,y,l);break;case 31:Ni(p,y,l),l&&S&4&&x0(p,y);break;case 13:Ni(p,y,l),l&&S&4&&b0(p,y);break;case 22:y.memoizedState===null&&Ni(p,y,l),eo(y,y.return);break;case 30:break;default:Ni(p,y,l)}r=r.sibling}}function Jd(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&&Il(l))}function Wd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Il(t))}function Un(t,r,l,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)S0(t,r,l,c),r=r.sibling}function S0(t,r,l,c){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Un(t,r,l,c),p&2048&&Wl(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&&Il(t)));break;case 12:if(p&2048){Un(t,r,l,c),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(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):to(t,r):y._visibility&2?Un(t,r,l,c):(y._visibility|=2,Ra(t,r,l,c,(r.subtreeFlags&10256)!==0||!1)),p&2048&&Jd(S,r);break;case 24:Un(t,r,l,c),p&2048&&Wd(r.alternate,r);break;default:Un(t,r,l,c)}}function Ra(t,r,l,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=t,S=r,M=l,I=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:Ra(y,S,M,I,p),Wl(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?Ra(y,S,M,I,p):to(y,S):(le._visibility|=2,Ra(y,S,M,I,p)),p&&W&2048&&Jd(S.alternate,S);break;case 24:Ra(y,S,M,I,p),p&&W&2048&&Wd(S.alternate,S);break;default:Ra(y,S,M,I,p)}r=r.sibling}}function to(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:to(l,c),p&2048&&Jd(c.alternate,c);break;case 24:to(l,c),p&2048&&Wd(c.alternate,c);break;default:to(l,c)}r=r.sibling}}var no=8192;function Oa(t,r,l){if(t.subtreeFlags&no)for(t=t.child;t!==null;)_0(t,r,l),t=t.sibling}function _0(t,r,l){switch(t.tag){case 26:Oa(t,r,l),t.flags&no&&t.memoizedState!==null&&eE(l,Bn,t.memoizedState,t.memoizedProps);break;case 5:Oa(t,r,l);break;case 3:case 4:var c=Bn;Bn=Du(t.stateNode.containerInfo),Oa(t,r,l),Bn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=no,no=16777216,Oa(t,r,l),no=c):Oa(t,r,l));break;default:Oa(t,r,l)}}function k0(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 io(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];Tt=c,N0(c,t)}k0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)E0(t),t=t.sibling}function E0(t){switch(t.tag){case 0:case 11:case 15:io(t),t.flags&2048&&nr(9,t,t.return);break;case 3:io(t);break;case 12:io(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,vu(t)):io(t);break;default:io(t)}}function vu(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];Tt=c,N0(c,t)}k0(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:nr(8,r,r.return),vu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,vu(r));break;default:vu(r)}t=t.sibling}}function N0(t,r){for(;Tt!==null;){var l=Tt;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:Il(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Tt=c;else e:for(l=t;Tt!==null;){c=Tt;var p=c.sibling,y=c.return;if(g0(c),c===l){Tt=null;break e}if(p!==null){p.return=y,Tt=p;break e}Tt=y}}}var mk={getCacheForType:function(t){var r=jt(xt),l=r.data.get(t);return l===void 0&&(l=t(),r.data.set(t,l)),l},cacheSignal:function(){return jt(xt).controller.signal}},gk=typeof WeakMap=="function"?WeakMap:Map,Qe=0,it=null,Le=null,Ue=0,Je=0,hn=null,ir=!1,La=!1,eh=!1,Ci=0,dt=0,rr=0,Vr=0,th=0,pn=0,Ha=0,ro=null,tn=null,nh=!1,wu=0,C0=0,Su=1/0,_u=null,ar=null,Ct=0,lr=null,Ba=null,Mi=0,ih=0,rh=null,M0=null,ao=0,ah=null;function mn(){return(Qe&2)!==0&&Ue!==0?Ue&-Ue:j.T!==null?fh():Cs()}function T0(){if(pn===0)if((Ue&536870912)===0||qe){var t=oa;oa<<=1,(oa&3932160)===0&&(oa=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)&&(Ua(t,0),or(t,Ue,pn,!1)),kr(t,l),((Qe&2)===0||t!==it)&&(t===it&&((Qe&2)===0&&(Vr|=l),dt===4&&or(t,Ue,pn,!1)),Wn(t))}function A0(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?bk(t,r):oh(t,r,!0),y=c;do{if(p===0){La&&!c&&or(t,r,0,!1);break}else{if(l=t.current.alternate,y&&!yk(l)){p=oh(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 M=t;p=ro;var I=M.current.memoizedState.isDehydrated;if(I&&(Ua(M,S).flags|=256),S=oh(M,S,!1),S!==2){if(eh&&!I){M.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){Ua(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=wu+300-Et(),10<p)){if(or(c,r,pn,!ir),ua(c,0,!0)!==0)break e;Mi=r,c.timeoutHandle=ox(z0.bind(null,c,l,tn,_u,nh,r,pn,Vr,Ha,ir,y,"Throttled",-0,0),p);break e}z0(c,l,tn,_u,nh,r,pn,Vr,Ha,ir,y,null,-0,0)}}break}while(!0);Wn(t)}function z0(t,r,l,c,p,y,S,M,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},_0(r,y,se);var ye=(y&62914560)===y?wu-Et():(y&4194048)===y?C0-Et():0;if(ye=tE(se,ye),ye!==null){Mi=y,t.cancelPendingCommit=ye(U0.bind(null,t,r,y,l,c,p,S,M,I,le,se,null,ee,re)),or(t,y,S,!W);return}}U0(t,r,y,l,c,p,S,M,I)}function yk(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&=~th,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&&ks(t,l,r)}function ku(){return(Qe&6)===0?(lo(0),!1):!0}function lh(){if(Le!==null){if(Je===0)var t=Le.return;else t=Le,yi=Rr=null,Sd(t),Ta=null,$l=0,t=Le;for(;t!==null;)s0(t.alternate,t),t=t.return;Le=null}}function Ua(t,r){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Hk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Mi=0,lh(),it=t,Le=l=mi(t.current,null),Ue=r,Je=0,hn=null,ir=!1,La=_r(t,r),eh=!1,Ha=pn=th=Vr=rr=dt=0,tn=ro=null,nh=!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,Ys(),l}function j0(t,r){Ae=null,j.H=Ql,r===Ma||r===Ws?(r=Gg(),Je=3):r===cd?(r=Gg(),Je=4):Je=r===Bd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Le===null&&(dt=1,hu(t,kn(r,t.current)))}function D0(){var t=fn.current;return t===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?t===Mn:!1}function R0(){var t=j.H;return j.H=Ql,t===null?Ql:t}function O0(){var t=j.A;return j.A=mk,t}function Eu(){dt=4,ir||(Ue&4194048)!==Ue&&fn.current!==null||(La=!0),(rr&134217727)===0&&(Vr&134217727)===0||it===null||or(it,Ue,pn,!1)}function oh(t,r,l){var c=Qe;Qe|=2;var p=R0(),y=O0();(it!==t||Ue!==r)&&(_u=null,Ua(t,r)),r=!1;var S=dt;e:do try{if(Je!==0&&Le!==null){var M=Le,I=hn;switch(Je){case 8:lh(),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,Ia(t,M,I,W),l&&La){S=0;break e}break;default:W=Je,Je=0,hn=null,Ia(t,M,I,W)}}xk(),S=dt;break}catch(le){j0(t,le)}while(!0);return r&&t.shellSuspendCounter++,yi=Rr=null,Qe=c,j.H=p,j.A=y,Le===null&&(it=null,Ue=0,Ys()),S}function xk(){for(;Le!==null;)L0(Le)}function bk(t,r){var l=Qe;Qe|=2;var c=R0(),p=O0();it!==t||Ue!==r?(_u=null,Su=Et()+500,Ua(t,r)):La=_r(t,r);e:do try{if(Je!==0&&Le!==null){r=Le;var y=hn;t:switch(Je){case 1:Je=0,hn=null,Ia(t,r,y,1);break;case 2:case 9:if(Xg(y)){Je=0,hn=null,H0(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:Xg(y)?(Je=0,hn=null,H0(r)):(Je=0,hn=null,Ia(t,r,y,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var M=Le;if(S?Sx(S):M.stateNode.complete){Je=0,hn=null;var I=M.sibling;if(I!==null)Le=I;else{var W=M.return;W!==null?(Le=W,Nu(W)):Le=null}break t}}Je=0,hn=null,Ia(t,r,y,5);break;case 6:Je=0,hn=null,Ia(t,r,y,6);break;case 8:lh(),dt=6;break e;default:throw Error(a(462))}}vk();break}catch(le){j0(t,le)}while(!0);return yi=Rr=null,j.H=c,j.A=p,Qe=l,Le!==null?0:(it=null,Ue=0,Ys(),dt)}function vk(){for(;Le!==null&&!oi();)L0(Le)}function L0(t){var r=l0(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?Nu(t):Le=r}function H0(t){var r=t,l=r.alternate;switch(r.tag){case 15:case 0:r=e0(l,r,r.pendingProps,r.type,void 0,Ue);break;case 11:r=e0(l,r,r.pendingProps,r.type.render,r.ref,Ue);break;case 5:Sd(r);default:s0(l,r),r=Le=Og(r,Ci),r=l0(l,r,Ci)}t.memoizedProps=t.pendingProps,r===null?Nu(t):Le=r}function Ia(t,r,l,c){yi=Rr=null,Sd(r),Ta=null,$l=0;var p=r.return;try{if(sk(t,p,r,l,Ue)){dt=1,hu(t,kn(l,t.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;dt=1,hu(t,kn(l,t.current)),Le=null;return}r.flags&32768?(qe||c===1?t=!0:La||(Ue&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))),B0(r,t)):Nu(r)}function Nu(t){var r=t;do{if((r.flags&32768)!==0){B0(r,ir);return}t=r.return;var l=fk(r.alternate,r,Ci);if(l!==null){Le=l;return}if(r=r.sibling,r!==null){Le=r;return}Le=r=t}while(r!==null);dt===0&&(dt=5)}function B0(t,r){do{var l=dk(t.alternate,t);if(l!==null){l.flags&=32767,Le=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(t=t.sibling,t!==null)){Le=t;return}Le=t=l}while(t!==null);dt=6,Le=null}function U0(t,r,l,c,p,y,S,M,I){t.cancelPendingCommit=null;do Cu();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|=Zf,Ef(t,l,y,S,M,I),t===it&&(Le=it=null,Ue=0),Ba=r,lr=t,Mi=l,ih=y,rh=p,M0=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,kk(_e,function(){return P0(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=j.T,j.T=null,p=U.p,U.p=2,S=Qe,Qe|=4;try{hk(t,r,l)}finally{Qe=S,U.p=p,j.T=c}}Ct=1,I0(),q0(),$0()}}function I0(){if(Ct===1){Ct=0;var t=lr,r=Ba,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{v0(r,t);var y=bh,S=Ng(t.containerInfo),M=y.focusedElem,I=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&Eg(M.ownerDocument.documentElement,M)){if(I!==null&&Pf(M)){var W=I.start,le=I.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var se=M.ownerDocument||document,ee=se&&se.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=M.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 Q=kg(M,ke),X=kg(M,nt);if(Q&&X&&(re.rangeCount!==1||re.anchorNode!==Q.node||re.anchorOffset!==Q.offset||re.focusNode!==X.node||re.focusOffset!==X.offset)){var J=se.createRange();J.setStart(Q.node,Q.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=M;re=re.parentNode;)re.nodeType===1&&se.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<se.length;M++){var oe=se[M];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Uu=!!xh,bh=xh=null}finally{Qe=p,U.p=c,j.T=l}}t.current=r,Ct=2}}function q0(){if(Ct===2){Ct=0;var t=lr,r=Ba,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=j.T,j.T=null;var c=U.p;U.p=2;var p=Qe;Qe|=4;try{m0(t,r.alternate,r)}finally{Qe=p,U.p=c,j.T=l}}Ct=3}}function $0(){if(Ct===4||Ct===3){Ct=0,si();var t=lr,r=Ba,l=Mi,c=M0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ct=5:(Ct=0,Ba=lr=null,V0(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ar=null),El(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=j.T,p=U.p,U.p=2,j.T=null;try{for(var y=t.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{j.T=r,U.p=p}}(Mi&3)!==0&&Cu(),Wn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===ah?ao++:(ao=0,ah=t):ao=0,lo(0)}}function V0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Il(r)))}function Cu(){return I0(),q0(),$0(),P0()}function P0(){if(Ct!==5)return!1;var t=lr,r=ih;ih=0;var l=El(Mi),c=j.T,p=U.p;try{U.p=32>l?32:l,j.T=null,l=rh,rh=null;var y=lr,S=Mi;if(Ct=0,Ba=lr=null,Mi=0,(Qe&6)!==0)throw Error(a(331));var M=Qe;if(Qe|=4,E0(y.current),S0(y,y.current,S,l),Qe=M,lo(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(At,y)}catch{}return!0}finally{U.p=p,j.T=c,V0(t,r)}}function Y0(t,r,l){r=kn(l,r),r=Hd(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)Y0(t,t,l);else for(;r!==null;){if(r.tag===3){Y0(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=Xy(2),c=Wi(r,l,2),c!==null&&(Fy(l,c,r,t),kr(c,2),Wn(c));break}}r=r.return}}function sh(t,r,l){var c=t.pingCache;if(c===null){c=t.pingCache=new gk;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)||(eh=!0,p.add(l),t=wk.bind(null,t,r,l),r.then(t,t))}function wk(t,r,l){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,it===t&&(Ue&l)===l&&(dt===4||dt===3&&(Ue&62914560)===Ue&&300>Et()-wu?(Qe&2)===0&&Ua(t,0):th|=l,Ha===Ue&&(Ha=0)),Wn(t)}function X0(t,r){r===0&&(r=_s()),t=zr(t,r),t!==null&&(kr(t,r),Wn(t))}function Sk(t){var r=t.memoizedState,l=0;r!==null&&(l=r.retryLane),X0(t,l)}function _k(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),X0(t,l)}function kk(t,r){return Gt(t,r)}var Mu=null,qa=null,uh=!1,Tu=!1,ch=!1,sr=0;function Wn(t){t!==qa&&t.next===null&&(qa===null?Mu=qa=t:qa=qa.next=t),Tu=!0,uh||(uh=!0,Nk())}function lo(t,r){if(!ch&&Tu){ch=!0;do for(var l=!1,c=Mu;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Ke(42|t)+1)-1,y&=p&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Q0(c,y))}else y=Ue,y=ua(c,c===it?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||_r(c,y)||(l=!0,Q0(c,y));c=c.next}while(l);ch=!1}}function Ek(){F0()}function F0(){Tu=uh=!1;var t=0;sr!==0&&Lk()&&(t=sr);for(var r=Et(),l=null,c=Mu;c!==null;){var p=c.next,y=G0(c,r);y===0?(c.next=null,l===null?Mu=p:l.next=p,p===null&&(qa=l)):(l=c,(t!==0||(y&3)!==0)&&(Tu=!0)),c=p}Ct!==0&&Ct!==5||lo(t),sr!==0&&(sr=0)}function G0(t,r){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ke(y),M=1<<S,I=p[S];I===-1?((M&l)===0||(M&c)!==0)&&(p[S]=kf(M,r)):I<=r&&(t.expiredLanes|=M),y&=~M}if(r=it,l=Ue,l=ua(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),El(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=$e;break;default:l=_e}return c=Z0.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 Z0(t,r){if(Ct!==0&&Ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Cu()&&t.callbackNode!==l)return null;var c=Ue;return c=ua(t,t===it?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(A0(t,c,r),G0(t,Et()),t.callbackNode!=null&&t.callbackNode===l?Z0.bind(null,t):null)}function Q0(t,r){if(Cu())return null;A0(t,r,!0)}function Nk(){Bk(function(){(Qe&6)!==0?Gt(ae,Ek):F0()})}function fh(){if(sr===0){var t=Na;t===0&&(t=la,la<<=1,(la&261888)===0&&(la=256)),sr=t}return sr}function K0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Hs(""+t)}function J0(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 Ck(t,r,l,c,p){if(r==="submit"&&l&&l.stateNode===p){var y=K0((p[Bt]||null).action),S=c.submitter;S&&(r=(r=S[Bt]||null)?K0(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var M=new qs("action","action",null,c,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(sr!==0){var I=S?J0(p,S):new FormData(p);zd(l,{pending:!0,data:I,method:p.method,action:y},null,I)}}else typeof y=="function"&&(M.preventDefault(),I=S?J0(p,S):new FormData(p),zd(l,{pending:!0,data:I,method:p.method,action:y},y,I))},currentTarget:p}]})}}for(var dh=0;dh<Gf.length;dh++){var hh=Gf[dh],Mk=hh.toLowerCase(),Tk=hh[0].toUpperCase()+hh.slice(1);Hn(Mk,"on"+Tk)}Hn(Tg,"onAnimationEnd"),Hn(Ag,"onAnimationIteration"),Hn(zg,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(Y_,"onTransitionRun"),Hn(X_,"onTransitionStart"),Hn(F_,"onTransitionCancel"),Hn(jg,"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 oo="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(" "),Ak=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oo));function W0(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 M=c[S],I=M.instance,W=M.currentTarget;if(M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Ps(le)}p.currentTarget=null,y=I}else for(S=0;S<c.length;S++){if(M=c[S],I=M.instance,W=M.currentTarget,M=M.listener,I!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(le){Ps(le)}p.currentTarget=null,y=I}}}}function He(t,r){var l=r[ca];l===void 0&&(l=r[ca]=new Set);var c=t+"__bubble";l.has(c)||(ex(r,t,2,!1),l.add(c))}function ph(t,r,l){var c=0;r&&(c|=4),ex(l,t,c,r)}var Au="_reactListening"+Math.random().toString(36).slice(2);function mh(t){if(!t[Au]){t[Au]=!0,zs.forEach(function(l){l!=="selectionchange"&&(Ak.has(l)||ph(l,!1,t),ph(l,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Au]||(r[Au]=!0,ph("selectionchange",!1,r))}}function ex(t,r,l,c){switch(Tx(r)){case 2:var p=rE;break;case 8:p=aE;break;default:p=Ah}l=p.bind(null,r,l,t),p=void 0,!Of||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 gh(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 M=c.stateNode.containerInfo;if(M===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(;M!==null;){if(S=qi(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){c=y=S;continue e}M=M.parentNode}}c=c.return}ag(function(){var W=y,le=Df(l),se=[];e:{var ee=Dg.get(t);if(ee!==void 0){var re=qs,ye=t;switch(t){case"keypress":if(Us(l)===0)break e;case"keydown":case"keyup":re=__;break;case"focusin":ye="focus",re=Uf;break;case"focusout":ye="blur",re=Uf;break;case"beforeblur":case"afterblur":re=Uf;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=sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=f_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=N_;break;case Tg:case Ag:case zg:re=p_;break;case jg:re=M_;break;case"scroll":case"scrollend":re=u_;break;case"wheel":re=A_;break;case"copy":case"cut":case"paste":re=g_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=cg;break;case"toggle":case"beforetoggle":re=j_}var ke=(r&4)!==0,nt=!ke&&(t==="scroll"||t==="scrollend"),Q=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||Q===null||(oe=Tl(X,Q),oe!=null&&ke.push(so(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!==jf&&(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=sg,oe="onMouseLeave",Q="onMouseEnter",X="mouse",(t==="pointerout"||t==="pointerover")&&(ke=cg,oe="onPointerLeave",Q="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(Q,X+"enter",ye,l,le),ke.target=J,ke.relatedTarget=nt,oe=ke),nt=oe,re&&ye)t:{for(ke=zk,Q=re,X=ye,J=0,oe=Q;oe;oe=ke(oe))J++;oe=0;for(var ve=X;ve;ve=ke(ve))oe++;for(;0<J-oe;)Q=ke(Q),J--;for(;0<oe-J;)X=ke(X),oe--;for(;J--;){if(Q===X||X!==null&&Q===X.alternate){ke=Q;break t}Q=ke(Q),X=ke(X)}ke=null}else ke=null;re!==null&&tx(se,ee,re,ke,!1),ye!==null&&nt!==null&&tx(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=xg;else if(gg(ee))if(bg)Fe=$_;else{Fe=I_;var xe=U_}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&zf(W.elementType)&&(Fe=xg):Fe=q_;if(Fe&&(Fe=Fe(t,W))){yg(se,Fe,l,le);break e}xe&&xe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&Ml(ee,"number",ee.value)}switch(xe=W?Vi(W):window,t){case"focusin":(gg(xe)||xe.contentEditable==="true")&&(xa=xe,Yf=W,Hl=null);break;case"focusout":Hl=Yf=xa=null;break;case"mousedown":Xf=!0;break;case"contextmenu":case"mouseup":case"dragend":Xf=!1,Cg(se,l,le);break;case"selectionchange":if(P_)break;case"keydown":case"keyup":Cg(se,l,le)}var ze;if(qf)e:{switch(t){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ya?pg(t,l)&&(Ie="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ie="onCompositionStart");Ie&&(fg&&l.locale!=="ko"&&(ya||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ya&&(ze=lg()):(Xi=le,Lf="value"in Xi?Xi.value:Xi.textContent,ya=!0)),xe=zu(W,Ie),0<xe.length&&(Ie=new ug(Ie,t,null,l,le),se.push({event:Ie,listeners:xe}),ze?Ie.data=ze:(ze=mg(l),ze!==null&&(Ie.data=ze)))),(ze=R_?O_(t,l):L_(t,l))&&(Ie=zu(W,"onBeforeInput"),0<Ie.length&&(xe=new ug("onBeforeInput","beforeinput",null,l,le),se.push({event:xe,listeners:Ie}),xe.data=ze)),Ck(se,t,W,l,le)}W0(se,r)})}function so(t,r,l){return{instance:t,listener:r,currentTarget:l}}function zu(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=Tl(t,l),p!=null&&c.unshift(so(t,p,y)),p=Tl(t,r),p!=null&&c.push(so(t,p,y))),t.tag===3)return c;t=t.return}return[]}function zk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function tx(t,r,l,c,p){for(var y=r._reactName,S=[];l!==null&&l!==c;){var M=l,I=M.alternate,W=M.stateNode;if(M=M.tag,I!==null&&I===c)break;M!==5&&M!==26&&M!==27||W===null||(I=W,p?(W=Tl(l,y),W!=null&&S.unshift(so(l,W,I))):p||(W=Tl(l,y),W!=null&&S.push(so(l,W,I)))),l=l.return}S.length!==0&&t.push({event:r,listeners:S})}var jk=/\r\n?/g,Dk=/\u0000|\uFFFD/g;function nx(t){return(typeof t=="string"?t:""+t).replace(jk,`
|
|
9
|
-
`).replace(Dk,"")}function ix(t,r){return r=nx(r),nx(t)===r}function tt(t,r,l,c,p,y){switch(l){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||pa(t,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&pa(t,""+c);break;case"className":da(t,"class",c);break;case"tabIndex":da(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":da(t,l,c);break;case"style":ig(t,c,y);break;case"data":if(r!=="object"){da(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=Hs(""+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=Hs(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=hi);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("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=Hs(""+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":He("beforetoggle",t),He("toggle",t),fa(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":fa(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=o_.get(l)||l,fa(t,l,c))}}function yh(t,r,l,c,p,y){switch(l){case"style":ig(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"?pa(t,c):(typeof c=="number"||typeof c=="bigint")&&pa(t,""+c);break;case"onScroll":c!=null&&He("scroll",t);break;case"onScrollEnd":c!=null&&He("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(!js.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,""):fa(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":He("error",t),He("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":He("invalid",t);var M=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":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,r));break;default:tt(t,r,c,le,l,null)}}Ls(t,y,M,I,W,S,p,!1);return;case"select":He("invalid",t),c=S=y=null;for(p in l)if(l.hasOwnProperty(p)&&(M=l[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:tt(t,r,p,M,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":He("invalid",t),y=p=c=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:tt(t,r,S,M,l,null)}tg(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":He("beforetoggle",t),He("toggle",t),He("cancel",t),He("close",t);break;case"iframe":case"object":He("load",t);break;case"video":case"audio":for(c=0;c<oo.length;c++)He(oo[c],t);break;case"image":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"embed":case"source":case"link":He("error",t),He("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(zf(r)){for(le in l)l.hasOwnProperty(le)&&(c=l[le],c!==void 0&&yh(t,r,le,c,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(c=l[M],c!=null&&tt(t,r,M,c,l,null))}function Rk(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,M=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":M=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,M,I,W,le,y,p);return;case"select":re=S=M=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":M=y;break;case"multiple":S=y;default:y!==I&&tt(t,r,p,y,c,I)}r=M,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(M in l)if(p=l[M],l.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:tt(t,r,M,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)}eg(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(zf(r)){for(var nt in l)ee=l[nt],l.hasOwnProperty(nt)&&ee!==void 0&&!c.hasOwnProperty(nt)&&yh(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||yh(t,r,le,ee,c,re);return}}for(var Q in l)ee=l[Q],l.hasOwnProperty(Q)&&ee!=null&&!c.hasOwnProperty(Q)&&tt(t,r,Q,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 rx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ok(){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,M=p.duration;if(y&&M&&rx(S)){for(S=0,M=p.responseEnd,c+=1;c<l.length;c++){var I=l[c],W=I.startTime;if(W>M)break;var le=I.transferSize,se=I.initiatorType;le&&rx(se)&&(I=I.responseEnd,S+=le*(I<M?1:(M-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 xh=null,bh=null;function ju(t){return t.nodeType===9?t:t.ownerDocument}function ax(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 lx(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 vh(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 wh=null;function Lk(){var t=window.event;return t&&t.type==="popstate"?t===wh?!1:(wh=t,!0):(wh=null,!1)}var ox=typeof setTimeout=="function"?setTimeout:void 0,Hk=typeof clearTimeout=="function"?clearTimeout:void 0,sx=typeof Promise=="function"?Promise:void 0,Bk=typeof queueMicrotask=="function"?queueMicrotask:typeof sx<"u"?function(t){return sx.resolve(null).then(t).catch(Uk)}:ox;function Uk(t){setTimeout(function(){throw t})}function ur(t){return t==="head"}function ux(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),Ya(r);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")uo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,uo(l);for(var y=l.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[Er]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=S}}else l==="body"&&uo(t.ownerDocument.body);l=p}while(l);Ya(r)}function cx(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 Sh(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":Sh(l),Nl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Ik(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=Tn(t.nextSibling),t===null)break}return null}function qk(t,r,l){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Tn(t.nextSibling),t===null))return null;return t}function fx(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Tn(t.nextSibling),t===null))return null;return t}function _h(t){return t.data==="$?"||t.data==="$~"}function kh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function $k(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 Tn(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 Eh=null;function dx(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(r===0)return Tn(t.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}t=t.nextSibling}return null}function hx(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 px(t,r,l){switch(r=ju(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 uo(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Nl(t)}var An=new Map,mx=new Set;function Du(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ti=U.d;U.d={f:Vk,r:Pk,D:Yk,C:Xk,L:Fk,m:Gk,X:Qk,S:Zk,M:Kk};function Vk(){var t=Ti.f(),r=ku();return t||r}function Pk(t){var r=$i(t);r!==null&&r.tag===5&&r.type==="form"?jy(r):Ti.r(t)}var $a=typeof document>"u"?null:document;function gx(t,r,l){var c=$a;if(c&&typeof r=="string"&&r){var p=Qt(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),mx.has(p)||(mx.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 Yk(t){Ti.D(t),gx("dns-prefetch",t,null)}function Xk(t,r){Ti.C(t,r),gx("preconnect",t,r)}function Fk(t,r,l){Ti.L(t,r,l);var c=$a;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=Va(t);break;case"script":y=Pa(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(co(y))||r==="script"&&c.querySelector(fo(y))||(r=c.createElement("link"),Rt(r,"link",t),yt(r),c.head.appendChild(r)))}}function Gk(t,r){Ti.m(t,r);var l=$a;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=Pa(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(fo(y)))return}c=l.createElement("link"),Rt(c,"link",t),yt(c),l.head.appendChild(c)}}}function Zk(t,r,l){Ti.S(t,r,l);var c=$a;if(c&&t){var p=Pi(c).hoistableStyles,y=Va(t);r=r||"default";var S=p.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(co(y)))M.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},l),(l=An.get(y))&&Nh(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(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Ru(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:M},p.set(y,S)}}}function Qk(t,r){Ti.X(t,r);var l=$a;if(l&&t){var c=Pi(l).hoistableScripts,p=Pa(t),y=c.get(p);y||(y=l.querySelector(fo(p)),y||(t=m({src:t,async:!0},r),(r=An.get(p))&&Ch(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 Kk(t,r){Ti.M(t,r);var l=$a;if(l&&t){var c=Pi(l).hoistableScripts,p=Pa(t),y=c.get(p);y||(y=l.querySelector(fo(p)),y||(t=m({src:t,async:!0,type:"module"},r),(r=An.get(p))&&Ch(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 yx(t,r,l,c){var p=(p=fe.current)?Du(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=Va(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=Va(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(co(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||Jk(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=Pa(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 Va(t){return'href="'+Qt(t)+'"'}function co(t){return'link[rel="stylesheet"]['+t+"]"}function xx(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function Jk(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 Pa(t){return'[src="'+Qt(t)+'"]'}function fo(t){return"script[async]"+t}function bx(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),Ru(c,l.precedence,t),r.instance=c;case"stylesheet":p=Va(l.href);var y=t.querySelector(co(p));if(y)return r.state.loading|=4,r.instance=y,yt(y),y;c=xx(l),(p=An.get(p))&&Nh(c,p),y=(t.ownerDocument||t).createElement("link"),yt(y);var S=y;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Rt(y,"link",c),r.state.loading|=4,Ru(y,l.precedence,t),r.instance=y;case"script":return y=Pa(l.src),(p=t.querySelector(fo(y)))?(r.instance=p,yt(p),p):(c=l,(p=An.get(y))&&(c=m({},l),Ch(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,Ru(c,l.precedence,t));return r.instance}function Ru(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 M=c[S];if(M.dataset.precedence===r)y=M;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 Nh(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Ch(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Ou=null;function vx(t,r,l){if(Ou===null){var c=new Map,p=Ou=new Map;p.set(l,c)}else p=Ou,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 M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function wx(t,r,l){t=t.ownerDocument||t,t.head.insertBefore(l,r==="title"?t.querySelector("head > title"):null)}function Wk(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 Sx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function eE(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=Va(c.href),y=r.querySelector(co(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Lu.bind(t),r.then(t,t)),l.state.loading|=4,l.instance=y,yt(y);return}y=r.ownerDocument||r,c=xx(c),(p=An.get(p))&&Nh(c,p),y=y.createElement("link"),yt(y);var S=y;S._p=new Promise(function(M,I){S.onload=M,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=Lu.bind(t),r.addEventListener("load",l),r.addEventListener("error",l))}}var Mh=0;function tE(t,r){return t.stylesheets&&t.count===0&&Bu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Bu(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},6e4+r);0<t.imgBytes&&Mh===0&&(Mh=62500*Ok());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Bu(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>Mh?50:800)+r);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Hu=null;function Bu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Hu=new Map,r.forEach(nE,t),Hu=null,Lu.call(t))}function nE(t,r){if(!(r.state.loading&4)){var l=Hu.get(t);if(l)var c=l.get(null);else{l=new Map,Hu.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=Lu.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 ho={$$typeof:k,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function iE(t,r,l,c,p,y,S,M,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_l(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_l(0),this.hiddenUpdates=_l(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 _x(t,r,l,c,p,y,S,M,I,W,le,se){return t=new iE(t,r,l,S,I,W,le,se,M),r=1,y===!0&&(r|=24),y=cn(3,null,null,r),t.current=y,y.stateNode=t,r=od(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:l,cache:r},fd(y),t}function kx(t){return t?(t=wa,t):wa}function Ex(t,r,l,c,p,y){p=kx(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),Pl(l,t,r))}function Nx(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<r?l:r}}function Th(t,r){Nx(t,r),(t=t.alternate)&&Nx(t,r)}function Cx(t){if(t.tag===13||t.tag===31){var r=zr(t,67108864);r!==null&&nn(r,t,67108864),Th(t,67108864)}}function Mx(t){if(t.tag===13||t.tag===31){var r=mn();r=kl(r);var l=zr(t,r);l!==null&&nn(l,t,r),Th(t,r)}}var Uu=!0;function rE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=2,Ah(t,r,l,c)}finally{U.p=y,j.T=p}}function aE(t,r,l,c){var p=j.T;j.T=null;var y=U.p;try{U.p=8,Ah(t,r,l,c)}finally{U.p=y,j.T=p}}function Ah(t,r,l,c){if(Uu){var p=zh(c);if(p===null)gh(t,r,c,Iu,l),Ax(t,c);else if(oE(p,t,r,l,c))c.stopPropagation();else if(Ax(t,c),r&4&&-1<lE.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 M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Ke(S);M.entanglements[1]|=I,S&=~I}Wn(y),(Qe&6)===0&&(Su=Et()+500,lo(0))}}break;case 31:case 13:M=zr(y,2),M!==null&&nn(M,y,2),ku(),Th(y,2)}if(y=zh(c),y===null&&gh(t,r,c,Iu,l),y===p)break;p=y}p!==null&&c.stopPropagation()}else gh(t,r,c,null,l)}}function zh(t){return t=Df(t),jh(t)}var Iu=null;function jh(t){if(Iu=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 Iu=t,null}function Tx(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 De:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Dh=!1,cr=null,fr=null,dr=null,po=new Map,mo=new Map,hr=[],lE="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 Ax(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":po.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(r.pointerId)}}function go(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&&Cx(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function oE(t,r,l,c,p){switch(r){case"focusin":return cr=go(cr,t,r,l,c,p),!0;case"dragenter":return fr=go(fr,t,r,l,c,p),!0;case"mouseover":return dr=go(dr,t,r,l,c,p),!0;case"pointerover":var y=p.pointerId;return po.set(y,go(po.get(y)||null,t,r,l,c,p)),!0;case"gotpointercapture":return y=p.pointerId,mo.set(y,go(mo.get(y)||null,t,r,l,c,p)),!0}return!1}function zx(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,Ms(t.priority,function(){Mx(l)});return}}else if(r===31){if(r=f(l),r!==null){t.blockedOn=r,Ms(t.priority,function(){Mx(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 qu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var l=zh(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);jf=c,l.target.dispatchEvent(c),jf=null}else return r=$i(l),r!==null&&Cx(r),t.blockedOn=l,!1;r.shift()}return!0}function jx(t,r,l){qu(t)&&l.delete(r)}function sE(){Dh=!1,cr!==null&&qu(cr)&&(cr=null),fr!==null&&qu(fr)&&(fr=null),dr!==null&&qu(dr)&&(dr=null),po.forEach(jx),mo.forEach(jx)}function $u(t,r){t.blockedOn===r&&(t.blockedOn=null,Dh||(Dh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sE)))}var Vu=null;function Dx(t){Vu!==t&&(Vu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vu===t&&(Vu=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(jh(c||l)===null)continue;break}var y=$i(l);y!==null&&(t.splice(r,3),r-=3,zd(y,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function Ya(t){function r(I){return $u(I,t)}cr!==null&&$u(cr,t),fr!==null&&$u(fr,t),dr!==null&&$u(dr,t),po.forEach(r),mo.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);)zx(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||Dx(l);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[Bt]||null)M=S.formAction;else if(jh(p)!==null)continue}else M=S.action;typeof M=="function"?l[c+1]=M:(l.splice(c,3),c-=3),Dx(l)}}}function Rx(){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 Rh(t){this._internalRoot=t}Pu.prototype.render=Rh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,c=mn();Ex(l,c,t,r,null,null)},Pu.prototype.unmount=Rh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Ex(t.current,2,null,t,null,null),ku(),r[ci]=null}};function Pu(t){this._internalRoot=t}Pu.prototype.unstable_scheduleHydration=function(t){if(t){var r=Cs();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&&zx(t)}};var Ox=n.version;if(Ox!=="19.2.3")throw Error(a(527,Ox,"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 uE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yu.isDisabled&&Yu.supportsFiber)try{At=Yu.inject(uE),pt=Yu}catch{}}return xo.createRoot=function(t,r){if(!o(t))throw Error(a(299));var l=!1,c="",p=$y,y=Vy,S=Py;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=_x(t,1,!1,null,null,l,c,null,p,y,S,Rx),t[ci]=r.current,mh(t),new Rh(r)},xo.hydrateRoot=function(t,r,l){if(!o(t))throw Error(a(299));var c=!1,p="",y=$y,S=Vy,M=Py,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&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=_x(t,1,!0,r,l??null,c,p,I,y,S,M,Rx),r.context=kx(null),l=r.current,c=mn(),c=kl(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,mh(t),new Pu(r)},xo.version="19.2.3",xo}var Yx;function xE(){if(Yx)return Hh.exports;Yx=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(),Hh.exports=yE(),Hh.exports}var bE=xE();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 vE={value:()=>{}};function Zc(){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 Sc(i)}function Sc(e){this._=e}function wE(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}})}Sc.prototype=Zc.prototype={constructor:Sc,on:function(e,n){var i=this._,a=wE(e+"",i),o,s=-1,u=a.length;if(arguments.length<2){for(;++s<u;)if((o=(e=a[s]).type)&&(o=SE(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]=Xx(i[o],e.name,n);else if(n==null)for(o in i)i[o]=Xx(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 Sc(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 SE(e,n){for(var i=0,a=e.length,o;i<a;++i)if((o=e[i]).name===n)return o.value}function Xx(e,n,i){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=vE,e=e.slice(0,a).concat(e.slice(a+1));break}return i!=null&&e.push({name:n,value:i}),e}var Np="http://www.w3.org/1999/xhtml";const Fx={svg:"http://www.w3.org/2000/svg",xhtml:Np,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qc(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Fx.hasOwnProperty(n)?{space:Fx[n],local:e}:e}function _E(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Np&&n.documentElement.namespaceURI===Np?n.createElement(e):n.createElementNS(i,e)}}function kE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function xv(e){var n=Qc(e);return(n.local?kE:_E)(n)}function EE(){}function lm(e){return e==null?EE:function(){return this.querySelector(e)}}function NE(e){typeof e!="function"&&(e=lm(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 CE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ME(){return[]}function bv(e){return e==null?ME:function(){return this.querySelectorAll(e)}}function TE(e){return function(){return CE(e.apply(this,arguments))}}function AE(e){typeof e=="function"?e=TE(e):e=bv(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 vv(e){return function(){return this.matches(e)}}function wv(e){return function(n){return n.matches(e)}}var zE=Array.prototype.find;function jE(e){return function(){return zE.call(this.children,e)}}function DE(){return this.firstElementChild}function RE(e){return this.select(e==null?DE:jE(typeof e=="function"?e:wv(e)))}var OE=Array.prototype.filter;function LE(){return Array.from(this.children)}function HE(e){return function(){return OE.call(this.children,e)}}function BE(e){return this.selectAll(e==null?LE:HE(typeof e=="function"?e:wv(e)))}function UE(e){typeof e!="function"&&(e=vv(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 Sv(e){return new Array(e.length)}function IE(){return new Sn(this._enter||this._groups.map(Sv),this._parents)}function Ac(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ac.prototype={constructor:Ac,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 qE(e){return function(){return e}}function $E(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 Ac(e,s[u]);for(;u<h;++u)(f=n[u])&&(o[u]=f)}function VE(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 Ac(e,s[f]);for(f=0;f<g;++f)(h=n[f])&&d.get(x[f])===h&&(o[f]=h)}function PE(e){return e.__data__}function YE(e,n){if(!arguments.length)return Array.from(this,PE);var i=n?VE:$E,a=this._parents,o=this._groups;typeof e!="function"&&(e=qE(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=XE(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 D=0,k=0,C,L;D<w;++D)if(C=E[D]){for(D>=k&&(k=D+1);!(L=N[k])&&++k<w;);C._next=L||null}}return u=new Sn(u,a),u._enter=f,u._exit=h,u}function XE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FE(){return new Sn(this._exit||this._groups.map(Sv),this._parents)}function GE(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 ZE(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 QE(){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 KE(e){e||(e=JE);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 JE(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function WE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function eN(){return Array.from(this)}function tN(){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 nN(){let e=0;for(const n of this)++e;return e}function iN(){return!this.node()}function rN(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 aN(e){return function(){this.removeAttribute(e)}}function lN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oN(e,n){return function(){this.setAttribute(e,n)}}function sN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function uN(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function cN(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 fN(e,n){var i=Qc(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?lN:aN:typeof n=="function"?i.local?cN:uN:i.local?sN:oN)(i,n))}function _v(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function dN(e){return function(){this.style.removeProperty(e)}}function hN(e,n,i){return function(){this.style.setProperty(e,n,i)}}function pN(e,n,i){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,i)}}function mN(e,n,i){return arguments.length>1?this.each((n==null?dN:typeof n=="function"?pN:hN)(e,n,i??"")):sl(this.node(),e)}function sl(e,n){return e.style.getPropertyValue(n)||_v(e).getComputedStyle(e,null).getPropertyValue(n)}function gN(e){return function(){delete this[e]}}function yN(e,n){return function(){this[e]=n}}function xN(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function bN(e,n){return arguments.length>1?this.each((n==null?gN:typeof n=="function"?xN:yN)(e,n)):this.node()[e]}function kv(e){return e.trim().split(/^|\s+/)}function om(e){return e.classList||new Ev(e)}function Ev(e){this._node=e,this._names=kv(e.getAttribute("class")||"")}Ev.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 Nv(e,n){for(var i=om(e),a=-1,o=n.length;++a<o;)i.add(n[a])}function Cv(e,n){for(var i=om(e),a=-1,o=n.length;++a<o;)i.remove(n[a])}function vN(e){return function(){Nv(this,e)}}function wN(e){return function(){Cv(this,e)}}function SN(e,n){return function(){(n.apply(this,arguments)?Nv:Cv)(this,e)}}function _N(e,n){var i=kv(e+"");if(arguments.length<2){for(var a=om(this.node()),o=-1,s=i.length;++o<s;)if(!a.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?SN:n?vN:wN)(i,n))}function kN(){this.textContent=""}function EN(e){return function(){this.textContent=e}}function NN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function CN(e){return arguments.length?this.each(e==null?kN:(typeof e=="function"?NN:EN)(e)):this.node().textContent}function MN(){this.innerHTML=""}function TN(e){return function(){this.innerHTML=e}}function AN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function zN(e){return arguments.length?this.each(e==null?MN:(typeof e=="function"?AN:TN)(e)):this.node().innerHTML}function jN(){this.nextSibling&&this.parentNode.appendChild(this)}function DN(){return this.each(jN)}function RN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ON(){return this.each(RN)}function LN(e){var n=typeof e=="function"?e:xv(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function HN(){return null}function BN(e,n){var i=typeof e=="function"?e:xv(e),a=n==null?HN:typeof n=="function"?n:lm(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function UN(){var e=this.parentNode;e&&e.removeChild(this)}function IN(){return this.each(UN)}function qN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function $N(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function VN(e){return this.select(e?$N:qN)}function PN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function YN(e){return function(n){e.call(this,n,this.__data__)}}function XN(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 FN(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 GN(e,n,i){return function(){var a=this.__on,o,s=YN(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 ZN(e,n,i){var a=XN(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?GN:FN,o=0;o<s;++o)this.each(f(a[o],n,i));return this}function Mv(e,n,i){var a=_v(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 QN(e,n){return function(){return Mv(this,e,n)}}function KN(e,n){return function(){return Mv(this,e,n.apply(this,arguments))}}function JN(e,n){return this.each((typeof n=="function"?KN:QN)(e,n))}function*WN(){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 Tv=[null];function Sn(e,n){this._groups=e,this._parents=n}function us(){return new Sn([[document.documentElement]],Tv)}function eC(){return this}Sn.prototype=us.prototype={constructor:Sn,select:NE,selectAll:AE,selectChild:RE,selectChildren:BE,filter:UE,data:YE,enter:IE,exit:FE,join:GE,merge:ZE,selection:eC,order:QE,sort:KE,call:WE,nodes:eN,node:tN,size:nN,empty:iN,each:rN,attr:fN,style:mN,property:bN,classed:_N,text:CN,html:zN,raise:DN,lower:ON,append:LN,insert:BN,remove:IN,clone:VN,datum:PN,on:ZN,dispatch:JN,[Symbol.iterator]:WN};function vn(e){return typeof e=="string"?new Sn([[document.querySelector(e)]],[document.documentElement]):new Sn([[e]],Tv)}function tC(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=tC(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 nC={passive:!1},Qo={capture:!0,passive:!1};function qh(e){e.stopImmediatePropagation()}function nl(e){e.preventDefault(),e.stopImmediatePropagation()}function Av(e){var n=e.document.documentElement,i=vn(e).on("dragstart.drag",nl,Qo);"onselectstart"in n?i.on("selectstart.drag",nl,Qo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function zv(e,n){var i=e.document.documentElement,a=vn(e).on("dragstart.drag",null);n&&(a.on("click.drag",nl,Qo),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 Xu=e=>()=>e;function Cp(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}})}Cp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function iC(e){return!e.ctrlKey&&!e.button}function rC(){return this.parentNode}function aC(e,n){return n??{x:e.x,y:e.y}}function lC(){return navigator.maxTouchPoints||"ontouchstart"in this}function jv(){var e=iC,n=rC,i=aC,a=lC,o={},s=Zc("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",_,nC).on("touchend.drag touchcancel.drag",D).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,Qo).on("mouseup.drag",E,Qo),Av(C.view),qh(C),d=!1,f=C.clientX,h=C.clientY,A("start",C))}}function w(C){if(nl(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),zv(C.view,d),nl(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]))&&(qh(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])&&(nl(C),F("drag",C,L[H]))}function D(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])&&(qh(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 Cp("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(j,U,Y){var K=V,z;switch(j){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(j,C,new Cp(j,{sourceEvent:U,subject:O,target:x,identifier:F,active:z,x:V[0]+P,y:V[1]+te,dx:V[0]-K[0],dy:V[1]-K[1],dispatch:q}),H)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Xu(!!C),x):e},x.container=function(C){return arguments.length?(n=typeof C=="function"?C:Xu(C),x):n},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Xu(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Xu(!!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 sm(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Dv(e,n){var i=Object.create(e.prototype);for(var a in n)i[a]=n[a];return i}function cs(){}var Ko=.7,zc=1/Ko,il="\\s*([+-]?\\d+)\\s*",Jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oC=/^#([0-9a-f]{3,8})$/,sC=new RegExp(`^rgb\\(${il},${il},${il}\\)$`),uC=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),cC=new RegExp(`^rgba\\(${il},${il},${il},${Jo}\\)$`),fC=new RegExp(`^rgba\\(${ii},${ii},${ii},${Jo}\\)$`),dC=new RegExp(`^hsl\\(${Jo},${ii},${ii}\\)$`),hC=new RegExp(`^hsla\\(${Jo},${ii},${ii},${Jo}\\)$`),Gx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};sm(cs,Wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zx,formatHex:Zx,formatHex8:pC,formatHsl:mC,formatRgb:Qx,toString:Qx});function Zx(){return this.rgb().formatHex()}function pC(){return this.rgb().formatHex8()}function mC(){return Rv(this).formatHsl()}function Qx(){return this.rgb().formatRgb()}function Wr(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=oC.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?Kx(n):i===3?new an(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Fu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Fu(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=sC.exec(e))?new an(n[1],n[2],n[3],1):(n=uC.exec(e))?new an(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=cC.exec(e))?Fu(n[1],n[2],n[3],n[4]):(n=fC.exec(e))?Fu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=dC.exec(e))?eb(n[1],n[2]/100,n[3]/100,1):(n=hC.exec(e))?eb(n[1],n[2]/100,n[3]/100,n[4]):Gx.hasOwnProperty(e)?Kx(Gx[e]):e==="transparent"?new an(NaN,NaN,NaN,0):null}function Kx(e){return new an(e>>16&255,e>>8&255,e&255,1)}function Fu(e,n,i,a){return a<=0&&(e=n=i=NaN),new an(e,n,i,a)}function gC(e){return e instanceof cs||(e=Wr(e)),e?(e=e.rgb(),new an(e.r,e.g,e.b,e.opacity)):new an}function Mp(e,n,i,a){return arguments.length===1?gC(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}sm(an,Mp,Dv(cs,{brighter(e){return e=e==null?zc:Math.pow(zc,e),new an(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ko:Math.pow(Ko,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),jc(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:Jx,formatHex:Jx,formatHex8:yC,formatRgb:Wx,toString:Wx}));function Jx(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function yC(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wx(){const e=jc(this.opacity);return`${e===1?"rgb(":"rgba("}${Kr(this.r)}, ${Kr(this.g)}, ${Kr(this.b)}${e===1?")":`, ${e})`}`}function jc(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 eb(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 Rv(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof cs||(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 xC(e,n,i,a){return arguments.length===1?Rv(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}sm(qn,xC,Dv(cs,{brighter(e){return e=e==null?zc:Math.pow(zc,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ko:Math.pow(Ko,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($h(e>=240?e-240:e+120,o,a),$h(e,o,a),$h(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new qn(tb(this.h),Gu(this.s),Gu(this.l),jc(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=jc(this.opacity);return`${e===1?"hsl(":"hsla("}${tb(this.h)}, ${Gu(this.s)*100}%, ${Gu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tb(e){return e=(e||0)%360,e<0?e+360:e}function Gu(e){return Math.max(0,Math.min(1,e||0))}function $h(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 um=e=>()=>e;function bC(e,n){return function(i){return e+i*n}}function vC(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 wC(e){return(e=+e)==1?Ov:function(n,i){return i-n?vC(n,i,e):um(isNaN(n)?i:n)}}function Ov(e,n){var i=n-e;return i?bC(e,i):um(isNaN(e)?n:e)}const Dc=(function e(n){var i=wC(n);function a(o,s){var u=i((o=Mp(o)).r,(s=Mp(s)).r),f=i(o.g,s.g),h=i(o.b,s.b),d=Ov(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 SC(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 _C(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kC(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]=Yo(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 EC(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 NC(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]=Yo(e[o],n[o]):a[o]=n[o];return function(s){for(o in i)a[o]=i[o](s);return a}}var Tp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vh=new RegExp(Tp.source,"g");function CC(e){return function(){return e}}function MC(e){return function(n){return e(n)+""}}function Lv(e,n){var i=Tp.lastIndex=Vh.lastIndex=0,a,o,s,u=-1,f=[],h=[];for(e=e+"",n=n+"";(a=Tp.exec(e))&&(o=Vh.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=Vh.lastIndex;return i<n.length&&(s=n.slice(i),f[u]?f[u]+=s:f[++u]=s),f.length<2?h[0]?MC(h[0].x):CC(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 Yo(e,n){var i=typeof n,a;return n==null||i==="boolean"?um(n):(i==="number"?ti:i==="string"?(a=Wr(n))?(n=a,Dc):Lv:n instanceof Wr?Dc:n instanceof Date?EC:_C(n)?SC:Array.isArray(n)?kC:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?NC:ti)(e,n)}var nb=180/Math.PI,Ap={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hv(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)*nb,skewX:Math.atan(h)*nb,scaleX:u,scaleY:f}}var Zu;function TC(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Ap:Hv(n.a,n.b,n.c,n.d,n.e,n.f)}function AC(e){return e==null||(Zu||(Zu=document.createElementNS("http://www.w3.org/2000/svg","g")),Zu.setAttribute("transform",e),!(e=Zu.transform.baseVal.consolidate()))?Ap:(e=e.matrix,Hv(e.a,e.b,e.c,e.d,e.e,e.f))}function Bv(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 zC=Bv(TC,"px, ","px)","deg)"),jC=Bv(AC,", ",")",")"),DC=1e-12;function ib(e){return((e=Math.exp(e))+1/e)/2}function RC(e){return((e=Math.exp(e))-1/e)/2}function OC(e){return((e=Math.exp(2*e))-1)/(e+1)}const _c=(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<DC)_=Math.log(x/d)/n,N=function(H){return[f+H*b,h+H*w,d*Math.exp(n*H*_)]};else{var D=Math.sqrt(E),k=(x*x-d*d+a*E)/(2*d*i*D),C=(x*x-d*d-a*E)/(2*x*i*D),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=ib(L),q=d/(i*D)*(G*OC(n*F+L)-RC(L));return[f+q*b,h+q*w,d*G/ib(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 ul=0,qo=0,bo=0,Uv=1e3,Rc,$o,Oc=0,ea=0,Kc=0,Wo=typeof performance=="object"&&performance.now?performance:Date,Iv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cm(){return ea||(Iv(LC),ea=Wo.now()+Kc)}function LC(){ea=0}function Lc(){this._call=this._time=this._next=null}Lc.prototype=qv.prototype={constructor:Lc,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?cm():+i)+(n==null?0:+n),!this._next&&$o!==this&&($o?$o._next=this:Rc=this,$o=this),this._call=e,this._time=i,zp()},stop:function(){this._call&&(this._call=null,this._time=1/0,zp())}};function qv(e,n,i){var a=new Lc;return a.restart(e,n,i),a}function HC(){cm(),++ul;for(var e=Rc,n;e;)(n=ea-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ul}function rb(){ea=(Oc=Wo.now())+Kc,ul=qo=0;try{HC()}finally{ul=0,UC(),ea=0}}function BC(){var e=Wo.now(),n=e-Oc;n>Uv&&(Kc-=n,Oc=e)}function UC(){for(var e,n=Rc,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:Rc=i);$o=e,zp(a)}function zp(e){if(!ul){qo&&(qo=clearTimeout(qo));var n=e-ea;n>24?(e<1/0&&(qo=setTimeout(rb,e-Wo.now()-Kc)),bo&&(bo=clearInterval(bo))):(bo||(Oc=Wo.now(),bo=setInterval(BC,Uv)),ul=1,Iv(rb))}}function ab(e,n,i){var a=new Lc;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,i),a}var IC=Zc("start","end","cancel","interrupt"),qC=[],$v=0,lb=1,jp=2,kc=3,ob=4,Dp=5,Ec=6;function Jc(e,n,i,a,o,s){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;$C(e,i,{name:n,index:a,group:o,on:IC,tween:qC,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:$v})}function fm(e,n){var i=Xn(e,n);if(i.state>$v)throw new Error("too late; already scheduled");return i}function ai(e,n){var i=Xn(e,n);if(i.state>kc)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 $C(e,n,i){var a=e.__transition,o;a[n]=i,i.timer=qv(s,0,i.time);function s(d){i.state=lb,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!==lb)return h();for(g in a)if(b=a[g],b.name===i.name){if(b.state===kc)return ab(u);b.state===ob?(b.state=Ec,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete a[g]):+g<n&&(b.state=Ec,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete a[g])}if(ab(function(){i.state===kc&&(i.state=ob,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=jp,i.on.call("start",e,e.__data__,i.index,i.group),i.state===jp){for(i.state=kc,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=Dp,1),m=-1,x=o.length;++m<x;)o[m].call(e,g);i.state===Dp&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=Ec,i.timer.stop(),delete a[n];for(var d in a)return;delete e.__transition}}function Nc(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>jp&&a.state<Dp,a.state=Ec,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete i[u]}s&&delete e.__transition}}function VC(e){return this.each(function(){Nc(this,e)})}function PC(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 YC(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 XC(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?PC:YC)(i,e,n))}function dm(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 Vv(e,n){var i;return(typeof n=="number"?ti:n instanceof Wr?Dc:(i=Wr(n))?(n=i,Dc):Lv)(e,n)}function FC(e){return function(){this.removeAttribute(e)}}function GC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ZC(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 QC(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 KC(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 JC(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 WC(e,n){var i=Qc(e),a=i==="transform"?jC:Vv;return this.attrTween(e,typeof n=="function"?(i.local?JC:KC)(i,a,dm(this,"attr."+e,n)):n==null?(i.local?GC:FC)(i):(i.local?QC:ZC)(i,a,n))}function e4(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function t4(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function n4(e,n){var i,a;function o(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&t4(e,s)),i}return o._value=n,o}function i4(e,n){var i,a;function o(){var s=n.apply(this,arguments);return s!==a&&(i=(a=s)&&e4(e,s)),i}return o._value=n,o}function r4(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=Qc(e);return this.tween(i,(a.local?n4:i4)(a,n))}function a4(e,n){return function(){fm(this,e).delay=+n.apply(this,arguments)}}function l4(e,n){return n=+n,function(){fm(this,e).delay=n}}function o4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?a4:l4)(n,e)):Xn(this.node(),n).delay}function s4(e,n){return function(){ai(this,e).duration=+n.apply(this,arguments)}}function u4(e,n){return n=+n,function(){ai(this,e).duration=n}}function c4(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?s4:u4)(n,e)):Xn(this.node(),n).duration}function f4(e,n){if(typeof n!="function")throw new Error;return function(){ai(this,e).ease=n}}function d4(e){var n=this._id;return arguments.length?this.each(f4(n,e)):Xn(this.node(),n).ease}function h4(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;ai(this,e).ease=i}}function p4(e){if(typeof e!="function")throw new Error;return this.each(h4(this._id,e))}function m4(e){typeof e!="function"&&(e=vv(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 g4(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 y4(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 x4(e,n,i){var a,o,s=y4(n)?fm:ai;return function(){var u=s(this,e),f=u.on;f!==a&&(o=(a=f).copy()).on(n,i),u.on=o}}function b4(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(x4(i,e,n))}function v4(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function w4(){return this.on("end.remove",v4(this._id))}function S4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=lm(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,Jc(d[x],n,i,x,d,Xn(g,i)));return new Li(s,this._parents,n,i)}function _4(e){var n=this._name,i=this._id;typeof e!="function"&&(e=bv(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])&&Jc(b,n,i,E,x,w);s.push(x),u.push(g)}return new Li(s,u,n,i)}var k4=us.prototype.constructor;function E4(){return new k4(this._groups,this._parents)}function N4(e,n){var i,a,o;return function(){var s=sl(this,e),u=(this.style.removeProperty(e),sl(this,e));return s===u?null:s===i&&u===a?o:o=n(i=s,a=u)}}function Pv(e){return function(){this.style.removeProperty(e)}}function C4(e,n,i){var a,o=i+"",s;return function(){var u=sl(this,e);return u===o?null:u===a?s:s=n(a=u,i)}}function M4(e,n,i){var a,o,s;return function(){var u=sl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),sl(this,e))),u===h?null:u===a&&h===o?s:(o=h,s=n(a=u,f))}}function T4(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=Pv(n)):void 0;(d!==i||o!==g)&&(a=(i=d).copy()).on(u,o=g),h.on=a}}function A4(e,n,i){var a=(e+="")=="transform"?zC:Vv;return n==null?this.styleTween(e,N4(e,a)).on("end.style."+e,Pv(e)):typeof n=="function"?this.styleTween(e,M4(e,a,dm(this,"style."+e,n))).each(T4(this._id,e)):this.styleTween(e,C4(e,a,n),i).on("end.style."+e,null)}function z4(e,n,i){return function(a){this.style.setProperty(e,n.call(this,a),i)}}function j4(e,n,i){var a,o;function s(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&z4(e,u,i)),a}return s._value=n,s}function D4(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,j4(e,n,i??""))}function R4(e){return function(){this.textContent=e}}function O4(e){return function(){var n=e(this);this.textContent=n??""}}function L4(e){return this.tween("text",typeof e=="function"?O4(dm(this,"text",e)):R4(e==null?"":e+""))}function H4(e){return function(n){this.textContent=e.call(this,n)}}function B4(e){var n,i;function a(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&H4(o)),n}return a._value=e,a}function U4(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,B4(e))}function I4(){for(var e=this._name,n=this._id,i=Yv(),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);Jc(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 q4(){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 $4=0;function Li(e,n,i,a){this._groups=e,this._parents=n,this._name=i,this._id=a}function Yv(){return++$4}var Ai=us.prototype;Li.prototype={constructor:Li,select:S4,selectAll:_4,selectChild:Ai.selectChild,selectChildren:Ai.selectChildren,filter:m4,merge:g4,selection:E4,transition:I4,call:Ai.call,nodes:Ai.nodes,node:Ai.node,size:Ai.size,empty:Ai.empty,each:Ai.each,on:b4,attr:WC,attrTween:r4,style:A4,styleTween:D4,text:L4,textTween:U4,remove:w4,tween:XC,delay:o4,duration:c4,ease:d4,easeVarying:p4,end:q4,[Symbol.iterator]:Ai[Symbol.iterator]};function V4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var P4={time:null,delay:0,duration:250,ease:V4};function Y4(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 X4(e){var n,i;e instanceof Li?(n=e._id,e=e._name):(n=Yv(),(i=P4).time=cm(),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])&&Jc(h,e,n,d,u,i||Y4(h,n));return new Li(a,this._parents,e,n)}us.prototype.interrupt=VC;us.prototype.transition=X4;const Qu=e=>()=>e;function F4(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 Wc=new Ri(1,0,0);Xv.prototype=Ri.prototype;function Xv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Wc;return e.__zoom}function Ph(e){e.stopImmediatePropagation()}function vo(e){e.preventDefault(),e.stopImmediatePropagation()}function G4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Z4(){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 sb(){return this.__zoom||Wc}function Q4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function K4(){return navigator.maxTouchPoints||"ontouchstart"in this}function J4(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 Fv(){var e=G4,n=Z4,i=J4,a=Q4,o=K4,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=_c,d=Zc("start","zoom","end"),g,m,x,b=500,w=150,E=0,N=10;function _(O){O.property("__zoom",sb).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,j,U){var Y=O.selection?O.selection():O;Y.property("__zoom",sb),O!==Y?L(O,B,j,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,j,U){_.scaleTo(O,function(){var Y=this.__zoom.k,K=typeof B=="function"?B.apply(this,arguments):B;return Y*K},j,U)},_.scaleTo=function(O,B,j,U){_.transform(O,function(){var Y=n.apply(this,arguments),K=this.__zoom,z=j==null?C(Y):typeof j=="function"?j.apply(this,arguments):j,R=K.invert(z),$=typeof B=="function"?B.apply(this,arguments):B;return i(k(D(K,$),z,R),Y,u)},j,U)},_.translateBy=function(O,B,j,U){_.transform(O,function(){return i(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof j=="function"?j.apply(this,arguments):j),n.apply(this,arguments),u)},null,U)},_.translateTo=function(O,B,j,U,Y){_.transform(O,function(){var K=n.apply(this,arguments),z=this.__zoom,R=U==null?C(K):typeof U=="function"?U.apply(this,arguments):U;return i(Wc.translate(R[0],R[1]).scale(z.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof j=="function"?-j.apply(this,arguments):-j),K,u)},U,Y)};function D(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,j){var U=B[0]-j[0]*O.k,Y=B[1]-j[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,j,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,K=arguments,z=A(Y,K).event(U),R=n.apply(Y,K),$=j==null?C(R):typeof j=="function"?j.apply(Y,K):j,T=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),ie=Y.__zoom,ce=typeof B=="function"?B.apply(Y,K):B,fe=h(ie.invert($).concat(T/ie.k),ce.invert($).concat(T/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=T/ue[2];he=new Ri(me,$[0]-ue[0]*me,$[1]-ue[1]*me)}z.zoom(null,he)}})}function A(O,B,j){return!j&&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 F4(O,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),B)}};function F(O,...B){if(!e.apply(this,arguments))return;var j=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)))),K=In(O);if(j.wheel)(j.mouse[0][0]!==K[0]||j.mouse[0][1]!==K[1])&&(j.mouse[1]=U.invert(j.mouse[0]=K)),clearTimeout(j.wheel);else{if(U.k===Y)return;j.mouse=[K,U.invert(K)],Nc(this),j.start()}vo(O),j.wheel=setTimeout(z,w),j.zoom("mouse",i(k(D(U,Y),j.mouse[0],j.mouse[1]),j.extent,u));function z(){j.wheel=null,j.end()}}function G(O,...B){if(x||!e.apply(this,arguments))return;var j=O.currentTarget,U=A(this,B,!0).event(O),Y=vn(O.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",T,!0),K=In(O,j),z=O.clientX,R=O.clientY;Av(O.view),Ph(O),U.mouse=[K,this.__zoom.invert(K)],Nc(this),U.start();function $(ie){if(vo(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,j),U.mouse[1]),U.extent,u))}function T(ie){Y.on("mousemove.zoom mouseup.zoom",null),zv(ie.view,U.moved),vo(ie),U.event(ie).end()}}function q(O,...B){if(e.apply(this,arguments)){var j=this.__zoom,U=In(O.changedTouches?O.changedTouches[0]:O,this),Y=j.invert(U),K=j.k*(O.shiftKey?.5:2),z=i(k(D(j,K),U,Y),n.apply(this,B),u);vo(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 j=O.touches,U=j.length,Y=A(this,B,O.changedTouches.length===U).event(O),K,z,R,$;for(Ph(O),z=0;z<U;++z)R=j[z],$=In(R,this),$=[$,this.__zoom.invert($),R.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==$[2]&&(Y.touch1=$,Y.taps=0):(Y.touch0=$,K=!0,Y.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(Y.taps<2&&(m=$[0],g=setTimeout(function(){g=null},b)),Nc(this),Y.start())}}function P(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z,R,$;for(vo(O),K=0;K<Y;++K)z=U[K],R=In(z,this),j.touch0&&j.touch0[2]===z.identifier?j.touch0[0]=R:j.touch1&&j.touch1[2]===z.identifier&&(j.touch1[0]=R);if(z=j.that.__zoom,j.touch1){var T=j.touch0[0],ie=j.touch0[1],ce=j.touch1[0],fe=j.touch1[1],he=(he=ce[0]-T[0])*he+(he=ce[1]-T[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=D(z,Math.sqrt(he/ue)),R=[(T[0]+ce[0])/2,(T[1]+ce[1])/2],$=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(j.touch0)R=j.touch0[0],$=j.touch0[1];else return;j.zoom("touch",i(k(z,R,$),j.extent,u))}}function te(O,...B){if(this.__zooming){var j=A(this,B).event(O),U=O.changedTouches,Y=U.length,K,z;for(Ph(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),K=0;K<Y;++K)z=U[K],j.touch0&&j.touch0[2]===z.identifier?delete j.touch0:j.touch1&&j.touch1[2]===z.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.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:Qu(+O),_):a},_.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Qu(!!O),_):e},_.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:Qu(!!O),_):o},_.extent=function(O){return arguments.length?(n=typeof O=="function"?O:Qu([[+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."},es=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Gv=["Enter"," ","Escape"],Zv={"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 cl;(function(e){e.Strict="strict",e.Loose="loose"})(cl||(cl={}));var Jr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jr||(Jr={}));var ts;(function(e){e.Partial="partial",e.Full="full"})(ts||(ts={}));const Qv={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 Hc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Hc||(Hc={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const ub={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function Kv(e){return e===null?null:e?"valid":"invalid"}const Jv=e=>"id"in e&&"source"in e&&"target"in e,W4=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),hm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),fs=(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}},eM=(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):hm(o)?o:n.nodeLookup.get(o.id));const f=u?Bc(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ef(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tf(i)},ds=(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=ef(i,Bc(o)),a=!0)}),a?tf(i):{x:0,y:0,width:0,height:0}},pm=(e,n,[i,a,o]=[0,0,1],s=!1,u=!1)=>{const f={...ps(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=ns(f,dl(d)),N=(b??0)*(w??0),_=s&&E>0;(!d.internals.handleBounds||_||E>=N||d.dragging)&&h.push(d)}return h},tM=(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 nM(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 iM({nodes:e,width:n,height:i,panZoom:a,minZoom:o,maxZoom:s},u){if(e.size===0)return Promise.resolve(!0);const f=nM(e,u),h=ds(f),d=mm(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 Wv({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&&hl(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=hl(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 rM({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=tM(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 fl=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),ta=(e={x:0,y:0},n,i)=>({x:fl(e.x,n[0][0],n[1][0]-(i?.width??0)),y:fl(e.y,n[0][1],n[1][1]-(i?.height??0))});function ew(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 cb=(e,n,i)=>e<n?fl(Math.abs(e-n),1,n)/n:e>i?-fl(Math.abs(e-i),1,n)/n:0,tw=(e,n,i=15,a=40)=>{const o=cb(e.x,a,n.width-a)*i,s=cb(e.y,a,n.height-a)*i;return[o,s]},ef=(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)}),Rp=({x:e,y:n,width:i,height:a})=>({x:e,y:n,x2:e+i,y2:n+a}),tf=({x:e,y:n,x2:i,y2:a})=>({x:e,y:n,width:i-e,height:a-n}),dl=(e,n=[0,0])=>{const{x:i,y:a}=hm(e)?e.internals.positionAbsolute:fs(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}},Bc=(e,n=[0,0])=>{const{x:i,y:a}=hm(e)?e.internals.positionAbsolute:fs(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)}},nw=(e,n)=>tf(ef(Rp(e),Rp(n))),ns=(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)},fb=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),aM=(e,n)=>{},hs=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),ps=({x:e,y:n},[i,a,o],s=!1,u=[1,1])=>{const f={x:(e-i)/o,y:(n-a)/o};return s?hs(f,u):f},Uc=({x:e,y:n},[i,a,o])=>({x:e*o+i,y:n*o+a});function Xa(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 lM(e,n,i){if(typeof e=="string"||typeof e=="number"){const a=Xa(e,i),o=Xa(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Xa(e.top??e.y??0,i),o=Xa(e.bottom??e.y??0,i),s=Xa(e.left??e.x??0,n),u=Xa(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 oM(e,n,i,a,o,s){const{x:u,y:f}=Uc(e,[n,i,a]),{x:h,y:d}=Uc({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 mm=(e,n,i,a,o,s)=>{const u=lM(s,n,i),f=(n-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=fl(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=oM(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}},is=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function hl(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 iw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function rw(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 db(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function sM(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function uM(e){return{...Zv,...e||{}}}function Xo(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:a,containerBounds:o}){const{x:s,y:u}=Vn(e),f=ps({x:s-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:d}=i?hs(f,n):f;return{xSnapped:h,ySnapped:d,...f}}const gm=e=>({width:e.offsetWidth,height:e.offsetHeight}),aw=e=>e?.getRootNode?.()||window?.document,cM=["INPUT","SELECT","TEXTAREA"];function lw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:cM.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const ow=e=>"clientX"in e,Vn=(e,n)=>{const i=ow(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)}},hb=(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,...gm(u)}})};function sw({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 Ku(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function pb({pos:e,x1:n,y1:i,x2:a,y2:o,c:s}){switch(e){case be.Left:return[n-Ku(n-a,s),i];case be.Right:return[n+Ku(a-n,s),i];case be.Top:return[n,i-Ku(i-o,s)];case be.Bottom:return[n,i+Ku(o-i,s)]}}function uw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top,curvature:u=.25}){const[f,h]=pb({pos:i,x1:e,y1:n,x2:a,y2:o,c:u}),[d,g]=pb({pos:s,x1:a,y1:o,x2:e,y2:n,c:u}),[m,x,b,w]=sw({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 cw({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 fM({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 dM({sourceNode:e,targetNode:n,width:i,height:a,transform:o}){const s=ef(Bc(e),Bc(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 ns(u,tf(s))>0}const hM=({source:e,sourceHandle:n,target:i,targetHandle:a})=>`xy-edge__${e}${n||""}-${i}${a||""}`,pM=(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)),fw=(e,n,i={})=>{if(!e.source||!e.target)return n;const a=i.getEdgeId||hM;let o;return Jv(e)?o={...e}:o={...e,id:a(e)},pM(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function dw({sourceX:e,sourceY:n,targetX:i,targetY:a}){const[o,s,u,f]=cw({sourceX:e,sourceY:n,targetX:i,targetY:a});return[`M ${e},${n}L ${i},${a}`,o,s,u,f]}const mb={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},mM=({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},gb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function gM({source:e,sourcePosition:n=be.Bottom,target:i,targetPosition:a=be.Top,center:o,offset:s,stepPosition:u}){const f=mb[n],h=mb[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=mM({source:d,sourcePosition:n,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],E,N;const _={x:0,y:0},D={x:0,y:0},[,,k,C]=cw({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:D[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+D.x,y:g.y+D.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+D.x,y:g.y+D.y},i],E,N,k,C]}function yM(e,n,i,a){const o=Math.min(gb(e,n)/2,gb(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 Op({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]=gM({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((_,D,k)=>{let C="";return k>0&&k<m.length-1?C=yM(m[k-1],D,m[k+1],u):C=`${k===0?"M":"L"}${D.x} ${D.y}`,_+=C,_},""),x,b,w,E]}function yb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function xM(e){const{sourceNode:n,targetNode:i}=e;if(!yb(n)||!yb(i))return null;const a=n.internals.handleBounds||xb(n.handles),o=i.internals.handleBounds||xb(i.handles),s=bb(a?.source??[],e.sourceHandle),u=bb(e.connectionMode===cl.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 xb(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 bb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Lp(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function bM(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=Lp(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 hw=1e3,vM=10,ym={nodeOrigin:[0,0],nodeExtent:es,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},wM={...ym,checkEquality:!0};function xm(e,n){const i={...e};for(const a in n)n[a]!==void 0&&(i[a]=n[a]);return i}function SM(e,n,i){const a=xm(ym,i);for(const o of e.values())if(o.parentId)vm(o,e,n,a);else{const s=fs(o,a.nodeOrigin),u=hl(o.extent)?o.extent:a.nodeExtent,f=ta(s,u,Bi(o));o.internals.positionAbsolute=f}}function _M(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 bm(e){return e==="manual"}function Hp(e,n,i,a={}){const o=xm(wM,a),s={i:0},u=new Map(n),f=o?.elevateNodesOnSelect&&!bm(o.zIndexMode)?hw: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=fs(d,o.nodeOrigin),x=hl(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:_M(d,g),z:pw(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&&vm(g,n,i,a,s)}return h}function kM(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 vm(e,n,i,a,o){const{elevateNodesOnSelect:s,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=xm(ym,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}kM(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*vM),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const m=s&&!bm(h)?hw:0,{x,y:b,z:w}=EM(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 pw(e,n,i){const a=$n(e.zIndex)?e.zIndex:0;return bm(i)?a:a+(e.selected?n:0)}function EM(e,n,i,a,o,s){const{x:u,y:f}=n.internals.positionAbsolute,h=Bi(e),d=fs(e,i),g=hl(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=ew(m,h,n));const x=pw(e,o,s),b=n.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function wm(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??dl(f),d=nw(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(D=>{e.some(k=>k.id===D.id)||o.push({id:D.id,type:"position",position:{x:D.position.x+x,y:D.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 NM(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=gm(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 D=b.nodeElement.getBoundingClientRect(),k=hl(w.extent)?w.extent:s;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=ew(C,E,n.get(w.parentId)):k&&(C=ta(C,k,E));const L={...w,measured:E,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:hb("source",b.nodeElement,D,m,w.id),target:hb("target",b.nodeElement,D,m,w.id)}}};n.set(w.id,L),w.parentId&&vm(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:dl(L,o)}))}}if(x.length>0){const b=wm(x,n,i,o);d.push(...b)}return{changes:d,updatedInternals:h}}async function CM({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 vb(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 mw(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}`;vb("source",h,g,e,o,u),vb("target",h,d,e,s,f),n.set(a.id,a)}}function gw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:gw(i,n):!1}function wb(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 MM(e,n,i,a){const o=new Map;for(const[s,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!gw(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 Yh({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 TM({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=hs(s,n);return{x:u.x-s.x,y:u.y-s.y}}function AM({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:D,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:j,snapToGrid:U,nodeOrigin:Y,onNodeDrag:K,onSelectionDrag:z,onError:R,updateNodePositions:$}=n();s={x:P,y:te};let T=!1;const ie=f.size>1,ce=ie&&B?Rp(ds(f)):null,fe=ie&&U?TM({dragItems:f,snapGrid:j,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)}:hs(me,j));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}=Wv({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||B,nodeOrigin:Y,onError:R});T=T||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||T,!!T&&($(f,!0),E&&(a||K||!A&&z))){const[he,ue]=Yh({nodeId:A,dragItems:f,nodeLookup:O});a?.(E,f,he,ue),K?.(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[j,U]=tw(d,g,O);(j!==0||U!==0)&&(s.x=(s.x??0)-j/P[2],s.y=(s.y??0)-U/P[2],await te({x:j,y:U})&&F(s)),u=requestAnimationFrame(G)}function q(P){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:B,transform:j,snapGrid:U,snapToGrid:Y,selectNodesOnDrag:K,onNodeDragStart:z,onSelectionDragStart:R,unselectNodesAndEdges:$}=n();m=!0,(!K||!L)&&!O&&A&&(te.get(A)?.selected||$()),L&&K&&A&&e?.(A);const T=Xo(P.sourceEvent,{transform:j,snapGrid:U,snapToGrid:Y,containerBounds:g});if(s=T,f=MM(te,B,T,A),f.size>0&&(i||z||!A&&R)){const[ie,ce]=Yh({nodeId:A,dragItems:f,nodeLookup:te});i?.(P.sourceEvent,f,ie,ce),z?.(P.sourceEvent,ie,ce),A||R?.(P.sourceEvent,ce)}}const V=jv().clickDistance(H).on("start",P=>{const{domNode:te,nodeDragThreshold:O,transform:B,snapGrid:j,snapToGrid:U}=n();g=te?.getBoundingClientRect()||null,b=!1,w=!1,E=P.sourceEvent,O===0&&q(P),s=Xo(P.sourceEvent,{transform:B,snapGrid:j,snapToGrid:U,containerBounds:g}),d=Vn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:B,snapToGrid:j,nodeDragThreshold:U,nodeLookup:Y}=n(),K=Xo(P.sourceEvent,{transform:O,snapGrid:B,snapToGrid:j,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!==K.xSnapped||s.y!==K.ySnapped)&&f&&m&&(d=Vn(P.sourceEvent,g),F(K))}}).on("end",P=>{if(!(!m||b)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:B,onSelectionDragStop:j}=n();if(w&&(O(f,!1),w=!1),o||B||!A&&j){const[U,Y]=Yh({nodeId:A,dragItems:f,nodeLookup:te,dragging:!1});o?.(P.sourceEvent,f,U,Y),B?.(P.sourceEvent,U,Y),A||j?.(P.sourceEvent,Y)}}}).filter(P=>{const te=P.target;return!P.button&&(!D||!wb(te,`.${D}`,C))&&(!k||wb(te,k,C))});x.call(V)}function _(){x?.on(".drag",null)}return{update:N,destroy:_}}function zM(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())ns(o,dl(s))>0&&a.push(s);return a}const jM=250;function DM(e,n,i,a){let o=[],s=1/0;const u=zM(e,i,n+jM);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 yw(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 xw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function RM(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const bw=()=>!0;function OM(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:_=bw,onReconnectEnd:D,updateConnection:k,getTransform:C,getFromHandle:L,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:F}){const G=aw(e.target);let q=0,V;const{x:P,y:te}=Vn(e),O=xw(s,F),B=f?.getBoundingClientRect();let j=!1;if(!B||!O)return;const U=yw(o,O,a,h,n);if(!U)return;let Y=Vn(e,B),K=!1,z=null,R=!1,$=null;function T(){if(!g||!B)return;const[Ce,we]=tw(Y,B,A);x({x:Ce,y:we}),q=requestAnimationFrame(T)}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:ub[ie.position],toNode:null,pointer:Y};function ue(){j=!0,k(he),w?.(e,{nodeId:o,handleId:a,handleType:O})}H===0&&ue();function me(Ce){if(!j){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=DM(ps(Y,we,!1,[1,1]),i,h,ie),K||(T(),K=!0);const Ne=vw(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=RM(!!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?Uc({x:Ne.toHandle.x,y:Ne.toHandle.y},we):Y,toHandle:Ne.toHandle,toPosition:R&&Ne.toHandle?Ne.toHandle.position:ub[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(j){(V||$)&&z&&R&&E?.(z);const{inProgress:we,...Ne}=he,Re={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,Re),s&&D?.(Ce,Re)}b(),cancelAnimationFrame(q),K=!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 vw(e,{handle:n,connectionMode:i,fromNodeId:a,fromHandleId:o,fromType:s,doc:u,lib:f,flowId:h,isValidConnection:d=bw,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 D=xw(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||!D)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===cl.Strict?m&&D==="source"||!m&&D==="target":k!==a||C!==o);_.isValid=G&&d(H),_.toHandle=yw(k,D,C,g,i,!0)}return _}const Bp={onPointerDown:OM,isValid:vw};function LM({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&&is()?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)},D=Fv().on("start",N).on("zoom",m?_:null).on("zoom.wheel",x?w:null);o.call(D,{})}function u(){o.on("zoom",null)}return{update:s,destroy:u,pointer:In}}const nf=e=>({x:e.x,y:e.y,zoom:e.k}),Xh=({x:e,y:n,zoom:i})=>Wc.translate(e,n).scale(i),el=(e,n)=>e.target.closest(`.${n}`),ww=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),HM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Fh=(e,n=0,i=HM,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(i).on("end",a):e},Sw=e=>{const n=e.ctrlKey&&is()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function BM({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(el(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),_=Sw(g),D=m*Math.pow(2,_);a.scaleTo(i,D,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;!is()&&g.shiftKey&&o!==Jr.Vertical&&(b=g.deltaY*x,w=0),a.translateBy(i,-(b/m)*s,-(w/m)*s,{internal:!0});const E=nf(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 UM({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(a,o){const s=a.type==="wheel",u=!n&&s&&!a.ctrlKey,f=el(a,e);if(a.ctrlKey&&s&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),i.call(this,a,o)}}function IM({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const o=nf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(a.sourceEvent,o)}}function qM({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:a,onPanZoom:o}){return s=>{e.usedRightMouseButton=!!(i&&ww(n,e.mouseButton??0)),s.sourceEvent?.sync||a([s.transform.x,s.transform.y,s.transform.k]),o&&!s.sourceEvent?.internal&&o?.(s.sourceEvent,nf(s.transform))}}function $M({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:s}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&ww(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&s(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const f=nf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,f)},i?150:0)}}}function VM({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"&&(el(m,`${d}-flow__node`)||el(m,`${d}-flow__edge`)))return!0;if(!a&&!x&&!o&&!s&&!i||u||g&&!w||el(m,f)&&w||el(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 PM({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=Fv().scaleExtent([n,i]).translateExtent(a),x=vn(e).call(m);D({x:o.x,y:o.y,zoom:fl(o.zoom,n,i)},[[0,0],[g.width,g.height]],a);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(Sw);function E(V,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?Yo:_c).transform(Fh(x,P?.duration,P?.ease,()=>te(!0)),V)}):Promise.resolve(!1)}function N({noWheelClassName:V,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:B,panOnDrag:j,panOnScrollMode:U,panOnScrollSpeed:Y,preventScrolling:K,zoomOnPinch:z,zoomOnScroll:R,zoomOnDoubleClick:$,zoomActivationKeyPressed:T,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&_();const me=B&&!T&&!O;m.clickDistance(ue?1/0:!$n(he)||he<0?0:he);const Ee=me?BM({zoomPanValues:d,noWheelClassName:V,d3Selection:x,d3Zoom:m,panOnScrollMode:U,panOnScrollSpeed:Y,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:f}):UM({noWheelClassName:V,preventScrolling:K,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=IM({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=qM({zoomPanValues:d,panOnDrag:j,onPaneContextMenu:!!te,onPanZoom:s,onTransformChange:ce});m.on("zoom",Ne);const Re=$M({zoomPanValues:d,panOnDrag:j,panOnScroll:B,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Re)}const Ce=VM({zoomActivationKeyPressed:T,panOnDrag:j,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 D(V,P,te){const O=Xh(V),B=m?.constrain()(O,P,te);return B&&await E(B),new Promise(j=>j(B))}async function k(V,P){const te=Xh(V);return await E(te,P),new Promise(O=>O(te))}function C(V){if(x){const P=Xh(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?Xv(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"?Yo:_c).scaleTo(Fh(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"?Yo:_c).scaleBy(Fh(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:D,getViewport:L,scaleTo:A,scaleBy:H,setScaleExtent:F,setTranslateExtent:G,syncViewport:C,setClickDistance:q}}var pl;(function(e){e.Line="line",e.Handle="handle"})(pl||(pl={}));function YM({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 Sb(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 Ju(e,n,i){return Math.max(0,n-e,e-i)}function _b(e,n){return e?!n:n}function XM(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:D}=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=Ju(q,E,N),B=Ju(V,_,D);if(u){let Y=0,K=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?K=mr(C+G+te,u[0][1]):!d&&G>0&&(K=gr(C+V+te,u[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(f){let Y=0,K=0;h&&F>0?Y=gr(k+F,f[0][0]):!h&&F<0&&(Y=mr(k+q,f[1][0])),d&&G>0?K=gr(C+G,f[0][1]):!d&&G<0&&(K=mr(C+V,f[1][1])),O=Math.max(O,Y),B=Math.max(B,K)}if(o){if(g){const Y=Ju(q/H,_,D)*H;if(O=Math.max(O,Y),u){let K=0;!h&&!d||h&&!d&&x?K=gr(C+te+q/H,u[1][1])*H:K=mr(C+te+(h?F:-F)/H,u[0][1])*H,O=Math.max(O,K)}if(f){let K=0;!h&&!d||h&&!d&&x?K=mr(C+q/H,f[1][1])*H:K=gr(C+(h?F:-F)/H,f[0][1])*H,O=Math.max(O,K)}}if(m){const Y=Ju(V*H,E,N)/H;if(B=Math.max(B,Y),u){let K=0;!h&&!d||d&&!h&&x?K=gr(k+V*H+P,u[1][0])/H:K=mr(k+(d?G:-G)*H+P,u[0][0])/H,B=Math.max(B,K)}if(f){let K=0;!h&&!d||d&&!h&&x?K=mr(k+V*H,f[1][0])/H:K=gr(k+(d?G:-G)*H,f[0][0])/H,B=Math.max(B,K)}}}G=G+(G<0?B:-B),F=F+(F<0?O:-O),o&&(x?q>V*H?G=(_b(h,d)?-F:F)/H:F=(_b(h,d)?-G:G)*H:g?(G=F/H,d=h):(F=G*H,h=d));const j=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)+j,y:s[1]*G*(d?-1:1)+U}}const _w={width:0,height:0,x:0,y:0},FM={..._w,pointerX:0,pointerY:0,aspectRatio:1};function GM(e){return[[0,0],[e.measured.width,e.measured.height]]}function ZM(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 QM({domNode:e,nodeId:n,getStoreItems:i,onChange:a,onEnd:o}){const s=vn(e);let u={controlDirection:Sb("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 _={..._w},D={...FM};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:Sb(d)};let k,C=null,L=[],A,H,F,G=!1;const q=jv().on("start",V=>{const{nodeLookup:P,transform:te,snapGrid:O,snapToGrid:B,nodeOrigin:j,paneDomNode:U}=i();if(k=P.get(n),!k)return;C=U?.getBoundingClientRect()??null;const{xSnapped:Y,ySnapped:K}=Xo(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},D={..._,pointerX:Y,pointerY:K,aspectRatio:_.width/_.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=P.get(k.parentId),H=A&&k.extent==="parent"?GM(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 $=ZM(R,k,R.origin??j);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(),j=Xo(V.sourceEvent,{transform:P,snapGrid:te,snapToGrid:O,containerBounds:C}),U=[];if(!k)return;const{x:Y,y:K,width:z,height:R}=_,$={},T=k.origin??B,{width:ie,height:ce,x:fe,y:he}=XM(D,u.controlDirection,j,u.boundaries,u.keepAspectRatio,T,H,F),ue=ie!==z,me=ce!==R,Ee=fe!==Y&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||T[0]===1||T[1]===1)&&($.x=Ee?fe:_.x,$.y=Ce?he:_.y,_.x=$.x,_.y=$.y,L.length>0)){const Ze=fe-Y,Xe=he-K;for(const ht of L)ht.position={x:ht.position.x-Ze+T[0]*(ie-z),y:ht.position.y-Xe+T[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=T[0]*($.width??0);$.x&&$.x<Ze&&(_.x=Ze,D.x=D.x-($.x-Ze));const Xe=T[1]*($.height??0);$.y&&$.y<Xe&&(_.y=Xe,D.y=D.y-($.y-Xe))}const we=YM({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 Gh={exports:{}},Zh={},Qh={exports:{}},Kh={};var kb;function KM(){if(kb)return Kh;kb=1;var e=ss();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 Kh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Kh}var Eb;function JM(){return Eb||(Eb=1,Qh.exports=KM()),Qh.exports}var Nb;function WM(){if(Nb)return Zh;Nb=1;var e=ss(),n=JM();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 Zh.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(!D){if(D=!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 D=!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},Zh}var Cb;function eT(){return Cb||(Cb=1,Gh.exports=WM()),Gh.exports}var tT=eT();const nT=Gc(tT),iT={},Mb=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:()=>{(iT?"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},rT=e=>e?Mb(e):Mb,{useDebugValue:aT}=Io,{useSyncExternalStoreWithSelector:lT}=nT,oT=e=>e;function kw(e,n=oT,i){const a=lT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return aT(a),a}const Tb=(e,n)=>{const i=rT(e),a=(o,s=n)=>kw(i,o,s);return Object.assign(a,i),a},sT=(e,n)=>e?Tb(e,n):Tb;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}yv();const rf=Z.createContext(null),uT=rf.Provider,Ew=ri.error001();function Ye(e,n){const i=Z.useContext(rf);if(i===null)throw new Error(Ew);return kw(i,e,n)}function ct(){const e=Z.useContext(rf);if(e===null)throw new Error(Ew);return Z.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ab={display:"none"},cT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Nw="react-flow__node-desc",Cw="react-flow__edge-desc",fT="react-flow__aria-live",dT=e=>e.ariaLiveMessage,hT=e=>e.ariaLabelConfig;function pT({rfId:e}){const n=Ye(dT);return v.jsx("div",{id:`${fT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:cT,children:n})}function mT({rfId:e,disableKeyboardA11y:n}){const i=Ye(hT);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${Nw}-${e}`,style:Ab,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${Cw}-${e}`,style:Ab,children:i["edge.a11yDescription.default"]}),!n&&v.jsx(pT,{rfId:e})]})}const af=Z.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})});af.displayName="Panel";function gT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:v.jsx(af,{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 yT=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}},Wu=e=>e.id;function xT(e,n){return ut(e.selectedNodes.map(Wu),n.selectedNodes.map(Wu))&&ut(e.selectedEdges.map(Wu),n.selectedEdges.map(Wu))}function bT({onSelectionChange:e}){const n=ct(),{selectedNodes:i,selectedEdges:a}=Ye(yT,xT);return Z.useEffect(()=>{const o={nodes:i,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[i,a,e]),null}const vT=e=>!!e.onSelectionChangeHandlers;function wT({onSelectionChange:e}){const n=Ye(vT);return e||n?v.jsx(bT,{onSelectionChange:e}):null}const Mw=[0,0],ST={x:0,y:0,zoom:1},_T=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],zb=[..._T,"rfId"],kT=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}),jb={translateExtent:es,nodeOrigin:Mw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ET(e){const{setNodes:n,setEdges:i,setMinZoom:a,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ye(kT,ut),d=ct();Z.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=jb,f()}),[]);const g=Z.useRef(jb);return Z.useEffect(()=>{for(const m of zb){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:uM(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},zb.map(m=>e[m])),null}function Db(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function NT(e){const[n,i]=Z.useState(e==="system"?null:e);return Z.useEffect(()=>{if(e!=="system"){i(e);return}const a=Db(),o=()=>i(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:Db()?.matches?"dark":"light"}const Rb=typeof document<"u"?document:null;function rs(e=null,n={target:Rb,actInsideInputWithModifier:!0}){const[i,a]=Z.useState(!1),o=Z.useRef(!1),s=Z.useRef(new Set([])),[u,f]=Z.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 Z.useEffect(()=>{const h=n?.target??Rb,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)&&lw(b))return!1;const E=Lb(b.code,f);if(s.current.add(b[E]),Ob(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=Lb(b.code,f);Ob(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 Ob(e,n,i){return e.filter(a=>i||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function Lb(e,n){return n.includes(e)?"code":"key"}const CT=()=>{const e=ct();return Z.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=mm(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 ps(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=Uc(n,i);return{x:u.x+o,y:u.y+s}}}),[])};function Tw(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)MT(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 MT(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 Aw(e,n){return Tw(e,n)}function zw(e,n){return Tw(e,n)}function Gr(e,n){return{id:e,type:"select",selected:n}}function tl(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 Hb({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 Bb(e){return{id:e.id,type:"remove"}}const Ub=e=>W4(e),TT=e=>Jv(e);function jw(e){return Z.forwardRef(e)}const AT=typeof window<"u"?Z.useLayoutEffect:Z.useEffect;function Ib(e){const[n,i]=Z.useState(BigInt(0)),[a]=Z.useState(()=>zT(()=>i(o=>o+BigInt(1))));return AT(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function zT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const Dw=Z.createContext(null);function jT({children:e}){const n=ct(),i=Z.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=Hb({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:D,setNodes:k}=n.getState();_&&k(D)})},[]),a=Ib(i),o=Z.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(Hb({items:b,lookup:x}))},[]),s=Ib(o),u=Z.useMemo(()=>({nodeQueue:a,edgeQueue:s}),[]);return v.jsx(Dw.Provider,{value:u,children:e})}function DT(){const e=Z.useContext(Dw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const RT=e=>!!e.panZoom;function Sm(){const e=CT(),n=ct(),i=DT(),a=Ye(RT),o=Z.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=Ub(m)?m:x.get(m.id),E=w.parentId?rw(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 dl(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&&Ub(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&&TT(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:D,onDelete:k,onBeforeDelete:C}=n.getState(),{nodes:L,edges:A}=await rM({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:C}),H=A.length>0,F=L.length>0;if(H){const G=A.map(Bb);N?.(A),D(G)}if(F){const G=L.map(Bb);E?.(L),_(G)}return(F||H)&&k?.({nodes:L,edges:A}),{deletedNodes:L,deletedEdges:A}},getIntersectingNodes:(m,x=!0,b)=>{const w=fb(m),E=w?m:h(m),N=b!==void 0;return E?(b||n.getState().nodes).filter(_=>{const D=n.getState().nodeLookup.get(_.id);if(D&&!w&&(_.id===m.id||!D.internals.positionAbsolute))return!1;const k=dl(N?_:D),C=ns(k,E);return x&&C>0||C>=k.width*k.height||C>=E.width*E.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const E=fb(m)?m:h(m);if(!E)return!1;const N=ns(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 eM(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??sM();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return Z.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const qb=e=>e.selected,OT=typeof window<"u"?window:void 0;function LT({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=ct(),{deleteElements:a}=Sm(),o=rs(e,{actInsideInputWithModifier:!1}),s=rs(n,{target:OT});Z.useEffect(()=>{if(o){const{edges:u,nodes:f}=i.getState();a({nodes:f.filter(qb),edges:u.filter(qb)}),i.setState({nodesSelectionActive:!1})}},[o]),Z.useEffect(()=>{i.setState({multiSelectionActive:s})},[s])}function HT(e){const n=ct();Z.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=gm(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 lf={position:"absolute",width:"100%",height:"100%",top:0,left:0},BT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function UT({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:D,paneClickDistance:k,selectionOnDrag:C}){const L=ct(),A=Z.useRef(null),{userSelectionActive:H,lib:F,connectionInProgress:G}=Ye(BT,ut),q=rs(x),V=Z.useRef();HT(A);const P=Z.useCallback(te=>{_?.({x:te[0],y:te[1],zoom:te[2]}),D||L.setState({transform:te})},[_,D]);return Z.useEffect(()=>{if(A.current){V.current=PM({domNode:A.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:j=>L.setState({paneDragging:j}),onPanZoomStart:(j,U)=>{const{onViewportChangeStart:Y,onMoveStart:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoom:(j,U)=>{const{onViewportChange:Y,onMove:K}=L.getState();K?.(j,U),Y?.(U)},onPanZoomEnd:(j,U)=>{const{onViewportChangeEnd:Y,onMoveEnd:K}=L.getState();K?.(j,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()}}},[]),Z.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:lf,children:w})}const IT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qT(){const{userSelectionActive:e,userSelectionRect:n}=Ye(IT,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 Jh=(e,n)=>i=>{i.target===n.current&&e?.(i)},$T=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function VT({isSelecting:e,selectionKeyPressed:n,selectionMode:i=ts.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:D,connectionInProgress:k}=Ye($T,ut),C=_&&(e||N),L=Z.useRef(null),A=Z.useRef(),H=Z.useRef(new Set),F=Z.useRef(new Set),G=Z.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:K}=E.getState();if(A.current=K?.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:T,y:ie}=Vn(Y.nativeEvent,A.current);E.setState({userSelectionRect:{width:0,height:0,startX:T,startY:ie,x:T,y:ie}}),z||(Y.stopPropagation(),Y.preventDefault())},B=Y=>{const{userSelectionRect:K,transform:z,nodeLookup:R,edgeLookup:$,connectionLookup:T,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=E.getState();if(!A.current||!K)return;const{x:ue,y:me}=Vn(Y.nativeEvent,A.current),{startX:Ee,startY:Ce}=K;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(pm(R,we,z,i===ts.Partial,!0).map(Xe=>Xe.id)),F.current=new Set;const Ze=fe?.selectable??!0;for(const Xe of H.current){const ht=T.get(Xe);if(ht)for(const{edgeId:on}of ht.values()){const Lt=$.get(on);Lt&&(Lt.selectable??Ze)&&F.current.add(on)}}if(!db(Ne,H.current)){const Xe=tl(R,H.current,!0);ie(Xe)}if(!db(Re,F.current)){const Xe=tl($,F.current);ce(Xe)}E.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},j=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:D,selection:e}]),onClick:C?void 0:Jh(q,L),onContextMenu:Jh(V,L),onWheel:Jh(P,L),onPointerEnter:C?void 0:m,onPointerMove:C?B:x,onPointerUp:C?j:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:b,ref:L,style:lf,children:[w,v.jsx(qT,{})]})}function Up({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 Rw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:a,nodeId:o,isSelectable:s,nodeClickDistance:u}){const f=ct(),[h,d]=Z.useState(!1),g=Z.useRef();return Z.useEffect(()=>{g.current=AM({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Up({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),Z.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 PT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function Ow(){const e=ct();return Z.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=PT(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 D={x:_.internals.positionAbsolute.x+E,y:_.internals.positionAbsolute.y+N};o&&(D=hs(D,s));const{position:k,positionAbsolute:C}=Wv({nodeId:_.id,nextPosition:D,nodeLookup:d,nodeExtent:a,nodeOrigin:g,onError:f});_.position=k,_.internals.positionAbsolute=C,m.set(_.id,_)}h(m)},[])}const _m=Z.createContext(null),YT=_m.Provider;_m.Consumer;const Lw=()=>Z.useContext(_m),XT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),FT=(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===cl.Strict?f?.type!==i:e!==f?.nodeId||n!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:g&&d}};function GT({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(),_=Lw(),{connectOnClick:D,noPanClassName:k,rfId:C}=Ye(XT,ut),{connectingFrom:L,connectingTo:A,clickConnecting:H,isPossibleEndHandle:F,connectionInProcess:G,clickConnectionInProcess:q,valid:V}=Ye(FT(_,w,e),ut);_||N.getState().onError?.("010",ri.error010());const P=B=>{const{defaultEdgeOptions:j,onConnect:U,hasDefaultEdges:Y}=N.getState(),K={...j,...B};if(Y){const{edges:z,setEdges:R}=N.getState();R(fw(K,z))}U?.(K),f?.(K)},te=B=>{if(!_)return;const j=ow(B.nativeEvent);if(o&&(j&&B.button===0||!j)){const U=N.getState();Bp.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})}j?g?.(B):m?.(B)},O=B=>{const{onClickConnectStart:j,onClickConnectEnd:U,connectionClickStartHandle:Y,connectionMode:K,isValidConnection:z,lib:R,rfId:$,nodeLookup:T,connection:ie}=N.getState();if(!_||!Y&&!o)return;if(!Y){j?.(B.nativeEvent,{nodeId:_,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:_,type:e,id:w}});return}const ce=aw(B.target),fe=i||z,{connection:he,isValid:ue}=Bp.isValid(B.nativeEvent,{handle:{nodeId:_,id:w,type:e},connectionMode:K,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:fe,flowId:$,doc:ce,lib:R,nodeLookup:T});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:D?O:void 0,ref:b,...x,children:h})}const ml=Z.memo(jw(GT));function ZT({data:e,isConnectable:n,sourcePosition:i=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(ml,{type:"source",position:i,isConnectable:n})]})}function QT({data:e,isConnectable:n,targetPosition:i=be.Top,sourcePosition:a=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(ml,{type:"target",position:i,isConnectable:n}),e?.label,v.jsx(ml,{type:"source",position:a,isConnectable:n})]})}function KT(){return null}function JT({data:e,isConnectable:n,targetPosition:i=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(ml,{type:"target",position:i,isConnectable:n}),e?.label]})}const Ic={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$b={input:ZT,default:QT,output:JT,group:KT};function WT(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 eA=e=>{const{width:n,height:i,x:a,y:o}=ds(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 tA({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const a=ct(),{width:o,height:s,transformString:u,userSelectionActive:f}=Ye(eA,ut),h=Ow(),d=Z.useRef(null);if(Z.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),Rw({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(Ic,x.key)&&(x.preventDefault(),h({direction:Ic[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 Vb=typeof window<"u"?window:void 0,nA=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Hw({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:D,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:j,disableKeyboardA11y:U,onViewportChange:Y,isControlledViewport:K}){const{nodesSelectionActive:z,userSelectionActive:R}=Ye(nA,ut),$=rs(d,{target:Vb}),T=rs(E,{target:Vb}),ie=T||F,ce=T||C,fe=g&&ie!==!0,he=$||R||fe;return LT({deleteKeyCode:h,multiSelectionKeyCode:w}),v.jsx(UT,{onPaneContextMenu:s,elementsSelectable:_,zoomOnScroll:D,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:j,onViewportChange:Y,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(VT,{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(tA,{onSelectionContextMenu:O,noPanClassName:j,disableKeyboardA11y:U})]})})}Hw.displayName="FlowRenderer";const iA=Z.memo(Hw),rA=e=>n=>e?pm(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 aA(e){return Ye(Z.useCallback(rA(e),[e]),ut)}const lA=e=>e.updateNodeInternals;function oA(){const e=Ye(lA),[n]=Z.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 Z.useEffect(()=>()=>{n?.disconnect()},[n]),n}function sA({node:e,nodeType:n,hasDimensions:i,resizeObserver:a}){const o=ct(),s=Z.useRef(null),u=Z.useRef(null),f=Z.useRef(e.sourcePosition),h=Z.useRef(e.targetPosition),d=Z.useRef(n),g=i&&!!e.internals.handleBounds;return Z.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]),Z.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),Z.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 uA({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:D}){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]||$b[A];H===void 0&&(D?.("003",ri.error003(A)),A="default",H=N?.default||$b.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=iw(k),O=sA({node:k,nodeType:A,hasDimensions:te,resizeObserver:m}),B=Rw({nodeRef:O,disabled:k.hidden||!F,noDragClassName:x,handleSelector:k.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:_}),j=Ow();if(k.hidden)return null;const U=Bi(k),Y=WT(k),K=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,T=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)&&Up({id:e,store:P,nodeRef:O}),n&&n(ue,{...C.userNode})},fe=ue=>{if(!(lw(ue.nativeEvent)||w)){if(Gv.includes(ue.key)&&G){const me=ue.key==="Escape";Up({id:e,store:P,unselect:me,nodeRef:O})}else if(F&&k.selected&&Object.prototype.hasOwnProperty.call(Ic,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})}),j({direction:Ic[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;pm(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:K?"all":"none",visibility:te?"visible":"hidden",...k.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:R,onMouseLeave:$,onContextMenu:T,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:`${Nw}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:v.jsx(YT,{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 cA=Z.memo(uA);const fA=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Bw(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:a,elementsSelectable:o,onError:s}=Ye(fA,ut),u=aA(e.onlyRenderVisibleElements),f=oA();return v.jsx("div",{className:"react-flow__nodes",style:lf,children:u.map(h=>v.jsx(cA,{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))})}Bw.displayName="NodeRenderer";const dA=Z.memo(Bw);function hA(e){return Ye(Z.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&&dM({sourceNode:s,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&a.push(o.id)}return a},[e]),ut)}const pA=({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"})},mA=({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"})},Pb={[Hc.Arrow]:pA,[Hc.ArrowClosed]:mA};function gA(e){const n=ct();return Z.useMemo(()=>Object.prototype.hasOwnProperty.call(Pb,e)?Pb[e]:(n.getState().onError?.("009",ri.error009(e)),null),[e])}const yA=({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=gA(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},Uw=({defaultColor:e,rfId:n})=>{const i=Ye(s=>s.edges),a=Ye(s=>s.defaultEdgeOptions),o=Z.useMemo(()=>bM(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(yA,{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};Uw.displayName="MarkerDefinitions";var xA=Z.memo(Uw);function Iw({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]=Z.useState({x:1,y:0,width:0,height:0}),b=_t(["react-flow__edge-textwrapper",d]),w=Z.useRef(null);return Z.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}Iw.displayName="EdgeText";const bA=Z.memo(Iw);function of({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(bA,{x:n,y:i,label:a,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function Yb({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 qw({sourceX:e,sourceY:n,sourcePosition:i=be.Bottom,targetX:a,targetY:o,targetPosition:s=be.Top}){const[u,f]=Yb({pos:i,x1:e,y1:n,x2:a,y2:o}),[h,d]=Yb({pos:s,x1:a,y1:o,x2:e,y2:n}),[g,m,x,b]=sw({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 $w(e){return Z.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[D,k,C]=qw({sourceX:i,sourceY:a,sourcePosition:u,targetX:o,targetY:s,targetPosition:f}),L=e.isInternal?void 0:n;return v.jsx(of,{id:L,path:D,labelX:k,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:_})})}const vA=$w({isInternal:!1}),Vw=$w({isInternal:!0});vA.displayName="SimpleBezierEdge";Vw.displayName="SimpleBezierEdgeInternal";function Pw(e){return Z.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:D})=>{const[k,C,L]=Op({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(of,{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:D})})}const Yw=Pw({isInternal:!1}),Xw=Pw({isInternal:!0});Yw.displayName="SmoothStepEdge";Xw.displayName="SmoothStepEdgeInternal";function Fw(e){return Z.memo(({id:n,...i})=>{const a=e.isInternal?void 0:n;return v.jsx(Yw,{...i,id:a,pathOptions:Z.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const wA=Fw({isInternal:!1}),Gw=Fw({isInternal:!0});wA.displayName="StepEdge";Gw.displayName="StepEdgeInternal";function Zw(e){return Z.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,_,D]=dw({sourceX:i,sourceY:a,targetX:o,targetY:s}),k=e.isInternal?void 0:n;return v.jsx(of,{id:k,path:N,labelX:_,labelY:D,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})})}const SA=Zw({isInternal:!1}),Qw=Zw({isInternal:!0});SA.displayName="StraightEdge";Qw.displayName="StraightEdgeInternal";function Kw(e){return Z.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:D})=>{const[k,C,L]=uw({sourceX:i,sourceY:a,sourcePosition:u,targetX:o,targetY:s,targetPosition:f,curvature:_?.curvature}),A=e.isInternal?void 0:n;return v.jsx(of,{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:D})})}const _A=Kw({isInternal:!1}),Jw=Kw({isInternal:!0});_A.displayName="BezierEdge";Jw.displayName="BezierEdgeInternal";const Xb={default:Jw,straight:Qw,step:Gw,smoothstep:Xw,simplebezier:Vw},Fb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},kA=(e,n,i)=>i===be.Left?e-n:i===be.Right?e+n:e,EA=(e,n,i)=>i===be.Top?e-n:i===be.Bottom?e+n:e,Gb="react-flow__edgeupdater";function Zb({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([Gb,`${Gb}-${f}`]),cx:kA(n,a,e),cy:EA(i,a,e),r:a,stroke:"transparent",fill:"transparent"})}function NA({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:j,panBy:U,updateConnection:Y}=w.getState(),K=L.type==="target",z=(T,ie)=>{x(!1),m?.(T,i,L.type,ie)},R=T=>d?.(i,T),$=(T,ie)=>{x(!0),g?.(C,i,L.type),P?.(T,ie)};Bp.onPointerDown(C.nativeEvent,{autoPanOnConnect:A,connectionMode:G,connectionRadius:q,domNode:H,handleId:L.id,nodeId:L.nodeId,nodeLookup:B,isTarget:K,edgeUpdaterType:L.type,lib:V,flowId:j,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"}),D=()=>b(!0),k=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(Zb,{position:f,centerX:a,centerY:o,radius:n,onMouseDown:N,onMouseEnter:D,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&v.jsx(Zb,{position:h,centerX:s,centerY:u,radius:n,onMouseDown:_,onMouseEnter:D,onMouseOut:k,type:"target"})]})}function CA({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:D}){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]||Xb[L];A===void 0&&(_?.("011",ri.error011(L)),L="default",A=E?.default||Xb.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=Z.useRef(null),[V,P]=Z.useState(!1),[te,O]=Z.useState(!1),B=ct(),{zIndex:j,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$}=Ye(Z.useCallback(we=>{const Ne=we.nodeLookup.get(k.source),Re=we.nodeLookup.get(k.target);if(!Ne||!Re)return{zIndex:k.zIndex,...Fb};const Ze=xM({id:e,sourceNode:Ne,targetNode:Re,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:we.connectionMode,onError:_});return{zIndex:fM({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:Re,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Ze||Fb}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),ut),T=Z.useMemo(()=>k.markerStart?`url('#${Lp(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ie=Z.useMemo(()=>k.markerEnd?`url('#${Lp(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||U===null||Y===null||K===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(!D&&Gv.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:j},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?`${Cw}-${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:K,targetY:z,sourcePosition:R,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:T,markerEnd:ie,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),F&&v.jsx(NA,{edge:k,isReconnectable:F,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:U,sourceY:Y,targetX:K,targetY:z,sourcePosition:R,targetPosition:$,setUpdateHover:P,setReconnecting:O})]})})}var MA=Z.memo(CA);const TA=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ww({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:D,onError:k}=Ye(TA,ut),C=hA(n);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(xA,{defaultColor:e,rfId:i}),C.map(L=>v.jsx(MA,{id:L,edgesFocusable:N,edgesReconnectable:_,elementsSelectable:D,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))]})}Ww.displayName="EdgeRenderer";const AA=Z.memo(Ww),zA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jA({children:e}){const n=Ye(zA);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function DA(e){const n=Sm(),i=Z.useRef(!1);Z.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const RA=e=>e.panZoom?.syncViewport;function OA(e){const n=Ye(RA),i=ct();return Z.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function LA(e){return e.connection.inProgress?{...e.connection,to:ps(e.connection.to,e.transform)}:{...e.connection}}function HA(e){return LA}function BA(e){const n=HA();return Ye(n,ut)}const UA=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function IA({containerStyle:e,style:n,type:i,component:a}){const{nodesConnectable:o,width:s,height:u,isValid:f,inProgress:h}=Ye(UA,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",Kv(f)]),children:v.jsx(eS,{style:n,type:i,CustomComponent:a,isValid:f})})})}const eS=({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}=BA();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:Kv(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]=uw(E);break;case wr.SimpleBezier:[w]=qw(E);break;case wr.Step:[w]=Op({...E,borderRadius:0});break;case wr.SmoothStep:[w]=Op(E);break;default:[w]=dw(E)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};eS.displayName="ConnectionLine";const qA={};function Qb(e=qA){Z.useRef(e),ct(),Z.useEffect(()=>{},[e])}function $A(){ct(),Z.useRef(!1),Z.useEffect(()=>{},[])}function tS({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:D,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:j,zoomOnScroll:U,zoomOnPinch:Y,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,zoomOnDoubleClick:$,panOnDrag:T,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 Qb(e),Qb(n),$A(),DA(i),OA(ae),v.jsx(iA,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:F,selectionKeyCode:D,selectionOnDrag:k,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:q,zoomOnScroll:U,zoomOnPinch:Y,zoomOnDoubleClick:$,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:R,panOnDrag:T,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(jA,{children:[v.jsx(AA,{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:j,noPanClassName:oi,disableKeyboardA11y:si,rfId:Ii}),v.jsx(IA,{style:E,type:w,component:N,containerStyle:_}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(dA,{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"})]})})}tS.displayName="GraphView";const VA=Z.memo(tS),Kb=({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??[],D=i??e??[],k=g??[0,0],C=m??es;mw(E,N,_);const L=Hp(D,b,w,{nodeOrigin:k,nodeExtent:C,zIndexMode:x});let A=[0,0,1];if(u&&o&&s){const H=ds(b,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:F,y:G,zoom:q}=mm(H,o,s,h,d,f?.padding??.1);A=[F,G,q]}return{rfId:"1",width:o??0,height:s??0,transform:A,nodes:D,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:es,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:cl.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:{...Qv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:aM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Zv,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},PA=({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})=>sT((b,w)=>{async function E(){const{nodeLookup:N,panZoom:_,fitViewOptions:D,fitViewResolver:k,width:C,height:L,minZoom:A,maxZoom:H}=w();_&&(await iM({nodes:N,width:C,height:L,panZoom:_,minZoom:A,maxZoom:H},D),k?.resolve(!0),b({fitViewResolver:null}))}return{...Kb({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:D,nodeOrigin:k,elevateNodesOnSelect:C,fitViewQueued:L,zIndexMode:A}=w(),H=Hp(N,_,D,{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:D}=w();mw(_,D,N),b({edges:N})},setDefaultNodesAndEdges:(N,_)=>{if(N){const{setNodes:D}=w();D(N),b({hasDefaultNodes:!0})}if(_){const{setEdges:D}=w();D(_),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:_,nodeLookup:D,parentLookup:k,domNode:C,nodeOrigin:L,nodeExtent:A,debug:H,fitViewQueued:F,zIndexMode:G}=w(),{changes:q,updatedInternals:V}=NM(N,D,k,C,L,A,G);V&&(SM(D,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 D=[];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&&D.push({id:G,parentId:V.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),k.push(te)}if(D.length>0){const{parentLookup:G,nodeOrigin:q}=w(),V=wm(D,C,G,q);k.push(...V)}for(const G of F.values())k=G(k);L(k)},triggerNodeChanges:N=>{const{onNodesChange:_,setNodes:D,nodes:k,hasDefaultNodes:C,debug:L}=w();if(N?.length){if(C){const A=Aw(N,k);D(A)}L&&console.log("React Flow: trigger node changes",N),_?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:_,setEdges:D,edges:k,hasDefaultEdges:C,debug:L}=w();if(N?.length){if(C){const A=zw(N,k);D(A)}L&&console.log("React Flow: trigger edge changes",N),_?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));C(A);return}C(tl(k,new Set([...N]),!0)),L(tl(D))},addSelectedEdges:N=>{const{multiSelectionActive:_,edgeLookup:D,nodeLookup:k,triggerNodeChanges:C,triggerEdgeChanges:L}=w();if(_){const A=N.map(H=>Gr(H,!0));L(A);return}L(tl(D,new Set([...N]))),C(tl(k,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:_}={})=>{const{edges:D,nodes:k,nodeLookup:C,triggerNodeChanges:L,triggerEdgeChanges:A}=w(),H=N||k,F=_||D,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:D}=w();_?.setScaleExtent([N,D]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:_,minZoom:D}=w();_?.setScaleExtent([D,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:_,triggerNodeChanges:D,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,[]);D(L),k(A)},setNodeExtent:N=>{const{nodes:_,nodeLookup:D,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]||(Hp(_,D,k,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:H}),b({nodeExtent:N}))},panBy:N=>{const{transform:_,width:D,height:k,panZoom:C,translateExtent:L}=w();return CM({delta:N,panZoom:C,transform:_,translateExtent:L,width:D,height:k})},setCenter:async(N,_,D)=>{const{width:k,height:C,maxZoom:L,panZoom:A}=w();if(!A)return Promise.resolve(!1);const H=typeof D?.zoom<"u"?D.zoom:L;return await A.setViewport({x:k/2-N*H,y:C/2-_*H,zoom:H},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Qv}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...Kb()})}},Object.is);function nS({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]=Z.useState(()=>PA({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(uT,{value:w,children:v.jsx(jT,{children:b})})}function YA({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 Z.useContext(rf)?v.jsx(v.Fragment,{children:e}):v.jsx(nS,{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 XA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function FA({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:D,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:j,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onBeforeDelete:z,connectionMode:R,connectionLineType:$=wr.Bezier,connectionLineStyle:T,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=ts.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=is()?"Meta":"Control",zoomActivationKeyCode:we=is()?"Meta":"Control",snapToGrid:Ne,snapGrid:Re,onlyRenderVisibleElements:Ze=!1,selectNodesOnDrag:Xe,nodesDraggable:ht,autoPanOnNodeFocus:on,nodesConnectable:Lt,nodesFocusable:Gt,nodeOrigin:Rn=Mw,edgesFocusable:oi,edgesReconnectable:si,elementsSelectable:Et=!0,defaultViewport:Ii=ST,minZoom:ae=.5,maxZoom:pe=2,translateExtent:_e=es,preventScrolling:De=!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:_f,onPaneMouseEnter:la,onPaneMouseMove:oa,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:ua,paneClickDistance:_r=1,nodeClickDistance:kf=0,children:_s,onReconnect:_l,onReconnectStart:kr,onReconnectEnd:Ef,onEdgeContextMenu:ks,onEdgeDoubleClick:Es,onEdgeMouseEnter:Ns,onEdgeMouseMove:kl,onEdgeMouseLeave:El,reconnectRadius:Cs=10,onNodesChange:Ms,onEdgesChange:Zn,noDragClassName:Nt="nodrag",noWheelClassName:Bt="nowheel",noPanClassName:ci="nopan",fitView:ca,fitViewOptions:Ts,connectOnClick:Nf,attributionPosition:As,proOptions:Er,defaultEdgeOptions:Nl,elevateNodesOnSelect:qi=!0,elevateEdgesOnSelect:$i=!1,disableKeyboardA11y:Vi=!1,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:zs,connectionRadius:js,isValidConnection:fi,onError:Yi,style:Cf,id:Cl,nodeDragThreshold:Ds,connectionDragThreshold:Mf,viewport:fa,onViewportChange:da,width:Ln,height:Zt,colorMode:Rs="light",debug:Tf,onScroll:ha,ariaLabelConfig:Os,zIndexMode:Nr="basic",...Af},Qt){const Cr=Cl||"1",Ls=NT(Rs),Ml=Z.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ha?.(di)},[ha]);return v.jsx("div",{"data-testid":"rf__wrapper",...Af,onScroll:Ml,style:{...Cf,...XA},ref:Qt,className:_t(["react-flow",o,Ls]),id:Cl,role:"application",children:v.jsxs(YA,{nodes:e,edges:n,width:Ln,height:Zt,fitView:ca,fitViewOptions:Ts,minZoom:ae,maxZoom:pe,nodeOrigin:Rn,nodeExtent:$e,zIndexMode:Nr,children:[v.jsx(VA,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:D,onNodeMouseMove:k,onNodeMouseLeave:C,onNodeContextMenu:L,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:u,connectionLineType:$,connectionLineStyle:T,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:De,zoomOnScroll:On,zoomOnPinch:At,zoomOnDoubleClick:Gn,panOnScroll:pt,panOnScrollSpeed:Ht,panOnScrollMode:Ke,panOnDrag:sn,onPaneClick:_f,onPaneMouseEnter:la,onPaneMouseMove:oa,onPaneMouseLeave:sa,onPaneScroll:ui,onPaneContextMenu:ua,paneClickDistance:_r,nodeClickDistance:kf,onSelectionContextMenu:U,onSelectionStart:Y,onSelectionEnd:K,onReconnect:_l,onReconnectStart:kr,onReconnectEnd:Ef,onEdgeContextMenu:ks,onEdgeDoubleClick:Es,onEdgeMouseEnter:Ns,onEdgeMouseMove:kl,onEdgeMouseLeave:El,reconnectRadius:Cs,defaultMarkerColor:Vt,noDragClassName:Nt,noWheelClassName:Bt,noPanClassName:ci,rfId:Cr,disableKeyboardA11y:Vi,nodeExtent:$e,viewport:fa,onViewportChange:da}),v.jsx(ET,{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:Ms,onEdgesChange:Zn,snapToGrid:Ne,snapGrid:Re,connectionMode:R,translateExtent:_e,connectOnClick:Nf,defaultEdgeOptions:Nl,fitView:ca,fitViewOptions:Ts,onNodesDelete:q,onEdgesDelete:V,onDelete:P,onNodeDragStart:H,onNodeDrag:F,onNodeDragStop:G,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:j,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:ci,nodeOrigin:Rn,rfId:Cr,autoPanOnConnect:Pi,autoPanOnNodeDrag:yt,autoPanSpeed:zs,onError:Yi,connectionRadius:js,isValidConnection:fi,selectNodesOnDrag:Xe,nodeDragThreshold:Ds,connectionDragThreshold:Mf,onBeforeDelete:z,debug:Tf,ariaLabelConfig:Os,zIndexMode:Nr}),v.jsx(wT,{onSelectionChange:te}),_s,v.jsx(gT,{proOptions:Er,position:As}),v.jsx(mT,{rfId:Cr,disableKeyboardA11y:Vi})]})})}var GA=jw(FA);function ZA({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 QA({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 KA={[Oi.Dots]:1,[Oi.Lines]:1,[Oi.Cross]:6},JA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function iS({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=Z.useRef(null),{transform:x,patternId:b}=Ye(JA,ut),w=a||KA[n],E=n===Oi.Dots,N=n===Oi.Cross,_=Array.isArray(i)?i:[i,i],D=[_[0]*x[2]||1,_[1]*x[2]||1],k=w*x[2],C=Array.isArray(s)?s:[s,s],L=N?[k,k]:D,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,...lf,"--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]%D[0],y:x[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:E?v.jsx(QA,{radius:k/2,className:g}):v.jsx(ZA,{dimensions:L,lineWidth:o,variant:n,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}iS.displayName="Background";const WA=Z.memo(iS);function e3(){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 t3(){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 n3(){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 i3(){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 r3(){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 ec({children:e,className:n,...i}){return v.jsx("button",{type:"button",className:_t(["react-flow__controls-button",n]),...i,children:e})}const a3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function rS({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:D}=Ye(a3,ut),{zoomIn:k,zoomOut:C,fitView:L}=Sm(),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(af,{className:_t(["react-flow__controls",q,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??D["controls.ariaLabel"],children:[n&&v.jsxs(v.Fragment,{children:[v.jsx(ec,{onClick:A,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:_,children:v.jsx(e3,{})}),v.jsx(ec,{onClick:H,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(t3,{})})]}),i&&v.jsx(ec,{className:"react-flow__controls-fitview",onClick:F,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:v.jsx(n3,{})}),a&&v.jsx(ec,{className:"react-flow__controls-interactive",onClick:G,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:E?v.jsx(r3,{}):v.jsx(i3,{})}),g]})}rS.displayName="Controls";const l3=Z.memo(rS);function o3({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 s3=Z.memo(o3),u3=e=>e.nodes.map(n=>n.id),Wh=e=>e instanceof Function?e:()=>e;function c3({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s=s3,onClick:u}){const f=Ye(u3,ut),h=Wh(n),d=Wh(e),g=Wh(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(d3,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:s,onClick:u,shapeRendering:m},x))})}function f3({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:D}=E.positionAbsolute,{width:k,height:C}=Bi(N);return{node:N,x:_,y:D,width:k,height:C}},ut);return!d||d.hidden||!iw(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 d3=Z.memo(f3);var h3=Z.memo(c3);const p3=200,m3=150,g3=e=>!e.hidden,y3=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?nw(ds(e.nodeLookup,{filter:g3}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},x3="react-flow__minimap-desc";function aS({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:D,zoomStep:k=1,offsetScale:C=5}){const L=ct(),A=Z.useRef(null),{boundingRect:H,viewBB:F,rfId:G,panZoom:q,translateExtent:V,flowWidth:P,flowHeight:te,ariaLabelConfig:O}=Ye(y3,ut),B=e?.width??p3,j=e?.height??m3,U=H.width/B,Y=H.height/j,K=Math.max(U,Y),z=K*B,R=K*j,$=C*K,T=H.x-(z-H.width)/2-$,ie=H.y-(R-H.height)/2-$,ce=z+$*2,fe=R+$*2,he=`${x3}-${G}`,ue=Z.useRef(0),me=Z.useRef();ue.current=K,Z.useEffect(()=>{if(A.current&&q)return me.current=LM({domNode:A.current,panZoom:q,getTransform:()=>L.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[q]),Z.useEffect(()=>{me.current?.update({translateExtent:V,width:P,height:te,inversePan:D,pannable:E,zoomStep:k,zoomable:N})},[E,N,D,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?Z.useCallback((Ne,Re)=>{const Ze=L.getState().nodeLookup.get(Re).internals.userNode;w(Ne,Ze)},[]):void 0,we=_??O["minimap.ariaLabel"];return v.jsx(af,{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*K: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:j,viewBox:`${T} ${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(h3,{onClick:Ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-$},${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"})]})})}aS.displayName="MiniMap";const b3=Z.memo(aS),v3=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,w3={[pl.Line]:"right",[pl.Handle]:"bottom-right"};function S3({nodeId:e,position:n,variant:i=pl.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 D=Lw(),k=typeof e=="string"?e:D,C=ct(),L=Z.useRef(null),A=i===pl.Handle,H=Ye(Z.useCallback(v3(A&&b),[A,b]),ut),F=Z.useRef(null),G=n??w3[i];Z.useEffect(()=>{if(!(!L.current||!k))return F.current||(F.current=QM({domNode:L.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,domNode:j}=C.getState();return{nodeLookup:V,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:B,paneDomNode:j}},onChange:(V,P)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:B,nodeOrigin:j}=C.getState(),U=[],Y={x:V.x,y:V.y},K=O.get(k);if(K&&K.expandParent&&K.parentId){const z=K.origin??j,R=V.width??K.measured.width??0,$=V.height??K.measured.height??0,T={id:K.id,parentId:K.parentId,rect:{width:R,height:$,...rw({x:V.x??K.position.x,y:V.y??K.position.y},{width:R,height:$},K.parentId,O,z)}},ie=wm([T],O,B,j);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})}Z.memo(S3);const lS=(...e)=>e.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();const _3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const k3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,a)=>a?a.toUpperCase():i.toLowerCase());const Jb=e=>{const n=k3(e);return n.charAt(0).toUpperCase()+n.slice(1)};var E3={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 N3=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const C3=Z.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:u,...f},h)=>Z.createElement("svg",{ref:h,...E3,width:n,height:n,stroke:e,strokeWidth:a?Number(i)*24/Number(n):i,className:lS("lucide",o),...!s&&!N3(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>Z.createElement(d,g)),...Array.isArray(s)?s:[s]]));const Oe=(e,n)=>{const i=Z.forwardRef(({className:a,...o},s)=>Z.createElement(C3,{ref:s,iconNode:n,className:lS(`lucide-${_3(Jb(e))}`,`lucide-${e}`,a),...o}));return i.displayName=Jb(e),i};const M3=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],km=Oe("anchor",M3);const T3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],A3=Oe("arrow-left",T3);const z3=[["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"}]],j3=Oe("bot",z3);const D3=[["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"}]],sf=Oe("chart-column",D3);const R3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],O3=Oe("check",R3);const L3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],H3=Oe("chevron-down",L3);const B3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],U3=Oe("chevron-up",B3);const I3=[["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"}]],Ip=Oe("circle-alert",I3);const q3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Em=Oe("circle-check-big",q3);const $3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],V3=Oe("circle-check",$3);const P3=[["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"}]],oS=Oe("circle-x",P3);const Y3=[["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"}]],rl=Oe("download",Y3);const X3=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],F3=Oe("eye-off",X3);const G3=[["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"}]],sS=Oe("eye",G3);const Z3=[["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"}]],al=Oe("file-text",Z3);const Q3=[["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"}]],Wb=Oe("folder-open",Q3);const K3=[["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"}]],J3=Oe("globe",K3);const W3=[["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"}]],uS=Oe("image",W3);const e5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t5=Oe("info",e5);const n5=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],i5=Oe("key",n5);const r5=[["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"}]],a5=Oe("link-2",r5);const l5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cS=Oe("loader-circle",l5);const o5=[["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"}]],s5=Oe("maximize-2",o5);const u5=[["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"}]],uf=Oe("message-square",u5);const c5=[["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"}]],f5=Oe("minimize-2",c5);const d5=[["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"}]],Nm=Oe("play",d5);const h5=[["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"}]],p5=Oe("save",h5);const m5=[["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"}]],g5=Oe("send",m5);const y5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],x5=Oe("server",y5);const b5=[["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"}]],v5=Oe("settings-2",b5);const w5=[["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"}]],fS=Oe("settings",w5);const S5=[["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"}]],ms=Oe("sparkles",S5);const _5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ra=Oe("terminal",_5);const k5=[["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"}]],cf=Oe("trash-2",k5);const E5=[["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"}]],N5=Oe("triangle-alert",E5);const C5=[["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"}]],M5=Oe("upload",C5);const T5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cm=Oe("x",T5);const A5=[["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"}]],ff=Oe("zap",A5),e1=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},z5=(e=>e?e1(e):e1),j5=e=>e;function D5(e,n=j5){const i=Io.useSyncExternalStore(e.subscribe,Io.useCallback(()=>n(e.getState()),[e,n]),Io.useCallback(()=>n(e.getInitialState()),[e,n]));return Io.useDebugValue(i),i}const t1=e=>{const n=z5(e),i=a=>D5(n,a);return Object.assign(i,n),i},df=(e=>e?t1(e):t1);function R5(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 qp=e=>n=>{try{const i=e(n);return i instanceof Promise?i:{then(a){return qp(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return qp(a)(i)}}}},O5=(e,n)=>(i,a,o)=>{let s={storage:R5(()=>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 D=++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 qp(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(D!==f)return;const[A,H]=C;if(w=s.merge(H,(L=a())!=null?L:b),i(w,!0),A)return m()}).then(()=>{D===f&&(k?.(w,void 0),w=a(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{D===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},dS=O5,L5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let gl=(e=21)=>{let n="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=L5[i[e]&63];return n};const Hi=df()(dS(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:gl(),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:gl(),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})})),hS=e=>e.nodes.find(n=>n.id===e.selectedNodeId),gs=df((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:gl(),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 pS=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return pS=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 as(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const $p=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 Te extends Error{}class qt extends Te{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 hf({message:a,cause:$p(i)});const s=i;return n===400?new gS(n,s,a,o):n===401?new yS(n,s,a,o):n===403?new xS(n,s,a,o):n===404?new bS(n,s,a,o):n===409?new vS(n,s,a,o):n===422?new wS(n,s,a,o):n===429?new SS(n,s,a,o):n>=500?new _S(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 hf extends qt{constructor({message:n,cause:i}){super(void 0,void 0,n||"Connection error.",void 0),i&&(this.cause=i)}}class mS extends hf{constructor({message:n}={}){super({message:n??"Request timed out."})}}class gS extends qt{}class yS extends qt{}class xS extends qt{}class bS extends qt{}class vS extends qt{}class wS extends qt{}class SS extends qt{}class _S extends qt{}const H5=/^[a-z][a-z0-9+.-]*:/i,B5=e=>H5.test(e);let Vp=e=>(Vp=Array.isArray,Vp(e)),n1=Vp;function Pp(e){return typeof e!="object"?{}:e??{}}function U5(e){if(!e)return!0;for(const n in e)return!1;return!0}function I5(e,n){return Object.prototype.hasOwnProperty.call(e,n)}const q5=(e,n)=>{if(typeof n!="number"||!Number.isInteger(n))throw new Te(`${e} must be an integer`);if(n<0)throw new Te(`${e} must be a positive integer`);return n},kS=e=>{try{return JSON.parse(e)}catch{return}},$5=e=>new Promise(n=>setTimeout(n,e)),Ka="0.71.2",V5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function P5(){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 Y5=()=>{const e=P5();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"X-Stainless-OS":r1(Deno.build.os),"X-Stainless-Arch":i1(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":Ka,"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":Ka,"X-Stainless-OS":r1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":i1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const n=X5();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ka,"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":Ka,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function X5(){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 i1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",r1=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 a1;const F5=()=>a1??(a1=Y5());function G5(){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 ES(...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 NS(e){let n=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ES({start(){},async pull(i){const{done:a,value:o}=await n.next();a?i.close():i.enqueue(o)},async cancel(){await n.return?.()}})}function Mm(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 Z5(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 Q5=({headers:e,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});function K5(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 l1;function Tm(e){let n;return(l1??(n=new globalThis.TextEncoder,l1=n.encode.bind(n)))(e)}let o1;function s1(e){let n;return(o1??(n=new globalThis.TextDecoder,o1=n.decode.bind(n)))(e)}var yn,xn;class ys{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"?Tm(n):n;ge(this,yn,K5([ne(this,yn,"f"),i]));const a=[];let o;for(;(o=J5(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(s1(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=s1(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;ys.NEWLINE_CHARS=new Set([`
|
|
17
|
-
`,"\r"]);ys.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function J5(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 W5(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 qc={off:0,error:200,warn:300,info:400,debug:500},u1=(e,n,i)=>{if(e){if(I5(qc,e))return e;Yt(i).warn(`${n} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(qc))}`)}};function Vo(){}function tc(e,n,i){return!n||qc[e]>qc[i]?Vo:n[e].bind(n)}const ez={error:Vo,warn:Vo,info:Vo,debug:Vo};let c1=new WeakMap;function Yt(e){const n=e.logger,i=e.logLevel??"off";if(!n)return ez;const a=c1.get(n);if(a&&a[0]===i)return a[1];const o={error:tc("error",n,i),warn:tc("warn",n,i),info:tc("info",n,i),debug:tc("debug",n,i)};return c1.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 wo;class ni{constructor(n,i,a){this.iterator=n,wo.set(this,void 0),this.controller=i,ge(this,wo,a)}static fromSSEResponse(n,i,a){let o=!1;const s=a?Yt(a):console;async function*u(){if(o)throw new Te("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let f=!1;try{for await(const h of tz(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,kS(h.data)??h.data,void 0,n.headers)}f=!0}catch(h){if(as(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 ys,h=Mm(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 Te("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(as(h))return;throw h}finally{f||i.abort()}}return new ni(u,i,a)}[(wo=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,wo,"f")),new ni(()=>o(i),this.controller,ne(this,wo,"f"))]}toReadableStream(){const n=this;let i;return ES({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=Tm(JSON.stringify(o)+`
|
|
18
|
-
`);a.enqueue(u)}catch(o){a.error(o)}},async cancel(){await i.return?.()}})}}async function*tz(e,n){if(!e.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Te("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 Te("Attempted to iterate over a response with no body");const i=new iz,a=new ys,o=Mm(e.body);for await(const s of nz(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*nz(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"?Tm(i):i;let o=new Uint8Array(n.length+a.length);o.set(n),o.set(a,n.length),n=o;let s;for(;(s=W5(n))!==-1;)yield n.slice(0,s),n=n.slice(s)}n.length>0&&(yield n)}class iz{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]=rz(n,":");return o.startsWith(" ")&&(o=o.substring(1)),i==="event"?this.event=o:i==="data"&&this.data.push(o),null}}function rz(e,n){const i=e.indexOf(n);return i!==-1?[e.substring(0,i),n,e.substring(i+n.length)]:[e,"",""]}async function CS(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 MS(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 MS(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 Po;class pf extends Promise{constructor(n,i,a=CS){super(o=>{o(null)}),this.responsePromise=i,this.parseResponse=a,Po.set(this,void 0),ge(this,Po,n)}_thenUnwrap(n){return new pf(ne(this,Po,"f"),this.responsePromise,async(i,a)=>MS(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,Po,"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)}}Po=new WeakMap;var nc;class TS{constructor(n,i,a,o){nc.set(this,void 0),ge(this,nc,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 Te("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ne(this,nc,"f").requestAPIList(this.constructor,n)}async*iterPages(){let n=this;for(yield n;n.hasNextPage();)n=await n.getNextPage(),yield n}async*[(nc=new WeakMap,Symbol.asyncIterator)](){for await(const n of this.iterPages())for(const i of n.getPaginatedItems())yield i}}class az extends pf{constructor(n,i,a){super(n,i,async(o,s)=>new a(o,s.response,await CS(o,s),s.options))}async*[Symbol.asyncIterator](){const n=await this;for await(const i of n)yield i}}class xs extends TS{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:{...Pp(this.options.query),before_id:i}}:null}const n=this.last_id;return n?{...this.options,query:{...Pp(this.options.query),after_id:n}}:null}}class AS extends TS{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:{...Pp(this.options.query),page:n}}:null}}const zS=()=>{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 ll(e,n,i){return zS(),new File(e,n??"unknown_file",i)}function Cc(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 jS=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Am=async(e,n)=>({...e,body:await oz(e.body,n)}),f1=new WeakMap;function lz(e){const n=typeof e=="function"?e:e.fetch,i=f1.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 f1.set(n,a),a}const oz=async(e,n)=>{if(!await lz(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])=>Yp(i,a,o))),i},sz=e=>e instanceof Blob&&"name"in e,Yp=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,ll([await i.blob()],Cc(i),a))}else if(jS(i))e.append(n,ll([await new Response(NS(i)).blob()],Cc(i)));else if(sz(i))e.append(n,ll([i],Cc(i),{type:i.type}));else if(Array.isArray(i))await Promise.all(i.map(a=>Yp(e,n+"[]",a)));else if(typeof i=="object")await Promise.all(Object.entries(i).map(([a,o])=>Yp(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`)}},DS=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",uz=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&DS(e),cz=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function fz(e,n,i){if(zS(),e=await e,n||(n=Cc(e)),uz(e))return e instanceof File&&n==null&&i==null?e:ll([await e.arrayBuffer()],n??e.name,{type:e.type,lastModified:e.lastModified,...i});if(cz(e)){const o=await e.blob();return n||(n=new URL(e.url).pathname.split(/[\\/]/).pop()),ll(await Xp(o),n,i)}const a=await Xp(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 ll(a,n,i)}async function Xp(e){let n=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)n.push(e);else if(DS(e))n.push(e instanceof Blob?e:await e.arrayBuffer());else if(jS(e))for await(const i of e)n.push(...await Xp(i));else{const i=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${i?`; constructor: ${i}`:""}${dz(e)}`)}return n}function dz(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(i=>`"${i}"`).join(", ")}]`}class Fn{constructor(n){this._client=n}}const RS=Symbol.for("brand.privateNullableHeaders");function*hz(e){if(!e)return;if(RS 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():n1(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=n1(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 hz(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{[RS]:!0,values:n,nulls:i}};function OS(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const d1=Object.freeze(Object.create(null)),pz=(e=OS)=>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??d1)??d1)?.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 Te(`Path parameters result in path with invalid segments:
|
|
20
|
-
${s.map(x=>x.error).join(`
|
|
21
|
-
`)}
|
|
22
|
-
${u}
|
|
23
|
-
${m}`)}return u},Ot=pz(OS);class LS extends Fn{list(n={},i){const{betas:a,...o}=n??{};return this._client.getAPIList("/v1/files",xs,{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",Am({body:o,...i,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},i?.headers])},this._client))}}let HS=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",xs,{query:o,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}};const BS={"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 h1(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}:US(e,n,i)}function US(e,n,i){let a=null;const o=e.content.map(s=>{if(s.type==="text"){const u=mz(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 mz(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 Te(`Failed to parse structured output: ${i}`)}}const gz=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},Ja=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),Ja(e);case"number":let i=n.value[n.value.length-1];if(i==="."||i==="-")return e=e.slice(0,e.length-1),Ja(e);case"string":let a=e[e.length-2];if(a?.type==="delimiter")return e=e.slice(0,e.length-1),Ja(e);if(a?.type==="brace"&&a.value==="{")return e=e.slice(0,e.length-1),Ja(e);break;case"delimiter":return e=e.slice(0,e.length-1),Ja(e)}return e},yz=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},xz=e=>{let n="";return e.map(i=>{i.type==="string"?n+='"'+i.value+'"':n+=i.value}),n},IS=e=>JSON.parse(xz(yz(Ja(gz(e)))));var zn,yr,Fa,So,ic,_o,ko,rc,Eo,zi,No,ac,lc,Pr,oc,sc,Co,ep,p1,uc,tp,np,ip,m1;const g1="__json_buf";function y1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class $c{constructor(n,i){zn.add(this),this.messages=[],this.receivedMessages=[],yr.set(this,void 0),Fa.set(this,null),this.controller=new AbortController,So.set(this,void 0),ic.set(this,()=>{}),_o.set(this,()=>{}),ko.set(this,void 0),rc.set(this,()=>{}),Eo.set(this,()=>{}),zi.set(this,{}),No.set(this,!1),ac.set(this,!1),lc.set(this,!1),Pr.set(this,!1),oc.set(this,void 0),sc.set(this,void 0),Co.set(this,void 0),uc.set(this,a=>{if(ge(this,ac,!0),as(a)&&(a=new Pn),a instanceof Pn)return ge(this,lc,!0),this._emit("abort",a);if(a instanceof Te)return this._emit("error",a);if(a instanceof Error){const o=new Te(a.message);return o.cause=a,this._emit("error",o)}return this._emit("error",new Te(String(a)))}),ge(this,So,new Promise((a,o)=>{ge(this,ic,a,"f"),ge(this,_o,o,"f")})),ge(this,ko,new Promise((a,o)=>{ge(this,rc,a,"f"),ge(this,Eo,o,"f")})),ne(this,So,"f").catch(()=>{}),ne(this,ko,"f").catch(()=>{}),ge(this,Fa,n),ge(this,Co,i?.logger??console)}get response(){return ne(this,oc,"f")}get request_id(){return ne(this,sc,"f")}async withResponse(){ge(this,Pr,!0);const n=await ne(this,So,"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 $c(null);return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a,{logger:o}={}){const s=new $c(i,{logger:o});for(const u of i.messages)s._addMessageParam(u);return ge(s,Fa,{...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,uc,"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",tp).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",np).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",ip).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(ge(this,oc,n),ge(this,sc,n?.headers.get("request-id")),ne(this,ic,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,No,"f")}get errored(){return ne(this,ac,"f")}get aborted(){return ne(this,lc,"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,ko,"f")}get currentMessage(){return ne(this,yr,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",ep).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",p1).call(this)}_emit(n,...i){if(ne(this,No,"f"))return;n==="end"&&(ge(this,No,!0),ne(this,rc,"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,_o,"f").call(this,o),ne(this,Eo,"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,_o,"f").call(this,o),ne(this,Eo,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"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,zn,"m",tp).call(this),this._connected(null);const s=ni.fromReadableStream(n,this.controller);for await(const u of s)ne(this,zn,"m",np).call(this,u);if(s.controller.signal?.aborted)throw new Pn;ne(this,zn,"m",ip).call(this)}finally{a&&o&&a.removeEventListener("abort",o)}}[(yr=new WeakMap,Fa=new WeakMap,So=new WeakMap,ic=new WeakMap,_o=new WeakMap,ko=new WeakMap,rc=new WeakMap,Eo=new WeakMap,zi=new WeakMap,No=new WeakMap,ac=new WeakMap,lc=new WeakMap,Pr=new WeakMap,oc=new WeakMap,sc=new WeakMap,Co=new WeakMap,uc=new WeakMap,zn=new WeakSet,ep=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},p1=function(){if(this.receivedMessages.length===0)throw new Te("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 Te("stream ended without producing a content block with type=text");return i.join(" ")},tp=function(){this.ended||ge(this,yr,void 0)},np=function(i){if(this.ended)return;const a=ne(this,zn,"m",m1).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":{y1(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(h1(a,ne(this,Fa,"f"),{logger:ne(this,Co,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",a.content.at(-1));break}case"message_start":{ge(this,yr,a);break}}},ip=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,yr,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,yr,void 0),h1(i,ne(this,Fa,"f"),{logger:ne(this,Co,"f")})},m1=function(i){let a=ne(this,yr,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`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&&y1(o)){let s=o[g1]||"";s+=i.delta.partial_json;const u={...o};if(Object.defineProperty(u,g1,{value:s,enumerable:!1,writable:!0}),s)try{u.input=IS(s)}catch(f){const h=new Te(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${s}`);ne(this,uc,"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 bz=1e5,vz=`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 Mo,Ga,Yr,Mt,To,gn,Di,xr,Ao,x1,Fp;function b1(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}class qS{constructor(n,i,a){Mo.add(this),this.client=n,Ga.set(this,!1),Yr.set(this,!1),Mt.set(this,void 0),To.set(this,void 0),gn.set(this,void 0),Di.set(this,void 0),xr.set(this,void 0),Ao.set(this,0),ge(this,Mt,{params:{...i,messages:structuredClone(i.messages)}}),ge(this,To,{...a,headers:Ve([{"x-stainless-helper":"BetaToolRunner"},a?.headers])}),ge(this,xr,b1())}async*[(Ga=new WeakMap,Yr=new WeakMap,Mt=new WeakMap,To=new WeakMap,gn=new WeakMap,Di=new WeakMap,xr=new WeakMap,Ao=new WeakMap,Mo=new WeakSet,x1=async function(){const i=ne(this,Mt,"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??bz;if(a<o)return!1;const s=i.model??ne(this,Mt,"f").params.model,u=i.summaryPrompt??vz,f=ne(this,Mt,"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,Mt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(h.content[0]?.type!=="text")throw new Te("Expected text response for compaction");return ne(this,Mt,"f").params.messages=[{role:"user",content:h.content}],!0},Symbol.asyncIterator)](){var n;if(ne(this,Ga,"f"))throw new Te("Cannot iterate over a consumed stream");ge(this,Ga,!0),ge(this,Yr,!0),ge(this,Di,void 0);try{for(;;){let i;try{if(ne(this,Mt,"f").params.max_iterations&&ne(this,Ao,"f")>=ne(this,Mt,"f").params.max_iterations)break;ge(this,Yr,!1,"f"),ge(this,Di,void 0,"f"),ge(this,Ao,(n=ne(this,Ao,"f"),n++,n),"f"),ge(this,gn,void 0,"f");const{max_iterations:a,compactionControl:o,...s}=ne(this,Mt,"f").params;if(s.stream?(i=this.client.beta.messages.stream({...s},ne(this,To,"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,To,"f")),"f"),yield ne(this,gn,"f")),!await ne(this,Mo,"m",x1).call(this)){if(!ne(this,Yr,"f")){const{role:h,content:d}=await ne(this,gn,"f");ne(this,Mt,"f").params.messages.push({role:h,content:d})}const f=await ne(this,Mo,"m",Fp).call(this,ne(this,Mt,"f").params.messages.at(-1));if(f)ne(this,Mt,"f").params.messages.push(f);else if(!ne(this,Yr,"f"))break}}finally{i&&i.abort()}}if(!ne(this,gn,"f"))throw new Te("ToolRunner concluded without a message from the server");ne(this,xr,"f").resolve(await ne(this,gn,"f"))}catch(i){throw ge(this,Ga,!1),ne(this,xr,"f").promise.catch(()=>{}),ne(this,xr,"f").reject(i),ge(this,xr,b1()),i}}setMessagesParams(n){typeof n=="function"?ne(this,Mt,"f").params=n(ne(this,Mt,"f").params):ne(this,Mt,"f").params=n,ge(this,Yr,!0),ge(this,Di,void 0)}async generateToolResponse(){const n=await ne(this,gn,"f")??this.params.messages.at(-1);return n?ne(this,Mo,"m",Fp).call(this,n):null}done(){return ne(this,xr,"f").promise}async runUntilDone(){if(!ne(this,Ga,"f"))for await(const n of this);return this.done()}get params(){return ne(this,Mt,"f").params}pushMessages(...n){this.setMessagesParams(i=>({...i,messages:[...i.messages,...n]}))}then(n,i){return this.runUntilDone().then(n,i)}}Fp=async function(n){return ne(this,Di,"f")!==void 0?ne(this,Di,"f"):(ge(this,Di,wz(ne(this,Mt,"f").params,n)),ne(this,Di,"f"))};async function wz(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 mf{constructor(n,i){this.iterator=n,this.controller=i}async*decoder(){const n=new ys;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 Te("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 Te("Attempted to iterate over a response with no body");return new mf(Mm(n.body),i)}}let $S=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",xs,{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 Te(`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)=>mf.fromResponse(f.response,f.controller))}};const v1={"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 gf=class extends Fn{constructor(){super(...arguments),this.batches=new $S(this._client)}create(n,i){const{betas:a,...o}=n;o.model in v1&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${v1[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=BS[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=>US(a,n,{logger:this._client.logger??console}))}stream(n,i){return $c.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 qS(this._client,n,i)}};gf.Batches=$S;gf.BetaToolRunner=qS;class VS extends Fn{create(n,i={},a){const{betas:o,...s}=i??{};return this._client.post(Ot`/v1/skills/${n}/versions?beta=true`,Am({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`,AS,{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 zm extends Fn{constructor(){super(...arguments),this.versions=new VS(this._client)}create(n={},i){const{betas:a,...o}=n??{};return this._client.post("/v1/skills?beta=true",Am({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",AS,{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])})}}zm.Versions=VS;class xl extends Fn{constructor(){super(...arguments),this.models=new HS(this._client),this.messages=new gf(this._client),this.files=new LS(this._client),this.skills=new zm(this._client)}}xl.Models=HS;xl.Messages=gf;xl.Files=LS;xl.Skills=zm;class PS 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 jn,br,zo,cc,jo,Do,fc,Ro,ji,Oo,dc,hc,Xr,pc,mc,rp,w1,ap,lp,op,sp,S1;const _1="__json_buf";function k1(e){return e.type==="tool_use"||e.type==="server_tool_use"}class Vc{constructor(){jn.add(this),this.messages=[],this.receivedMessages=[],br.set(this,void 0),this.controller=new AbortController,zo.set(this,void 0),cc.set(this,()=>{}),jo.set(this,()=>{}),Do.set(this,void 0),fc.set(this,()=>{}),Ro.set(this,()=>{}),ji.set(this,{}),Oo.set(this,!1),dc.set(this,!1),hc.set(this,!1),Xr.set(this,!1),pc.set(this,void 0),mc.set(this,void 0),ap.set(this,n=>{if(ge(this,dc,!0),as(n)&&(n=new Pn),n instanceof Pn)return ge(this,hc,!0),this._emit("abort",n);if(n instanceof Te)return this._emit("error",n);if(n instanceof Error){const i=new Te(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Te(String(n)))}),ge(this,zo,new Promise((n,i)=>{ge(this,cc,n,"f"),ge(this,jo,i,"f")})),ge(this,Do,new Promise((n,i)=>{ge(this,fc,n,"f"),ge(this,Ro,i,"f")})),ne(this,zo,"f").catch(()=>{}),ne(this,Do,"f").catch(()=>{})}get response(){return ne(this,pc,"f")}get request_id(){return ne(this,mc,"f")}async withResponse(){ge(this,Xr,!0);const n=await ne(this,zo,"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 Vc;return i._run(()=>i._fromReadableStream(n)),i}static createMessage(n,i,a){const o=new Vc;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,ap,"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,jn,"m",lp).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,jn,"m",op).call(this,h);if(f.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",sp).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(ge(this,pc,n),ge(this,mc,n?.headers.get("request-id")),ne(this,cc,"f").call(this,n),this._emit("connect"))}get ended(){return ne(this,Oo,"f")}get errored(){return ne(this,dc,"f")}get aborted(){return ne(this,hc,"f")}abort(){this.controller.abort()}on(n,i){return(ne(this,ji,"f")[n]||(ne(this,ji,"f")[n]=[])).push({listener:i}),this}off(n,i){const a=ne(this,ji,"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,ji,"f")[n]||(ne(this,ji,"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,Do,"f")}get currentMessage(){return ne(this,br,"f")}async finalMessage(){return await this.done(),ne(this,jn,"m",rp).call(this)}async finalText(){return await this.done(),ne(this,jn,"m",w1).call(this)}_emit(n,...i){if(ne(this,Oo,"f"))return;n==="end"&&(ge(this,Oo,!0),ne(this,fc,"f").call(this));const a=ne(this,ji,"f")[n];if(a&&(ne(this,ji,"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,jo,"f").call(this,o),ne(this,Ro,"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,jo,"f").call(this,o),ne(this,Ro,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,jn,"m",rp).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,jn,"m",lp).call(this),this._connected(null);const s=ni.fromReadableStream(n,this.controller);for await(const u of s)ne(this,jn,"m",op).call(this,u);if(s.controller.signal?.aborted)throw new Pn;ne(this,jn,"m",sp).call(this)}finally{a&&o&&a.removeEventListener("abort",o)}}[(br=new WeakMap,zo=new WeakMap,cc=new WeakMap,jo=new WeakMap,Do=new WeakMap,fc=new WeakMap,Ro=new WeakMap,ji=new WeakMap,Oo=new WeakMap,dc=new WeakMap,hc=new WeakMap,Xr=new WeakMap,pc=new WeakMap,mc=new WeakMap,ap=new WeakMap,jn=new WeakSet,rp=function(){if(this.receivedMessages.length===0)throw new Te("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},w1=function(){if(this.receivedMessages.length===0)throw new Te("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 Te("stream ended without producing a content block with type=text");return i.join(" ")},lp=function(){this.ended||ge(this,br,void 0)},op=function(i){if(this.ended)return;const a=ne(this,jn,"m",S1).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":{k1(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}}},sp=function(){if(this.ended)throw new Te("stream has ended, this shouldn't happen");const i=ne(this,br,"f");if(!i)throw new Te("request ended without sending any chunks");return ge(this,br,void 0),i},S1=function(i){let a=ne(this,br,"f");if(i.type==="message_start"){if(a)throw new Te(`Unexpected event order, got ${i.type} before receiving "message_stop"`);return i.message}if(!a)throw new Te(`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&&k1(o)){let s=o[_1]||"";s+=i.delta.partial_json;const u={...o};Object.defineProperty(u,_1,{value:s,enumerable:!1,writable:!0}),s&&(u.input=IS(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 YS 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",xs,{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 Te(`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)=>mf.fromResponse(s.response,s.controller))}}class jm extends Fn{constructor(){super(...arguments),this.batches=new YS(this._client)}create(n,i){n.model in E1&&console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${E1[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=BS[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 Vc.createMessage(this,n,i)}countTokens(n,i){return this._client.post("/v1/messages/count_tokens",{body:n,...i})}}const E1={"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"};jm.Batches=YS;class XS 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",xs,{query:o,...i,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},i?.headers])})}}var Sz={};const gc=e=>{if(typeof globalThis.process<"u")return Sz?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var Gp,Dm,Mc,FS;const _z="\\n\\nHuman:",kz="\\n\\nAssistant:";class kt{constructor({baseURL:n=gc("ANTHROPIC_BASE_URL"),apiKey:i=gc("ANTHROPIC_API_KEY")??null,authToken:a=gc("ANTHROPIC_AUTH_TOKEN")??null,...o}={}){Gp.add(this),Mc.set(this,void 0);const s={apiKey:i,authToken:a,...o,baseURL:n||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&V5())throw new Te(`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??Dm.DEFAULT_TIMEOUT,this.logger=s.logger??console;const u="warn";this.logLevel=u,this.logLevel=u1(s.logLevel,"ClientOptions.logLevel",this)??u1(gc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??G5(),ge(this,Mc,Q5),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 Te(`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 ${Ka}`}defaultIdempotencyKey(){return`stainless-node-retry-${pS()}`}makeStatusError(n,i,a,o){return qt.generate(n,i,a,o)}buildURL(n,i,a){const o=!ne(this,Gp,"m",FS).call(this)&&a||this.baseURL,s=B5(n)?new URL(n):new URL(o+(o.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),u=this.defaultQuery();return U5(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 Te("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 pf(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($p),w=Date.now();if(b instanceof globalThis.Error){const _=`retrying, ${i} attempts remaining`;if(o.signal?.aborted)throw new Pn;const D=as(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(i)return Yt(this).info(`[${d}] connection ${D?"timed out":"failed"} - ${_}`),Yt(this).debug(`[${d}] connection ${D?"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 ${D?"timed out":"failed"} - error; no more retries left`),Yt(this).debug(`[${d}] connection ${D?"timed out":"failed"} (error; no more retries left)`,Zr({retryOfRequestLogID:a,url:f,durationMs:w-m,message:b.message})),D?new mS:new hf({cause:b})}const E=[...b.headers.entries()].filter(([_])=>_==="request-id").map(([_,D])=>", "+_+": "+JSON.stringify(D)).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 Z5(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 D=_?"error; no more retries left":"error; not retryable";Yt(this).info(`${N} - ${D}`);const k=await b.text().catch(H=>$p(H).message),C=kS(k),L=C?void 0:k;throw Yt(this).debug(`[${d}] response error (${D})`,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 az(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 $5(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 Te("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&&q5("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))}:{},...F5(),...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:NS(n)}:ne(this,Mc,"f").call(this,{body:n,headers:a})}}Dm=kt,Mc=new WeakMap,Gp=new WeakSet,FS=function(){return this.baseURL!=="https://api.anthropic.com"};kt.Anthropic=Dm;kt.HUMAN_PROMPT=_z;kt.AI_PROMPT=kz;kt.DEFAULT_TIMEOUT=6e5;kt.AnthropicError=Te;kt.APIError=qt;kt.APIConnectionError=hf;kt.APIConnectionTimeoutError=mS;kt.APIUserAbortError=Pn;kt.NotFoundError=bS;kt.ConflictError=vS;kt.RateLimitError=SS;kt.BadRequestError=gS;kt.AuthenticationError=yS;kt.InternalServerError=_S;kt.PermissionDeniedError=xS;kt.UnprocessableEntityError=wS;kt.toFile=fz;class bs extends kt{constructor(){super(...arguments),this.completions=new PS(this),this.messages=new jm(this),this.models=new XS(this),this.beta=new xl(this)}}bs.Completions=PS;bs.Messages=jm;bs.Models=XS;bs.Beta=xl;let yc=null;function GS(){return yc||(yc=localStorage.getItem("claude_api_key"),yc)}async function Ez(e,n,i="sonnet"){const a=GS();if(!a)throw new Error("API key not set. Please configure your Claude API key.");const o=new bs({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 Nz(){return!!GS()}function Cz(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 Mz(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 Tz(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 Az(e,n,i){const a=e.data;if(!Nz())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 Ez(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 zz(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 jz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Executing command: /${a.commandName||"unnamed"}`,e.id);const o=`# Command Execution
|
|
71
|
-
|
|
72
|
-
Command: /${a.commandName||"command"}
|
|
73
|
-
Path: ${a.commandPath||"default"}
|
|
74
|
-
|
|
75
|
-
## Input
|
|
76
|
-
${n}
|
|
77
|
-
|
|
78
|
-
## Status
|
|
79
|
-
Command executed successfully. In production, this would run the actual slash command.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Command /${a.commandName||"unnamed"} completed`,e.id),o}async function Dz(e,n,i){const a=e.data;i.onNodeProgress(e.id,50),i.onLog("info",`Configuring hook: ${a.hookEvent||"PreToolUse"}`,e.id);const o=`# Hook Configuration
|
|
80
|
-
|
|
81
|
-
Event: ${a.hookEvent||"PreToolUse"}
|
|
82
|
-
Matcher: ${a.hookMatcher||"*"}
|
|
83
|
-
Command: ${a.hookCommand||'echo "Hook executed"'}
|
|
84
|
-
|
|
85
|
-
## Input
|
|
86
|
-
${n}
|
|
87
|
-
|
|
88
|
-
## Status
|
|
89
|
-
Hook configured successfully. In production, this would set up the actual hook.`;return i.onNodeProgress(e.id,100),i.onLog("success",`Hook ${a.hookEvent||"unnamed"} configured`,e.id),o}async function Rz(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
|
|
90
|
-
|
|
91
|
-
## Result
|
|
92
|
-
${n}
|
|
93
|
-
|
|
94
|
-
## Output Type
|
|
95
|
-
${a.outputType||"auto"}
|
|
96
|
-
|
|
97
|
-
## Generated at
|
|
98
|
-
${new Date().toISOString()}`;return i.onNodeProgress(e.id,100),i.onLog("success","Workflow completed successfully",e.id),o}async function Oz(e,n,i){const a={results:new Map,cancelled:!1},o=Cz(e,n);i.onLog("info",`Starting workflow execution with ${o.length} nodes`);for(const s of o){i.onNodeStart(s.id);try{const u=Mz(s.id,n,a.results);let f;switch(s.type){case"input":f=await Tz(s,i);break;case"subagent":f=await Az(s,u,i);break;case"skill":f=await zz(s,u,i);break;case"command":f=await jz(s,u,i);break;case"hook":f=await Dz(s,u,i);break;case"output":f=await Rz(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 ZS(){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}=gs(),[b,w]=Z.useState([]),E=Z.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),s(),w([]),m("info",`워크플로우 "${i}" 실행 시작...`);try{const D=await Oz(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 D){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(D){const k=D instanceof Error?D.message:"Unknown error";u(),m("error",`실행 오류: ${k}`)}},[e,n,i,m,x,s,u,a,f,h,d,g]),N=Z.useCallback((D,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=D,document.body.appendChild(A),A.click(),document.body.removeChild(A),URL.revokeObjectURL(L),m("info",`파일 다운로드: ${D}`)},[m]),_=Z.useCallback(()=>{b.forEach(D=>{N(D.name,D.content)})},[b,N]);return{isRunning:o,execute:E,generatedFiles:b,downloadFile:N,downloadAllFiles:_}}function Lz(e,n,i,a="local"){const o=a==="global"?"~/.claude":".claude",s=Hz(n,o),u=Bz(n,o),f=Uz(e,n,i,o),h=Iz(n);return{skills:s,commands:f,agents:u,mcpSettings:h}}function Hz(e,n){return e.filter(a=>a.type==="skill").filter(a=>a.data.skillType==="custom").map(a=>{const o=a.data,s=bl(o.skillId||o.label),u=`${n}/skills/${s}/SKILL.md`,f=qz(o);return{name:s,path:u,content:f}})}function Bz(e,n){return e.filter(a=>a.type==="subagent").map(a=>{const o=a.data,s=bl(o.label),u=`${n}/agents/${s}.md`,f=$z(o);return{name:s,path:u,content:f}})}function Uz(e,n,i,a){if(n.length===0)return[];const o=bl(e),s=`${a}/commands/${o}.md`,u=Vz(e,n,i);return[{name:o,path:s,content:u}]}function Iz(e){return e.filter(i=>i.type==="hook").length===0,null}function qz(e){if(e.skillContent)return e.skillContent;const n=bl(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(`
|
|
99
|
-
`)}function $z(e){const n=bl(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(`
|
|
100
|
-
`)}function Vz(e,n,i){const a=n.filter(g=>g.type==="input"),o=n.filter(g=>g.type==="output"),s=a.map(g=>`<${bl(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=Pz(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==="command"){const m=g.data;f.push(` - Command: /${m.commandName}`)}if(g.type==="hook"){const m=g.data;f.push(` - Hook: ${m.hookEvent} (${m.hookMatcher||"*"})`)}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(`
|
|
101
|
-
`)}function bl(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Pz(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 QS(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=QS(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=QS(e))&&(a&&(a+=" "),a+=n);return a}const KS="http://localhost:3001/api";async function Yz(e,n){const i=await fetch(`${KS}/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 Xz(){const e=await fetch(`${KS}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Fz(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 Gz({isOpen:e,onClose:n,config:i}){const[a,o]=Z.useState("local"),[s,u]=Z.useState(!0),[f,h]=Z.useState(!0),[d,g]=Z.useState(!0),[m,x]=Z.useState(!0),[b,w]=Z.useState(""),[E,N]=Z.useState([]),[_,D]=Z.useState(null),[k,C]=Z.useState(!1),[L,A]=Z.useState(null),[H,F]=Z.useState(null);Z.useEffect(()=>{e&&Xz().then(w).catch(()=>w("."))},[e]),Z.useEffect(()=>{if(!e)return;Fz(i,{location:a,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!_&&D(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 Yz(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(al,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(j3,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(ra,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(fS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(al,{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(rl,{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(Cm,{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(Wb,{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(Wb,{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:()=>D(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(O3,{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(Ip,{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(Ip,{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(rl,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}const Rm=df()(dS(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://api.anthropic.com",setApiMode:n=>e({apiMode:n}),setApiKey:n=>e({apiKey:n}),setProxyUrl:n=>e({proxyUrl:n})}),{name:"makecc-settings"}));function Zz({isOpen:e,onClose:n}){const{apiMode:i,apiKey:a,proxyUrl:o,setApiMode:s,setApiKey:u,setProxyUrl:f}=Rm(),[h,d]=Z.useState(i),[g,m]=Z.useState(a),[x,b]=Z.useState(o),[w,E]=Z.useState(!1);if(Z.useEffect(()=>{e&&(d(i),m(a),b(o))},[e,i,a,o]),!e)return null;const N=async()=>{if(s(h),u(g),f(x),h==="direct"&&g)try{(await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:g})})).ok||console.error("Failed to save API key to .env")}catch(_){console.error("Failed to save API key:",_)}n()};return v.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),v.jsx("button",{onClick:n,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(Cm,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"p-6 space-y-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:`
|
|
102
|
-
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
103
|
-
${h==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
104
|
-
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:h==="proxy",onChange:()=>d("proxy"),className:"sr-only"}),v.jsx(x5,{className:`w-5 h-5 ${h==="proxy"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${h==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),v.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),h==="proxy"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),v.jsxs("label",{className:`
|
|
105
|
-
flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
|
|
106
|
-
${h==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
|
|
107
|
-
`,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),v.jsx(i5,{className:`w-5 h-5 ${h==="direct"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${h==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),v.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),h==="direct"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),h==="proxy"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),v.jsx("input",{type:"text",value:x,onChange:_=>b(_.target.value),placeholder:"https://your-proxy-server.com",className:"w-full px-4 py-2.5 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),h==="direct"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:w?"text":"password",value:g,onChange:_=>m(_.target.value),placeholder:"sk-ant-...",className:"w-full px-4 py-2.5 pr-10 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),v.jsx("button",{type:"button",onClick:()=>E(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:w?v.jsx(F3,{className:"w-4 h-4"}):v.jsx(sS,{className:"w-4 h-4"})})]}),v.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),v.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[v.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),v.jsx("button",{onClick:N,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function Qz(){const{workflowName:e,setWorkflowName:n,isDraft:i,nodes:a,edges:o,clearWorkflow:s}=Hi(),{isRunning:u,execute:f}=ZS(),[h,d]=Z.useState(!1),[g,m]=Z.useState(!1),[x,b]=Z.useState(null),w=()=>{const D=Lz(e,a,o,"local");b(D),d(!0)},E=()=>{d(!1),b(null)},N=()=>{u||f()},_=()=>{a.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&s()};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(A3,{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:D=>n(D.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:N,disabled:u,className:`
|
|
108
|
-
flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
|
|
109
|
-
${u?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
|
|
110
|
-
`,children:[v.jsx(Nm,{className:"w-4 h-4"}),u?"Running...":"Run"]}),v.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[v.jsx(rl,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),v.jsxs("button",{onClick:_,disabled:a.length===0,className:`
|
|
111
|
-
flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
|
|
112
|
-
${a.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
|
|
113
|
-
`,title:"모든 노드 삭제",children:[v.jsx(cf,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(p5,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{onClick:()=>m(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:v.jsx(fS,{className:"w-5 h-5 text-gray-400"})})]}),x&&v.jsx(Gz,{isOpen:h,onClose:E,config:x}),v.jsx(Zz,{isOpen:g,onClose:()=>m(!1)})]})}function yf(e){const n={id:e.id,type:e.type,label:e.data.label,description:e.data.description};switch(e.type){case"skill":return{...n,skillId:e.data.skillId,skillPath:e.data.skillPath};case"subagent":return{...n,tools:e.data.tools,model:e.data.model,skills:e.data.skills,systemPrompt:e.data.systemPrompt};case"command":return{...n,commandName:e.data.commandName,commandContent:e.data.commandContent};case"hook":return{...n,hookEvent:e.data.hookEvent,hookMatcher:e.data.hookMatcher,hookCommand:e.data.hookCommand};default:return n}}async function JS(e){if(e.type==="input"||e.type==="output")return!0;try{const n=await fetch("/api/sync/node",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:yf(e)})});return n.ok?!0:(console.error("Failed to sync node:",await n.text()),!1)}catch(n){return console.error("Failed to sync node:",n),!1}}async function WS(e){if(e.type==="input"||e.type==="output")return!0;try{const n=await fetch("/api/sync/node",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:yf(e)})});return n.ok?!0:(console.error("Failed to delete node:",await n.text()),!1)}catch(n){return console.error("Failed to delete node:",n),!1}}async function Kz(e,n){const i=n.find(o=>o.id===e.source),a=n.find(o=>o.id===e.target);if(!i||!a||(i.type==="input"||i.type==="output")&&(a.type==="input"||a.type==="output"))return!0;try{const o=await fetch("/api/sync/edge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:i.type,targetType:a.type},nodes:n.map(yf)})});return o.ok?!0:(console.error("Failed to sync edge:",await o.text()),!1)}catch(o){return console.error("Failed to sync edge:",o),!1}}async function Jz(e,n){const i=n.find(o=>o.id===e.source),a=n.find(o=>o.id===e.target);if(!i||!a)return!0;try{const o=await fetch("/api/sync/edge",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:i.type,targetType:a.type},nodes:n.map(yf)})});return o.ok?!0:(console.error("Failed to remove edge:",await o.text()),!1)}catch(o){return console.error("Failed to remove edge:",o),!1}}const Wz=[{type:"input",label:"User Input",icon:v.jsx(uf,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:v.jsx(ms,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:v.jsx(ff,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"command",label:"Command",icon:v.jsx(ra,{className:"w-4 h-4"}),color:"text-orange-400",hoverColor:"hover:bg-orange-500/10"},{type:"hook",label:"Hook",icon:v.jsx(km,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:v.jsx(sf,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function ej(e){const n=gl(),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"command":return{id:n,type:"command",position:i,data:{label:"Command",description:"Execute a slash command...",commandName:"",status:"idle",usedInputs:[]}};case"hook":return{id:n,type:"hook",position:i,data:{label:"Hook",description:"Configure tool lifecycle hook...",hookEvent:"PreToolUse",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 tj(){const e=Hi(i=>i.addNode),n=i=>{const a=ej(i);e(a),JS(a).catch(o=>{console.error("Failed to sync node to filesystem:",o)})};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:Wz.map(i=>v.jsxs("button",{onClick:()=>n(i.type),className:`
|
|
114
|
-
flex items-center gap-2 px-4 py-2 rounded-lg
|
|
115
|
-
bg-surface border border-border
|
|
116
|
-
${i.hoverColor}
|
|
117
|
-
transition-all duration-200
|
|
118
|
-
hover:border-gray-500
|
|
119
|
-
`,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 nj({status:e}){switch(e){case"running":return v.jsx(cS,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(V3,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(Ip,{className:"w-4 h-4 text-red-400"});default:return v.jsx(Nm,{className:"w-4 h-4"})}}function ij({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(nj,{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(ml,{type:"target",position:be.Left}),s&&v.jsx(ml,{type:"source",position:be.Right})]})}const vl=Z.memo(ij);function rj({data:e,selected:n}){return v.jsx(vl,{data:e,selected:n,headerIcon:v.jsx(uf,{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 aj=Z.memo(rj);function lj({data:e,selected:n}){return v.jsx(vl,{data:e,selected:n,headerIcon:v.jsx(ms,{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 oj=Z.memo(lj);function sj({data:e,selected:n}){return v.jsx(vl,{data:e,selected:n,headerIcon:v.jsx(ff,{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 uj=Z.memo(sj);function cj({data:e,selected:n}){return v.jsx(vl,{data:e,selected:n,headerIcon:v.jsx(ra,{className:"w-4 h-4 text-orange-100"}),headerColor:"bg-gradient-to-br from-orange-500 to-orange-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.commandName&&v.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-orange-900/50 text-orange-300 rounded",children:["/",e.commandName]}),e.commandPath&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.commandPath})]})})}const fj=Z.memo(cj);function dj({data:e,selected:n}){return v.jsx(vl,{data:e,selected:n,headerIcon:v.jsx(km,{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.hookEvent&&v.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.hookEvent}),e.hookMatcher&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const hj=Z.memo(dj);function pj(e){switch(e){case"markdown":case"document":return v.jsx(al,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(uS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(J3,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(a5,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(sf,{className:"w-4 h-4 text-emerald-100"})}}function mj({data:e,selected:n}){return v.jsx(vl,{data:e,selected:n,headerIcon:pj(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 gj=Z.memo(mj),Om=df(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 yj(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 xj={input:aj,subagent:oj,skill:uj,command:fj,hook:hj,output:gj};function bj(){const{nodes:e,edges:n,setNodes:i,setEdges:a,addEdge:o,setSelectedNode:s}=Hi(),u=Om(x=>x.openStepPanel),f=Z.useCallback(x=>{for(const b of x)if(b.type==="remove"){const w=e.find(E=>E.id===b.id);w&&WS(w).catch(E=>{console.error("Failed to delete node from filesystem:",E)})}i(Aw(x,e))},[e,i]),h=Z.useCallback(x=>{for(const b of x)if(b.type==="remove"){const w=n.find(E=>E.id===b.id);w&&Jz(w,e).catch(E=>{console.error("Failed to remove edge from filesystem:",E)})}a(zw(x,n))},[n,e,a]),d=Z.useCallback(x=>{if(!yj(x,e))return;const b={id:`e-${x.source}-${x.target}`,source:x.source,target:x.target,animated:!0};a(fw({...x,animated:!0},n)),o(b),Kz(b,e).catch(w=>{console.error("Failed to sync edge to filesystem:",w)})},[e,n,a,o]),g=Z.useCallback((x,b)=>{s(b.id),u()},[s,u]),m=Z.useCallback(()=>{s(null)},[s]);return v.jsxs(GA,{nodes:e,edges:n,onNodesChange:f,onEdgesChange:h,onConnect:d,onNodeClick:g,onPaneClick:m,nodeTypes:xj,defaultViewport:{x:100,y:100,zoom:.7},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,children:[v.jsx(WA,{variant:Oi.Dots,gap:20,size:1,color:"#333333"}),v.jsx(l3,{}),v.jsx(b3,{nodeColor:x=>{switch(x.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"command":return"#f97316";case"hook":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]})}function vj(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const wj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_j={};function N1(e,n){return(_j.jsx?Sj:wj).test(e)}const kj=/[ \t\n\f\r]/g;function Ej(e){return typeof e=="object"?e.type==="text"?C1(e.value):!1:C1(e)}function C1(e){return e.replace(kj,"")===""}class vs{constructor(n,i,a){this.normal=i,this.property=n,a&&(this.space=a)}}vs.prototype.normal={};vs.prototype.property={};vs.prototype.space=void 0;function e2(e,n){const i={},a={};for(const o of e)Object.assign(i,o.property),Object.assign(a,o.normal);return new vs(i,a,n)}function Zp(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 Nj=0;const je=aa(),St=aa(),Qp=aa(),de=aa(),at=aa(),ol=aa(),bn=aa();function aa(){return 2**++Nj}const Kp=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:St,commaOrSpaceSeparated:bn,commaSeparated:ol,number:de,overloadedBoolean:Qp,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),up=Object.keys(Kp);class Lm extends ln{constructor(n,i,a,o){let s=-1;if(super(n,i),M1(this,"space",o),typeof a=="number")for(;++s<up.length;){const u=up[s];M1(this,up[s],(a&Kp[u])===Kp[u])}}}Lm.prototype.defined=!0;function M1(e,n,i){i&&(e[n]=i)}function wl(e){const n={},i={};for(const[a,o]of Object.entries(e.properties)){const s=new Lm(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(s.mustUseProperty=!0),n[a]=s,i[Zp(a)]=a,i[Zp(s.attribute)]=a}return new vs(n,i,e.space)}const t2=wl({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 n2(e,n){return n in e?e[n]:n}function i2(e,n){return n2(e,n.toLowerCase())}const Cj=wl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ol,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:at,autoFocus:je,autoPlay:je,blocking:at,capture:null,charSet:null,checked:je,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:St,controls:je,controlsList:at,coords:de|ol,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Qp,draggable:St,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:at,height:de,hidden:Qp,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:at,itemRef:at,itemScope:je,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:at,required:je,reversed:je,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,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:je,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:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:je,noHref:je,noShade:je,noWrap:je,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:je,disableRemotePlayback:je,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:i2}),Mj=wl({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:je,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:ol,g2:ol,glyphName:ol,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:n2}),r2=wl({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()}}),a2=wl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:i2}),l2=wl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Tj={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"},Aj=/[A-Z]/g,T1=/-[a-z]/g,zj=/^data[-\w.:]+$/i;function jj(e,n){const i=Zp(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"&&zj.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(T1,Rj);a="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!T1.test(s)){let u=s.replace(Aj,Dj);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=Lm}return new o(a,n)}function Dj(e){return"-"+e.toLowerCase()}function Rj(e){return e.charAt(1).toUpperCase()}const Oj=e2([t2,Cj,r2,a2,l2],"html"),Hm=e2([t2,Mj,r2,a2,l2],"svg");function Lj(e){return e.join(" ").trim()}var Za={},cp,A1;function Hj(){if(A1)return cp;A1=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=`
|
|
120
|
-
`,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 D=1,k=1;function C(O){var B=O.match(n);B&&(D+=B.length);var j=O.lastIndexOf(h);k=~j?O.length-j:k+O.length}function L(){var O={line:D,column:k};return function(B){return B.position=new A(O),G(),B}}function A(O){this.start=O,this.end={line:D,column:k},this.source=_.source}A.prototype.content=N;function H(O){var B=new Error(_.source+":"+D+":"+k+": "+O);if(B.reason=O,B.filename=_.source,B.line=D,B.column=k,B.source=N,!_.silent)throw B}function F(O){var B=O.exec(N);if(B){var j=B[0];return C(j),N=N.slice(j.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 j=N.slice(2,B-2);return k+=2,C(j),N=N.slice(B),k+=2,O({type:x,comment:j})}}function P(){var O=L(),B=F(a);if(B){if(V(),!F(o))return H("property missing ':'");var j=F(s),U=O({type:b,property:E(B[0].replace(e,m)),value:j?E(j[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 cp=w,cp}var z1;function Bj(){if(z1)return Za;z1=1;var e=Za&&Za.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=i;const n=e(Hj());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 Za}var Lo={},j1;function Uj(){if(j1)return Lo;j1=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.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 Lo.camelCase=h,Lo}var Ho,D1;function Ij(){if(D1)return Ho;D1=1;var e=Ho&&Ho.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(Bj()),i=Uj();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,Ho=a,Ho}var qj=Ij();const $j=Gc(qj),o2=s2("end"),Bm=s2("start");function s2(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 Vj(e){const n=Bm(e),i=o2(e);if(n&&i)return{start:n,end:i}}function Fo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?R1(e.position):"start"in e||"end"in e?R1(e):"line"in e||"column"in e?Jp(e):""}function Jp(e){return O1(e&&e.line)+":"+O1(e&&e.column)}function R1(e){return Jp(e&&e.start)+"-"+Jp(e&&e.end)}function O1(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=Fo(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 Um={}.hasOwnProperty,Pj=new Map,Yj=/[A-Z]/g,Xj=new Set(["table","tbody","thead","tfoot","tr"]),Fj=new Set(["td","th"]),u2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gj(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=nD(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=tD(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"?Hm:Oj,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=c2(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function c2(e,n,i){if(n.type==="element")return Zj(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Qj(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Jj(e,n,i);if(n.type==="mdxjsEsm")return Kj(e,n);if(n.type==="root")return Wj(e,n,i);if(n.type==="text")return eD(e,n)}function Zj(e,n,i){const a=e.schema;let o=a;n.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Hm,e.schema=o),e.ancestors.push(n);const s=d2(e,n.tagName,!1),u=iD(e,n);let f=qm(e,n);return Xj.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!Ej(h):!0})),f2(e,u,s,n),Im(u,f),e.ancestors.pop(),e.schema=a,e.create(n,s,u,i)}function Qj(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)}ls(e,n.position)}function Kj(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ls(e,n.position)}function Jj(e,n,i){const a=e.schema;let o=a;n.name==="svg"&&a.space==="html"&&(o=Hm,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:d2(e,n.name,!0),u=rD(e,n),f=qm(e,n);return f2(e,u,s,n),Im(u,f),e.ancestors.pop(),e.schema=a,e.create(n,s,u,i)}function Wj(e,n,i){const a={};return Im(a,qm(e,n)),e.create(n,e.Fragment,a,i)}function eD(e,n){return n.value}function f2(e,n,i,a){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=a)}function Im(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function tD(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 nD(e,n){return i;function i(a,o,s,u){const f=Array.isArray(s.children),h=Bm(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 iD(e,n){const i={};let a,o;for(o in n.properties)if(o!=="children"&&Um.call(n.properties,o)){const s=aD(e,o,n.properties[o]);if(s){const[u,f]=s;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&Fj.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 rD(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 ls(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 ls(e,n.position);else s=a.value===null?!0:a.value;i[o]=s}return i}function qm(e,n){const i=[];let a=-1;const o=e.passKeys?new Map:Pj;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=c2(e,s,u);f!==void 0&&i.push(f)}return i}function aD(e,n,i){const a=jj(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=a.commaSeparated?vj(i):Lj(i)),a.property==="style"){let o=typeof i=="object"?i:lD(e,String(i));return e.stylePropertyNameCase==="css"&&(o=oD(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?Tj[a.property]||a.property:a.attribute,i]}}function lD(e,n){try{return $j(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=u2+"#cannot-parse-style-attribute",o}}function d2(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=N1(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=N1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(a.type==="Literal"){const o=a.value;return Um.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);ls(e)}function ls(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=u2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function oD(e){const n={};let i;for(i in e)Um.call(e,i)&&(n[sD(i)]=e[i]);return n}function sD(e){let n=e.replace(Yj,uD);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function uD(e){return"-"+e.toLowerCase()}const fp={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"]},cD={};function $m(e,n){const i=cD,a=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return h2(e,a,o)}function h2(e,n,i){if(fD(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 L1(e.children,n,i)}return Array.isArray(e)?L1(e,n,i):""}function L1(e,n,i){const a=[];let o=-1;for(;++o<e.length;)a[o]=h2(e[o],n,i);return a.join("")}function fD(e){return!!(e&&typeof e=="object")}const H1=document.createElement("i");function Vm(e){const n="&"+e+";";H1.innerHTML=n;const i=H1.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 Dn(e,n){return e.length>0?(wn(e,e.length,0,n),e):n}const B1={}.hasOwnProperty;function p2(e){const n={};let i=-1;for(;++i<e.length;)dD(n,e[i]);return n}function dD(e,n){let i;for(i in n){const o=(B1.call(e,i)?e[i]:void 0)||(e[i]={}),s=n[i];let u;if(s)for(u in s){B1.call(o,u)||(o[u]=[]);const f=s[u];hD(o[u],Array.isArray(f)?f:f?[f]:[])}}}function hD(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 m2(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]/),pD=Sr(/[#-'*+\--9=?A-Z^-~]/);function Pc(e){return e!==null&&(e<32||e===127)}const Wp=Sr(/\d/),mD=Sr(/[\dA-Fa-f]/),gD=Sr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const xf=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 Sl(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 Be(h)?(e.enter(i),f(h)):n(h)}function f(h){return Be(h)&&s++<o?(e.consume(h),f):(e.exit(i),n(h))}}const yD={tokenize:xD};function xD(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 bD={tokenize:vD},U1={tokenize:wD};function vD(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&&D();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(U1,g,m)(k)}function g(k){return o&&D(),_(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(U1,b,w)(k)}function b(k){return a++,i.push([n.currentConstruct,n.containerState]),x(k)}function w(k){if(k===null){o&&D(),_(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 D(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function wD(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 yl(e){if(e===null||rt(e)||ia(e))return 1;if(xf(e))return 2}function bf(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 em={name:"attention",resolveAll:SD,tokenize:_D};function SD(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};I1(m,-h),I1(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=Dn(d,[["enter",e[a][1],n],["exit",e[a][1],n]])),d=Dn(d,[["enter",o,n],["enter",u,n],["exit",u,n],["enter",s,n]]),d=Dn(d,bf(n.parser.constructs.insideSpan.null,e.slice(a+1,i),n)),d=Dn(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=Dn(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 _D(e,n){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,o=yl(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=yl(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 I1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const kD={name:"autolink",tokenize:ED};function ED(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||Pc(b)?i(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),g):pD(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 ws={partial:!0,tokenize:ND};function ND(e,n,i){return a;function a(s){return Be(s)?Pe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Se(s)?n(s):i(s)}}const g2={continuation:{tokenize:MD},exit:TD,name:"blockQuote",tokenize:CD};function CD(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 Be(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function MD(e,n,i){const a=this;return o;function o(u){return Be(u)?Pe(e,s,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(g2,n,i)(u)}}function TD(e){e.exit("blockQuote")}const y2={name:"characterEscape",tokenize:AD};function AD(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 gD(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(s)}}const x2={name:"characterReference",tokenize:zD};function zD(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=mD,g):(e.enter("characterReferenceValue"),s=7,u=Wp,g(m))}function g(m){if(m===59&&o){const x=e.exit("characterReferenceValue");return u===It&&!Vm(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 q1={partial:!0,tokenize:DD},$1={concrete:!0,name:"codeFenced",tokenize:jD};function jD(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"),Be(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(q1,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)):Be(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&&Be(A)?Pe(e,D,"linePrefix",s+1)(A):D(A)}function D(A){return A===null||Se(A)?e.check(q1,E,C)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||Se(A)?(e.exit("codeFlowValue"),D(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"),Be(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"),Be(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 DD(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 dp={name:"codeIndented",tokenize:OD},RD={partial:!0,tokenize:LD};function OD(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(RD,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 LD(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 HD={name:"codeText",previous:UD,resolve:BD,tokenize:ID};function BD(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 UD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ID(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 qD{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&&Bo(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),Bo(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Bo(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);Bo(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Bo(this.left,i.reverse())}}}function Bo(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 b2(e){const n={};let i=-1,a,o,s,u,f,h,d;const g=new qD(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,$D(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 $D(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]),D=s.pop();h.push([D,D+_.length-1]),e.splice(D,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 VD={resolve:YD,tokenize:XD},PD={partial:!0,tokenize:FD};function YD(e){return b2(e),e}function XD(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(PD,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 FD(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 v2(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||Pc(_)?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||Pc(_)?i(_):(e.consume(_),_===92?N:E)}function N(_){return _===40||_===41||_===92?(e.consume(_),E):E(_)}}function w2(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=!Be(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function S2(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 Go(e,n){let i;return a;function a(o){return Se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,a):Be(o)?Pe(e,a,i?"linePrefix":"lineSuffix")(o):n(o)}}const GD={name:"definition",tokenize:QD},ZD={partial:!0,tokenize:KD};function QD(e,n,i){const a=this;let o;return s;function s(b){return e.enter("definition"),u(b)}function u(b){return w2.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)?Go(e,d)(b):d(b)}function d(b){return v2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(ZD,m,m)(b)}function m(b){return Be(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 KD(e,n,i){return a;function a(f){return rt(f)?Go(e,o)(f):i(f)}function o(f){return S2(e,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return Be(f)?Pe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?n(f):i(f)}}const JD={name:"hardBreakEscape",tokenize:WD};function WD(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 eR={name:"headingAtx",resolve:tR,tokenize:nR};function tR(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 nR(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)):Be(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 iR=["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"],V1=["pre","script","style","textarea"],rR={concrete:!0,name:"htmlFlow",resolveTo:oR,tokenize:sR},aR={partial:!0,tokenize:cR},lR={partial:!0,tokenize:uR};function oR(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 sR(e,n,i){const a=this;let o,s,u,f,h;return d;function d(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),x):T===47?(e.consume(T),s=!0,E):T===63?(e.consume(T),o=3,a.interrupt?n:z):Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function x(T){return T===45?(e.consume(T),o=2,b):T===91?(e.consume(T),o=5,f=0,w):Ft(T)?(e.consume(T),o=4,a.interrupt?n:z):i(T)}function b(T){return T===45?(e.consume(T),a.interrupt?n:z):i(T)}function w(T){const ie="CDATA[";return T===ie.charCodeAt(f++)?(e.consume(T),f===ie.length?a.interrupt?n:P:w):i(T)}function E(T){return Ft(T)?(e.consume(T),u=String.fromCharCode(T),N):i(T)}function N(T){if(T===null||T===47||T===62||rt(T)){const ie=T===47,ce=u.toLowerCase();return!ie&&!s&&V1.includes(ce)?(o=1,a.interrupt?n(T):P(T)):iR.includes(u.toLowerCase())?(o=6,ie?(e.consume(T),_):a.interrupt?n(T):P(T)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(T):s?D(T):k(T))}return T===45||It(T)?(e.consume(T),u+=String.fromCharCode(T),N):i(T)}function _(T){return T===62?(e.consume(T),a.interrupt?n:P):i(T)}function D(T){return Be(T)?(e.consume(T),D):q(T)}function k(T){return T===47?(e.consume(T),q):T===58||T===95||Ft(T)?(e.consume(T),C):Be(T)?(e.consume(T),k):q(T)}function C(T){return T===45||T===46||T===58||T===95||It(T)?(e.consume(T),C):L(T)}function L(T){return T===61?(e.consume(T),A):Be(T)?(e.consume(T),L):k(T)}function A(T){return T===null||T===60||T===61||T===62||T===96?i(T):T===34||T===39?(e.consume(T),h=T,H):Be(T)?(e.consume(T),A):F(T)}function H(T){return T===h?(e.consume(T),h=null,G):T===null||Se(T)?i(T):(e.consume(T),H)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||rt(T)?L(T):(e.consume(T),F)}function G(T){return T===47||T===62||Be(T)?k(T):i(T)}function q(T){return T===62?(e.consume(T),V):i(T)}function V(T){return T===null||Se(T)?P(T):Be(T)?(e.consume(T),V):i(T)}function P(T){return T===45&&o===2?(e.consume(T),j):T===60&&o===1?(e.consume(T),U):T===62&&o===4?(e.consume(T),R):T===63&&o===3?(e.consume(T),z):T===93&&o===5?(e.consume(T),K):Se(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(aR,$,te)(T)):T===null||Se(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),P)}function te(T){return e.check(lR,O,$)(T)}function O(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return T===null||Se(T)?te(T):(e.enter("htmlFlowData"),P(T))}function j(T){return T===45?(e.consume(T),z):P(T)}function U(T){return T===47?(e.consume(T),u="",Y):P(T)}function Y(T){if(T===62){const ie=u.toLowerCase();return V1.includes(ie)?(e.consume(T),R):P(T)}return Ft(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),Y):P(T)}function K(T){return T===93?(e.consume(T),z):P(T)}function z(T){return T===62?(e.consume(T),R):T===45&&o===2?(e.consume(T),z):P(T)}function R(T){return T===null||Se(T)?(e.exit("htmlFlowData"),$(T)):(e.consume(T),R)}function $(T){return e.exit("htmlFlow"),n(T)}}function uR(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 cR(e,n,i){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ws,n,i)}}const fR={name:"htmlText",tokenize:dR};function dR(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),D):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?j(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?j(z):z===93?(e.consume(z),_):E(z)}function D(z){return z===null||z===62?j(z):Se(z)?(u=D,U(z)):(e.consume(z),D)}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?j(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)):Be(z)?(e.consume(z),H):j(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),j):z===58||z===95||Ft(z)?(e.consume(z),q):Se(z)?(u=G,U(z)):Be(z)?(e.consume(z),G):j(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)):Be(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)):Be(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 j(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 Be(z)?Pe(e,K,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):K(z)}function K(z){return e.enter("htmlTextData"),u(z)}}const Pm={name:"labelEnd",resolveAll:gR,resolveTo:yR,tokenize:xR},hR={tokenize:bR},pR={tokenize:vR},mR={tokenize:wR};function gR(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 yR(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=Dn(f,e.slice(s+1,s+a+3)),f=Dn(f,[["enter",g,n]]),f=Dn(f,bf(n.parser.constructs.insideSpan.null,e.slice(s+a+4,u-3),n)),f=Dn(f,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),f=Dn(f,e.slice(u+1)),f=Dn(f,[["exit",h,n]]),wn(e,s,e.length,f),e}function xR(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(hR,g,u?g:m)(x):x===91?e.attempt(pR,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(mR,g,m)(x)}function g(x){return n(x)}function m(x){return s._balanced=!0,i(x)}}function bR(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)?Go(e,s)(m):s(m)}function s(m){return m===41?g(m):v2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return rt(m)?Go(e,h)(m):g(m)}function f(m){return i(m)}function h(m){return m===34||m===39||m===40?S2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return rt(m)?Go(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 vR(e,n,i){const a=this;return o;function o(f){return w2.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 wR(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:Pm.resolveAll,tokenize:_R};function _R(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 kR={name:"labelStartLink",resolveAll:Pm.resolveAll,tokenize:ER};function ER(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 hp={name:"lineEnding",tokenize:NR};function NR(e,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pe(e,n,"linePrefix")}}const Tc={name:"thematicBreak",tokenize:CR};function CR(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"),Be(d)?Pe(e,f,"whitespace")(d):f(d))}}const rn={continuation:{tokenize:zR},exit:DR,name:"list",tokenize:AR},MR={partial:!0,tokenize:RR},TR={partial:!0,tokenize:jR};function AR(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:Wp(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(Tc,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 Wp(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(ws,a.interrupt?i:g,e.attempt(MR,x,m))}function g(b){return a.containerState.initialBlankLine=!0,s++,x(b)}function m(b){return Be(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 zR(e,n,i){const a=this;return a.containerState._closeFlow=void 0,e.check(ws,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||!Be(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(TR,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 jR(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 DR(e){e.exit(this.containerState.type)}function RR(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!Be(s)&&u&&u[1].type==="listItemPrefixWhitespace"?n(s):i(s)}}const P1={name:"setextUnderline",resolveTo:OR,tokenize:LR};function OR(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 LR(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"),Be(d)?Pe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const HR={tokenize:BR};function BR(e){const n=this,i=e.attempt(ws,a,e.attempt(this.parser.constructs.flowInitial,o,Pe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(VD,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 UR={resolveAll:k2()},IR=_2("string"),qR=_2("text");function _2(e){return{resolveAll:k2(e==="text"?$R: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 k2(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 $R(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 VR={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:g2},PR={91:GD},YR={[-2]:dp,[-1]:dp,32:dp},XR={35:eR,42:Tc,45:[P1,Tc],60:rR,61:P1,95:Tc,96:$1,126:$1},FR={38:x2,92:y2},GR={[-5]:hp,[-4]:hp,[-3]:hp,33:SR,38:x2,42:em,60:[kD,fR],91:kR,92:[JD,y2],93:Pm,95:em,96:HD},ZR={null:[em,UR]},QR={null:[42,95]},KR={null:[]},JR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:QR,contentInitial:PR,disable:KR,document:VR,flow:XR,flowInitial:YR,insideSpan:ZR,string:FR,text:GR},Symbol.toStringTag,{value:"Module"}));function WR(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:D,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=Dn(u,V),N(),u[u.length-1]!==null?[]:(F(n,0),d.events=bf(s,d.events,d),d.events)}function x(V,P){return tO(b(V),P)}function b(V){return eO(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 D(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,j){let U,Y,K,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?j:T(fe[Y])}function T(fe){return he;function he(ue){return z=G(),K=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(K,z),B}function ce(fe){return z.restore(),++Y<U.length?T(U[Y]):j}}}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:j};function j(){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 eO(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 tO(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=`
|
|
121
|
-
`;break}case-3:{u=`\r
|
|
122
|
-
`;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 nO(e){const a={constructs:p2([JR,...(e||{}).extensions||[]]),content:o(yD),defined:[],document:o(bD),flow:o(HR),lazy:{},string:o(IR),text:o(qR)};return a;function o(s){return u;function u(f){return WR(a,s,f)}}}function iO(e){for(;!b2(e););return e}const Y1=/[\0\t\n\r]/g;function rO(){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(Y1.lastIndex=m,d=Y1.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 aO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lO(e){return e.replace(aO,oO)}function oO(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),s=o===120||o===88;return m2(i.slice(s?2:1),s?16:10)}return Vm(i)||e}const E2={}.hasOwnProperty;function sO(e,n,i){return typeof n!="string"&&(i=n,n=void 0),uO(i)(iO(nO(i).document().write(rO()(e,n,!0))))}function uO(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:T,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:D,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(te),htmlFlowData:q,htmlText:h(O),htmlTextData:q,image:h(U),label:K,labelText:Y,lineEnding:V,link:h(j),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()}};N2(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},De=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")De.push($e);else{const Vt=De.pop();$e=o(ae,Vt,$e)}for($e=-1;++$e<ae.length;){const Vt=n[ae[$e][0]];E2.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]||X1).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 De=pe-1,$e=-1,Vt=!1,On,At,pt,Ht;for(;++De<=_e;){const Ke=ae[De];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=De),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=De;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||De,0,["exit",On,Ke[2]]),De++,_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(De,0,["enter",Gn,Ke[2]]),De++,_e++,pt=void 0,Ht=!0}}}return ae[pe][1]._spread=Vt,_e}function s(ae,pe){return _e;function _e(De){f.call(this,ae(De),De),pe&&pe.call(this,De)}}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(),De=this.tokenStack.pop();if(De)De[0].type!==ae.type&&(pe?pe.call(this,ae,De[0]):(De[1]||X1).call(this,ae,De[0]));else throw new Error("Cannot close `"+ae.type+"` ("+Fo({start:ae.start,end:ae.end})+"): it’s not open");_e.position.end=vr(ae.end)}function g(){return $m(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 D(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 De=_e[_e.length-1];(!De||De.type!=="text")&&(De=Et(),De.position={start:vr(ae.start),end:void 0},_e.push(De)),this.stack.push(De)}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 j(){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=lO(pe),_e.identifier=Yn(pe).toLowerCase()}function K(){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 De=ae.children;_e.children=De}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 T(){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 De;_e?(De=m2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Vm(pe);const $e=this.stack[this.stack.length-1];$e.value+=De}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 N2(e,n){let i=-1;for(;++i<n.length;){const a=n[i];Array.isArray(a)?N2(e,a):cO(e,a)}}function cO(e,n){let i;for(i in n)if(E2.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 X1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Fo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Fo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Fo({start:n.start,end:n.end})+") is still open")}function fO(e){const n=this;n.parser=i;function i(a){return sO(a,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function dO(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 hO(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
|
|
123
|
-
`}]}function pO(e,n){const i=n.value?n.value+`
|
|
124
|
-
`:"",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 mO(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function gO(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function yO(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(n.identifier).toUpperCase(),o=Sl(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 xO(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 bO(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function C2(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 vO(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return C2(e,n);const o={src:Sl(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 wO(e,n){const i={src:Sl(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 _O(e,n){const i=String(n.identifier).toUpperCase(),a=e.definitionById.get(i);if(!a)return C2(e,n);const o={href:Sl(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 kO(e,n){const i={href:Sl(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 EO(e,n,i){const a=e.all(n),o=i?NO(i):M2(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:`
|
|
125
|
-
`}),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:`
|
|
126
|
-
`});const d={type:"element",tagName:"li",properties:s,children:u};return e.patch(n,d),e.applyData(n,d)}function NO(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=M2(i[a])}return n}function M2(e){const n=e.spread;return n??e.children.length>1}function CO(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 MO(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function TO(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function AO(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function zO(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=Bm(n.children[1]),h=o2(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 jO(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 DO(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const F1=9,G1=32;function RO(e){const n=String(e),i=/\r?\n|\r/g;let a=i.exec(n),o=0;const s=[];for(;a;)s.push(Z1(n.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=i.exec(n);return s.push(Z1(n.slice(o),o>0,!1)),s.join("")}function Z1(e,n,i){let a=0,o=e.length;if(n){let s=e.codePointAt(a);for(;s===F1||s===G1;)a++,s=e.codePointAt(a)}if(i){let s=e.codePointAt(o-1);for(;s===F1||s===G1;)o--,s=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function OO(e,n){const i={type:"text",value:RO(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function LO(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const HO={blockquote:dO,break:hO,code:pO,delete:mO,emphasis:gO,footnoteReference:yO,heading:xO,html:bO,imageReference:vO,image:wO,inlineCode:SO,linkReference:_O,link:kO,listItem:EO,list:CO,paragraph:MO,root:TO,strong:AO,table:zO,tableCell:DO,tableRow:jO,text:OO,thematicBreak:LO,toml:xc,yaml:xc,definition:xc,footnoteDefinition:xc};function xc(){}const T2=-1,vf=0,Zo=1,Yc=2,Ym=3,Xm=4,Fm=5,Gm=6,A2=7,z2=8,Q1=typeof self=="object"?self:globalThis,BO=(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 vf:case T2:return i(u,o);case Zo:{const f=i([],o);for(const h of u)f.push(a(h));return f}case Yc:{const f=i({},o);for(const[h,d]of u)f[a(h)]=a(d);return f}case Ym:return i(new Date(u),o);case Xm:{const{source:f,flags:h}=u;return i(new RegExp(f,h),o)}case Fm:{const f=i(new Map,o);for(const[h,d]of u)f.set(a(h),a(d));return f}case Gm:{const f=i(new Set,o);for(const h of u)f.add(a(h));return f}case A2:{const{name:f,message:h}=u;return i(new Q1[f](h),o)}case z2: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 Q1[s](u),o)};return a},K1=e=>BO(new Map,e)(0),Qa="",{toString:UO}={},{keys:IO}=Object,Uo=e=>{const n=typeof e;if(n!=="object"||!e)return[vf,n];const i=UO.call(e).slice(8,-1);switch(i){case"Array":return[Zo,Qa];case"Object":return[Yc,Qa];case"Date":return[Ym,Qa];case"RegExp":return[Xm,Qa];case"Map":return[Fm,Qa];case"Set":return[Gm,Qa];case"DataView":return[Zo,i]}return i.includes("Array")?[Zo,i]:i.includes("Error")?[A2,i]:[Yc,i]},bc=([e,n])=>e===vf&&(n==="function"||n==="symbol"),qO=(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]=Uo(u);switch(f){case vf:{let g=u;switch(h){case"bigint":f=z2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([T2],u)}return o([f,g],u)}case Zo:{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 Yc:{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 IO(u))(e||!bc(Uo(u[x])))&&g.push([s(x),s(u[x])]);return m}case Ym:return o([f,u.toISOString()],u);case Xm:{const{source:g,flags:m}=u;return o([f,{source:g,flags:m}],u)}case Fm:{const g=[],m=o([f,g],u);for(const[x,b]of u)(e||!(bc(Uo(x))||bc(Uo(b))))&&g.push([s(x),s(b)]);return m}case Gm:{const g=[],m=o([f,g],u);for(const x of u)(e||!bc(Uo(x)))&&g.push(s(x));return m}}const{message:d}=u;return o([f,{name:h,message:d}],u)};return s},J1=(e,{json:n,lossy:i}={})=>{const a=[];return qO(!(n||i),!!n,new Map,a)(e),a},Xc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?K1(J1(e,n)):structuredClone(e):(e,n)=>K1(J1(e,n));function $O(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 VO(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function PO(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||$O,a=e.options.footnoteBackLabel||VO,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=Sl(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 D=typeof i=="string"?i:i(h,b);typeof D=="string"&&(D={type:"text",value:D}),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(D)?D:[D]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const D=N.children[N.children.length-1];D&&D.type==="text"?D.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:{...Xc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
127
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
128
|
-
`}]}}const wf=(function(e){if(e==null)return GO;if(typeof e=="function")return Sf(e);if(typeof e=="object")return Array.isArray(e)?YO(e):XO(e);if(typeof e=="string")return FO(e);throw new Error("Expected function, string, or object as test")});function YO(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=wf(e[i]);return Sf(a);function a(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function XO(e){const n=e;return Sf(i);function i(a){const o=a;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function FO(e){return Sf(n);function n(i){return i&&i.type===e}}function Sf(e){return n;function n(i,a,o){return!!(ZO(i)&&e.call(this,i,typeof a=="number"?a:void 0,o||void 0))}}function GO(){return!0}function ZO(e){return e!==null&&typeof e=="object"&&"type"in e}const j2=[],QO=!0,tm=!1,KO="skip";function D2(e,n,i,a){let o;typeof n=="function"&&typeof i!="function"?(a=i,i=n):o=n;const s=wf(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=j2,w,E,N;if((!n||s(h,d,g[g.length-1]||void 0))&&(b=JO(i(h,g)),b[0]===tm))return b;if("children"in h&&h.children){const _=h;if(_.children&&b[0]!==KO)for(E=(a?_.children.length:-1)+u,N=g.concat(_);E>-1&&E<_.children.length;){const D=_.children[E];if(w=f(D,E,N)(),w[0]===tm)return w;E=typeof w[1]=="number"?w[1]:E+u}}return b}}}function JO(e){return Array.isArray(e)?e:typeof e=="number"?[QO,e]:e==null?j2:[e]}function Zm(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),D2(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 nm={}.hasOwnProperty,WO={};function e6(e,n){const i=n||WO,a=new Map,o=new Map,s=new Map,u={...HO,...i.handlers},f={all:d,applyData:n6,definitionById:a,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:h,options:i,patch:t6,wrap:r6};return Zm(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(nm.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,_=Xc(N);return _.children=f.all(g),_}return Xc(g)}return(f.options.unknownHandler||i6)(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=W1(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=W1(E.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function t6(e,n){e.position&&(n.position=Vj(e))}function n6(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,Xc(s)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function i6(e,n){const i=n.data||{},a="value"in n&&!(nm.call(i,"hProperties")||nm.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 r6(e,n){const i=[];let a=-1;for(n&&i.push({type:"text",value:`
|
|
129
|
-
`});++a<e.length;)a&&i.push({type:"text",value:`
|
|
130
|
-
`}),i.push(e[a]);return n&&e.length>0&&i.push({type:"text",value:`
|
|
131
|
-
`}),i}function W1(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function ev(e,n){const i=e6(e,n),a=i.one(e,void 0),o=PO(i),s=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
132
|
-
`},o),s}function a6(e,n){return e&&"run"in e?async function(i,a){const o=ev(i,{file:a,...n});await e.run(o,a)}:function(i,a){return ev(i,{file:a,...e||n})}}function tv(e){if(e)throw e}var pp,nv;function l6(){if(nv)return pp;nv=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 pp=function h(){var d,g,m,x,b,w,E=arguments[0],N=1,_=arguments.length,D=!1;for(typeof E=="boolean"&&(D=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&&(D&&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(D,w,x)})):typeof x<"u"&&u(E,{name:g,newValue:x}));return E},pp}var o6=l6();const mp=Gc(o6);function im(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 s6(){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?u6(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 u6(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:c6,dirname:f6,extname:d6,join:h6,sep:"/"};function c6(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ss(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 f6(e){if(Ss(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 d6(e){Ss(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 h6(...e){let n=-1,i;for(;++n<e.length;)Ss(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":p6(i)}function p6(e){Ss(e);const n=e.codePointAt(0)===47;let i=m6(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function m6(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 Ss(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const g6={cwd:y6};function y6(){return"/"}function rm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function x6(e){if(typeof e=="string")e=new URL(e);else if(!rm(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 b6(e)}function b6(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 gp=["history","path","basename","stem","extname","dirname"];class R2{constructor(n){let i;n?rm(n)?i={path:n}:typeof n=="string"||v6(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":g6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<gp.length;){const s=gp[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)gp.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?ei.basename(this.path):void 0}set basename(n){xp(n,"basename"),yp(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){iv(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(yp(n,"extname"),iv(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){rm(n)&&(n=x6(n)),xp(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){xp(n,"stem"),yp(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 yp(e,n){if(e&&e.includes(ei.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ei.sep+"`")}function xp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function iv(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function v6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const w6=(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 Qm extends w6{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=s6()}copy(){const n=new Qm;let i=-1;for(;++i<this.attachers.length;){const a=this.attachers[i];n.use(...a)}return n.data(mp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(wp("data",this.frozen),this.namespace[n]=i,this):S6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(wp("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=vc(n),a=this.parser||this.Parser;return bp("parse",a),a(String(i),i)}process(n,i){const a=this;return this.freeze(),bp("process",this.parser||this.Parser),vp("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(s,u){const f=vc(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);E6(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(),bp("processSync",this.parser||this.Parser),vp("processSync",this.compiler||this.Compiler),this.process(n,o),av("processSync","process",i),a;function o(s,u){i=!0,tv(s),a=u}}run(n,i,a){rv(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=vc(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),av("runSync","run",a),o;function s(u,f){tv(u),o=f,a=!0}}stringify(n,i){this.freeze();const a=vc(i),o=this.compiler||this.Compiler;return vp("stringify",o),rv(n),o(n,a)}use(n,...i){const a=this.attachers,o=this.namespace;if(wp("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=mp(!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];im(E)&&im(b)&&(b=mp(!0,E,b)),a[x]=[d,b,...w]}}}}const _6=new Qm().freeze();function bp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wp(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 rv(e){if(!im(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function av(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function vc(e){return k6(e)?e:new R2(e)}function k6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function E6(e){return typeof e=="string"||N6(e)}function N6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const C6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lv=[],ov={allowDangerousHtml:!0},M6=/^(https?|ircs?|mailto|xmpp)$/i,T6=[{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 sv(e){const n=A6(e),i=z6(e);return j6(n.runSync(n.parse(i),i),e)}function A6(e){const n=e.rehypePlugins||lv,i=e.remarkPlugins||lv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ov}:ov;return _6().use(fO).use(i).use(a6,a).use(n)}function z6(e){const n=e.children||"",i=new R2;return typeof n=="string"&&(i.value=n),i}function j6(e,n){const i=n.allowedElements,a=n.allowElement,o=n.components,s=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||D6;for(const g of T6)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+C6+g.id,void 0);return Zm(e,d),Gj(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 fp)if(Object.hasOwn(fp,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=fp[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 D6(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||M6.test(e.slice(0,n))?e:""}function uv(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 R6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function O6(e,n,i){const o=wf((i||{}).ignore||[]),s=L6(n);let u=-1;for(;++u<s.length;)D2(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,D=[];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&&D.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(A)?D.push(...A):A&&D.push(A),w=C+k[0].length,_=!0),!x.global)break;k=x.exec(d.value)}return _?(w<d.value.length&&D.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...D)):D=[d],N+D.length}}function L6(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([H6(o[0]),B6(o[1])])}return n}function H6(e){return typeof e=="string"?new RegExp(R6(e),"g"):e}function B6(e){return typeof e=="function"?e:function(){return e}}const Sp="phrasing",_p=["autolink","link","image","label"];function U6(){return{transforms:[X6],enter:{literalAutolink:q6,literalAutolinkEmail:kp,literalAutolinkHttp:kp,literalAutolinkWww:kp},exit:{literalAutolink:Y6,literalAutolinkEmail:P6,literalAutolinkHttp:$6,literalAutolinkWww:V6}}}function I6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sp,notInConstruct:_p},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sp,notInConstruct:_p},{character:":",before:"[ps]",after:"\\/",inConstruct:Sp,notInConstruct:_p}]}}function q6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function kp(e){this.config.enter.autolinkProtocol.call(this,e)}function $6(e){this.config.exit.autolinkProtocol.call(this,e)}function V6(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 P6(e){this.config.exit.autolinkEmail.call(this,e)}function Y6(e){this.exit(e)}function X6(e){O6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,F6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),G6]],{ignore:["link","linkReference"]})}function F6(e,n,i,a,o){let s="";if(!O2(o)||(/^w/i.test(n)&&(i=n+i,n="",s="http://"),!Z6(i)))return!1;const u=Q6(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 G6(e,n,i,a){return!O2(a,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function Z6(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 Q6(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=uv(e,"(");let s=uv(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 O2(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||ia(i)||xf(i))&&(!n||i!==47)}L2.peek=a8;function K6(){this.buffer()}function J6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function W6(){this.buffer()}function e8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function t8(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 n8(e){this.exit(e)}function i8(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 r8(e){this.exit(e)}function a8(){return"["}function L2(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 l8(){return{enter:{gfmFootnoteCallString:K6,gfmFootnoteCall:J6,gfmFootnoteDefinitionLabelString:W6,gfmFootnoteDefinition:e8},exit:{gfmFootnoteCallString:t8,gfmFootnoteCall:n8,gfmFootnoteDefinitionLabelString:i8,gfmFootnoteDefinition:r8}}}function o8(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:L2},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?`
|
|
133
|
-
`:" ")+s.indentLines(s.containerFlow(a,f.current()),n?H2:s8))),d(),h}}function s8(e,n,i){return n===0?e:H2(e,n,i)}function H2(e,n,i){return(i?"":" ")+e}const u8=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];B2.peek=p8;function c8(){return{canContainEols:["delete"],enter:{strikethrough:d8},exit:{strikethrough:h8}}}function f8(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:u8}],handlers:{delete:B2}}}function d8(e){this.enter({type:"delete",children:[]},e)}function h8(e){this.exit(e)}function B2(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 p8(){return"~"}function m8(e){return e.length}function g8(e,n){const i=n||{},a=(i.align||[]).concat(),o=i.stringLength||m8,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 D=y8(e[g][_]);if(i.alignDelimiters!==!1){const k=o(D);N[_]=k,(h[_]===void 0||k>h[_])&&(h[_]=k)}E.push(D)}u[g]=E,f[g]=N}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<d;)s[m]=cv(a[m]);else{const E=cv(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 D=i.alignDelimiters===!1?1:Math.max(1,h[m]-N.length-_.length);const k=N+"-".repeat(D)+_;i.alignDelimiters!==!1&&(D=N.length+D+_.length,D>h[m]&&(h[m]=D),b[m]=D),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 D=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&&D==="")&&(i.delimiterStart!==!1||m)&&_.push(" "),i.alignDelimiters!==!1&&_.push(k),_.push(D),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(`
|
|
134
|
-
`)}function y8(e){return e==null?"":String(e)}function cv(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 x8(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()),b8);return o(),u}function b8(e,n,i){return">"+(i?"":" ")+e}function v8(e,n){return fv(e,n.inConstruct,!0)&&!fv(e,n.notInConstruct,!1)}function fv(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 dv(e,n,i,a){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
|
|
135
|
-
`&&v8(i.stack,i.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
136
|
-
`}function w8(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 _8(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 k8(e,n,i,a){const o=_8(i),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(S8(e,i)){const m=i.enter("codeIndented"),x=i.indentLines(s,E8);return m(),x}const f=i.createTracker(a),h=o.repeat(Math.max(w8(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:`
|
|
137
|
-
`,encode:["`"],...f.current()})),m()}return g+=f.move(`
|
|
138
|
-
`),s&&(g+=f.move(s+`
|
|
139
|
-
`)),g+=f.move(h),d(),g}function E8(e,n,i){return(i?"":" ")+e}function Km(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 N8(e,n,i,a){const o=Km(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?" ":`
|
|
140
|
-
`,...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 C8(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 os(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fc(e,n,i){const a=yl(e),o=yl(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}}U2.peek=M8;function U2(e,n,i,a){const o=C8(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=Fc(a.before.charCodeAt(a.before.length-1),d,o);g.inside&&(h=os(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Fc(a.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+os(m));const b=u.move(o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function M8(e,n,i){return i.options.emphasis||"*"}function T8(e,n){let i=!1;return Zm(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return i=!0,tm}),!!((!e.depth||e.depth<3)&&$m(e)&&(n.options.setext||i))}function A8(e,n,i,a){const o=Math.max(Math.min(6,e.depth||1),1),s=i.createTracker(a);if(T8(e,i)){const g=i.enter("headingSetext"),m=i.enter("phrasing"),x=i.containerPhrasing(e,{...s.current(),before:`
|
|
141
|
-
`,after:`
|
|
142
|
-
`});return m(),g(),x+`
|
|
143
|
-
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
144
|
-
`))+1))}const u="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");s.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
|
|
145
|
-
`,...s.current()});return/^[\t ]/.test(d)&&(d=os(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),h(),f(),d}I2.peek=z8;function I2(e){return e.value||""}function z8(){return"<"}q2.peek=j8;function q2(e,n,i,a){const o=Km(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 j8(){return"!"}$2.peek=D8;function $2(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 D8(){return"!"}V2.peek=R8;function V2(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 R8(){return"`"}function P2(e,n){const i=$m(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))}Y2.peek=O8;function Y2(e,n,i,a){const o=Km(i),s=o==='"'?"Quote":"Apostrophe",u=i.createTracker(a);let f,h;if(P2(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 O8(e,n,i){return P2(e,i)?"<":"["}X2.peek=L8;function X2(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 L8(){return"["}function Jm(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 H8(e){const n=Jm(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 B8(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 F2(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 U8(e,n,i,a){const o=i.enter("list"),s=i.bulletCurrent;let u=e.ordered?B8(i):Jm(i);const f=e.ordered?u==="."?")":".":H8(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),F2(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 I8(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 q8(e,n,i,a){const o=I8(i);let s=i.bulletCurrent||Jm(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 $8(e,n,i,a){const o=i.enter("paragraph"),s=i.enter("phrasing"),u=i.containerPhrasing(e,a);return s(),o(),u}const V8=wf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function P8(e,n,i,a){return(e.children.some(function(u){return V8(u)})?i.containerPhrasing:i.containerFlow).call(i,e,a)}function Y8(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}G2.peek=X8;function G2(e,n,i,a){const o=Y8(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=Fc(a.before.charCodeAt(a.before.length-1),d,o);g.inside&&(h=os(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=Fc(a.after.charCodeAt(0),m,o);x.inside&&(h=h.slice(0,-1)+os(m));const b=u.move(o+o);return s(),i.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+b}function X8(e,n,i){return i.options.strong||"*"}function F8(e,n,i,a){return i.safe(e.value,a)}function G8(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 Z8(e,n,i){const a=(F2(i)+(i.options.ruleSpaces?" ":"")).repeat(G8(i));return i.options.ruleSpaces?a.slice(0,-1):a}const Z2={blockquote:x8,break:dv,code:k8,definition:N8,emphasis:U2,hardBreak:dv,heading:A8,html:I2,image:q2,imageReference:$2,inlineCode:V2,link:Y2,linkReference:X2,list:U8,listItem:q8,paragraph:$8,root:P8,strong:G2,text:F8,thematicBreak:Z8};function Q8(){return{enter:{table:K8,tableData:hv,tableHeader:hv,tableRow:W8},exit:{codeText:eL,table:J8,tableData:Ep,tableHeader:Ep,tableRow:Ep}}}function K8(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 J8(e){this.exit(e),this.data.inTable=void 0}function W8(e){this.enter({type:"tableRow",children:[]},e)}function Ep(e){this.exit(e)}function hv(e){this.enter({type:"tableCell",children:[]},e)}function eL(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,tL));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function tL(e,n){return n==="|"?n:e}function nL(e){const n=e||{},i=n.tableCellPadding,a=n.tablePipeAlign,o=n.stringLength,s=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
146
|
-
`,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),D=d([_]);return D.slice(0,D.indexOf(`
|
|
147
|
-
`))}function h(b,w,E,N){const _=E.enter("tableCell"),D=E.enter("phrasing"),k=E.containerPhrasing(b,{...N,before:s,after:s});return D(),_(),k}function d(b,w){return g8(b,{align:w,alignDelimiters:a,padding:i,stringLength:o})}function g(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("table");for(;++_<N.length;)D[_]=m(N[_],w,E);return k(),D}function m(b,w,E){const N=b.children;let _=-1;const D=[],k=w.enter("tableRow");for(;++_<N.length;)D[_]=h(N[_],b,w,E);return k(),D}function x(b,w,E){let N=Z2.inlineCode(b,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function iL(){return{exit:{taskListCheckValueChecked:pv,taskListCheckValueUnchecked:pv,paragraph:aL}}}function rL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lL}}}function pv(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function aL(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 lL(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=Z2.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 oL(){return[U6(),l8(),c8(),Q8(),iL()]}function sL(e){return{extensions:[I6(),o8(e),f8(),nL(e),rL()]}}const uL={tokenize:mL,partial:!0},Q2={tokenize:gL,partial:!0},K2={tokenize:yL,partial:!0},J2={tokenize:xL,partial:!0},cL={tokenize:bL,partial:!0},W2={name:"wwwAutolink",tokenize:hL,previous:t_},e_={name:"protocolAutolink",tokenize:pL,previous:n_},Ui={name:"emailAutolink",tokenize:dL,previous:i_},li={};function fL(){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,e_];li[104]=[Ui,e_];li[87]=[Ui,W2];li[119]=[Ui,W2];function dL(e,n,i){const a=this;let o,s;return u;function u(m){return!am(m)||!i_.call(a,a.previous)||Wm(a.events)?i(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return am(m)?(e.consume(m),f):m===64?(e.consume(m),h):i(m)}function h(m){return m===46?e.check(cL,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 hL(e,n,i){const a=this;return o;function o(u){return u!==87&&u!==119||!t_.call(a,a.previous)||Wm(a.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(uL,e.attempt(Q2,e.attempt(K2,s),i),i)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function pL(e,n,i){const a=this;let o="",s=!1;return u;function u(m){return(m===72||m===104)&&n_.call(a,a.previous)&&!Wm(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||Pc(m)||rt(m)||ia(m)||xf(m)?i(m):e.attempt(Q2,e.attempt(K2,g),i)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function mL(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 gL(e,n,i){let a,o,s;return u;function u(d){return d===46||d===95?e.check(J2,h,f)(d):d===null||rt(d)||ia(d)||d!==45&&xf(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 yL(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(J2,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 xL(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 bL(e,n,i){return a;function a(s){return e.consume(s),o}function o(s){return It(s)?i(s):n(s)}}function t_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function n_(e){return!Ft(e)}function i_(e){return!(e===47||am(e))}function am(e){return e===43||e===45||e===46||e===95||It(e)}function Wm(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 vL={tokenize:ML,partial:!0};function wL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:EL,continuation:{tokenize:NL},exit:CL}},text:{91:{name:"gfmFootnoteCall",tokenize:kL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:SL,resolveTo:_L}}}}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 _L(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 kL(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 EL(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 NL(e,n,i){return e.check(ws,n,e.attempt(vL,n,i))}function CL(e){e.exit("gfmFootnoteDefinition")}function ML(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 TL(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,bf(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=yl(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"),_=yl(w);return N._open=!_||_===2&&!!E,N._close=!E||E===2&&!!_,f(w)}}}class AL{constructor(){this.map=[]}add(n,i,a){zL(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 zL(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 jL(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 DL(){return{flow:{null:{name:"table",tokenize:RL,resolveAll:OL}}}}function RL(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):Be(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,Be(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 Be(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"),D(q)):L(q)}function D(q){return q===45?(e.consume(q),D):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 Be(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)):Be(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 OL(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 AL;for(;++i<e.length;){const b=e[i],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(mv(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=wc(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=wc(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=wc(x,n,s,o,i,m)):u[1]!==0&&(m=wc(x,n,u,o,i,m)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&mv(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=jL(n.events,i))}return e}function wc(e,n,i,a,o,s){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(s.end=Object.assign({},Wa(n.events,i[0])),e.add(i[0],0,[["exit",s,n]]));const h=Wa(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=Wa(n.events,i[2]),g=Wa(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({},Wa(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function mv(e,n,i,a,o){const s=[],u=Wa(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 Wa(e,n){const i=e[n],a=i[0]==="enter"?"start":"end";return i[1][a]}const LL={name:"tasklistCheck",tokenize:BL};function HL(){return{text:{91:LL}}}function BL(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):Be(h)?e.check({tokenize:UL},n,i)(h):i(h)}}function UL(e,n,i){return Pe(e,a,"whitespace");function a(o){return o===null?i(o):n(o)}}function IL(e){return p2([fL(),wL(),TL(e),DL(),HL()])}const qL={};function gv(e){const n=this,i=e||qL,a=n.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(IL(i)),s.push(oL()),u.push(sL(i))}function $L(){const{isRunning:e,results:n,workflowResults:i,logs:a}=gs(),{nodes:o,selectedNodeId:s,updateNode:u}=Hi(),f=Hi(hS),{execute:h,generatedFiles:d,downloadFile:g,downloadAllFiles:m}=ZS(),[x,b]=Z.useState("");Z.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,D=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(sS,{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(Nm,{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(uf,{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=>D(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(M5,{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=>D(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(rl,{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(al,{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(rl,{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(Em,{className:"w-5 h-5 text-green-500"}):v.jsx(oS,{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(uS,{className:"w-4 h-4 text-purple-400"}):v.jsx(al,{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(sv,{remarkPlugins:[gv],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):E?v.jsx("div",{className:"markdown-content",children:v.jsx(sv,{remarkPlugins:[gv],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(al,{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(rl,{className:"w-4 h-4"}),"Download .md"]})})]})}function r_({level:e}){switch(e){case"success":return v.jsx(Em,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(oS,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(N5,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(t5,{className:"w-4 h-4 text-blue-400"})}}function a_(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function VL({isOpen:e,onClose:n}){const{logs:i,clearLogs:a,isRunning:o}=gs(),[s,u]=Z.useState(!1),[f,h]=Z.useState(250),d=Z.useRef(null);Z.useEffect(()=>{d.current&&!s&&d.current.scrollIntoView({behavior:"smooth"})},[i,s]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=N=>{const _=x-N.clientY,D=Math.min(Math.max(b+_,100),500);h(D)},E=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",E)};return e?v.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:s?40:f},children:[!s&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),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(ra,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),o&&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:["(",i.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:a,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!s),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:s?"Expand":"Minimize",children:s?v.jsx(U3,{className:"w-4 h-4 text-gray-400"}):v.jsx(H3,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(f5,{className:"w-4 h-4 text-gray-400"}):v.jsx(s5,{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(Cm,{className:"w-4 h-4 text-gray-400"})})]})]}),!s&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.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:[i.map(m=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",m.level==="error"&&"bg-red-500/10",m.level==="warning"&&"bg-yellow-500/10",m.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",a_(m.timestamp),"]"]}),v.jsx(r_,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",m.level==="error"&&"text-red-400",m.level==="warning"&&"text-yellow-400",m.level==="success"&&"text-green-400",m.level==="info"&&"text-gray-300"),children:m.message}),m.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof m.details=="string"?m.details:JSON.stringify(m.details,null,2)})]})]},m.id)),v.jsx("div",{ref:d})]})})]}):null}function PL(){const{logs:e,clearLogs:n,isRunning:i}=gs(),a=Z.useRef(null);return Z.useEffect(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[e]),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(ra,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&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:["(",e.length," logs)"]})]}),v.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:v.jsx(cf,{className:"w-4 h-4"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.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:[e.map(o=>v.jsxs("div",{className:Xt("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",o.level==="error"&&"bg-red-500/10",o.level==="warning"&&"bg-yellow-500/10",o.level==="success"&&"bg-green-500/10"),children:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",a_(o.timestamp),"]"]}),v.jsx(r_,{level:o.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("span",{className:Xt("text-xs",o.level==="error"&&"text-red-400",o.level==="warning"&&"text-yellow-400",o.level==="success"&&"text-green-400",o.level==="info"&&"text-gray-300"),children:o.message}),o.nodeId&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",o.nodeId.slice(0,8),"]"]}),o.details&&v.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof o.details=="string"?o.details:JSON.stringify(o.details,null,2)})]})]},o.id)),v.jsx("div",{ref:a})]})})]})}const YL=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],XL=[{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 FL(e){switch(e){case"input":return v.jsx(uf,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(ms,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(ff,{className:"w-5 h-5 text-cyan-400"});case"command":return v.jsx(ra,{className:"w-5 h-5 text-orange-400"});case"hook":return v.jsx(km,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(sf,{className:"w-5 h-5 text-emerald-400"});default:return null}}function GL(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"command":return"Command";case"hook":return"Hook";case"output":return"Output";default:return"Node"}}function ZL({node:e}){const{updateNode:n,removeNode:i}=Hi(),a=Z.useRef(null),o=Z.useCallback(h=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{JS(h).catch(d=>{console.error("Failed to sync node to filesystem:",d)})},500)},[]);if(Z.useEffect(()=>(e&&e.type!=="input"&&e.type!=="output"&&o(e),()=>{a.current&&clearTimeout(a.current)}),[e,o]),!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(v5,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const s=()=>{WS(e).catch(h=>{console.error("Failed to delete node from filesystem:",h)}),i(e.id)},u=h=>{n(e.id,{label:h})},f=h=>{n(e.id,{description: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 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:FL(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:GL(e.type)})]})]}),v.jsx("button",{onClick:s,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(cf,{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:h=>u(h.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:h=>f(h.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(QL,{data:e.data,onUpdate:h=>n(e.id,h)}),e.type==="subagent"&&v.jsx(KL,{data:e.data,onUpdate:h=>n(e.id,h)}),e.type==="skill"&&v.jsx(JL,{data:e.data,onUpdate:h=>n(e.id,h)}),e.type==="command"&&v.jsx(WL,{data:e.data,onUpdate:h=>n(e.id,h)}),e.type==="hook"&&v.jsx(e9,{data:e.data,onUpdate:h=>n(e.id,h)}),e.type==="output"&&v.jsx(t9,{onUpdate:h=>n(e.id,h)})]})]})}function QL({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 KL({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:XL.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(ms,{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:YL.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 JL({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(ff,{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 WL({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:"Command Name"}),v.jsx("input",{type:"text",value:e.commandName||"",onChange:i=>n({commandName:i.target.value}),placeholder:"e.g., commit, review-pr",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.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Slash command to execute (without /)"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Path (optional)"}),v.jsx("input",{type:"text",value:e.commandPath||"",onChange:i=>n({commandPath:i.target.value}),placeholder:"e.g., .claude/commands/my-command.md",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 e9({data:e,onUpdate:n}){const i=["PreToolUse","PostToolUse","Notification","Stop"];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:"Hook Event"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(a=>v.jsx("button",{onClick:()=>n({hookEvent:a}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.hookEvent===a?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:a},a))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),v.jsx("input",{type:"text",value:e.hookMatcher||"",onChange:a=>n({hookMatcher:a.target.value}),placeholder:"e.g., Bash, Write, Edit",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.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),v.jsx("input",{type:"text",value:e.hookCommand||"",onChange:a=>n({hookCommand:a.target.value}),placeholder:"e.g., npm run lint",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.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Shell command to execute"})]})]})}function t9({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(sf,{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 n9=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function i9(){const{activeTab:e,setActiveTab:n}=Om(),i=Hi(hS);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:n9.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($L,{}),e==="console"&&v.jsx(PL,{}),e==="step"&&v.jsx(ZL,{node:i}),e==="theme"&&v.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function r9(e){let n;const{apiMode:i,apiKey:a,proxyUrl:o}=Rm.getState(),s={"Content-Type":"application/json","X-API-Mode":i};i==="direct"&&a?s["X-API-Key"]=a:i==="proxy"&&o&&(s["X-Proxy-URL"]=o);try{n=await fetch("/api/generate/workflow",{method:"POST",headers:s,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!n.ok){let h=`서버 오류 (${n.status})`;try{h=(await n.json()).message||h}catch{}throw new Error(h)}let u;try{u=await n.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:l9(u),workflowName:u.workflowName}}function a9(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),D=w.depth+1;(_===void 0||D>_)&&(d.set(N,D),g.push({id:N,depth:D}))})}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,D=s+(300-_)/2;E.forEach((k,C)=>{b.set(k,{x:o+w*i,y:D+C*a})})}return e.map(w=>{const E=b.get(w.id)||w.position;return{...w,position:E}})}function l9(e){const n=[],i=new Map,a={x:0,y:0};e.nodes.forEach((u,f)=>{const h=gl();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"command":n.push({id:h,type:"command",position:{...a},data:{...d,commandName:u.config.commandName||u.label,commandPath:u.config.commandPath}});break;case"hook":n.push({id:h,type:"hook",position:{...a},data:{...d,hookEvent:u.config.hookEvent||"PreToolUse",hookMatcher:u.config.hookMatcher,hookCommand:u.config.hookCommand}});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:a9(n,o),edges:o}}function o9(e){const n=e.toLowerCase();if(n.includes("스킬")||n.includes("skill"))return!0;const i=[/만들어\s*(줘|주세요|줘요)/,/작성해\s*(줘|주세요|줘요)/,/생성해\s*(줘|주세요|줘요)/];for(const a of i)if(a.test(e))return!0;return!1}async function s9(e){const{apiMode:n,apiKey:i,proxyUrl:a}=Rm.getState(),o={"Content-Type":"application/json","X-API-Mode":n};n==="direct"&&i?o["X-API-Key"]=i:n==="proxy"&&a&&(o["X-Proxy-URL"]=a);try{const s=await fetch("/api/generate/skill",{method:"POST",headers:o,body:JSON.stringify({prompt:e})});if(!s.ok){let u=`서버 오류 (${s.status})`;try{u=(await s.json()).message||u}catch{}return{success:!1,error:u}}return await s.json()}catch{return{success:!1,error:"서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요."}}}function u9(){const[e,n]=Z.useState(""),[i,a]=Z.useState(!1),[o,s]=Z.useState(null),[u,f]=Z.useState(null),[h,d]=Z.useState("workflow"),{loadWorkflow:g,addNode:m,nodes:x}=Hi(),b=async()=>{if(!e.trim()||i)return;a(!0),s(null),f(null);const E=o9(e);d(E?"skill":"workflow");try{if(E){const N=await s9(e);if(N.success&&N.skill){const _=gl(),D=x.length*50;m({id:_,type:"skill",position:{x:200+D,y:200},data:{label:N.skill.skillName,description:N.skill.description,status:"idle",skillType:"custom",skillId:N.skill.skillId,skillPath:N.savedPath}}),f(`스킬 "${N.skill.skillName}" 생성 완료!`),n(""),setTimeout(()=>f(null),5e3)}else throw new Error(N.error||"스킬 생성에 실패했습니다.")}else{const{workflow:N,workflowName:_}=await r9(e);g({nodes:N.nodes,edges:N.edges,name:_}),n("")}}catch(N){console.error("Generation failed:",N);const _=N instanceof Error?N.message:"생성에 실패했습니다.";s(_)}finally{a(!1)}},w=E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),b())};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(ms,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.jsx("input",{type:"text",value:e,onChange:E=>n(E.target.value),onKeyDown:w,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:b,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(cS,{className:"w-5 h-5 animate-spin"}):v.jsx(g5,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:o?v.jsx("span",{className:"text-red-400",children:o}):u?v.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[v.jsx(Em,{className:"w-3 h-3"}),u]}):i?v.jsxs("span",{className:"text-accent",children:["AI가 ",h==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):v.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function c9(){const{isCollapsed:e,width:n}=Om(),{isRunning:i,logs:a}=gs(),[o,s]=Z.useState(!1);return Z.useEffect(()=>{i&&s(!0)},[i]),v.jsx(nS,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(Qz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(tj,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(bj,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(u9,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${n}px`},children:v.jsx(i9,{})})]}),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(ra,{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(VL,{isOpen:o,onClose:()=>s(!1)})]})})}bE.createRoot(document.getElementById("root")).render(v.jsx(Z.StrictMode,{children:v.jsx(c9,{})}));
|