makecc 0.2.18 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,69 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(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"&&l(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 l(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();function hc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eh={exports:{}},Ja={};var lx;function wE(){if(lx)return Ja;lx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(l,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:l,key:u,ref:o!==void 0?o:null,props:s}}return Ja.Fragment=t,Ja.jsx=i,Ja.jsxs=i,Ja}var ax;function SE(){return ax||(ax=1,eh.exports=wE()),eh.exports}var x=SE(),th={exports:{}},_e={};var ox;function kE(){if(ox)return _e;ox=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=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"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function N(O,Y,j){this.props=O,this.context=Y,this.refs=C,this.updater=j||w}N.prototype.isReactComponent={},N.prototype.setState=function(O,Y){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,Y,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=N.prototype;function k(O,Y,j){this.props=O,this.context=Y,this.refs=C,this.updater=j||w}var T=k.prototype=new _;T.constructor=k,E(T,N.prototype),T.isPureReactComponent=!0;var B=Array.isArray;function A(){}var L={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function Z(O,Y,j){var ne=j.ref;return{$$typeof:e,type:O,key:Y,ref:ne!==void 0?ne:null,props:j}}function U(O,Y){return Z(O.type,Y,O.props)}function I(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function P(O){var Y={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(j){return Y[j]})}var ee=/\/+/g;function H(O,Y){return typeof O=="object"&&O!==null&&O.key!=null?P(""+O.key):Y.toString(36)}function q(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(A,A):(O.status="pending",O.then(function(Y){O.status==="pending"&&(O.status="fulfilled",O.value=Y)},function(Y){O.status==="pending"&&(O.status="rejected",O.reason=Y)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function D(O,Y,j,ne,ue){var ce=typeof O;(ce==="undefined"||ce==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(ce){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0;break;case g:return de=O._init,D(de(O._payload),Y,j,ne,ue)}}if(de)return ue=ue(O),de=ne===""?"."+H(O,0):ne,B(ue)?(j="",de!=null&&(j=de.replace(ee,"$&/")+"/"),D(ue,Y,j,"",function(ke){return ke})):ue!=null&&(I(ue)&&(ue=U(ue,j+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(ee,"$&/")+"/")+de)),Y.push(ue)),1;de=0;var se=ne===""?".":ne+":";if(B(O))for(var pe=0;pe<O.length;pe++)ne=O[pe],ce=se+H(ne,pe),de+=D(ne,Y,j,ce,ue);else if(pe=v(O),typeof pe=="function")for(O=pe.call(O),pe=0;!(ne=O.next()).done;)ne=ne.value,ce=se+H(ne,pe++),de+=D(ne,Y,j,ce,ue);else if(ce==="object"){if(typeof O.then=="function")return D(q(O),Y,j,ne,ue);throw Y=String(O),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return de}function V(O,Y,j){if(O==null)return O;var ne=[],ue=0;return D(O,ne,"","",function(ce){return Y.call(j,ce,ue++)}),ne}function F(O){if(O._status===-1){var Y=O._result;Y=Y(),Y.then(function(j){(O._status===0||O._status===-1)&&(O._status=1,O._result=j)},function(j){(O._status===0||O._status===-1)&&(O._status=2,O._result=j)}),O._status===-1&&(O._status=0,O._result=Y)}if(O._status===1)return O._result.default;throw O._result}var K=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},z={map:V,forEach:function(O,Y,j){V(O,function(){Y.apply(this,arguments)},j)},count:function(O){var Y=0;return V(O,function(){Y++}),Y},toArray:function(O){return V(O,function(Y){return Y})||[]},only:function(O){if(!I(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return _e.Activity=p,_e.Children=z,_e.Component=N,_e.Fragment=i,_e.Profiler=o,_e.PureComponent=k,_e.StrictMode=l,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,_e.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},_e.cache=function(O){return function(){return O.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(O,Y,j){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ne=E({},O.props),ue=O.key;if(Y!=null)for(ce in Y.key!==void 0&&(ue=""+Y.key),Y)!X.call(Y,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&Y.ref===void 0||(ne[ce]=Y[ce]);var ce=arguments.length-2;if(ce===1)ne.children=j;else if(1<ce){for(var de=Array(ce),se=0;se<ce;se++)de[se]=arguments[se+2];ne.children=de}return Z(O.type,ue,ne)},_e.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:s,_context:O},O},_e.createElement=function(O,Y,j){var ne,ue={},ce=null;if(Y!=null)for(ne in Y.key!==void 0&&(ce=""+Y.key),Y)X.call(Y,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ue[ne]=Y[ne]);var de=arguments.length-2;if(de===1)ue.children=j;else if(1<de){for(var se=Array(de),pe=0;pe<de;pe++)se[pe]=arguments[pe+2];ue.children=se}if(O&&O.defaultProps)for(ne in de=O.defaultProps,de)ue[ne]===void 0&&(ue[ne]=de[ne]);return Z(O,ce,ue)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(O){return{$$typeof:f,render:O}},_e.isValidElement=I,_e.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:F}},_e.memo=function(O,Y){return{$$typeof:d,type:O,compare:Y===void 0?null:Y}},_e.startTransition=function(O){var Y=L.T,j={};L.T=j;try{var ne=O(),ue=L.S;ue!==null&&ue(j,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(A,K)}catch(ce){K(ce)}finally{Y!==null&&j.types!==null&&(Y.types=j.types),L.T=Y}},_e.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},_e.use=function(O){return L.H.use(O)},_e.useActionState=function(O,Y,j){return L.H.useActionState(O,Y,j)},_e.useCallback=function(O,Y){return L.H.useCallback(O,Y)},_e.useContext=function(O){return L.H.useContext(O)},_e.useDebugValue=function(){},_e.useDeferredValue=function(O,Y){return L.H.useDeferredValue(O,Y)},_e.useEffect=function(O,Y){return L.H.useEffect(O,Y)},_e.useEffectEvent=function(O){return L.H.useEffectEvent(O)},_e.useId=function(){return L.H.useId()},_e.useImperativeHandle=function(O,Y,j){return L.H.useImperativeHandle(O,Y,j)},_e.useInsertionEffect=function(O,Y){return L.H.useInsertionEffect(O,Y)},_e.useLayoutEffect=function(O,Y){return L.H.useLayoutEffect(O,Y)},_e.useMemo=function(O,Y){return L.H.useMemo(O,Y)},_e.useOptimistic=function(O,Y){return L.H.useOptimistic(O,Y)},_e.useReducer=function(O,Y,j){return L.H.useReducer(O,Y,j)},_e.useRef=function(O){return L.H.useRef(O)},_e.useState=function(O){return L.H.useState(O)},_e.useSyncExternalStore=function(O,Y,j){return L.H.useSyncExternalStore(O,Y,j)},_e.useTransition=function(){return L.H.useTransition()},_e.version="19.2.3",_e}var sx;function Do(){return sx||(sx=1,th.exports=kE()),th.exports}var R=Do();const so=hc(R);var nh={exports:{}},Wa={},ih={exports:{}},rh={};var ux;function EE(){return ux||(ux=1,(function(e){function t(D,V){var F=D.length;D.push(V);e:for(;0<F;){var K=F-1>>>1,z=D[K];if(0<o(z,V))D[K]=V,D[F]=z,F=K;else break e}}function i(D){return D.length===0?null:D[0]}function l(D){if(D.length===0)return null;var V=D[0],F=D.pop();if(F!==V){D[0]=F;e:for(var K=0,z=D.length,O=z>>>1;K<O;){var Y=2*(K+1)-1,j=D[Y],ne=Y+1,ue=D[ne];if(0>o(j,F))ne<z&&0>o(ue,j)?(D[K]=ue,D[ne]=F,K=ne):(D[K]=j,D[Y]=F,K=Y);else if(ne<z&&0>o(ue,F))D[K]=ue,D[ne]=F,K=ne;else break e}}return V}function o(D,V){var F=D.sortIndex-V.sortIndex;return F!==0?F:D.id-V.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,p=null,b=3,v=!1,w=!1,E=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function T(D){for(var V=i(d);V!==null;){if(V.callback===null)l(d);else if(V.startTime<=D)l(d),V.sortIndex=V.expirationTime,t(h,V);else break;V=i(d)}}function B(D){if(E=!1,T(D),!w)if(i(h)!==null)w=!0,A||(A=!0,P());else{var V=i(d);V!==null&&q(B,V.startTime-D)}}var A=!1,L=-1,X=5,Z=-1;function U(){return C?!0:!(e.unstable_now()-Z<X)}function I(){if(C=!1,A){var D=e.unstable_now();Z=D;var V=!0;try{e:{w=!1,E&&(E=!1,_(L),L=-1),v=!0;var F=b;try{t:{for(T(D),p=i(h);p!==null&&!(p.expirationTime>D&&U());){var K=p.callback;if(typeof K=="function"){p.callback=null,b=p.priorityLevel;var z=K(p.expirationTime<=D);if(D=e.unstable_now(),typeof z=="function"){p.callback=z,T(D),V=!0;break t}p===i(h)&&l(h),T(D)}else l(h);p=i(h)}if(p!==null)V=!0;else{var O=i(d);O!==null&&q(B,O.startTime-D),V=!1}}break e}finally{p=null,b=F,v=!1}V=void 0}}finally{V?P():A=!1}}}var P;if(typeof k=="function")P=function(){k(I)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,H=ee.port2;ee.port1.onmessage=I,P=function(){H.postMessage(null)}}else P=function(){N(I,0)};function q(D,V){L=N(function(){D(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(D){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var F=b;b=V;try{return D()}finally{b=F}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(D,V){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var F=b;b=D;try{return V()}finally{b=F}},e.unstable_scheduleCallback=function(D,V,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,D){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=F+z,D={id:g++,callback:V,priorityLevel:D,startTime:F,expirationTime:z,sortIndex:-1},F>K?(D.sortIndex=F,t(d,D),i(h)===null&&D===i(d)&&(E?(_(L),L=-1):E=!0,q(B,F-K))):(D.sortIndex=z,t(h,D),w||v||(w=!0,A||(A=!0,P()))),D},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(D){var V=b;return function(){var F=b;b=V;try{return D.apply(this,arguments)}finally{b=F}}}})(rh)),rh}var cx;function NE(){return cx||(cx=1,ih.exports=EE()),ih.exports}var lh={exports:{}},Lt={};var fx;function CE(){if(fx)return Lt;fx=1;var e=Do();function t(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 l={d:{f:i,r:function(){throw Error(t(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 p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,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 Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Lt.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(t(299));return s(h,d,null,g)},Lt.flushSync=function(h){var d=u.T,g=l.p;try{if(u.T=null,l.p=2,h)return h()}finally{u.T=d,l.p=g,l.d.f()}},Lt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,l.d.C(h,d))},Lt.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},Lt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,p=f(g,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?l.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):g==="script"&&l.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Lt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);l.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&&l.d.M(h)},Lt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,p=f(g,d.crossOrigin);l.d.L(h,g,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Lt.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=f(d.as,d.crossOrigin);l.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 l.d.m(h)},Lt.requestFormReset=function(h){l.d.r(h)},Lt.unstable_batchedUpdates=function(h,d){return h(d)},Lt.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},Lt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Lt.version="19.2.3",Lt}var dx;function jb(){if(dx)return lh.exports;dx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),lh.exports=CE(),lh.exports}var hx;function _E(){if(hx)return Wa;hx=1;var e=NE(),t=Do(),i=jb();function l(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function s(n){var r=n,a=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(a=r.return),n=r.return;while(n)}return r.tag===3?a:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function h(n){if(s(n)!==n)throw Error(l(188))}function d(n){var r=n.alternate;if(!r){if(r=s(n),r===null)throw Error(l(188));return r!==n?null:n}for(var a=n,c=r;;){var m=a.return;if(m===null)break;var y=m.alternate;if(y===null){if(c=m.return,c!==null){a=c;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===a)return h(m),n;if(y===c)return h(m),r;y=y.sibling}throw Error(l(188))}if(a.return!==c.return)a=m,c=y;else{for(var S=!1,M=m.child;M;){if(M===a){S=!0,a=m,c=y;break}if(M===c){S=!0,c=m,a=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===a){S=!0,a=y,c=m;break}if(M===c){S=!0,c=y,a=m;break}M=M.sibling}if(!S)throw Error(l(189))}}if(a.alternate!==c)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?n:r}function g(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=g(n),r!==null)return r;n=n.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),k=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function P(n){return n===null||typeof n!="object"?null:(n=I&&n[I]||n["@@iterator"],typeof n=="function"?n:null)}var ee=Symbol.for("react.client.reference");function H(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ee?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case E:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case B:return"Suspense";case A:return"SuspenseList";case Z:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case k:return n.displayName||"Context";case _:return(n._context.displayName||"Context")+".Consumer";case T:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return r=n.displayName||null,r!==null?r:H(n.type)||"Memo";case X:r=n._payload,n=n._init;try{return H(n(r))}catch{}}return null}var q=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},K=[],z=-1;function O(n){return{current:n}}function Y(n){0>z||(n.current=K[z],K[z]=null,z--)}function j(n,r){z++,K[z]=n.current,n.current=r}var ne=O(null),ue=O(null),ce=O(null),de=O(null);function se(n,r){switch(j(ce,r),j(ue,n),j(ne,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?T0(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=T0(r),n=A0(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Y(ne),j(ne,n)}function pe(){Y(ne),Y(ue),Y(ce)}function ke(n){n.memoizedState!==null&&j(de,n);var r=ne.current,a=A0(r,n.type);r!==a&&(j(ue,n),j(ne,a))}function Ne(n){ue.current===n&&(Y(ne),Y(ue)),de.current===n&&(Y(de),Ga._currentValue=F)}var be,Ee;function ze(n){if(be===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);be=r&&r[1]||"",Ee=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+be+n+Ee}var Fe=!1;function $e(n,r){if(!n||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(ie){var te=ie}Reflect.construct(n,[],oe)}else{try{oe.call()}catch(ie){te=ie}n.call(oe.prototype)}}else{try{throw Error()}catch(ie){te=ie}(oe=n())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),S=y[0],M=y[1];if(S&&M){var $=S.split(`
4
+ `),W=M.split(`
5
+ `);for(m=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;if(c===$.length||m===W.length)for(c=$.length-1,m=W.length-1;1<=c&&0<=m&&$[c]!==W[m];)m--;for(;1<=c&&0<=m;c--,m--)if($[c]!==W[m]){if(c!==1||m!==1)do if(c--,m--,0>m||$[c]!==W[m]){var le=`
6
+ `+$[c].replace(" at new "," at ");return n.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",n.displayName)),le}while(1<=c&&0<=m);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?ze(a):""}function ft(n,r){switch(n.tag){case 26:case 27:case 5:return ze(n.type);case 16:return ze("Lazy");case 13:return n.child!==r&&r!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return $e(n.type,!1);case 11:return $e(n.type.render,!1);case 1:return $e(n.type,!0);case 31:return ze("Activity");default:return""}}function tn(n){try{var r="",a=null;do r+=ft(n,a),a=n,n=n.return;while(n);return r}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var Rt=Object.prototype.hasOwnProperty,$t=e.unstable_scheduleCallback,Cn=e.unstable_cancelCallback,ti=e.unstable_shouldYield,ni=e.unstable_requestPaint,kt=e.unstable_now,Ri=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,je=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,Ut=e.log,_n=e.unstable_setDisableYieldValue,Tt=null,dt=null;function Dt(n){if(typeof Ut=="function"&&_n(n),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Tt,n)}catch{}}var Ge=Math.clz32?Math.clz32:qc,Un=Math.log,nn=Math.LN2;function qc(n){return n>>>=0,n===0?32:31-(Un(n)/nn|0)|0}var Xr=256,Gr=262144,Zr=4194304;function ii(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Qr(n,r,a){var c=n.pendingLanes;if(c===0)return 0;var m=0,y=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var M=c&134217727;return M!==0?(c=M&~y,c!==0?m=ii(c):(S&=M,S!==0?m=ii(S):a||(a=M&~n,a!==0&&(m=ii(a))))):(M=c&~y,M!==0?m=ii(M):S!==0?m=ii(S):a||(a=c&~n,a!==0&&(m=ii(a)))),m===0?0:r!==0&&r!==m&&(r&y)===0&&(y=m&-m,a=r&-r,y>=a||y===32&&(a&4194048)!==0)?r:m}function pr(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Vc(n,r){switch(n){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 Ko(){var n=Zr;return Zr<<=1,(Zr&62914560)===0&&(Zr=4194304),n}function la(n){for(var r=[],a=0;31>a;a++)r.push(n);return r}function mr(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function $c(n,r,a,c,m,y){var S=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var M=n.entanglements,$=n.expirationTimes,W=n.hiddenUpdates;for(a=S&~a;0<a;){var le=31-Ge(a),oe=1<<le;M[le]=0,$[le]=-1;var te=W[le];if(te!==null)for(W[le]=null,le=0;le<te.length;le++){var ie=te[le];ie!==null&&(ie.lane&=-536870913)}a&=~oe}c!==0&&Jo(n,c,0),y!==0&&m===0&&n.tag!==0&&(n.suspendedLanes|=y&~(S&~r))}function Jo(n,r,a){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-Ge(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|a&261930}function Wo(n,r){var a=n.entangledLanes|=r;for(n=n.entanglements;a;){var c=31-Ge(a),m=1<<c;m&r|n[c]&r&&(n[c]|=r),a&=~m}}function es(n,r){var a=r&-r;return a=(a&42)!==0?1:aa(a),(a&(n.suspendedLanes|r))!==0?0:a}function aa(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function oa(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ts(){var n=V.p;return n!==0?n:(n=window.event,n===void 0?32:J0(n.type))}function ns(n,r){var a=V.p;try{return V.p=n,r()}finally{V.p=a}}var In=Math.random().toString(36).slice(2),Et="__reactFiber$"+In,Ot="__reactProps$"+In,ri="__reactContainer$"+In,Kr="__reactEvents$"+In,is="__reactListeners$"+In,Pc="__reactHandles$"+In,rs="__reactResources$"+In,gr="__reactMarker$"+In;function sa(n){delete n[Et],delete n[Ot],delete n[Kr],delete n[is],delete n[Pc]}function Di(n){var r=n[Et];if(r)return r;for(var a=n.parentNode;a;){if(r=a[ri]||a[Et]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(n=L0(n);n!==null;){if(a=n[Et])return a;n=L0(n)}return r}n=a,a=n.parentNode}return null}function Oi(n){if(n=n[Et]||n[ri]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function Li(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(l(33))}function Bi(n){var r=n[rs];return r||(r=n[rs]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function mt(n){n[gr]=!0}var ls=new Set,as={};function li(n,r){Hi(n,r),Hi(n+"Capture",r)}function Hi(n,r){for(as[n]=r,n=0;n<r.length;n++)ls.add(r[n])}var Yc=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]*$"),ua={},os={};function Fc(n){return Rt.call(os,n)?!0:Rt.call(ua,n)?!1:Yc.test(n)?os[n]=!0:(ua[n]=!0,!1)}function Jr(n,r,a){if(Fc(r))if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+a)}}function Wr(n,r,a){if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+a)}}function Tn(n,r,a,c){if(c===null)n.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(r,a,""+c)}}function Pt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ss(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Xc(n,r,a){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,y=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return m.call(this)},set:function(S){a=""+S,y.call(this,S)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function el(n){if(!n._valueTracker){var r=ss(n)?"checked":"value";n._valueTracker=Xc(n,r,""+n[r])}}function us(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var a=r.getValue(),c="";return n&&(c=ss(n)?n.checked?"true":"false":n.value),n=c,n!==a?(r.setValue(n),!0):!1}function yr(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Gc=/[\n"\\]/g;function Yt(n){return n.replace(Gc,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function xr(n,r,a,c,m,y,S,M){n.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.type=S:n.removeAttribute("type"),r!=null?S==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Pt(r)):n.value!==""+Pt(r)&&(n.value=""+Pt(r)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),r!=null?ca(n,S,Pt(r)):a!=null?ca(n,S,Pt(a)):c!=null&&n.removeAttribute("value"),m==null&&y!=null&&(n.defaultChecked=!!y),m!=null&&(n.checked=m&&typeof m!="function"&&typeof m!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?n.name=""+Pt(M):n.removeAttribute("name")}function cs(n,r,a,c,m,y,S,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),r!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){el(n);return}a=a!=null?""+Pt(a):"",r=r!=null?""+Pt(r):a,M||r===n.value||(n.value=r),n.defaultValue=r}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=M?n.checked:!!c,n.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),el(n)}function ca(n,r,a){r==="number"&&yr(n.ownerDocument)===n||n.defaultValue===""+a||(n.defaultValue=""+a)}function ai(n,r,a,c){if(n=n.options,r){r={};for(var m=0;m<a.length;m++)r["$"+a[m]]=!0;for(a=0;a<n.length;a++)m=r.hasOwnProperty("$"+n[a].value),n[a].selected!==m&&(n[a].selected=m),m&&c&&(n[a].defaultSelected=!0)}else{for(a=""+Pt(a),r=null,m=0;m<n.length;m++){if(n[m].value===a){n[m].selected=!0,c&&(n[m].defaultSelected=!0);return}r!==null||n[m].disabled||(r=n[m])}r!==null&&(r.selected=!0)}}function km(n,r,a){if(r!=null&&(r=""+Pt(r),r!==n.value&&(n.value=r),a==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=a!=null?""+Pt(a):""}function Em(n,r,a,c){if(r==null){if(c!=null){if(a!=null)throw Error(l(92));if(q(c)){if(1<c.length)throw Error(l(93));c=c[0]}a=c}a==null&&(a=""),r=a}a=Pt(r),n.defaultValue=a,c=n.textContent,c===a&&c!==""&&c!==null&&(n.value=c),el(n)}function tl(n,r){if(r){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=r;return}}n.textContent=r}var gS=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 Nm(n,r,a){var c=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,a):typeof a!="number"||a===0||gS.has(r)?r==="float"?n.cssFloat=a:n[r]=(""+a).trim():n[r]=a+"px"}function Cm(n,r,a){if(r!=null&&typeof r!="object")throw Error(l(62));if(n=n.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var m in r)c=r[m],r.hasOwnProperty(m)&&a[m]!==c&&Nm(n,m,c)}else for(var y in r)r.hasOwnProperty(y)&&Nm(n,y,r[y])}function Zc(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yS=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"]]),xS=/^[\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 fs(n){return xS.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function oi(){}var Qc=null;function Kc(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var nl=null,il=null;function _m(n){var r=Oi(n);if(r&&(n=r.stateNode)){var a=n[Ot]||null;e:switch(n=r.stateNode,r.type){case"input":if(xr(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Yt(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var c=a[r];if(c!==n&&c.form===n.form){var m=c[Ot]||null;if(!m)throw Error(l(90));xr(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(r=0;r<a.length;r++)c=a[r],c.form===n.form&&us(c)}break e;case"textarea":km(n,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&ai(n,!!a.multiple,r,!1)}}}var Jc=!1;function Tm(n,r,a){if(Jc)return n(r,a);Jc=!0;try{var c=n(r);return c}finally{if(Jc=!1,(nl!==null||il!==null)&&(Js(),nl&&(r=nl,n=il,il=nl=null,_m(r),n)))for(r=0;r<n.length;r++)_m(n[r])}}function fa(n,r){var a=n.stateNode;if(a===null)return null;var c=a[Ot]||null;if(c===null)return null;a=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)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(l(231,r,typeof a));return a}var si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wc=!1;if(si)try{var da={};Object.defineProperty(da,"passive",{get:function(){Wc=!0}}),window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{Wc=!1}var Ui=null,ef=null,ds=null;function Am(){if(ds)return ds;var n,r=ef,a=r.length,c,m="value"in Ui?Ui.value:Ui.textContent,y=m.length;for(n=0;n<a&&r[n]===m[n];n++);var S=a-n;for(c=1;c<=S&&r[a-c]===m[y-c];c++);return ds=m.slice(n,1<c?1-c:void 0)}function hs(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function ps(){return!0}function Mm(){return!1}function Ft(n){function r(a,c,m,y,S){this._reactName=a,this._targetInst=m,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var M in n)n.hasOwnProperty(M)&&(a=n[M],this[M]=a?a(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?ps:Mm,this.isPropagationStopped=Mm,this}return p(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ps)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ps)},persist:function(){},isPersistent:ps}),r}var br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ms=Ft(br),ha=p({},br,{view:0,detail:0}),bS=Ft(ha),tf,nf,pa,gs=p({},ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==pa&&(pa&&n.type==="mousemove"?(tf=n.screenX-pa.screenX,nf=n.screenY-pa.screenY):nf=tf=0,pa=n),tf)},movementY:function(n){return"movementY"in n?n.movementY:nf}}),jm=Ft(gs),vS=p({},gs,{dataTransfer:0}),wS=Ft(vS),SS=p({},ha,{relatedTarget:0}),rf=Ft(SS),kS=p({},br,{animationName:0,elapsedTime:0,pseudoElement:0}),ES=Ft(kS),NS=p({},br,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),CS=Ft(NS),_S=p({},br,{data:0}),zm=Ft(_S),TS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AS={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"},MS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jS(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=MS[n])?!!r[n]:!1}function lf(){return jS}var zS=p({},ha,{key:function(n){if(n.key){var r=TS[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=hs(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?AS[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lf,charCode:function(n){return n.type==="keypress"?hs(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?hs(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),RS=Ft(zS),DS=p({},gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rm=Ft(DS),OS=p({},ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lf}),LS=Ft(OS),BS=p({},br,{propertyName:0,elapsedTime:0,pseudoElement:0}),HS=Ft(BS),US=p({},gs,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),IS=Ft(US),qS=p({},br,{newState:0,oldState:0}),VS=Ft(qS),$S=[9,13,27,32],af=si&&"CompositionEvent"in window,ma=null;si&&"documentMode"in document&&(ma=document.documentMode);var PS=si&&"TextEvent"in window&&!ma,Dm=si&&(!af||ma&&8<ma&&11>=ma),Om=" ",Lm=!1;function Bm(n,r){switch(n){case"keyup":return $S.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hm(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var rl=!1;function YS(n,r){switch(n){case"compositionend":return Hm(r);case"keypress":return r.which!==32?null:(Lm=!0,Om);case"textInput":return n=r.data,n===Om&&Lm?null:n;default:return null}}function FS(n,r){if(rl)return n==="compositionend"||!af&&Bm(n,r)?(n=Am(),ds=ef=Ui=null,rl=!1,n):null;switch(n){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 Dm&&r.locale!=="ko"?null:r.data;default:return null}}var XS={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 Um(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!XS[n.type]:r==="textarea"}function Im(n,r,a,c){nl?il?il.push(c):il=[c]:nl=c,r=lu(r,"onChange"),0<r.length&&(a=new ms("onChange","change",null,a,c),n.push({event:a,listeners:r}))}var ga=null,ya=null;function GS(n){S0(n,0)}function ys(n){var r=Li(n);if(us(r))return n}function qm(n,r){if(n==="change")return r}var Vm=!1;if(si){var of;if(si){var sf="oninput"in document;if(!sf){var $m=document.createElement("div");$m.setAttribute("oninput","return;"),sf=typeof $m.oninput=="function"}of=sf}else of=!1;Vm=of&&(!document.documentMode||9<document.documentMode)}function Pm(){ga&&(ga.detachEvent("onpropertychange",Ym),ya=ga=null)}function Ym(n){if(n.propertyName==="value"&&ys(ya)){var r=[];Im(r,ya,n,Kc(n)),Tm(GS,r)}}function ZS(n,r,a){n==="focusin"?(Pm(),ga=r,ya=a,ga.attachEvent("onpropertychange",Ym)):n==="focusout"&&Pm()}function QS(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ys(ya)}function KS(n,r){if(n==="click")return ys(r)}function JS(n,r){if(n==="input"||n==="change")return ys(r)}function WS(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var rn=typeof Object.is=="function"?Object.is:WS;function xa(n,r){if(rn(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var a=Object.keys(n),c=Object.keys(r);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var m=a[c];if(!Rt.call(r,m)||!rn(n[m],r[m]))return!1}return!0}function Fm(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Xm(n,r){var a=Fm(n);n=0;for(var c;a;){if(a.nodeType===3){if(c=n+a.textContent.length,n<=r&&c>=r)return{node:a,offset:r-n};n=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Fm(a)}}function Gm(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Gm(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Zm(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=yr(n.document);r instanceof n.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)n=r.contentWindow;else break;r=yr(n.document)}return r}function uf(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var ek=si&&"documentMode"in document&&11>=document.documentMode,ll=null,cf=null,ba=null,ff=!1;function Qm(n,r,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ff||ll==null||ll!==yr(c)||(c=ll,"selectionStart"in c&&uf(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}),ba&&xa(ba,c)||(ba=c,c=lu(cf,"onSelect"),0<c.length&&(r=new ms("onSelect","select",null,r,a),n.push({event:r,listeners:c}),r.target=ll)))}function vr(n,r){var a={};return a[n.toLowerCase()]=r.toLowerCase(),a["Webkit"+n]="webkit"+r,a["Moz"+n]="moz"+r,a}var al={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionrun:vr("Transition","TransitionRun"),transitionstart:vr("Transition","TransitionStart"),transitioncancel:vr("Transition","TransitionCancel"),transitionend:vr("Transition","TransitionEnd")},df={},Km={};si&&(Km=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function wr(n){if(df[n])return df[n];if(!al[n])return n;var r=al[n],a;for(a in r)if(r.hasOwnProperty(a)&&a in Km)return df[n]=r[a];return n}var Jm=wr("animationend"),Wm=wr("animationiteration"),eg=wr("animationstart"),tk=wr("transitionrun"),nk=wr("transitionstart"),ik=wr("transitioncancel"),tg=wr("transitionend"),ng=new Map,hf="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(" ");hf.push("scrollEnd");function An(n,r){ng.set(n,r),li(r,[n])}var xs=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},mn=[],ol=0,pf=0;function bs(){for(var n=ol,r=pf=ol=0;r<n;){var a=mn[r];mn[r++]=null;var c=mn[r];mn[r++]=null;var m=mn[r];mn[r++]=null;var y=mn[r];if(mn[r++]=null,c!==null&&m!==null){var S=c.pending;S===null?m.next=m:(m.next=S.next,S.next=m),c.pending=m}y!==0&&ig(a,m,y)}}function vs(n,r,a,c){mn[ol++]=n,mn[ol++]=r,mn[ol++]=a,mn[ol++]=c,pf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function mf(n,r,a,c){return vs(n,r,a,c),ws(n)}function Sr(n,r){return vs(n,null,null,r),ws(n)}function ig(n,r,a){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a);for(var m=!1,y=n.return;y!==null;)y.childLanes|=a,c=y.alternate,c!==null&&(c.childLanes|=a),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(m=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,m&&r!==null&&(m=31-Ge(a),n=y.hiddenUpdates,c=n[m],c===null?n[m]=[r]:c.push(r),r.lane=a|536870912),y):null}function ws(n){if(50<qa)throw qa=0,Ed=null,Error(l(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var sl={};function rk(n,r,a,c){this.tag=n,this.key=a,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 ln(n,r,a,c){return new rk(n,r,a,c)}function gf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ui(n,r){var a=n.alternate;return a===null?(a=ln(n.tag,r,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=r,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&65011712,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,r=n.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function rg(n,r){n.flags&=65011714;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,r=a.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Ss(n,r,a,c,m,y){var S=0;if(c=n,typeof n=="function")gf(n)&&(S=1);else if(typeof n=="string")S=uE(n,a,ne.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Z:return n=ln(31,a,r,m),n.elementType=Z,n.lanes=y,n;case E:return kr(a.children,m,y,r);case C:S=8,m|=24;break;case N:return n=ln(12,a,r,m|2),n.elementType=N,n.lanes=y,n;case B:return n=ln(13,a,r,m),n.elementType=B,n.lanes=y,n;case A:return n=ln(19,a,r,m),n.elementType=A,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:S=10;break e;case _:S=9;break e;case T:S=11;break e;case L:S=14;break e;case X:S=16,c=null;break e}S=29,a=Error(l(130,n===null?"null":typeof n,"")),c=null}return r=ln(S,a,r,m),r.elementType=n,r.type=c,r.lanes=y,r}function kr(n,r,a,c){return n=ln(7,n,c,r),n.lanes=a,n}function yf(n,r,a){return n=ln(6,n,null,r),n.lanes=a,n}function lg(n){var r=ln(18,null,null,0);return r.stateNode=n,r}function xf(n,r,a){return r=ln(4,n.children!==null?n.children:[],n.key,r),r.lanes=a,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var ag=new WeakMap;function gn(n,r){if(typeof n=="object"&&n!==null){var a=ag.get(n);return a!==void 0?a:(r={value:n,source:r,stack:tn(r)},ag.set(n,r),r)}return{value:n,source:r,stack:tn(r)}}var ul=[],cl=0,ks=null,va=0,yn=[],xn=0,Ii=null,qn=1,Vn="";function ci(n,r){ul[cl++]=va,ul[cl++]=ks,ks=n,va=r}function og(n,r,a){yn[xn++]=qn,yn[xn++]=Vn,yn[xn++]=Ii,Ii=n;var c=qn;n=Vn;var m=32-Ge(c)-1;c&=~(1<<m),a+=1;var y=32-Ge(r)+m;if(30<y){var S=m-m%5;y=(c&(1<<S)-1).toString(32),c>>=S,m-=S,qn=1<<32-Ge(r)+m|a<<m|c,Vn=y+n}else qn=1<<y|a<<m|c,Vn=n}function bf(n){n.return!==null&&(ci(n,1),og(n,1,0))}function vf(n){for(;n===ks;)ks=ul[--cl],ul[cl]=null,va=ul[--cl],ul[cl]=null;for(;n===Ii;)Ii=yn[--xn],yn[xn]=null,Vn=yn[--xn],yn[xn]=null,qn=yn[--xn],yn[xn]=null}function sg(n,r){yn[xn++]=qn,yn[xn++]=Vn,yn[xn++]=Ii,qn=r.id,Vn=r.overflow,Ii=n}var At=null,it=null,He=!1,qi=null,bn=!1,wf=Error(l(519));function Vi(n){var r=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wa(gn(r,n)),wf}function ug(n){var r=n.stateNode,a=n.type,c=n.memoizedProps;switch(r[Et]=n,r[Ot]=c,a){case"dialog":De("cancel",r),De("close",r);break;case"iframe":case"object":case"embed":De("load",r);break;case"video":case"audio":for(a=0;a<$a.length;a++)De($a[a],r);break;case"source":De("error",r);break;case"img":case"image":case"link":De("error",r),De("load",r);break;case"details":De("toggle",r);break;case"input":De("invalid",r),cs(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":De("invalid",r);break;case"textarea":De("invalid",r),Em(r,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||c.suppressHydrationWarning===!0||C0(r.textContent,a)?(c.popover!=null&&(De("beforetoggle",r),De("toggle",r)),c.onScroll!=null&&De("scroll",r),c.onScrollEnd!=null&&De("scrollend",r),c.onClick!=null&&(r.onclick=oi),r=!0):r=!1,r||Vi(n,!0)}function cg(n){for(At=n.return;At;)switch(At.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:At=At.return}}function fl(n){if(n!==At)return!1;if(!He)return cg(n),He=!0,!1;var r=n.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||Ud(n.type,n.memoizedProps)),a=!a),a&&it&&Vi(n),cg(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(l(317));it=O0(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(l(317));it=O0(n)}else r===27?(r=it,nr(n.type)?(n=Pd,Pd=null,it=n):it=r):it=At?wn(n.stateNode.nextSibling):null;return!0}function Er(){it=At=null,He=!1}function Sf(){var n=qi;return n!==null&&(Qt===null?Qt=n:Qt.push.apply(Qt,n),qi=null),n}function wa(n){qi===null?qi=[n]:qi.push(n)}var kf=O(null),Nr=null,fi=null;function $i(n,r,a){j(kf,r._currentValue),r._currentValue=a}function di(n){n._currentValue=kf.current,Y(kf)}function Ef(n,r,a){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===a)break;n=n.return}}function Nf(n,r,a,c){var m=n.child;for(m!==null&&(m.return=n);m!==null;){var y=m.dependencies;if(y!==null){var S=m.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=m;for(var $=0;$<r.length;$++)if(M.context===r[$]){y.lanes|=a,M=y.alternate,M!==null&&(M.lanes|=a),Ef(y.return,a,n),c||(S=null);break e}y=M.next}}else if(m.tag===18){if(S=m.return,S===null)throw Error(l(341));S.lanes|=a,y=S.alternate,y!==null&&(y.lanes|=a),Ef(S,a,n),S=null}else S=m.child;if(S!==null)S.return=m;else for(S=m;S!==null;){if(S===n){S=null;break}if(m=S.sibling,m!==null){m.return=S.return,S=m;break}S=S.return}m=S}}function dl(n,r,a,c){n=null;for(var m=r,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var S=m.alternate;if(S===null)throw Error(l(387));if(S=S.memoizedProps,S!==null){var M=m.type;rn(m.pendingProps.value,S.value)||(n!==null?n.push(M):n=[M])}}else if(m===de.current){if(S=m.alternate,S===null)throw Error(l(387));S.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(n!==null?n.push(Ga):n=[Ga])}m=m.return}n!==null&&Nf(r,n,a,c),r.flags|=262144}function Es(n){for(n=n.firstContext;n!==null;){if(!rn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Cr(n){Nr=n,fi=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Mt(n){return fg(Nr,n)}function Ns(n,r){return Nr===null&&Cr(n),fg(n,r)}function fg(n,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},fi===null){if(n===null)throw Error(l(308));fi=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else fi=fi.next=r;return a}var lk=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(a,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(a){return a()})}},ak=e.unstable_scheduleCallback,ok=e.unstable_NormalPriority,gt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cf(){return{controller:new lk,data:new Map,refCount:0}}function Sa(n){n.refCount--,n.refCount===0&&ak(ok,function(){n.controller.abort()})}var ka=null,_f=0,hl=0,pl=null;function sk(n,r){if(ka===null){var a=ka=[];_f=0,hl=Md(),pl={status:"pending",value:void 0,then:function(c){a.push(c)}}}return _f++,r.then(dg,dg),r}function dg(){if(--_f===0&&ka!==null){pl!==null&&(pl.status="fulfilled");var n=ka;ka=null,hl=0,pl=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function uk(n,r){var a=[],c={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var m=0;m<a.length;m++)(0,a[m])(r)},function(m){for(c.status="rejected",c.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),c}var hg=D.S;D.S=function(n,r){Qy=kt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&sk(n,r),hg!==null&&hg(n,r)};var _r=O(null);function Tf(){var n=_r.current;return n!==null?n:et.pooledCache}function Cs(n,r){r===null?j(_r,_r.current):j(_r,r.pool)}function pg(){var n=Tf();return n===null?null:{parent:gt._currentValue,pool:n}}var ml=Error(l(460)),Af=Error(l(474)),_s=Error(l(542)),Ts={then:function(){}};function mg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function gg(n,r,a){switch(a=n[a],a===void 0?n.push(r):a!==r&&(r.then(oi,oi),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,xg(n),n;default:if(typeof r.status=="string")r.then(oi,oi);else{if(n=et,n!==null&&100<n.shellSuspendCounter)throw Error(l(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var m=r;m.status="fulfilled",m.value=c}},function(c){if(r.status==="pending"){var m=r;m.status="rejected",m.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,xg(n),n}throw Ar=r,ml}}function Tr(n){try{var r=n._init;return r(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ar=a,ml):a}}var Ar=null;function yg(){if(Ar===null)throw Error(l(459));var n=Ar;return Ar=null,n}function xg(n){if(n===ml||n===_s)throw Error(l(483))}var gl=null,Ea=0;function As(n){var r=Ea;return Ea+=1,gl===null&&(gl=[]),gg(gl,n,r)}function Na(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Ms(n,r){throw r.$$typeof===b?Error(l(525)):(n=Object.prototype.toString.call(r),Error(l(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function bg(n){function r(Q,G){if(n){var J=Q.deletions;J===null?(Q.deletions=[G],Q.flags|=16):J.push(G)}}function a(Q,G){if(!n)return null;for(;G!==null;)r(Q,G),G=G.sibling;return null}function c(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function m(Q,G){return Q=ui(Q,G),Q.index=0,Q.sibling=null,Q}function y(Q,G,J){return Q.index=J,n?(J=Q.alternate,J!==null?(J=J.index,J<G?(Q.flags|=67108866,G):J):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function S(Q){return n&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,G,J,ae){return G===null||G.tag!==6?(G=yf(J,Q.mode,ae),G.return=Q,G):(G=m(G,J),G.return=Q,G)}function $(Q,G,J,ae){var xe=J.type;return xe===E?le(Q,G,J.props.children,ae,J.key):G!==null&&(G.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===X&&Tr(xe)===G.type)?(G=m(G,J.props),Na(G,J),G.return=Q,G):(G=Ss(J.type,J.key,J.props,null,Q.mode,ae),Na(G,J),G.return=Q,G)}function W(Q,G,J,ae){return G===null||G.tag!==4||G.stateNode.containerInfo!==J.containerInfo||G.stateNode.implementation!==J.implementation?(G=xf(J,Q.mode,ae),G.return=Q,G):(G=m(G,J.children||[]),G.return=Q,G)}function le(Q,G,J,ae,xe){return G===null||G.tag!==7?(G=kr(J,Q.mode,ae,xe),G.return=Q,G):(G=m(G,J),G.return=Q,G)}function oe(Q,G,J){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=yf(""+G,Q.mode,J),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case v:return J=Ss(G.type,G.key,G.props,null,Q.mode,J),Na(J,G),J.return=Q,J;case w:return G=xf(G,Q.mode,J),G.return=Q,G;case X:return G=Tr(G),oe(Q,G,J)}if(q(G)||P(G))return G=kr(G,Q.mode,J,null),G.return=Q,G;if(typeof G.then=="function")return oe(Q,As(G),J);if(G.$$typeof===k)return oe(Q,Ns(Q,G),J);Ms(Q,G)}return null}function te(Q,G,J,ae){var xe=G!==null?G.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return xe!==null?null:M(Q,G,""+J,ae);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===xe?$(Q,G,J,ae):null;case w:return J.key===xe?W(Q,G,J,ae):null;case X:return J=Tr(J),te(Q,G,J,ae)}if(q(J)||P(J))return xe!==null?null:le(Q,G,J,ae,null);if(typeof J.then=="function")return te(Q,G,As(J),ae);if(J.$$typeof===k)return te(Q,G,Ns(Q,J),ae);Ms(Q,J)}return null}function ie(Q,G,J,ae,xe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Q=Q.get(J)||null,M(G,Q,""+ae,xe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:return Q=Q.get(ae.key===null?J:ae.key)||null,$(G,Q,ae,xe);case w:return Q=Q.get(ae.key===null?J:ae.key)||null,W(G,Q,ae,xe);case X:return ae=Tr(ae),ie(Q,G,J,ae,xe)}if(q(ae)||P(ae))return Q=Q.get(J)||null,le(G,Q,ae,xe,null);if(typeof ae.then=="function")return ie(Q,G,J,As(ae),xe);if(ae.$$typeof===k)return ie(Q,G,J,Ns(G,ae),xe);Ms(G,ae)}return null}function me(Q,G,J,ae){for(var xe=null,Pe=null,ge=G,Ae=G=0,Be=null;ge!==null&&Ae<J.length;Ae++){ge.index>Ae?(Be=ge,ge=null):Be=ge.sibling;var Ye=te(Q,ge,J[Ae],ae);if(Ye===null){ge===null&&(ge=Be);break}n&&ge&&Ye.alternate===null&&r(Q,ge),G=y(Ye,G,Ae),Pe===null?xe=Ye:Pe.sibling=Ye,Pe=Ye,ge=Be}if(Ae===J.length)return a(Q,ge),He&&ci(Q,Ae),xe;if(ge===null){for(;Ae<J.length;Ae++)ge=oe(Q,J[Ae],ae),ge!==null&&(G=y(ge,G,Ae),Pe===null?xe=ge:Pe.sibling=ge,Pe=ge);return He&&ci(Q,Ae),xe}for(ge=c(ge);Ae<J.length;Ae++)Be=ie(ge,Q,Ae,J[Ae],ae),Be!==null&&(n&&Be.alternate!==null&&ge.delete(Be.key===null?Ae:Be.key),G=y(Be,G,Ae),Pe===null?xe=Be:Pe.sibling=Be,Pe=Be);return n&&ge.forEach(function(or){return r(Q,or)}),He&&ci(Q,Ae),xe}function Se(Q,G,J,ae){if(J==null)throw Error(l(151));for(var xe=null,Pe=null,ge=G,Ae=G=0,Be=null,Ye=J.next();ge!==null&&!Ye.done;Ae++,Ye=J.next()){ge.index>Ae?(Be=ge,ge=null):Be=ge.sibling;var or=te(Q,ge,Ye.value,ae);if(or===null){ge===null&&(ge=Be);break}n&&ge&&or.alternate===null&&r(Q,ge),G=y(or,G,Ae),Pe===null?xe=or:Pe.sibling=or,Pe=or,ge=Be}if(Ye.done)return a(Q,ge),He&&ci(Q,Ae),xe;if(ge===null){for(;!Ye.done;Ae++,Ye=J.next())Ye=oe(Q,Ye.value,ae),Ye!==null&&(G=y(Ye,G,Ae),Pe===null?xe=Ye:Pe.sibling=Ye,Pe=Ye);return He&&ci(Q,Ae),xe}for(ge=c(ge);!Ye.done;Ae++,Ye=J.next())Ye=ie(ge,Q,Ae,Ye.value,ae),Ye!==null&&(n&&Ye.alternate!==null&&ge.delete(Ye.key===null?Ae:Ye.key),G=y(Ye,G,Ae),Pe===null?xe=Ye:Pe.sibling=Ye,Pe=Ye);return n&&ge.forEach(function(vE){return r(Q,vE)}),He&&ci(Q,Ae),xe}function We(Q,G,J,ae){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 v:e:{for(var xe=J.key;G!==null;){if(G.key===xe){if(xe=J.type,xe===E){if(G.tag===7){a(Q,G.sibling),ae=m(G,J.props.children),ae.return=Q,Q=ae;break e}}else if(G.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===X&&Tr(xe)===G.type){a(Q,G.sibling),ae=m(G,J.props),Na(ae,J),ae.return=Q,Q=ae;break e}a(Q,G);break}else r(Q,G);G=G.sibling}J.type===E?(ae=kr(J.props.children,Q.mode,ae,J.key),ae.return=Q,Q=ae):(ae=Ss(J.type,J.key,J.props,null,Q.mode,ae),Na(ae,J),ae.return=Q,Q=ae)}return S(Q);case w:e:{for(xe=J.key;G!==null;){if(G.key===xe)if(G.tag===4&&G.stateNode.containerInfo===J.containerInfo&&G.stateNode.implementation===J.implementation){a(Q,G.sibling),ae=m(G,J.children||[]),ae.return=Q,Q=ae;break e}else{a(Q,G);break}else r(Q,G);G=G.sibling}ae=xf(J,Q.mode,ae),ae.return=Q,Q=ae}return S(Q);case X:return J=Tr(J),We(Q,G,J,ae)}if(q(J))return me(Q,G,J,ae);if(P(J)){if(xe=P(J),typeof xe!="function")throw Error(l(150));return J=xe.call(J),Se(Q,G,J,ae)}if(typeof J.then=="function")return We(Q,G,As(J),ae);if(J.$$typeof===k)return We(Q,G,Ns(Q,J),ae);Ms(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,G!==null&&G.tag===6?(a(Q,G.sibling),ae=m(G,J),ae.return=Q,Q=ae):(a(Q,G),ae=yf(J,Q.mode,ae),ae.return=Q,Q=ae),S(Q)):a(Q,G)}return function(Q,G,J,ae){try{Ea=0;var xe=We(Q,G,J,ae);return gl=null,xe}catch(ge){if(ge===ml||ge===_s)throw ge;var Pe=ln(29,ge,null,Q.mode);return Pe.lanes=ae,Pe.return=Q,Pe}}}var Mr=bg(!0),vg=bg(!1),Pi=!1;function Mf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jf(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Yi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Fi(n,r,a){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Xe&2)!==0){var m=c.pending;return m===null?r.next=r:(r.next=m.next,m.next=r),c.pending=r,r=ws(n),ig(n,null,a),r}return vs(n,c,r,a),ws(n)}function Ca(n,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,Wo(n,a)}}function zf(n,r){var a=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var m=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?m=y=S:y=y.next=S,a=a.next}while(a!==null);y===null?m=y=r:y=y.next=r}else m=y=r;a={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=r:n.next=r,a.lastBaseUpdate=r}var Rf=!1;function _a(){if(Rf){var n=pl;if(n!==null)throw n}}function Ta(n,r,a,c){Rf=!1;var m=n.updateQueue;Pi=!1;var y=m.firstBaseUpdate,S=m.lastBaseUpdate,M=m.shared.pending;if(M!==null){m.shared.pending=null;var $=M,W=$.next;$.next=null,S===null?y=W:S.next=W,S=$;var le=n.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==S&&(M===null?le.firstBaseUpdate=W:M.next=W,le.lastBaseUpdate=$))}if(y!==null){var oe=m.baseState;S=0,le=W=$=null,M=y;do{var te=M.lane&-536870913,ie=te!==M.lane;if(ie?(Le&te)===te:(c&te)===te){te!==0&&te===hl&&(Rf=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var me=n,Se=M;te=r;var We=a;switch(Se.tag){case 1:if(me=Se.payload,typeof me=="function"){oe=me.call(We,oe,te);break e}oe=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Se.payload,te=typeof me=="function"?me.call(We,oe,te):me,te==null)break e;oe=p({},oe,te);break e;case 2:Pi=!0}}te=M.callback,te!==null&&(n.flags|=64,ie&&(n.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(W=le=ie,$=oe):le=le.next=ie,S|=te;if(M=M.next,M===null){if(M=m.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);le===null&&($=oe),m.baseState=$,m.firstBaseUpdate=W,m.lastBaseUpdate=le,y===null&&(m.shared.lanes=0),Ki|=S,n.lanes=S,n.memoizedState=oe}}function wg(n,r){if(typeof n!="function")throw Error(l(191,n));n.call(r)}function Sg(n,r){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)wg(a[n],r)}var yl=O(null),js=O(0);function kg(n,r){n=wi,j(js,n),j(yl,r),wi=n|r.baseLanes}function Df(){j(js,wi),j(yl,yl.current)}function Of(){wi=js.current,Y(yl),Y(js)}var an=O(null),vn=null;function Xi(n){var r=n.alternate;j(ht,ht.current&1),j(an,n),vn===null&&(r===null||yl.current!==null||r.memoizedState!==null)&&(vn=n)}function Lf(n){j(ht,ht.current),j(an,n),vn===null&&(vn=n)}function Eg(n){n.tag===22?(j(ht,ht.current),j(an,n),vn===null&&(vn=n)):Gi()}function Gi(){j(ht,ht.current),j(an,an.current)}function on(n){Y(an),vn===n&&(vn=null),Y(ht)}var ht=O(0);function zs(n){for(var r=n;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Vd(a)||$d(a)))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===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var hi=0,Te=null,Ke=null,yt=null,Rs=!1,xl=!1,jr=!1,Ds=0,Aa=0,bl=null,ck=0;function ut(){throw Error(l(321))}function Bf(n,r){if(r===null)return!1;for(var a=0;a<r.length&&a<n.length;a++)if(!rn(n[a],r[a]))return!1;return!0}function Hf(n,r,a,c,m,y){return hi=y,Te=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,D.H=n===null||n.memoizedState===null?oy:Wf,jr=!1,y=a(c,m),jr=!1,xl&&(y=Cg(r,a,c,m)),Ng(n),y}function Ng(n){D.H=za;var r=Ke!==null&&Ke.next!==null;if(hi=0,yt=Ke=Te=null,Rs=!1,Aa=0,bl=null,r)throw Error(l(300));n===null||xt||(n=n.dependencies,n!==null&&Es(n)&&(xt=!0))}function Cg(n,r,a,c){Te=n;var m=0;do{if(xl&&(bl=null),Aa=0,xl=!1,25<=m)throw Error(l(301));if(m+=1,yt=Ke=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}D.H=sy,y=r(a,c)}while(xl);return y}function fk(){var n=D.H,r=n.useState()[0];return r=typeof r.then=="function"?Ma(r):r,n=n.useState()[0],(Ke!==null?Ke.memoizedState:null)!==n&&(Te.flags|=1024),r}function Uf(){var n=Ds!==0;return Ds=0,n}function If(n,r,a){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~a}function qf(n){if(Rs){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Rs=!1}hi=0,yt=Ke=Te=null,xl=!1,Aa=Ds=0,bl=null}function It(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Te.memoizedState=yt=n:yt=yt.next=n,yt}function pt(){if(Ke===null){var n=Te.alternate;n=n!==null?n.memoizedState:null}else n=Ke.next;var r=yt===null?Te.memoizedState:yt.next;if(r!==null)yt=r,Ke=n;else{if(n===null)throw Te.alternate===null?Error(l(467)):Error(l(310));Ke=n,n={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},yt===null?Te.memoizedState=yt=n:yt=yt.next=n}return yt}function Os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ma(n){var r=Aa;return Aa+=1,bl===null&&(bl=[]),n=gg(bl,n,r),r=Te,(yt===null?r.memoizedState:yt.next)===null&&(r=r.alternate,D.H=r===null||r.memoizedState===null?oy:Wf),n}function Ls(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Ma(n);if(n.$$typeof===k)return Mt(n)}throw Error(l(438,String(n)))}function Vf(n){var r=null,a=Te.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var c=Te.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(m){return m.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=Os(),Te.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(n),c=0;c<n;c++)a[c]=U;return r.index++,a}function pi(n,r){return typeof r=="function"?r(n):r}function Bs(n){var r=pt();return $f(r,Ke,n)}function $f(n,r,a){var c=n.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=a;var m=n.baseQueue,y=c.pending;if(y!==null){if(m!==null){var S=m.next;m.next=y.next,y.next=S}r.baseQueue=m=y,c.pending=null}if(y=n.baseState,m===null)n.memoizedState=y;else{r=m.next;var M=S=null,$=null,W=r,le=!1;do{var oe=W.lane&-536870913;if(oe!==W.lane?(Le&oe)===oe:(hi&oe)===oe){var te=W.revertLane;if(te===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),oe===hl&&(le=!0);else if((hi&te)===te){W=W.next,te===hl&&(le=!0);continue}else oe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},$===null?(M=$=oe,S=y):$=$.next=oe,Te.lanes|=te,Ki|=te;oe=W.action,jr&&a(y,oe),y=W.hasEagerState?W.eagerState:a(y,oe)}else te={lane:oe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},$===null?(M=$=te,S=y):$=$.next=te,Te.lanes|=oe,Ki|=oe;W=W.next}while(W!==null&&W!==r);if($===null?S=y:$.next=M,!rn(y,n.memoizedState)&&(xt=!0,le&&(a=pl,a!==null)))throw a;n.memoizedState=y,n.baseState=S,n.baseQueue=$,c.lastRenderedState=y}return m===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function Pf(n){var r=pt(),a=r.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=n;var c=a.dispatch,m=a.pending,y=r.memoizedState;if(m!==null){a.pending=null;var S=m=m.next;do y=n(y,S.action),S=S.next;while(S!==m);rn(y,r.memoizedState)||(xt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),a.lastRenderedState=y}return[y,c]}function _g(n,r,a){var c=Te,m=pt(),y=He;if(y){if(a===void 0)throw Error(l(407));a=a()}else a=r();var S=!rn((Ke||m).memoizedState,a);if(S&&(m.memoizedState=a,xt=!0),m=m.queue,Xf(Mg.bind(null,c,m,n),[n]),m.getSnapshot!==r||S||yt!==null&&yt.memoizedState.tag&1){if(c.flags|=2048,vl(9,{destroy:void 0},Ag.bind(null,c,m,a,r),null),et===null)throw Error(l(349));y||(hi&127)!==0||Tg(c,r,a)}return a}function Tg(n,r,a){n.flags|=16384,n={getSnapshot:r,value:a},r=Te.updateQueue,r===null?(r=Os(),Te.updateQueue=r,r.stores=[n]):(a=r.stores,a===null?r.stores=[n]:a.push(n))}function Ag(n,r,a,c){r.value=a,r.getSnapshot=c,jg(r)&&zg(n)}function Mg(n,r,a){return a(function(){jg(r)&&zg(n)})}function jg(n){var r=n.getSnapshot;n=n.value;try{var a=r();return!rn(n,a)}catch{return!0}}function zg(n){var r=Sr(n,2);r!==null&&Kt(r,n,2)}function Yf(n){var r=It();if(typeof n=="function"){var a=n;if(n=a(),jr){Dt(!0);try{a()}finally{Dt(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:n},r}function Rg(n,r,a,c){return n.baseState=a,$f(n,Ke,typeof c=="function"?c:pi)}function dk(n,r,a,c,m){if(Is(n))throw Error(l(485));if(n=r.action,n!==null){var y={payload:m,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};D.T!==null?a(!0):y.isTransition=!1,c(y),a=r.pending,a===null?(y.next=r.pending=y,Dg(r,y)):(y.next=a.next,r.pending=a.next=y)}}function Dg(n,r){var a=r.action,c=r.payload,m=n.state;if(r.isTransition){var y=D.T,S={};D.T=S;try{var M=a(m,c),$=D.S;$!==null&&$(S,M),Og(n,r,M)}catch(W){Ff(n,r,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),D.T=y}}else try{y=a(m,c),Og(n,r,y)}catch(W){Ff(n,r,W)}}function Og(n,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){Lg(n,r,c)},function(c){return Ff(n,r,c)}):Lg(n,r,a)}function Lg(n,r,a){r.status="fulfilled",r.value=a,Bg(r),n.state=a,r=n.pending,r!==null&&(a=r.next,a===r?n.pending=null:(a=a.next,r.next=a,Dg(n,a)))}function Ff(n,r,a){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=a,Bg(r),r=r.next;while(r!==c)}n.action=null}function Bg(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Hg(n,r){return r}function Ug(n,r){if(He){var a=et.formState;if(a!==null){e:{var c=Te;if(He){if(it){t:{for(var m=it,y=bn;m.nodeType!==8;){if(!y){m=null;break t}if(m=wn(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){it=wn(m.nextSibling),c=m.data==="F!";break e}}Vi(c)}c=!1}c&&(r=a[0])}}return a=It(),a.memoizedState=a.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hg,lastRenderedState:r},a.queue=c,a=ry.bind(null,Te,c),c.dispatch=a,c=Yf(!1),y=Jf.bind(null,Te,!1,c.queue),c=It(),m={state:r,dispatch:null,action:n,pending:null},c.queue=m,a=dk.bind(null,Te,m,y,a),m.dispatch=a,c.memoizedState=n,[r,a,!1]}function Ig(n){var r=pt();return qg(r,Ke,n)}function qg(n,r,a){if(r=$f(n,r,Hg)[0],n=Bs(pi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Ma(r)}catch(S){throw S===ml?_s:S}else c=r;r=pt();var m=r.queue,y=m.dispatch;return a!==r.memoizedState&&(Te.flags|=2048,vl(9,{destroy:void 0},hk.bind(null,m,a),null)),[c,y,n]}function hk(n,r){n.action=r}function Vg(n){var r=pt(),a=Ke;if(a!==null)return qg(r,a,n);pt(),r=r.memoizedState,a=pt();var c=a.queue.dispatch;return a.memoizedState=n,[r,c,!1]}function vl(n,r,a,c){return n={tag:n,create:a,deps:c,inst:r,next:null},r=Te.updateQueue,r===null&&(r=Os(),Te.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=n.next=n:(c=a.next,a.next=n,n.next=c,r.lastEffect=n),n}function $g(){return pt().memoizedState}function Hs(n,r,a,c){var m=It();Te.flags|=n,m.memoizedState=vl(1|r,{destroy:void 0},a,c===void 0?null:c)}function Us(n,r,a,c){var m=pt();c=c===void 0?null:c;var y=m.memoizedState.inst;Ke!==null&&c!==null&&Bf(c,Ke.memoizedState.deps)?m.memoizedState=vl(r,y,a,c):(Te.flags|=n,m.memoizedState=vl(1|r,y,a,c))}function Pg(n,r){Hs(8390656,8,n,r)}function Xf(n,r){Us(2048,8,n,r)}function pk(n){Te.flags|=4;var r=Te.updateQueue;if(r===null)r=Os(),Te.updateQueue=r,r.events=[n];else{var a=r.events;a===null?r.events=[n]:a.push(n)}}function Yg(n){var r=pt().memoizedState;return pk({ref:r,nextImpl:n}),function(){if((Xe&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}function Fg(n,r){return Us(4,2,n,r)}function Xg(n,r){return Us(4,4,n,r)}function Gg(n,r){if(typeof r=="function"){n=n();var a=r(n);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Zg(n,r,a){a=a!=null?a.concat([n]):null,Us(4,4,Gg.bind(null,r,n),a)}function Gf(){}function Qg(n,r){var a=pt();r=r===void 0?null:r;var c=a.memoizedState;return r!==null&&Bf(r,c[1])?c[0]:(a.memoizedState=[n,r],n)}function Kg(n,r){var a=pt();r=r===void 0?null:r;var c=a.memoizedState;if(r!==null&&Bf(r,c[1]))return c[0];if(c=n(),jr){Dt(!0);try{n()}finally{Dt(!1)}}return a.memoizedState=[c,r],c}function Zf(n,r,a){return a===void 0||(hi&1073741824)!==0&&(Le&261930)===0?n.memoizedState=r:(n.memoizedState=a,n=Jy(),Te.lanes|=n,Ki|=n,a)}function Jg(n,r,a,c){return rn(a,r)?a:yl.current!==null?(n=Zf(n,a,c),rn(n,r)||(xt=!0),n):(hi&42)===0||(hi&1073741824)!==0&&(Le&261930)===0?(xt=!0,n.memoizedState=a):(n=Jy(),Te.lanes|=n,Ki|=n,r)}function Wg(n,r,a,c,m){var y=V.p;V.p=y!==0&&8>y?y:8;var S=D.T,M={};D.T=M,Jf(n,!1,r,a);try{var $=m(),W=D.S;if(W!==null&&W(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var le=uk($,c);ja(n,r,le,cn(n))}else ja(n,r,c,cn(n))}catch(oe){ja(n,r,{then:function(){},status:"rejected",reason:oe},cn())}finally{V.p=y,S!==null&&M.types!==null&&(S.types=M.types),D.T=S}}function mk(){}function Qf(n,r,a,c){if(n.tag!==5)throw Error(l(476));var m=ey(n).queue;Wg(n,m,r,F,a===null?mk:function(){return ty(n),a(c)})}function ey(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:F},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:a},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function ty(n){var r=ey(n);r.next===null&&(r=n.alternate.memoizedState),ja(n,r.next.queue,{},cn())}function Kf(){return Mt(Ga)}function ny(){return pt().memoizedState}function iy(){return pt().memoizedState}function gk(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var a=cn();n=Yi(a);var c=Fi(r,n,a);c!==null&&(Kt(c,r,a),Ca(c,r,a)),r={cache:Cf()},n.payload=r;return}r=r.return}}function yk(n,r,a){var c=cn();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Is(n)?ly(r,a):(a=mf(n,r,a,c),a!==null&&(Kt(a,n,c),ay(a,r,c)))}function ry(n,r,a){var c=cn();ja(n,r,a,c)}function ja(n,r,a,c){var m={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Is(n))ly(r,m);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,M=y(S,a);if(m.hasEagerState=!0,m.eagerState=M,rn(M,S))return vs(n,r,m,0),et===null&&bs(),!1}catch{}if(a=mf(n,r,m,c),a!==null)return Kt(a,n,c),ay(a,r,c),!0}return!1}function Jf(n,r,a,c){if(c={lane:2,revertLane:Md(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Is(n)){if(r)throw Error(l(479))}else r=mf(n,a,c,2),r!==null&&Kt(r,n,2)}function Is(n){var r=n.alternate;return n===Te||r!==null&&r===Te}function ly(n,r){xl=Rs=!0;var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}function ay(n,r,a){if((a&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,Wo(n,a)}}var za={readContext:Mt,use:Ls,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};za.useEffectEvent=ut;var oy={readContext:Mt,use:Ls,useCallback:function(n,r){return It().memoizedState=[n,r===void 0?null:r],n},useContext:Mt,useEffect:Pg,useImperativeHandle:function(n,r,a){a=a!=null?a.concat([n]):null,Hs(4194308,4,Gg.bind(null,r,n),a)},useLayoutEffect:function(n,r){return Hs(4194308,4,n,r)},useInsertionEffect:function(n,r){Hs(4,2,n,r)},useMemo:function(n,r){var a=It();r=r===void 0?null:r;var c=n();if(jr){Dt(!0);try{n()}finally{Dt(!1)}}return a.memoizedState=[c,r],c},useReducer:function(n,r,a){var c=It();if(a!==void 0){var m=a(r);if(jr){Dt(!0);try{a(r)}finally{Dt(!1)}}}else m=r;return c.memoizedState=c.baseState=m,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:m},c.queue=n,n=n.dispatch=yk.bind(null,Te,n),[c.memoizedState,n]},useRef:function(n){var r=It();return n={current:n},r.memoizedState=n},useState:function(n){n=Yf(n);var r=n.queue,a=ry.bind(null,Te,r);return r.dispatch=a,[n.memoizedState,a]},useDebugValue:Gf,useDeferredValue:function(n,r){var a=It();return Zf(a,n,r)},useTransition:function(){var n=Yf(!1);return n=Wg.bind(null,Te,n.queue,!0,!1),It().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,a){var c=Te,m=It();if(He){if(a===void 0)throw Error(l(407));a=a()}else{if(a=r(),et===null)throw Error(l(349));(Le&127)!==0||Tg(c,r,a)}m.memoizedState=a;var y={value:a,getSnapshot:r};return m.queue=y,Pg(Mg.bind(null,c,y,n),[n]),c.flags|=2048,vl(9,{destroy:void 0},Ag.bind(null,c,y,a,r),null),a},useId:function(){var n=It(),r=et.identifierPrefix;if(He){var a=Vn,c=qn;a=(c&~(1<<32-Ge(c)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Ds++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=ck++,r="_"+r+"r_"+a.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Kf,useFormState:Ug,useActionState:Ug,useOptimistic:function(n){var r=It();r.memoizedState=r.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Jf.bind(null,Te,!0,a),a.dispatch=r,[n,r]},useMemoCache:Vf,useCacheRefresh:function(){return It().memoizedState=gk.bind(null,Te)},useEffectEvent:function(n){var r=It(),a={impl:n};return r.memoizedState=a,function(){if((Xe&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},Wf={readContext:Mt,use:Ls,useCallback:Qg,useContext:Mt,useEffect:Xf,useImperativeHandle:Zg,useInsertionEffect:Fg,useLayoutEffect:Xg,useMemo:Kg,useReducer:Bs,useRef:$g,useState:function(){return Bs(pi)},useDebugValue:Gf,useDeferredValue:function(n,r){var a=pt();return Jg(a,Ke.memoizedState,n,r)},useTransition:function(){var n=Bs(pi)[0],r=pt().memoizedState;return[typeof n=="boolean"?n:Ma(n),r]},useSyncExternalStore:_g,useId:ny,useHostTransitionStatus:Kf,useFormState:Ig,useActionState:Ig,useOptimistic:function(n,r){var a=pt();return Rg(a,Ke,n,r)},useMemoCache:Vf,useCacheRefresh:iy};Wf.useEffectEvent=Yg;var sy={readContext:Mt,use:Ls,useCallback:Qg,useContext:Mt,useEffect:Xf,useImperativeHandle:Zg,useInsertionEffect:Fg,useLayoutEffect:Xg,useMemo:Kg,useReducer:Pf,useRef:$g,useState:function(){return Pf(pi)},useDebugValue:Gf,useDeferredValue:function(n,r){var a=pt();return Ke===null?Zf(a,n,r):Jg(a,Ke.memoizedState,n,r)},useTransition:function(){var n=Pf(pi)[0],r=pt().memoizedState;return[typeof n=="boolean"?n:Ma(n),r]},useSyncExternalStore:_g,useId:ny,useHostTransitionStatus:Kf,useFormState:Vg,useActionState:Vg,useOptimistic:function(n,r){var a=pt();return Ke!==null?Rg(a,Ke,n,r):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:Vf,useCacheRefresh:iy};sy.useEffectEvent=Yg;function ed(n,r,a,c){r=n.memoizedState,a=a(c,r),a=a==null?r:p({},r,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var td={enqueueSetState:function(n,r,a){n=n._reactInternals;var c=cn(),m=Yi(c);m.payload=r,a!=null&&(m.callback=a),r=Fi(n,m,c),r!==null&&(Kt(r,n,c),Ca(r,n,c))},enqueueReplaceState:function(n,r,a){n=n._reactInternals;var c=cn(),m=Yi(c);m.tag=1,m.payload=r,a!=null&&(m.callback=a),r=Fi(n,m,c),r!==null&&(Kt(r,n,c),Ca(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var a=cn(),c=Yi(a);c.tag=2,r!=null&&(c.callback=r),r=Fi(n,c,a),r!==null&&(Kt(r,n,a),Ca(r,n,a))}};function uy(n,r,a,c,m,y,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,y,S):r.prototype&&r.prototype.isPureReactComponent?!xa(a,c)||!xa(m,y):!0}function cy(n,r,a,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,c),r.state!==n&&td.enqueueReplaceState(r,r.state,null)}function zr(n,r){var a=r;if("ref"in r){a={};for(var c in r)c!=="ref"&&(a[c]=r[c])}if(n=n.defaultProps){a===r&&(a=p({},a));for(var m in n)a[m]===void 0&&(a[m]=n[m])}return a}function fy(n){xs(n)}function dy(n){console.error(n)}function hy(n){xs(n)}function qs(n,r){try{var a=n.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function py(n,r,a){try{var c=n.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function nd(n,r,a){return a=Yi(a),a.tag=3,a.payload={element:null},a.callback=function(){qs(n,r)},a}function my(n){return n=Yi(n),n.tag=3,n}function gy(n,r,a,c){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var y=c.value;n.payload=function(){return m(y)},n.callback=function(){py(r,a,c)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){py(r,a,c),typeof m!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function xk(n,r,a,c,m){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=a.alternate,r!==null&&dl(r,a,m,!0),a=an.current,a!==null){switch(a.tag){case 31:case 13:return vn===null?Ws():a.alternate===null&&ct===0&&(ct=3),a.flags&=-257,a.flags|=65536,a.lanes=m,c===Ts?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([c]):r.add(c),_d(n,c,m)),!1;case 22:return a.flags|=65536,c===Ts?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([c]):a.add(c)),_d(n,c,m)),!1}throw Error(l(435,a.tag))}return _d(n,c,m),Ws(),!1}if(He)return r=an.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=m,c!==wf&&(n=Error(l(422),{cause:c}),wa(gn(n,a)))):(c!==wf&&(r=Error(l(423),{cause:c}),wa(gn(r,a))),n=n.current.alternate,n.flags|=65536,m&=-m,n.lanes|=m,c=gn(c,a),m=nd(n.stateNode,c,m),zf(n,m),ct!==4&&(ct=2)),!1;var y=Error(l(520),{cause:c});if(y=gn(y,a),Ia===null?Ia=[y]:Ia.push(y),ct!==4&&(ct=2),r===null)return!0;c=gn(c,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,n=m&-m,a.lanes|=n,n=nd(a.stateNode,c,n),zf(a,n),!1;case 1:if(r=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ji===null||!Ji.has(y))))return a.flags|=65536,m&=-m,a.lanes|=m,m=my(m),gy(m,n,a,c),zf(a,m),!1}a=a.return}while(a!==null);return!1}var id=Error(l(461)),xt=!1;function jt(n,r,a,c){r.child=n===null?vg(r,null,a,c):Mr(r,n.child,a,c)}function yy(n,r,a,c,m){a=a.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 Cr(r),c=Hf(n,r,a,S,y,m),M=Uf(),n!==null&&!xt?(If(n,r,m),mi(n,r,m)):(He&&M&&bf(r),r.flags|=1,jt(n,r,c,m),r.child)}function xy(n,r,a,c,m){if(n===null){var y=a.type;return typeof y=="function"&&!gf(y)&&y.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=y,by(n,r,y,c,m)):(n=Ss(a.type,null,c,r,r.mode,m),n.ref=r.ref,n.return=r,r.child=n)}if(y=n.child,!fd(n,m)){var S=y.memoizedProps;if(a=a.compare,a=a!==null?a:xa,a(S,c)&&n.ref===r.ref)return mi(n,r,m)}return r.flags|=1,n=ui(y,c),n.ref=r.ref,n.return=r,r.child=n}function by(n,r,a,c,m){if(n!==null){var y=n.memoizedProps;if(xa(y,c)&&n.ref===r.ref)if(xt=!1,r.pendingProps=c=y,fd(n,m))(n.flags&131072)!==0&&(xt=!0);else return r.lanes=n.lanes,mi(n,r,m)}return rd(n,r,a,c,m)}function vy(n,r,a,c){var m=c.children,y=n!==null?n.memoizedState:null;if(n===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|a:a,n!==null){for(c=r.child=n.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~y}else c=0,r.child=null;return wy(n,r,y,a,c)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Cs(r,y!==null?y.cachePool:null),y!==null?kg(r,y):Df(),Eg(r);else return c=r.lanes=536870912,wy(n,r,y!==null?y.baseLanes|a:a,a,c)}else y!==null?(Cs(r,y.cachePool),kg(r,y),Gi(),r.memoizedState=null):(n!==null&&Cs(r,null),Df(),Gi());return jt(n,r,m,a),r.child}function Ra(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function wy(n,r,a,c,m){var y=Tf();return y=y===null?null:{parent:gt._currentValue,pool:y},r.memoizedState={baseLanes:a,cachePool:y},n!==null&&Cs(r,null),Df(),Eg(r),n!==null&&dl(n,r,c,!0),r.childLanes=m,null}function Vs(n,r){return r=Ps({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function Sy(n,r,a){return Mr(r,n.child,null,a),n=Vs(r,r.pendingProps),n.flags|=2,on(r),r.memoizedState=null,n}function bk(n,r,a){var c=r.pendingProps,m=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(He){if(c.mode==="hidden")return n=Vs(r,c),r.lanes=536870912,Ra(null,n);if(Lf(r),(n=it)?(n=D0(n,bn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Ii!==null?{id:qn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},a=lg(n),a.return=r,r.child=a,At=r,it=null)):n=null,n===null)throw Vi(r);return r.lanes=536870912,null}return Vs(r,c)}var y=n.memoizedState;if(y!==null){var S=y.dehydrated;if(Lf(r),m)if(r.flags&256)r.flags&=-257,r=Sy(n,r,a);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(l(558));else if(xt||dl(n,r,a,!1),m=(a&n.childLanes)!==0,xt||m){if(c=et,c!==null&&(S=es(c,a),S!==0&&S!==y.retryLane))throw y.retryLane=S,Sr(n,S),Kt(c,n,S),id;Ws(),r=Sy(n,r,a)}else n=y.treeContext,it=wn(S.nextSibling),At=r,He=!0,qi=null,bn=!1,n!==null&&sg(r,n),r=Vs(r,c),r.flags|=4096;return r}return n=ui(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function $s(n,r){var a=r.ref;if(a===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(n===null||n.ref!==a)&&(r.flags|=4194816)}}function rd(n,r,a,c,m){return Cr(r),a=Hf(n,r,a,c,void 0,m),c=Uf(),n!==null&&!xt?(If(n,r,m),mi(n,r,m)):(He&&c&&bf(r),r.flags|=1,jt(n,r,a,m),r.child)}function ky(n,r,a,c,m,y){return Cr(r),r.updateQueue=null,a=Cg(r,c,a,m),Ng(n),c=Uf(),n!==null&&!xt?(If(n,r,y),mi(n,r,y)):(He&&c&&bf(r),r.flags|=1,jt(n,r,a,y),r.child)}function Ey(n,r,a,c,m){if(Cr(r),r.stateNode===null){var y=sl,S=a.contextType;typeof S=="object"&&S!==null&&(y=Mt(S)),y=new a(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=td,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},Mf(r),S=a.contextType,y.context=typeof S=="object"&&S!==null?Mt(S):sl,y.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(ed(r,a,S,c),y.state=r.memoizedState),typeof a.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&&td.enqueueReplaceState(y,y.state,null),Ta(r,c,y,m),_a(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){y=r.stateNode;var M=r.memoizedProps,$=zr(a,M);y.props=$;var W=y.context,le=a.contextType;S=sl,typeof le=="object"&&le!==null&&(S=Mt(le));var oe=a.getDerivedStateFromProps;le=typeof oe=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,le||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&cy(r,y,c,S),Pi=!1;var te=r.memoizedState;y.state=te,Ta(r,c,y,m),_a(),W=r.memoizedState,M||te!==W||Pi?(typeof oe=="function"&&(ed(r,a,oe,c),W=r.memoizedState),($=Pi||uy(r,a,$,c,te,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=$):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,jf(n,r),S=r.memoizedProps,le=zr(a,S),y.props=le,oe=r.pendingProps,te=y.context,W=a.contextType,$=sl,typeof W=="object"&&W!==null&&($=Mt(W)),M=a.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==oe||te!==$)&&cy(r,y,c,$),Pi=!1,te=r.memoizedState,y.state=te,Ta(r,c,y,m),_a();var ie=r.memoizedState;S!==oe||te!==ie||Pi||n!==null&&n.dependencies!==null&&Es(n.dependencies)?(typeof M=="function"&&(ed(r,a,M,c),ie=r.memoizedState),(le=Pi||uy(r,a,le,c,te,ie,$)||n!==null&&n.dependencies!==null&&Es(n.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,ie,$),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,ie,$)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=ie),y.props=c,y.state=ie,y.context=$,c=le):(typeof y.componentDidUpdate!="function"||S===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),c=!1)}return y=c,$s(n,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,n!==null&&c?(r.child=Mr(r,n.child,null,m),r.child=Mr(r,null,a,m)):jt(n,r,a,m),r.memoizedState=y.state,n=r.child):n=mi(n,r,m),n}function Ny(n,r,a,c){return Er(),r.flags|=256,jt(n,r,a,c),r.child}var ld={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ad(n){return{baseLanes:n,cachePool:pg()}}function od(n,r,a){return n=n!==null?n.childLanes&~a:0,r&&(n|=un),n}function Cy(n,r,a){var c=r.pendingProps,m=!1,y=(r.flags&128)!==0,S;if((S=y)||(S=n!==null&&n.memoizedState===null?!1:(ht.current&2)!==0),S&&(m=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,n===null){if(He){if(m?Xi(r):Gi(),(n=it)?(n=D0(n,bn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Ii!==null?{id:qn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},a=lg(n),a.return=r,r.child=a,At=r,it=null)):n=null,n===null)throw Vi(r);return $d(n)?r.lanes=32:r.lanes=536870912,null}var M=c.children;return c=c.fallback,m?(Gi(),m=r.mode,M=Ps({mode:"hidden",children:M},m),c=kr(c,m,a,null),M.return=r,c.return=r,M.sibling=c,r.child=M,c=r.child,c.memoizedState=ad(a),c.childLanes=od(n,S,a),r.memoizedState=ld,Ra(null,c)):(Xi(r),sd(r,M))}var $=n.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(y)r.flags&256?(Xi(r),r.flags&=-257,r=ud(n,r,a)):r.memoizedState!==null?(Gi(),r.child=n.child,r.flags|=128,r=null):(Gi(),M=c.fallback,m=r.mode,c=Ps({mode:"visible",children:c.children},m),M=kr(M,m,a,null),M.flags|=2,c.return=r,M.return=r,c.sibling=M,r.child=c,Mr(r,n.child,null,a),c=r.child,c.memoizedState=ad(a),c.childLanes=od(n,S,a),r.memoizedState=ld,r=Ra(null,c));else if(Xi(r),$d(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(l(419)),c.stack="",c.digest=S,wa({value:c,source:null,stack:null}),r=ud(n,r,a)}else if(xt||dl(n,r,a,!1),S=(a&n.childLanes)!==0,xt||S){if(S=et,S!==null&&(c=es(S,a),c!==0&&c!==$.retryLane))throw $.retryLane=c,Sr(n,c),Kt(S,n,c),id;Vd(M)||Ws(),r=ud(n,r,a)}else Vd(M)?(r.flags|=192,r.child=n.child,r=null):(n=$.treeContext,it=wn(M.nextSibling),At=r,He=!0,qi=null,bn=!1,n!==null&&sg(r,n),r=sd(r,c.children),r.flags|=4096);return r}return m?(Gi(),M=c.fallback,m=r.mode,$=n.child,W=$.sibling,c=ui($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,W!==null?M=ui(W,M):(M=kr(M,m,a,null),M.flags|=2),M.return=r,c.return=r,c.sibling=M,r.child=c,Ra(null,c),c=r.child,M=n.child.memoizedState,M===null?M=ad(a):(m=M.cachePool,m!==null?($=gt._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=pg(),M={baseLanes:M.baseLanes|a,cachePool:m}),c.memoizedState=M,c.childLanes=od(n,S,a),r.memoizedState=ld,Ra(n.child,c)):(Xi(r),a=n.child,n=a.sibling,a=ui(a,{mode:"visible",children:c.children}),a.return=r,a.sibling=null,n!==null&&(S=r.deletions,S===null?(r.deletions=[n],r.flags|=16):S.push(n)),r.child=a,r.memoizedState=null,a)}function sd(n,r){return r=Ps({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Ps(n,r){return n=ln(22,n,null,r),n.lanes=0,n}function ud(n,r,a){return Mr(r,n.child,null,a),n=sd(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function _y(n,r,a){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),Ef(n.return,r,a)}function cd(n,r,a,c,m,y){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:m,treeForkCount:y}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=a,S.tailMode=m,S.treeForkCount=y)}function Ty(n,r,a){var c=r.pendingProps,m=c.revealOrder,y=c.tail;c=c.children;var S=ht.current,M=(S&2)!==0;if(M?(S=S&1|2,r.flags|=128):S&=1,j(ht,S),jt(n,r,c,a),c=He?va:0,!M&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_y(n,a,r);else if(n.tag===19)_y(n,a,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(m){case"forwards":for(a=r.child,m=null;a!==null;)n=a.alternate,n!==null&&zs(n)===null&&(m=a),a=a.sibling;a=m,a===null?(m=r.child,r.child=null):(m=a.sibling,a.sibling=null),cd(r,!1,m,a,y,c);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=r.child,r.child=null;m!==null;){if(n=m.alternate,n!==null&&zs(n)===null){r.child=m;break}n=m.sibling,m.sibling=a,a=m,m=n}cd(r,!0,a,null,y,c);break;case"together":cd(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function mi(n,r,a){if(n!==null&&(r.dependencies=n.dependencies),Ki|=r.lanes,(a&r.childLanes)===0)if(n!==null){if(dl(n,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(l(153));if(r.child!==null){for(n=r.child,a=ui(n,n.pendingProps),r.child=a,a.return=r;n.sibling!==null;)n=n.sibling,a=a.sibling=ui(n,n.pendingProps),a.return=r;a.sibling=null}return r.child}function fd(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Es(n)))}function vk(n,r,a){switch(r.tag){case 3:se(r,r.stateNode.containerInfo),$i(r,gt,n.memoizedState.cache),Er();break;case 27:case 5:ke(r);break;case 4:se(r,r.stateNode.containerInfo);break;case 10:$i(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Lf(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(Xi(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Cy(n,r,a):(Xi(r),n=mi(n,r,a),n!==null?n.sibling:null);Xi(r);break;case 19:var m=(n.flags&128)!==0;if(c=(a&r.childLanes)!==0,c||(dl(n,r,a,!1),c=(a&r.childLanes)!==0),m){if(c)return Ty(n,r,a);r.flags|=128}if(m=r.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),j(ht,ht.current),c)break;return null;case 22:return r.lanes=0,vy(n,r,a,r.pendingProps);case 24:$i(r,gt,n.memoizedState.cache)}return mi(n,r,a)}function Ay(n,r,a){if(n!==null)if(n.memoizedProps!==r.pendingProps)xt=!0;else{if(!fd(n,a)&&(r.flags&128)===0)return xt=!1,vk(n,r,a);xt=(n.flags&131072)!==0}else xt=!1,He&&(r.flags&1048576)!==0&&og(r,va,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=Tr(r.elementType),r.type=n,typeof n=="function")gf(n)?(c=zr(n,c),r.tag=1,r=Ey(null,r,n,c,a)):(r.tag=0,r=rd(null,r,n,c,a));else{if(n!=null){var m=n.$$typeof;if(m===T){r.tag=11,r=yy(null,r,n,c,a);break e}else if(m===L){r.tag=14,r=xy(null,r,n,c,a);break e}}throw r=H(n)||n,Error(l(306,r,""))}}return r;case 0:return rd(n,r,r.type,r.pendingProps,a);case 1:return c=r.type,m=zr(c,r.pendingProps),Ey(n,r,c,m,a);case 3:e:{if(se(r,r.stateNode.containerInfo),n===null)throw Error(l(387));c=r.pendingProps;var y=r.memoizedState;m=y.element,jf(n,r),Ta(r,c,null,a);var S=r.memoizedState;if(c=S.cache,$i(r,gt,c),c!==y.cache&&Nf(r,[gt],a,!0),_a(),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=Ny(n,r,c,a);break e}else if(c!==m){m=gn(Error(l(424)),r),wa(m),r=Ny(n,r,c,a);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,it=wn(n.firstChild),At=r,He=!0,qi=null,bn=!0,a=vg(r,null,c,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Er(),c===m){r=mi(n,r,a);break e}jt(n,r,c,a)}r=r.child}return r;case 26:return $s(n,r),n===null?(a=I0(r.type,null,r.pendingProps,null))?r.memoizedState=a:He||(a=r.type,n=r.pendingProps,c=au(ce.current).createElement(a),c[Et]=r,c[Ot]=n,zt(c,a,n),mt(c),r.stateNode=c):r.memoizedState=I0(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return ke(r),n===null&&He&&(c=r.stateNode=B0(r.type,r.pendingProps,ce.current),At=r,bn=!0,m=it,nr(r.type)?(Pd=m,it=wn(c.firstChild)):it=m),jt(n,r,r.pendingProps.children,a),$s(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&He&&((m=c=it)&&(c=Qk(c,r.type,r.pendingProps,bn),c!==null?(r.stateNode=c,At=r,it=wn(c.firstChild),bn=!1,m=!0):m=!1),m||Vi(r)),ke(r),m=r.type,y=r.pendingProps,S=n!==null?n.memoizedProps:null,c=y.children,Ud(m,y)?c=null:S!==null&&Ud(m,S)&&(r.flags|=32),r.memoizedState!==null&&(m=Hf(n,r,fk,null,null,a),Ga._currentValue=m),$s(n,r),jt(n,r,c,a),r.child;case 6:return n===null&&He&&((n=a=it)&&(a=Kk(a,r.pendingProps,bn),a!==null?(r.stateNode=a,At=r,it=null,n=!0):n=!1),n||Vi(r)),null;case 13:return Cy(n,r,a);case 4:return se(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=Mr(r,null,c,a):jt(n,r,c,a),r.child;case 11:return yy(n,r,r.type,r.pendingProps,a);case 7:return jt(n,r,r.pendingProps,a),r.child;case 8:return jt(n,r,r.pendingProps.children,a),r.child;case 12:return jt(n,r,r.pendingProps.children,a),r.child;case 10:return c=r.pendingProps,$i(r,r.type,c.value),jt(n,r,c.children,a),r.child;case 9:return m=r.type._context,c=r.pendingProps.children,Cr(r),m=Mt(m),c=c(m),r.flags|=1,jt(n,r,c,a),r.child;case 14:return xy(n,r,r.type,r.pendingProps,a);case 15:return by(n,r,r.type,r.pendingProps,a);case 19:return Ty(n,r,a);case 31:return bk(n,r,a);case 22:return vy(n,r,a,r.pendingProps);case 24:return Cr(r),c=Mt(gt),n===null?(m=Tf(),m===null&&(m=et,y=Cf(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=a),m=y),r.memoizedState={parent:c,cache:m},Mf(r),$i(r,gt,m)):((n.lanes&a)!==0&&(jf(n,r),Ta(r,null,null,a),_a()),m=n.memoizedState,y=r.memoizedState,m.parent!==c?(m={parent:c,cache:c},r.memoizedState=m,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=m),$i(r,gt,c)):(c=y.cache,$i(r,gt,c),c!==m.cache&&Nf(r,[gt],a,!0))),jt(n,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(l(156,r.tag))}function gi(n){n.flags|=4}function dd(n,r,a,c,m){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(m&335544128)===m)if(n.stateNode.complete)n.flags|=8192;else if(n0())n.flags|=8192;else throw Ar=Ts,Af}else n.flags&=-16777217}function My(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Y0(r))if(n0())n.flags|=8192;else throw Ar=Ts,Af}function Ys(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ko():536870912,n.lanes|=r,El|=r)}function Da(n,r){if(!He)switch(n.tailMode){case"hidden":r=n.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?n.tail=null:a.sibling=null;break;case"collapsed":a=n.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function rt(n){var r=n.alternate!==null&&n.alternate.child===n.child,a=0,c=0;if(r)for(var m=n.child;m!==null;)a|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=n,m=m.sibling;else for(m=n.child;m!==null;)a|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=n,m=m.sibling;return n.subtreeFlags|=c,n.childLanes=a,r}function wk(n,r,a){var c=r.pendingProps;switch(vf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(r),null;case 1:return rt(r),null;case 3:return a=r.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),di(gt),pe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(fl(r)?gi(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Sf())),rt(r),null;case 26:var m=r.type,y=r.memoizedState;return n===null?(gi(r),y!==null?(rt(r),My(r,y)):(rt(r),dd(r,m,null,c,a))):y?y!==n.memoizedState?(gi(r),rt(r),My(r,y)):(rt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&gi(r),rt(r),dd(r,m,n,c,a)),null;case 27:if(Ne(r),a=ce.current,m=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&gi(r);else{if(!c){if(r.stateNode===null)throw Error(l(166));return rt(r),null}n=ne.current,fl(r)?ug(r):(n=B0(m,c,a),r.stateNode=n,gi(r))}return rt(r),null;case 5:if(Ne(r),m=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&gi(r);else{if(!c){if(r.stateNode===null)throw Error(l(166));return rt(r),null}if(y=ne.current,fl(r))ug(r);else{var S=au(ce.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",m);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(m,{is:c.is}):S.createElement(m)}}y[Et]=r,y[Ot]=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(zt(y,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&gi(r)}}return rt(r),dd(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,a),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&gi(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(l(166));if(n=ce.current,fl(r)){if(n=r.stateNode,a=r.memoizedProps,c=null,m=At,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}n[Et]=r,n=!!(n.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||C0(n.nodeValue,a)),n||Vi(r,!0)}else n=au(n).createTextNode(c),n[Et]=r,r.stateNode=n}return rt(r),null;case 31:if(a=r.memoizedState,n===null||n.memoizedState!==null){if(c=fl(r),a!==null){if(n===null){if(!c)throw Error(l(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(l(557));n[Et]=r}else Er(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;rt(r),n=!1}else a=Sf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return r.flags&256?(on(r),r):(on(r),null);if((r.flags&128)!==0)throw Error(l(558))}return rt(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(m=fl(r),c!==null&&c.dehydrated!==null){if(n===null){if(!m)throw Error(l(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[Et]=r}else Er(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;rt(r),m=!1}else m=Sf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=m),m=!0;if(!m)return r.flags&256?(on(r),r):(on(r),null)}return on(r),(r.flags&128)!==0?(r.lanes=a,r):(a=c!==null,n=n!==null&&n.memoizedState!==null,a&&(c=r.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048)),a!==n&&a&&(r.child.flags|=8192),Ys(r,r.updateQueue),rt(r),null);case 4:return pe(),n===null&&Dd(r.stateNode.containerInfo),rt(r),null;case 10:return di(r.type),rt(r),null;case 19:if(Y(ht),c=r.memoizedState,c===null)return rt(r),null;if(m=(r.flags&128)!==0,y=c.rendering,y===null)if(m)Da(c,!1);else{if(ct!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(y=zs(n),y!==null){for(r.flags|=128,Da(c,!1),n=y.updateQueue,r.updateQueue=n,Ys(r,n),r.subtreeFlags=0,n=a,a=r.child;a!==null;)rg(a,n),a=a.sibling;return j(ht,ht.current&1|2),He&&ci(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&kt()>Qs&&(r.flags|=128,m=!0,Da(c,!1),r.lanes=4194304)}else{if(!m)if(n=zs(y),n!==null){if(r.flags|=128,m=!0,n=n.updateQueue,r.updateQueue=n,Ys(r,n),Da(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!He)return rt(r),null}else 2*kt()-c.renderingStartTime>Qs&&a!==536870912&&(r.flags|=128,m=!0,Da(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(n=c.last,n!==null?n.sibling=y:r.child=y,c.last=y)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=kt(),n.sibling=null,a=ht.current,j(ht,m?a&1|2:a&1),He&&ci(r,c.treeForkCount),n):(rt(r),null);case 22:case 23:return on(r),Of(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(a&536870912)!==0&&(r.flags&128)===0&&(rt(r),r.subtreeFlags&6&&(r.flags|=8192)):rt(r),a=r.updateQueue,a!==null&&Ys(r,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==a&&(r.flags|=2048),n!==null&&Y(_r),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),di(gt),rt(r),null;case 25:return null;case 30:return null}throw Error(l(156,r.tag))}function Sk(n,r){switch(vf(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return di(gt),pe(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Ne(r),null;case 31:if(r.memoizedState!==null){if(on(r),r.alternate===null)throw Error(l(340));Er()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(on(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(l(340));Er()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return Y(ht),null;case 4:return pe(),null;case 10:return di(r.type),null;case 22:case 23:return on(r),Of(),n!==null&&Y(_r),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return di(gt),null;case 25:return null;default:return null}}function jy(n,r){switch(vf(r),r.tag){case 3:di(gt),pe();break;case 26:case 27:case 5:Ne(r);break;case 4:pe();break;case 31:r.memoizedState!==null&&on(r);break;case 13:on(r);break;case 19:Y(ht);break;case 10:di(r.type);break;case 22:case 23:on(r),Of(),n!==null&&Y(_r);break;case 24:di(gt)}}function Oa(n,r){try{var a=r.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var m=c.next;a=m;do{if((a.tag&n)===n){c=void 0;var y=a.create,S=a.inst;c=y(),S.destroy=c}a=a.next}while(a!==m)}}catch(M){Qe(r,r.return,M)}}function Zi(n,r,a){try{var c=r.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var y=m.next;c=y;do{if((c.tag&n)===n){var S=c.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,m=r;var $=a,W=M;try{W()}catch(le){Qe(m,$,le)}}}c=c.next}while(c!==y)}}catch(le){Qe(r,r.return,le)}}function zy(n){var r=n.updateQueue;if(r!==null){var a=n.stateNode;try{Sg(r,a)}catch(c){Qe(n,n.return,c)}}}function Ry(n,r,a){a.props=zr(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(c){Qe(n,r,c)}}function La(n,r){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof a=="function"?n.refCleanup=a(c):a.current=c}}catch(m){Qe(n,r,m)}}function $n(n,r){var a=n.ref,c=n.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(m){Qe(n,r,m)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){Qe(n,r,m)}else a.current=null}function Dy(n){var r=n.type,a=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(m){Qe(n,n.return,m)}}function hd(n,r,a){try{var c=n.stateNode;Pk(c,n.type,a,r),c[Ot]=r}catch(m){Qe(n,n.return,m)}}function Oy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&nr(n.type)||n.tag===4}function pd(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Oy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&nr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function md(n,r,a){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(n),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=oi));else if(c!==4&&(c===27&&nr(n.type)&&(a=n.stateNode,r=null),n=n.child,n!==null))for(md(n,r,a),n=n.sibling;n!==null;)md(n,r,a),n=n.sibling}function Fs(n,r,a){var c=n.tag;if(c===5||c===6)n=n.stateNode,r?a.insertBefore(n,r):a.appendChild(n);else if(c!==4&&(c===27&&nr(n.type)&&(a=n.stateNode),n=n.child,n!==null))for(Fs(n,r,a),n=n.sibling;n!==null;)Fs(n,r,a),n=n.sibling}function Ly(n){var r=n.stateNode,a=n.memoizedProps;try{for(var c=n.type,m=r.attributes;m.length;)r.removeAttributeNode(m[0]);zt(r,c,a),r[Et]=n,r[Ot]=a}catch(y){Qe(n,n.return,y)}}var yi=!1,bt=!1,gd=!1,By=typeof WeakSet=="function"?WeakSet:Set,_t=null;function kk(n,r){if(n=n.containerInfo,Bd=hu,n=Zm(n),uf(n)){if("selectionStart"in n)var a={start:n.selectionStart,end:n.selectionEnd};else e:{a=(a=n.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var m=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{a.nodeType,y.nodeType}catch{a=null;break e}var S=0,M=-1,$=-1,W=0,le=0,oe=n,te=null;t:for(;;){for(var ie;oe!==a||m!==0&&oe.nodeType!==3||(M=S+m),oe!==y||c!==0&&oe.nodeType!==3||($=S+c),oe.nodeType===3&&(S+=oe.nodeValue.length),(ie=oe.firstChild)!==null;)te=oe,oe=ie;for(;;){if(oe===n)break t;if(te===a&&++W===m&&(M=S),te===y&&++le===c&&($=S),(ie=oe.nextSibling)!==null)break;oe=te,te=oe.parentNode}oe=ie}a=M===-1||$===-1?null:{start:M,end:$}}else a=null}a=a||{start:0,end:0}}else a=null;for(Hd={focusedElem:n,selectionRange:a},hu=!1,_t=r;_t!==null;)if(r=_t,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,_t=n;else for(;_t!==null;){switch(r=_t,y=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(a=0;a<n.length;a++)m=n[a],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,a=r,m=y.memoizedProps,y=y.memoizedState,c=a.stateNode;try{var me=zr(a.type,m);n=c.getSnapshotBeforeUpdate(me,y),c.__reactInternalSnapshotBeforeUpdate=n}catch(Se){Qe(a,a.return,Se)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,a=n.nodeType,a===9)qd(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":qd(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(l(163))}if(n=r.sibling,n!==null){n.return=r.return,_t=n;break}_t=r.return}}function Hy(n,r,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:bi(n,a),c&4&&Oa(5,a);break;case 1:if(bi(n,a),c&4)if(n=a.stateNode,r===null)try{n.componentDidMount()}catch(S){Qe(a,a.return,S)}else{var m=zr(a.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(m,r,n.__reactInternalSnapshotBeforeUpdate)}catch(S){Qe(a,a.return,S)}}c&64&&zy(a),c&512&&La(a,a.return);break;case 3:if(bi(n,a),c&64&&(n=a.updateQueue,n!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Sg(n,r)}catch(S){Qe(a,a.return,S)}}break;case 27:r===null&&c&4&&Ly(a);case 26:case 5:bi(n,a),r===null&&c&4&&Dy(a),c&512&&La(a,a.return);break;case 12:bi(n,a);break;case 31:bi(n,a),c&4&&qy(n,a);break;case 13:bi(n,a),c&4&&Vy(n,a),c&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=zk.bind(null,a),Jk(n,a))));break;case 22:if(c=a.memoizedState!==null||yi,!c){r=r!==null&&r.memoizedState!==null||bt,m=yi;var y=bt;yi=c,(bt=r)&&!y?vi(n,a,(a.subtreeFlags&8772)!==0):bi(n,a),yi=m,bt=y}break;case 30:break;default:bi(n,a)}}function Uy(n){var r=n.alternate;r!==null&&(n.alternate=null,Uy(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&sa(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var lt=null,Xt=!1;function xi(n,r,a){for(a=a.child;a!==null;)Iy(n,r,a),a=a.sibling}function Iy(n,r,a){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Tt,a)}catch{}switch(a.tag){case 26:bt||$n(a,r),xi(n,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:bt||$n(a,r);var c=lt,m=Xt;nr(a.type)&&(lt=a.stateNode,Xt=!1),xi(n,r,a),Ya(a.stateNode),lt=c,Xt=m;break;case 5:bt||$n(a,r);case 6:if(c=lt,m=Xt,lt=null,xi(n,r,a),lt=c,Xt=m,lt!==null)if(Xt)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(a.stateNode)}catch(y){Qe(a,r,y)}else try{lt.removeChild(a.stateNode)}catch(y){Qe(a,r,y)}break;case 18:lt!==null&&(Xt?(n=lt,z0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),zl(n)):z0(lt,a.stateNode));break;case 4:c=lt,m=Xt,lt=a.stateNode.containerInfo,Xt=!0,xi(n,r,a),lt=c,Xt=m;break;case 0:case 11:case 14:case 15:Zi(2,a,r),bt||Zi(4,a,r),xi(n,r,a);break;case 1:bt||($n(a,r),c=a.stateNode,typeof c.componentWillUnmount=="function"&&Ry(a,r,c)),xi(n,r,a);break;case 21:xi(n,r,a);break;case 22:bt=(c=bt)||a.memoizedState!==null,xi(n,r,a),bt=c;break;default:xi(n,r,a)}}function qy(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{zl(n)}catch(a){Qe(r,r.return,a)}}}function Vy(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{zl(n)}catch(a){Qe(r,r.return,a)}}function Ek(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new By),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new By),r;default:throw Error(l(435,n.tag))}}function Xs(n,r){var a=Ek(n);r.forEach(function(c){if(!a.has(c)){a.add(c);var m=Rk.bind(null,n,c);c.then(m,m)}})}function Gt(n,r){var a=r.deletions;if(a!==null)for(var c=0;c<a.length;c++){var m=a[c],y=n,S=r,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(nr(M.type)){lt=M.stateNode,Xt=!1;break e}break;case 5:lt=M.stateNode,Xt=!1;break e;case 3:case 4:lt=M.stateNode.containerInfo,Xt=!0;break e}M=M.return}if(lt===null)throw Error(l(160));Iy(y,S,m),lt=null,Xt=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)$y(r,n),r=r.sibling}var Mn=null;function $y(n,r){var a=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Gt(r,n),Zt(n),c&4&&(Zi(3,n,n.return),Oa(3,n),Zi(5,n,n.return));break;case 1:Gt(r,n),Zt(n),c&512&&(bt||a===null||$n(a,a.return)),c&64&&yi&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?c:a.concat(c))));break;case 26:var m=Mn;if(Gt(r,n),Zt(n),c&512&&(bt||a===null||$n(a,a.return)),c&4){var y=a!==null?a.memoizedState:null;if(c=n.memoizedState,a===null)if(c===null)if(n.stateNode===null){e:{c=n.type,a=n.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":y=m.getElementsByTagName("title")[0],(!y||y[gr]||y[Et]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(c),m.head.insertBefore(y,m.querySelector("head > title"))),zt(y,c,a),y[Et]=n,mt(y),c=y;break e;case"link":var S=$0("link","href",m).get(c+(a.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],y.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&y.getAttribute("rel")===(a.rel==null?null:a.rel)&&y.getAttribute("title")===(a.title==null?null:a.title)&&y.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(M,1);break t}}y=m.createElement(c),zt(y,c,a),m.head.appendChild(y);break;case"meta":if(S=$0("meta","content",m).get(c+(a.content||""))){for(M=0;M<S.length;M++)if(y=S[M],y.getAttribute("content")===(a.content==null?null:""+a.content)&&y.getAttribute("name")===(a.name==null?null:a.name)&&y.getAttribute("property")===(a.property==null?null:a.property)&&y.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&y.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(M,1);break t}}y=m.createElement(c),zt(y,c,a),m.head.appendChild(y);break;default:throw Error(l(468,c))}y[Et]=n,mt(y),c=y}n.stateNode=c}else P0(m,n.type,n.stateNode);else n.stateNode=V0(m,c,n.memoizedProps);else y!==c?(y===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):y.count--,c===null?P0(m,n.type,n.stateNode):V0(m,c,n.memoizedProps)):c===null&&n.stateNode!==null&&hd(n,n.memoizedProps,a.memoizedProps)}break;case 27:Gt(r,n),Zt(n),c&512&&(bt||a===null||$n(a,a.return)),a!==null&&c&4&&hd(n,n.memoizedProps,a.memoizedProps);break;case 5:if(Gt(r,n),Zt(n),c&512&&(bt||a===null||$n(a,a.return)),n.flags&32){m=n.stateNode;try{tl(m,"")}catch(me){Qe(n,n.return,me)}}c&4&&n.stateNode!=null&&(m=n.memoizedProps,hd(n,m,a!==null?a.memoizedProps:m)),c&1024&&(gd=!0);break;case 6:if(Gt(r,n),Zt(n),c&4){if(n.stateNode===null)throw Error(l(162));c=n.memoizedProps,a=n.stateNode;try{a.nodeValue=c}catch(me){Qe(n,n.return,me)}}break;case 3:if(uu=null,m=Mn,Mn=ou(r.containerInfo),Gt(r,n),Mn=m,Zt(n),c&4&&a!==null&&a.memoizedState.isDehydrated)try{zl(r.containerInfo)}catch(me){Qe(n,n.return,me)}gd&&(gd=!1,Py(n));break;case 4:c=Mn,Mn=ou(n.stateNode.containerInfo),Gt(r,n),Zt(n),Mn=c;break;case 12:Gt(r,n),Zt(n);break;case 31:Gt(r,n),Zt(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Xs(n,c)));break;case 13:Gt(r,n),Zt(n),n.child.flags&8192&&n.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zs=kt()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Xs(n,c)));break;case 22:m=n.memoizedState!==null;var $=a!==null&&a.memoizedState!==null,W=yi,le=bt;if(yi=W||m,bt=le||$,Gt(r,n),bt=le,yi=W,Zt(n),c&8192)e:for(r=n.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,m&&(a===null||$||yi||bt||Rr(n)),a=null,r=n;;){if(r.tag===5||r.tag===26){if(a===null){$=a=r;try{if(y=$.stateNode,m)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=$.stateNode;var oe=$.memoizedProps.style,te=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;M.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(me){Qe($,$.return,me)}}}else if(r.tag===6){if(a===null){$=r;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(me){Qe($,$.return,me)}}}else if(r.tag===18){if(a===null){$=r;try{var ie=$.stateNode;m?R0(ie,!0):R0($.stateNode,!1)}catch(me){Qe($,$.return,me)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=n.updateQueue,c!==null&&(a=c.retryQueue,a!==null&&(c.retryQueue=null,Xs(n,a))));break;case 19:Gt(r,n),Zt(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Xs(n,c)));break;case 30:break;case 21:break;default:Gt(r,n),Zt(n)}}function Zt(n){var r=n.flags;if(r&2){try{for(var a,c=n.return;c!==null;){if(Oy(c)){a=c;break}c=c.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var m=a.stateNode,y=pd(n);Fs(n,y,m);break;case 5:var S=a.stateNode;a.flags&32&&(tl(S,""),a.flags&=-33);var M=pd(n);Fs(n,M,S);break;case 3:case 4:var $=a.stateNode.containerInfo,W=pd(n);md(n,W,$);break;default:throw Error(l(161))}}catch(le){Qe(n,n.return,le)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function Py(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;Py(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function bi(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Hy(n,r.alternate,r),r=r.sibling}function Rr(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Zi(4,r,r.return),Rr(r);break;case 1:$n(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Ry(r,r.return,a),Rr(r);break;case 27:Ya(r.stateNode);case 26:case 5:$n(r,r.return),Rr(r);break;case 22:r.memoizedState===null&&Rr(r);break;case 30:Rr(r);break;default:Rr(r)}n=n.sibling}}function vi(n,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,m=n,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:vi(m,y,a),Oa(4,y);break;case 1:if(vi(m,y,a),c=y,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(W){Qe(c,c.return,W)}if(c=y,m=c.updateQueue,m!==null){var M=c.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)wg($[m],M)}catch(W){Qe(c,c.return,W)}}a&&S&64&&zy(y),La(y,y.return);break;case 27:Ly(y);case 26:case 5:vi(m,y,a),a&&c===null&&S&4&&Dy(y),La(y,y.return);break;case 12:vi(m,y,a);break;case 31:vi(m,y,a),a&&S&4&&qy(m,y);break;case 13:vi(m,y,a),a&&S&4&&Vy(m,y);break;case 22:y.memoizedState===null&&vi(m,y,a),La(y,y.return);break;case 30:break;default:vi(m,y,a)}r=r.sibling}}function yd(n,r){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&Sa(a))}function xd(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Sa(n))}function jn(n,r,a,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Yy(n,r,a,c),r=r.sibling}function Yy(n,r,a,c){var m=r.flags;switch(r.tag){case 0:case 11:case 15:jn(n,r,a,c),m&2048&&Oa(9,r);break;case 1:jn(n,r,a,c);break;case 3:jn(n,r,a,c),m&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Sa(n)));break;case 12:if(m&2048){jn(n,r,a,c),n=r.stateNode;try{var y=r.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(S,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch($){Qe(r,r.return,$)}}else jn(n,r,a,c);break;case 31:jn(n,r,a,c);break;case 13:jn(n,r,a,c);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState!==null?y._visibility&2?jn(n,r,a,c):Ba(n,r):y._visibility&2?jn(n,r,a,c):(y._visibility|=2,wl(n,r,a,c,(r.subtreeFlags&10256)!==0||!1)),m&2048&&yd(S,r);break;case 24:jn(n,r,a,c),m&2048&&xd(r.alternate,r);break;default:jn(n,r,a,c)}}function wl(n,r,a,c,m){for(m=m&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=n,S=r,M=a,$=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:wl(y,S,M,$,m),Oa(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?wl(y,S,M,$,m):Ba(y,S):(le._visibility|=2,wl(y,S,M,$,m)),m&&W&2048&&yd(S.alternate,S);break;case 24:wl(y,S,M,$,m),m&&W&2048&&xd(S.alternate,S);break;default:wl(y,S,M,$,m)}r=r.sibling}}function Ba(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=n,c=r,m=c.flags;switch(c.tag){case 22:Ba(a,c),m&2048&&yd(c.alternate,c);break;case 24:Ba(a,c),m&2048&&xd(c.alternate,c);break;default:Ba(a,c)}r=r.sibling}}var Ha=8192;function Sl(n,r,a){if(n.subtreeFlags&Ha)for(n=n.child;n!==null;)Fy(n,r,a),n=n.sibling}function Fy(n,r,a){switch(n.tag){case 26:Sl(n,r,a),n.flags&Ha&&n.memoizedState!==null&&cE(a,Mn,n.memoizedState,n.memoizedProps);break;case 5:Sl(n,r,a);break;case 3:case 4:var c=Mn;Mn=ou(n.stateNode.containerInfo),Sl(n,r,a),Mn=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=Ha,Ha=16777216,Sl(n,r,a),Ha=c):Sl(n,r,a));break;default:Sl(n,r,a)}}function Xy(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function Ua(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];_t=c,Zy(c,n)}Xy(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Gy(n),n=n.sibling}function Gy(n){switch(n.tag){case 0:case 11:case 15:Ua(n),n.flags&2048&&Zi(9,n,n.return);break;case 3:Ua(n);break;case 12:Ua(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Gs(n)):Ua(n);break;default:Ua(n)}}function Gs(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];_t=c,Zy(c,n)}Xy(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Zi(8,r,r.return),Gs(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Gs(r));break;default:Gs(r)}n=n.sibling}}function Zy(n,r){for(;_t!==null;){var a=_t;switch(a.tag){case 0:case 11:case 15:Zi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Sa(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,_t=c;else e:for(a=n;_t!==null;){c=_t;var m=c.sibling,y=c.return;if(Uy(c),c===a){_t=null;break e}if(m!==null){m.return=y,_t=m;break e}_t=y}}}var Nk={getCacheForType:function(n){var r=Mt(gt),a=r.data.get(n);return a===void 0&&(a=n(),r.data.set(n,a)),a},cacheSignal:function(){return Mt(gt).controller.signal}},Ck=typeof WeakMap=="function"?WeakMap:Map,Xe=0,et=null,Re=null,Le=0,Ze=0,sn=null,Qi=!1,kl=!1,bd=!1,wi=0,ct=0,Ki=0,Dr=0,vd=0,un=0,El=0,Ia=null,Qt=null,wd=!1,Zs=0,Qy=0,Qs=1/0,Ks=null,Ji=null,Nt=0,Wi=null,Nl=null,Si=0,Sd=0,kd=null,Ky=null,qa=0,Ed=null;function cn(){return(Xe&2)!==0&&Le!==0?Le&-Le:D.T!==null?Md():ts()}function Jy(){if(un===0)if((Le&536870912)===0||He){var n=Gr;Gr<<=1,(Gr&3932160)===0&&(Gr=262144),un=n}else un=536870912;return n=an.current,n!==null&&(n.flags|=32),un}function Kt(n,r,a){(n===et&&(Ze===2||Ze===9)||n.cancelPendingCommit!==null)&&(Cl(n,0),er(n,Le,un,!1)),mr(n,a),((Xe&2)===0||n!==et)&&(n===et&&((Xe&2)===0&&(Dr|=a),ct===4&&er(n,Le,un,!1)),Pn(n))}function Wy(n,r,a){if((Xe&6)!==0)throw Error(l(327));var c=!a&&(r&127)===0&&(r&n.expiredLanes)===0||pr(n,r),m=c?Ak(n,r):Cd(n,r,!0),y=c;do{if(m===0){kl&&!c&&er(n,r,0,!1);break}else{if(a=n.current.alternate,y&&!_k(a)){m=Cd(n,r,!1),y=!1;continue}if(m===2){if(y=r,n.errorRecoveryDisabledLanes&y)var S=0;else S=n.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var M=n;m=Ia;var $=M.current.memoizedState.isDehydrated;if($&&(Cl(M,S).flags|=256),S=Cd(M,S,!1),S!==2){if(bd&&!$){M.errorRecoveryDisabledLanes|=y,Dr|=y,m=4;break e}y=Qt,Qt=m,y!==null&&(Qt===null?Qt=y:Qt.push.apply(Qt,y))}m=S}if(y=!1,m!==2)continue}}if(m===1){Cl(n,0),er(n,r,0,!0);break}e:{switch(c=n,y=m,y){case 0:case 1:throw Error(l(345));case 4:if((r&4194048)!==r)break;case 6:er(c,r,un,!Qi);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((r&62914560)===r&&(m=Zs+300-kt(),10<m)){if(er(c,r,un,!Qi),Qr(c,0,!0)!==0)break e;Si=r,c.timeoutHandle=M0(e0.bind(null,c,a,Qt,Ks,wd,r,un,Dr,El,Qi,y,"Throttled",-0,0),m);break e}e0(c,a,Qt,Ks,wd,r,un,Dr,El,Qi,y,null,-0,0)}}break}while(!0);Pn(n)}function e0(n,r,a,c,m,y,S,M,$,W,le,oe,te,ie){if(n.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},Fy(r,y,oe);var me=(y&62914560)===y?Zs-kt():(y&4194048)===y?Qy-kt():0;if(me=fE(oe,me),me!==null){Si=y,n.cancelPendingCommit=me(s0.bind(null,n,r,y,a,c,m,S,M,$,le,oe,null,te,ie)),er(n,y,S,!W);return}}s0(n,r,y,a,c,m,S,M,$)}function _k(n){for(var r=n;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var m=a[c],y=m.getSnapshot;m=m.value;try{if(!rn(y(),m))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function er(n,r,a,c){r&=~vd,r&=~Dr,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var m=r;0<m;){var y=31-Ge(m),S=1<<y;c[y]=-1,m&=~S}a!==0&&Jo(n,a,r)}function Js(){return(Xe&6)===0?(Va(0),!1):!0}function Nd(){if(Re!==null){if(Ze===0)var n=Re.return;else n=Re,fi=Nr=null,qf(n),gl=null,Ea=0,n=Re;for(;n!==null;)jy(n.alternate,n),n=n.return;Re=null}}function Cl(n,r){var a=n.timeoutHandle;a!==-1&&(n.timeoutHandle=-1,Xk(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),Si=0,Nd(),et=n,Re=a=ui(n.current,null),Le=r,Ze=0,sn=null,Qi=!1,kl=pr(n,r),bd=!1,El=un=vd=Dr=Ki=ct=0,Qt=Ia=null,wd=!1,(r&8)!==0&&(r|=r&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=r;0<c;){var m=31-Ge(c),y=1<<m;r|=n[m],c&=~y}return wi=r,bs(),a}function t0(n,r){Te=null,D.H=za,r===ml||r===_s?(r=yg(),Ze=3):r===Af?(r=yg(),Ze=4):Ze=r===id?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,sn=r,Re===null&&(ct=1,qs(n,gn(r,n.current)))}function n0(){var n=an.current;return n===null?!0:(Le&4194048)===Le?vn===null:(Le&62914560)===Le||(Le&536870912)!==0?n===vn:!1}function i0(){var n=D.H;return D.H=za,n===null?za:n}function r0(){var n=D.A;return D.A=Nk,n}function Ws(){ct=4,Qi||(Le&4194048)!==Le&&an.current!==null||(kl=!0),(Ki&134217727)===0&&(Dr&134217727)===0||et===null||er(et,Le,un,!1)}function Cd(n,r,a){var c=Xe;Xe|=2;var m=i0(),y=r0();(et!==n||Le!==r)&&(Ks=null,Cl(n,r)),r=!1;var S=ct;e:do try{if(Ze!==0&&Re!==null){var M=Re,$=sn;switch(Ze){case 8:Nd(),S=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(r=!0);var W=Ze;if(Ze=0,sn=null,_l(n,M,$,W),a&&kl){S=0;break e}break;default:W=Ze,Ze=0,sn=null,_l(n,M,$,W)}}Tk(),S=ct;break}catch(le){t0(n,le)}while(!0);return r&&n.shellSuspendCounter++,fi=Nr=null,Xe=c,D.H=m,D.A=y,Re===null&&(et=null,Le=0,bs()),S}function Tk(){for(;Re!==null;)l0(Re)}function Ak(n,r){var a=Xe;Xe|=2;var c=i0(),m=r0();et!==n||Le!==r?(Ks=null,Qs=kt()+500,Cl(n,r)):kl=pr(n,r);e:do try{if(Ze!==0&&Re!==null){r=Re;var y=sn;t:switch(Ze){case 1:Ze=0,sn=null,_l(n,r,y,1);break;case 2:case 9:if(mg(y)){Ze=0,sn=null,a0(r);break}r=function(){Ze!==2&&Ze!==9||et!==n||(Ze=7),Pn(n)},y.then(r,r);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:mg(y)?(Ze=0,sn=null,a0(r)):(Ze=0,sn=null,_l(n,r,y,7));break;case 5:var S=null;switch(Re.tag){case 26:S=Re.memoizedState;case 5:case 27:var M=Re;if(S?Y0(S):M.stateNode.complete){Ze=0,sn=null;var $=M.sibling;if($!==null)Re=$;else{var W=M.return;W!==null?(Re=W,eu(W)):Re=null}break t}}Ze=0,sn=null,_l(n,r,y,5);break;case 6:Ze=0,sn=null,_l(n,r,y,6);break;case 8:Nd(),ct=6;break e;default:throw Error(l(462))}}Mk();break}catch(le){t0(n,le)}while(!0);return fi=Nr=null,D.H=c,D.A=m,Xe=a,Re!==null?0:(et=null,Le=0,bs(),ct)}function Mk(){for(;Re!==null&&!ti();)l0(Re)}function l0(n){var r=Ay(n.alternate,n,wi);n.memoizedProps=n.pendingProps,r===null?eu(n):Re=r}function a0(n){var r=n,a=r.alternate;switch(r.tag){case 15:case 0:r=ky(a,r,r.pendingProps,r.type,void 0,Le);break;case 11:r=ky(a,r,r.pendingProps,r.type.render,r.ref,Le);break;case 5:qf(r);default:jy(a,r),r=Re=rg(r,wi),r=Ay(a,r,wi)}n.memoizedProps=n.pendingProps,r===null?eu(n):Re=r}function _l(n,r,a,c){fi=Nr=null,qf(r),gl=null,Ea=0;var m=r.return;try{if(xk(n,m,r,a,Le)){ct=1,qs(n,gn(a,n.current)),Re=null;return}}catch(y){if(m!==null)throw Re=m,y;ct=1,qs(n,gn(a,n.current)),Re=null;return}r.flags&32768?(He||c===1?n=!0:kl||(Le&536870912)!==0?n=!1:(Qi=n=!0,(c===2||c===9||c===3||c===6)&&(c=an.current,c!==null&&c.tag===13&&(c.flags|=16384))),o0(r,n)):eu(r)}function eu(n){var r=n;do{if((r.flags&32768)!==0){o0(r,Qi);return}n=r.return;var a=wk(r.alternate,r,wi);if(a!==null){Re=a;return}if(r=r.sibling,r!==null){Re=r;return}Re=r=n}while(r!==null);ct===0&&(ct=5)}function o0(n,r){do{var a=Sk(n.alternate,n);if(a!==null){a.flags&=32767,Re=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(n=n.sibling,n!==null)){Re=n;return}Re=n=a}while(n!==null);ct=6,Re=null}function s0(n,r,a,c,m,y,S,M,$){n.cancelPendingCommit=null;do tu();while(Nt!==0);if((Xe&6)!==0)throw Error(l(327));if(r!==null){if(r===n.current)throw Error(l(177));if(y=r.lanes|r.childLanes,y|=pf,$c(n,a,y,S,M,$),n===et&&(Re=et=null,Le=0),Nl=r,Wi=n,Si=a,Sd=y,kd=m,Ky=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,Dk(we,function(){return h0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=D.T,D.T=null,m=V.p,V.p=2,S=Xe,Xe|=4;try{kk(n,r,a)}finally{Xe=S,V.p=m,D.T=c}}Nt=1,u0(),c0(),f0()}}function u0(){if(Nt===1){Nt=0;var n=Wi,r=Nl,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var c=V.p;V.p=2;var m=Xe;Xe|=4;try{$y(r,n);var y=Hd,S=Zm(n.containerInfo),M=y.focusedElem,$=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&Gm(M.ownerDocument.documentElement,M)){if($!==null&&uf(M)){var W=$.start,le=$.end;if(le===void 0&&(le=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(le,M.value.length);else{var oe=M.ownerDocument||document,te=oe&&oe.defaultView||window;if(te.getSelection){var ie=te.getSelection(),me=M.textContent.length,Se=Math.min($.start,me),We=$.end===void 0?Se:Math.min($.end,me);!ie.extend&&Se>We&&(S=We,We=Se,Se=S);var Q=Xm(M,Se),G=Xm(M,We);if(Q&&G&&(ie.rangeCount!==1||ie.anchorNode!==Q.node||ie.anchorOffset!==Q.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var J=oe.createRange();J.setStart(Q.node,Q.offset),ie.removeAllRanges(),Se>We?(ie.addRange(J),ie.extend(G.node,G.offset)):(J.setEnd(G.node,G.offset),ie.addRange(J))}}}}for(oe=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&oe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<oe.length;M++){var ae=oe[M];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}hu=!!Bd,Hd=Bd=null}finally{Xe=m,V.p=c,D.T=a}}n.current=r,Nt=2}}function c0(){if(Nt===2){Nt=0;var n=Wi,r=Nl,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var c=V.p;V.p=2;var m=Xe;Xe|=4;try{Hy(n,r.alternate,r)}finally{Xe=m,V.p=c,D.T=a}}Nt=3}}function f0(){if(Nt===4||Nt===3){Nt=0,ni();var n=Wi,r=Nl,a=Si,c=Ky;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Nt=5:(Nt=0,Nl=Wi=null,d0(n,n.pendingLanes));var m=n.pendingLanes;if(m===0&&(Ji=null),oa(a),r=r.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Tt,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=D.T,m=V.p,V.p=2,D.T=null;try{for(var y=n.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{D.T=r,V.p=m}}(Si&3)!==0&&tu(),Pn(n),m=n.pendingLanes,(a&261930)!==0&&(m&42)!==0?n===Ed?qa++:(qa=0,Ed=n):qa=0,Va(0)}}function d0(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Sa(r)))}function tu(){return u0(),c0(),f0(),h0()}function h0(){if(Nt!==5)return!1;var n=Wi,r=Sd;Sd=0;var a=oa(Si),c=D.T,m=V.p;try{V.p=32>a?32:a,D.T=null,a=kd,kd=null;var y=Wi,S=Si;if(Nt=0,Nl=Wi=null,Si=0,(Xe&6)!==0)throw Error(l(331));var M=Xe;if(Xe|=4,Gy(y.current),Yy(y,y.current,S,a),Xe=M,Va(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Tt,y)}catch{}return!0}finally{V.p=m,D.T=c,d0(n,r)}}function p0(n,r,a){r=gn(a,r),r=nd(n.stateNode,r,2),n=Fi(n,r,2),n!==null&&(mr(n,2),Pn(n))}function Qe(n,r,a){if(n.tag===3)p0(n,n,a);else for(;r!==null;){if(r.tag===3){p0(r,n,a);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ji===null||!Ji.has(c))){n=gn(a,n),a=my(2),c=Fi(r,a,2),c!==null&&(gy(a,c,r,n),mr(c,2),Pn(c));break}}r=r.return}}function _d(n,r,a){var c=n.pingCache;if(c===null){c=n.pingCache=new Ck;var m=new Set;c.set(r,m)}else m=c.get(r),m===void 0&&(m=new Set,c.set(r,m));m.has(a)||(bd=!0,m.add(a),n=jk.bind(null,n,r,a),r.then(n,n))}function jk(n,r,a){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,et===n&&(Le&a)===a&&(ct===4||ct===3&&(Le&62914560)===Le&&300>kt()-Zs?(Xe&2)===0&&Cl(n,0):vd|=a,El===Le&&(El=0)),Pn(n)}function m0(n,r){r===0&&(r=Ko()),n=Sr(n,r),n!==null&&(mr(n,r),Pn(n))}function zk(n){var r=n.memoizedState,a=0;r!==null&&(a=r.retryLane),m0(n,a)}function Rk(n,r){var a=0;switch(n.tag){case 31:case 13:var c=n.stateNode,m=n.memoizedState;m!==null&&(a=m.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(l(314))}c!==null&&c.delete(r),m0(n,a)}function Dk(n,r){return $t(n,r)}var nu=null,Tl=null,Td=!1,iu=!1,Ad=!1,tr=0;function Pn(n){n!==Tl&&n.next===null&&(Tl===null?nu=Tl=n:Tl=Tl.next=n),iu=!0,Td||(Td=!0,Lk())}function Va(n,r){if(!Ad&&iu){Ad=!0;do for(var a=!1,c=nu;c!==null;){if(n!==0){var m=c.pendingLanes;if(m===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Ge(42|n)+1)-1,y&=m&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,b0(c,y))}else y=Le,y=Qr(c,c===et?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||pr(c,y)||(a=!0,b0(c,y));c=c.next}while(a);Ad=!1}}function Ok(){g0()}function g0(){iu=Td=!1;var n=0;tr!==0&&Fk()&&(n=tr);for(var r=kt(),a=null,c=nu;c!==null;){var m=c.next,y=y0(c,r);y===0?(c.next=null,a===null?nu=m:a.next=m,m===null&&(Tl=a)):(a=c,(n!==0||(y&3)!==0)&&(iu=!0)),c=m}Nt!==0&&Nt!==5||Va(n),tr!==0&&(tr=0)}function y0(n,r){for(var a=n.suspendedLanes,c=n.pingedLanes,m=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var S=31-Ge(y),M=1<<S,$=m[S];$===-1?((M&a)===0||(M&c)!==0)&&(m[S]=Vc(M,r)):$<=r&&(n.expiredLanes|=M),y&=~M}if(r=et,a=Le,a=Qr(n,n===r?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,a===0||n===r&&(Ze===2||Ze===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&Cn(c),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||pr(n,a)){if(r=a&-a,r===n.callbackPriority)return r;switch(c!==null&&Cn(c),oa(a)){case 2:case 8:a=he;break;case 32:a=we;break;case 268435456:a=Ie;break;default:a=we}return c=x0.bind(null,n),a=$t(a,c),n.callbackPriority=r,n.callbackNode=a,r}return c!==null&&c!==null&&Cn(c),n.callbackPriority=2,n.callbackNode=null,2}function x0(n,r){if(Nt!==0&&Nt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(tu()&&n.callbackNode!==a)return null;var c=Le;return c=Qr(n,n===et?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(Wy(n,c,r),y0(n,kt()),n.callbackNode!=null&&n.callbackNode===a?x0.bind(null,n):null)}function b0(n,r){if(tu())return null;Wy(n,r,!0)}function Lk(){Gk(function(){(Xe&6)!==0?$t(re,Ok):g0()})}function Md(){if(tr===0){var n=hl;n===0&&(n=Xr,Xr<<=1,(Xr&261888)===0&&(Xr=256)),tr=n}return tr}function v0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:fs(""+n)}function w0(n,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,n.id&&a.setAttribute("form",n.id),r.parentNode.insertBefore(a,r),n=new FormData(n),a.parentNode.removeChild(a),n}function Bk(n,r,a,c,m){if(r==="submit"&&a&&a.stateNode===m){var y=v0((m[Ot]||null).action),S=c.submitter;S&&(r=(r=S[Ot]||null)?v0(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var M=new ms("action","action",null,c,m);n.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(tr!==0){var $=S?w0(m,S):new FormData(m);Qf(a,{pending:!0,data:$,method:m.method,action:y},null,$)}}else typeof y=="function"&&(M.preventDefault(),$=S?w0(m,S):new FormData(m),Qf(a,{pending:!0,data:$,method:m.method,action:y},y,$))},currentTarget:m}]})}}for(var jd=0;jd<hf.length;jd++){var zd=hf[jd],Hk=zd.toLowerCase(),Uk=zd[0].toUpperCase()+zd.slice(1);An(Hk,"on"+Uk)}An(Jm,"onAnimationEnd"),An(Wm,"onAnimationIteration"),An(eg,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(tk,"onTransitionRun"),An(nk,"onTransitionStart"),An(ik,"onTransitionCancel"),An(tg,"onTransitionEnd"),Hi("onMouseEnter",["mouseout","mouseover"]),Hi("onMouseLeave",["mouseout","mouseover"]),Hi("onPointerEnter",["pointerout","pointerover"]),Hi("onPointerLeave",["pointerout","pointerover"]),li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),li("onBeforeInput",["compositionend","keypress","textInput","paste"]),li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $a="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(" "),Ik=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($a));function S0(n,r){r=(r&4)!==0;for(var a=0;a<n.length;a++){var c=n[a],m=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],$=M.instance,W=M.currentTarget;if(M=M.listener,$!==y&&m.isPropagationStopped())break e;y=M,m.currentTarget=W;try{y(m)}catch(le){xs(le)}m.currentTarget=null,y=$}else for(S=0;S<c.length;S++){if(M=c[S],$=M.instance,W=M.currentTarget,M=M.listener,$!==y&&m.isPropagationStopped())break e;y=M,m.currentTarget=W;try{y(m)}catch(le){xs(le)}m.currentTarget=null,y=$}}}}function De(n,r){var a=r[Kr];a===void 0&&(a=r[Kr]=new Set);var c=n+"__bubble";a.has(c)||(k0(r,n,2,!1),a.add(c))}function Rd(n,r,a){var c=0;r&&(c|=4),k0(a,n,c,r)}var ru="_reactListening"+Math.random().toString(36).slice(2);function Dd(n){if(!n[ru]){n[ru]=!0,ls.forEach(function(a){a!=="selectionchange"&&(Ik.has(a)||Rd(a,!1,n),Rd(a,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[ru]||(r[ru]=!0,Rd("selectionchange",!1,r))}}function k0(n,r,a,c){switch(J0(r)){case 2:var m=pE;break;case 8:m=mE;break;default:m=Zd}a=m.bind(null,r,a,n),m=void 0,!Wc||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(m=!0),c?m!==void 0?n.addEventListener(r,a,{capture:!0,passive:m}):n.addEventListener(r,a,!0):m!==void 0?n.addEventListener(r,a,{passive:m}):n.addEventListener(r,a,!1)}function Od(n,r,a,c,m){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===m)break;if(S===4)for(S=c.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===m)return;S=S.return}for(;M!==null;){if(S=Di(M),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){c=y=S;continue e}M=M.parentNode}}c=c.return}Tm(function(){var W=y,le=Kc(a),oe=[];e:{var te=ng.get(n);if(te!==void 0){var ie=ms,me=n;switch(n){case"keypress":if(hs(a)===0)break e;case"keydown":case"keyup":ie=RS;break;case"focusin":me="focus",ie=rf;break;case"focusout":me="blur",ie=rf;break;case"beforeblur":case"afterblur":ie=rf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=wS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=LS;break;case Jm:case Wm:case eg:ie=ES;break;case tg:ie=HS;break;case"scroll":case"scrollend":ie=bS;break;case"wheel":ie=IS;break;case"copy":case"cut":case"paste":ie=CS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Rm;break;case"toggle":case"beforetoggle":ie=VS}var Se=(r&4)!==0,We=!Se&&(n==="scroll"||n==="scrollend"),Q=Se?te!==null?te+"Capture":null:te;Se=[];for(var G=W,J;G!==null;){var ae=G;if(J=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||J===null||Q===null||(ae=fa(G,Q),ae!=null&&Se.push(Pa(G,ae,J))),We)break;G=G.return}0<Se.length&&(te=new ie(te,me,null,a,le),oe.push({event:te,listeners:Se}))}}if((r&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",te&&a!==Qc&&(me=a.relatedTarget||a.fromElement)&&(Di(me)||me[ri]))break e;if((ie||te)&&(te=le.window===le?le:(te=le.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(me=a.relatedTarget||a.toElement,ie=W,me=me?Di(me):null,me!==null&&(We=s(me),Se=me.tag,me!==We||Se!==5&&Se!==27&&Se!==6)&&(me=null)):(ie=null,me=W),ie!==me)){if(Se=jm,ae="onMouseLeave",Q="onMouseEnter",G="mouse",(n==="pointerout"||n==="pointerover")&&(Se=Rm,ae="onPointerLeave",Q="onPointerEnter",G="pointer"),We=ie==null?te:Li(ie),J=me==null?te:Li(me),te=new Se(ae,G+"leave",ie,a,le),te.target=We,te.relatedTarget=J,ae=null,Di(le)===W&&(Se=new Se(Q,G+"enter",me,a,le),Se.target=J,Se.relatedTarget=We,ae=Se),We=ae,ie&&me)t:{for(Se=qk,Q=ie,G=me,J=0,ae=Q;ae;ae=Se(ae))J++;ae=0;for(var xe=G;xe;xe=Se(xe))ae++;for(;0<J-ae;)Q=Se(Q),J--;for(;0<ae-J;)G=Se(G),ae--;for(;J--;){if(Q===G||G!==null&&Q===G.alternate){Se=Q;break t}Q=Se(Q),G=Se(G)}Se=null}else Se=null;ie!==null&&E0(oe,te,ie,Se,!1),me!==null&&We!==null&&E0(oe,We,me,Se,!0)}}e:{if(te=W?Li(W):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var Pe=qm;else if(Um(te))if(Vm)Pe=JS;else{Pe=QS;var ge=ZS}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?W&&Zc(W.elementType)&&(Pe=qm):Pe=KS;if(Pe&&(Pe=Pe(n,W))){Im(oe,Pe,a,le);break e}ge&&ge(n,te,W),n==="focusout"&&W&&te.type==="number"&&W.memoizedProps.value!=null&&ca(te,"number",te.value)}switch(ge=W?Li(W):window,n){case"focusin":(Um(ge)||ge.contentEditable==="true")&&(ll=ge,cf=W,ba=null);break;case"focusout":ba=cf=ll=null;break;case"mousedown":ff=!0;break;case"contextmenu":case"mouseup":case"dragend":ff=!1,Qm(oe,a,le);break;case"selectionchange":if(ek)break;case"keydown":case"keyup":Qm(oe,a,le)}var Ae;if(af)e:{switch(n){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else rl?Bm(n,a)&&(Be="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(Be="onCompositionStart");Be&&(Dm&&a.locale!=="ko"&&(rl||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&rl&&(Ae=Am()):(Ui=le,ef="value"in Ui?Ui.value:Ui.textContent,rl=!0)),ge=lu(W,Be),0<ge.length&&(Be=new zm(Be,n,null,a,le),oe.push({event:Be,listeners:ge}),Ae?Be.data=Ae:(Ae=Hm(a),Ae!==null&&(Be.data=Ae)))),(Ae=PS?YS(n,a):FS(n,a))&&(Be=lu(W,"onBeforeInput"),0<Be.length&&(ge=new zm("onBeforeInput","beforeinput",null,a,le),oe.push({event:ge,listeners:Be}),ge.data=Ae)),Bk(oe,n,W,a,le)}S0(oe,r)})}function Pa(n,r,a){return{instance:n,listener:r,currentTarget:a}}function lu(n,r){for(var a=r+"Capture",c=[];n!==null;){var m=n,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=fa(n,a),m!=null&&c.unshift(Pa(n,m,y)),m=fa(n,r),m!=null&&c.push(Pa(n,m,y))),n.tag===3)return c;n=n.return}return[]}function qk(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function E0(n,r,a,c,m){for(var y=r._reactName,S=[];a!==null&&a!==c;){var M=a,$=M.alternate,W=M.stateNode;if(M=M.tag,$!==null&&$===c)break;M!==5&&M!==26&&M!==27||W===null||($=W,m?(W=fa(a,y),W!=null&&S.unshift(Pa(a,W,$))):m||(W=fa(a,y),W!=null&&S.push(Pa(a,W,$)))),a=a.return}S.length!==0&&n.push({event:r,listeners:S})}var Vk=/\r\n?/g,$k=/\u0000|\uFFFD/g;function N0(n){return(typeof n=="string"?n:""+n).replace(Vk,`
9
+ `).replace($k,"")}function C0(n,r){return r=N0(r),N0(n)===r}function Je(n,r,a,c,m,y){switch(a){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||tl(n,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&tl(n,""+c);break;case"className":Wr(n,"class",c);break;case"tabIndex":Wr(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Wr(n,a,c);break;case"style":Cm(n,c,y);break;case"data":if(r!=="object"){Wr(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||a!=="href")){n.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=fs(""+c),n.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(a,"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"&&(a==="formAction"?(r!=="input"&&Je(n,r,"name",m.name,m,null),Je(n,r,"formEncType",m.formEncType,m,null),Je(n,r,"formMethod",m.formMethod,m,null),Je(n,r,"formTarget",m.formTarget,m,null)):(Je(n,r,"encType",m.encType,m,null),Je(n,r,"method",m.method,m,null),Je(n,r,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=fs(""+c),n.setAttribute(a,c);break;case"onClick":c!=null&&(n.onclick=oi);break;case"onScroll":c!=null&&De("scroll",n);break;case"onScrollEnd":c!=null&&De("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(a=c.__html,a!=null){if(m.children!=null)throw Error(l(60));n.innerHTML=a}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}a=fs(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,""+c):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":c===!0?n.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,c):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(a,c):n.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(a):n.setAttribute(a,c);break;case"popover":De("beforetoggle",n),De("toggle",n),Jr(n,"popover",c);break;case"xlinkActuate":Tn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Tn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Tn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Tn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Tn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Tn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Tn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Tn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Tn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Jr(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=yS.get(a)||a,Jr(n,a,c))}}function Ld(n,r,a,c,m,y){switch(a){case"style":Cm(n,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(a=c.__html,a!=null){if(m.children!=null)throw Error(l(60));n.innerHTML=a}}break;case"children":typeof c=="string"?tl(n,c):(typeof c=="number"||typeof c=="bigint")&&tl(n,""+c);break;case"onScroll":c!=null&&De("scroll",n);break;case"onScrollEnd":c!=null&&De("scrollend",n);break;case"onClick":c!=null&&(n.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!as.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),r=a.slice(2,m?a.length-7:void 0),y=n[Ot]||null,y=y!=null?y[a]:null,typeof y=="function"&&n.removeEventListener(r,y,m),typeof c=="function")){typeof y!="function"&&y!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(r,c,m);break e}a in n?n[a]=c:c===!0?n.setAttribute(a,""):Jr(n,a,c)}}}function zt(n,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",n),De("load",n);var c=!1,m=!1,y;for(y in a)if(a.hasOwnProperty(y)){var S=a[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,r));default:Je(n,r,y,S,a,null)}}m&&Je(n,r,"srcSet",a.srcSet,a,null),c&&Je(n,r,"src",a.src,a,null);return;case"input":De("invalid",n);var M=y=S=m=null,$=null,W=null;for(c in a)if(a.hasOwnProperty(c)){var le=a[c];if(le!=null)switch(c){case"name":m=le;break;case"type":S=le;break;case"checked":$=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(l(137,r));break;default:Je(n,r,c,le,a,null)}}cs(n,y,M,$,W,S,m,!1);return;case"select":De("invalid",n),c=S=y=null;for(m in a)if(a.hasOwnProperty(m)&&(M=a[m],M!=null))switch(m){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:Je(n,r,m,M,a,null)}r=y,a=S,n.multiple=!!c,r!=null?ai(n,!!c,r,!1):a!=null&&ai(n,!!c,a,!0);return;case"textarea":De("invalid",n),y=m=c=null;for(S in a)if(a.hasOwnProperty(S)&&(M=a[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":m=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(91));break;default:Je(n,r,S,M,a,null)}Em(n,c,m,y);return;case"option":for($ in a)a.hasOwnProperty($)&&(c=a[$],c!=null)&&($==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":Je(n,r,$,c,a,null));return;case"dialog":De("beforetoggle",n),De("toggle",n),De("cancel",n),De("close",n);break;case"iframe":case"object":De("load",n);break;case"video":case"audio":for(c=0;c<$a.length;c++)De($a[c],n);break;case"image":De("error",n),De("load",n);break;case"details":De("toggle",n);break;case"embed":case"source":case"link":De("error",n),De("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in a)if(a.hasOwnProperty(W)&&(c=a[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,r));default:Je(n,r,W,c,a,null)}return;default:if(Zc(r)){for(le in a)a.hasOwnProperty(le)&&(c=a[le],c!==void 0&&Ld(n,r,le,c,a,void 0));return}}for(M in a)a.hasOwnProperty(M)&&(c=a[M],c!=null&&Je(n,r,M,c,a,null))}function Pk(n,r,a,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,S=null,M=null,$=null,W=null,le=null;for(ie in a){var oe=a[ie];if(a.hasOwnProperty(ie)&&oe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":$=oe;default:c.hasOwnProperty(ie)||Je(n,r,ie,null,c,oe)}}for(var te in c){var ie=c[te];if(oe=a[te],c.hasOwnProperty(te)&&(ie!=null||oe!=null))switch(te){case"type":y=ie;break;case"name":m=ie;break;case"checked":W=ie;break;case"defaultChecked":le=ie;break;case"value":S=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(l(137,r));break;default:ie!==oe&&Je(n,r,te,ie,c,oe)}}xr(n,S,M,$,W,le,y,m);return;case"select":ie=S=M=te=null;for(y in a)if($=a[y],a.hasOwnProperty(y)&&$!=null)switch(y){case"value":break;case"multiple":ie=$;default:c.hasOwnProperty(y)||Je(n,r,y,null,c,$)}for(m in c)if(y=c[m],$=a[m],c.hasOwnProperty(m)&&(y!=null||$!=null))switch(m){case"value":te=y;break;case"defaultValue":M=y;break;case"multiple":S=y;default:y!==$&&Je(n,r,m,y,c,$)}r=M,a=S,c=ie,te!=null?ai(n,!!a,te,!1):!!c!=!!a&&(r!=null?ai(n,!!a,r,!0):ai(n,!!a,a?[]:"",!1));return;case"textarea":ie=te=null;for(M in a)if(m=a[M],a.hasOwnProperty(M)&&m!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Je(n,r,M,null,c,m)}for(S in c)if(m=c[S],y=a[S],c.hasOwnProperty(S)&&(m!=null||y!=null))switch(S){case"value":te=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==y&&Je(n,r,S,m,c,y)}km(n,te,ie);return;case"option":for(var me in a)te=a[me],a.hasOwnProperty(me)&&te!=null&&!c.hasOwnProperty(me)&&(me==="selected"?n.selected=!1:Je(n,r,me,null,c,te));for($ in c)te=c[$],ie=a[$],c.hasOwnProperty($)&&te!==ie&&(te!=null||ie!=null)&&($==="selected"?n.selected=te&&typeof te!="function"&&typeof te!="symbol":Je(n,r,$,te,c,ie));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 Se in a)te=a[Se],a.hasOwnProperty(Se)&&te!=null&&!c.hasOwnProperty(Se)&&Je(n,r,Se,null,c,te);for(W in c)if(te=c[W],ie=a[W],c.hasOwnProperty(W)&&te!==ie&&(te!=null||ie!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(l(137,r));break;default:Je(n,r,W,te,c,ie)}return;default:if(Zc(r)){for(var We in a)te=a[We],a.hasOwnProperty(We)&&te!==void 0&&!c.hasOwnProperty(We)&&Ld(n,r,We,void 0,c,te);for(le in c)te=c[le],ie=a[le],!c.hasOwnProperty(le)||te===ie||te===void 0&&ie===void 0||Ld(n,r,le,te,c,ie);return}}for(var Q in a)te=a[Q],a.hasOwnProperty(Q)&&te!=null&&!c.hasOwnProperty(Q)&&Je(n,r,Q,null,c,te);for(oe in c)te=c[oe],ie=a[oe],!c.hasOwnProperty(oe)||te===ie||te==null&&ie==null||Je(n,r,oe,te,c,ie)}function _0(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Yk(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var m=a[c],y=m.transferSize,S=m.initiatorType,M=m.duration;if(y&&M&&_0(S)){for(S=0,M=m.responseEnd,c+=1;c<a.length;c++){var $=a[c],W=$.startTime;if(W>M)break;var le=$.transferSize,oe=$.initiatorType;le&&_0(oe)&&($=$.responseEnd,S+=le*($<M?1:(M-W)/($-W)))}if(--c,r+=8*(y+S)/(m.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Bd=null,Hd=null;function au(n){return n.nodeType===9?n:n.ownerDocument}function T0(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function A0(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Ud(n,r){return n==="textarea"||n==="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 Id=null;function Fk(){var n=window.event;return n&&n.type==="popstate"?n===Id?!1:(Id=n,!0):(Id=null,!1)}var M0=typeof setTimeout=="function"?setTimeout:void 0,Xk=typeof clearTimeout=="function"?clearTimeout:void 0,j0=typeof Promise=="function"?Promise:void 0,Gk=typeof queueMicrotask=="function"?queueMicrotask:typeof j0<"u"?function(n){return j0.resolve(null).then(n).catch(Zk)}:M0;function Zk(n){setTimeout(function(){throw n})}function nr(n){return n==="head"}function z0(n,r){var a=r,c=0;do{var m=a.nextSibling;if(n.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(c===0){n.removeChild(m),zl(r);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")Ya(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,Ya(a);for(var y=a.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[gr]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=S}}else a==="body"&&Ya(n.ownerDocument.body);a=m}while(a);zl(r)}function R0(n,r){var a=n;n=0;do{var c=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=c}while(a)}function qd(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":qd(a),sa(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function Qk(n,r,a,c){for(;n.nodeType===1;){var m=a;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[gr])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==m.rel||n.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||n.getAttribute("title")!==(m.title==null?null:m.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(m.src==null?null:m.src)||n.getAttribute("type")!==(m.type==null?null:m.type)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=wn(n.nextSibling),n===null)break}return null}function Kk(n,r,a){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=wn(n.nextSibling),n===null))return null;return n}function D0(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=wn(n.nextSibling),n===null))return null;return n}function Vd(n){return n.data==="$?"||n.data==="$~"}function $d(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function Jk(n,r){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||a.readyState!=="loading")r();else{var c=function(){r(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function wn(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Pd=null;function O0(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(r===0)return wn(n.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}n=n.nextSibling}return null}function L0(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return n;r--}else a!=="/$"&&a!=="/&"||r++}n=n.previousSibling}return null}function B0(n,r,a){switch(r=au(a),n){case"html":if(n=r.documentElement,!n)throw Error(l(452));return n;case"head":if(n=r.head,!n)throw Error(l(453));return n;case"body":if(n=r.body,!n)throw Error(l(454));return n;default:throw Error(l(451))}}function Ya(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);sa(n)}var Sn=new Map,H0=new Set;function ou(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var ki=V.d;V.d={f:Wk,r:eE,D:tE,C:nE,L:iE,m:rE,X:aE,S:lE,M:oE};function Wk(){var n=ki.f(),r=Js();return n||r}function eE(n){var r=Oi(n);r!==null&&r.tag===5&&r.type==="form"?ty(r):ki.r(n)}var Al=typeof document>"u"?null:document;function U0(n,r,a){var c=Al;if(c&&typeof r=="string"&&r){var m=Yt(r);m='link[rel="'+n+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),H0.has(m)||(H0.add(m),n={rel:n,crossOrigin:a,href:r},c.querySelector(m)===null&&(r=c.createElement("link"),zt(r,"link",n),mt(r),c.head.appendChild(r)))}}function tE(n){ki.D(n),U0("dns-prefetch",n,null)}function nE(n,r){ki.C(n,r),U0("preconnect",n,r)}function iE(n,r,a){ki.L(n,r,a);var c=Al;if(c&&n&&r){var m='link[rel="preload"][as="'+Yt(r)+'"]';r==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+Yt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+Yt(a.imageSizes)+'"]')):m+='[href="'+Yt(n)+'"]';var y=m;switch(r){case"style":y=Ml(n);break;case"script":y=jl(n)}Sn.has(y)||(n=p({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:n,as:r},a),Sn.set(y,n),c.querySelector(m)!==null||r==="style"&&c.querySelector(Fa(y))||r==="script"&&c.querySelector(Xa(y))||(r=c.createElement("link"),zt(r,"link",n),mt(r),c.head.appendChild(r)))}}function rE(n,r){ki.m(n,r);var a=Al;if(a&&n){var c=r&&typeof r.as=="string"?r.as:"script",m='link[rel="modulepreload"][as="'+Yt(c)+'"][href="'+Yt(n)+'"]',y=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=jl(n)}if(!Sn.has(y)&&(n=p({rel:"modulepreload",href:n},r),Sn.set(y,n),a.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Xa(y)))return}c=a.createElement("link"),zt(c,"link",n),mt(c),a.head.appendChild(c)}}}function lE(n,r,a){ki.S(n,r,a);var c=Al;if(c&&n){var m=Bi(c).hoistableStyles,y=Ml(n);r=r||"default";var S=m.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(Fa(y)))M.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":r},a),(a=Sn.get(y))&&Yd(n,a);var $=S=c.createElement("link");mt($),zt($,"link",n),$._p=new Promise(function(W,le){$.onload=W,$.onerror=le}),$.addEventListener("load",function(){M.loading|=1}),$.addEventListener("error",function(){M.loading|=2}),M.loading|=4,su(S,r,c)}S={type:"stylesheet",instance:S,count:1,state:M},m.set(y,S)}}}function aE(n,r){ki.X(n,r);var a=Al;if(a&&n){var c=Bi(a).hoistableScripts,m=jl(n),y=c.get(m);y||(y=a.querySelector(Xa(m)),y||(n=p({src:n,async:!0},r),(r=Sn.get(m))&&Fd(n,r),y=a.createElement("script"),mt(y),zt(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function oE(n,r){ki.M(n,r);var a=Al;if(a&&n){var c=Bi(a).hoistableScripts,m=jl(n),y=c.get(m);y||(y=a.querySelector(Xa(m)),y||(n=p({src:n,async:!0,type:"module"},r),(r=Sn.get(m))&&Fd(n,r),y=a.createElement("script"),mt(y),zt(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(m,y))}}function I0(n,r,a,c){var m=(m=ce.current)?ou(m):null;if(!m)throw Error(l(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=Ml(a.href),a=Bi(m).hoistableStyles,c=a.get(r),c||(c={type:"style",instance:null,count:0,state:null},a.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=Ml(a.href);var y=Bi(m).hoistableStyles,S=y.get(n);if(S||(m=m.ownerDocument||m,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,S),(y=m.querySelector(Fa(n)))&&!y._p&&(S.instance=y,S.state.loading=5),Sn.has(n)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Sn.set(n,a),y||sE(m,n,a,S.state))),r&&c===null)throw Error(l(528,""));return S}if(r&&c!==null)throw Error(l(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=jl(a),a=Bi(m).hoistableScripts,c=a.get(r),c||(c={type:"script",instance:null,count:0,state:null},a.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,n))}}function Ml(n){return'href="'+Yt(n)+'"'}function Fa(n){return'link[rel="stylesheet"]['+n+"]"}function q0(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function sE(n,r,a,c){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=n.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),zt(r,"link",a),mt(r),n.head.appendChild(r))}function jl(n){return'[src="'+Yt(n)+'"]'}function Xa(n){return"script[async]"+n}function V0(n,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+Yt(a.href)+'"]');if(c)return r.instance=c,mt(c),c;var m=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),mt(c),zt(c,"style",m),su(c,a.precedence,n),r.instance=c;case"stylesheet":m=Ml(a.href);var y=n.querySelector(Fa(m));if(y)return r.state.loading|=4,r.instance=y,mt(y),y;c=q0(a),(m=Sn.get(m))&&Yd(c,m),y=(n.ownerDocument||n).createElement("link"),mt(y);var S=y;return S._p=new Promise(function(M,$){S.onload=M,S.onerror=$}),zt(y,"link",c),r.state.loading|=4,su(y,a.precedence,n),r.instance=y;case"script":return y=jl(a.src),(m=n.querySelector(Xa(y)))?(r.instance=m,mt(m),m):(c=a,(m=Sn.get(y))&&(c=p({},a),Fd(c,m)),n=n.ownerDocument||n,m=n.createElement("script"),mt(m),zt(m,"link",c),n.head.appendChild(m),r.instance=m);case"void":return null;default:throw Error(l(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,su(c,a.precedence,n));return r.instance}function su(n,r,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,y=m,S=0;S<c.length;S++){var M=c[S];if(M.dataset.precedence===r)y=M;else if(y!==m)break}y?y.parentNode.insertBefore(n,y.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(n,r.firstChild))}function Yd(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Fd(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var uu=null;function $0(n,r,a){if(uu===null){var c=new Map,m=uu=new Map;m.set(a,c)}else m=uu,c=m.get(a),c||(c=new Map,m.set(a,c));if(c.has(n))return c;for(c.set(n,null),a=a.getElementsByTagName(n),m=0;m<a.length;m++){var y=a[m];if(!(y[gr]||y[Et]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=n+S;var M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function P0(n,r,a){n=n.ownerDocument||n,n.head.insertBefore(a,r==="title"?n.querySelector("head > title"):null)}function uE(n,r,a){if(a===1||r.itemProp!=null)return!1;switch(n){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"?(n=r.disabled,typeof r.precedence=="string"&&n==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 Y0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function cE(n,r,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=Ml(c.href),y=r.querySelector(Fa(m));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=cu.bind(n),r.then(n,n)),a.state.loading|=4,a.instance=y,mt(y);return}y=r.ownerDocument||r,c=q0(c),(m=Sn.get(m))&&Yd(c,m),y=y.createElement("link"),mt(y);var S=y;S._p=new Promise(function(M,$){S.onload=M,S.onerror=$}),zt(y,"link",c),a.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=cu.bind(n),r.addEventListener("load",a),r.addEventListener("error",a))}}var Xd=0;function fE(n,r){return n.stylesheets&&n.count===0&&du(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var c=setTimeout(function(){if(n.stylesheets&&du(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+r);0<n.imgBytes&&Xd===0&&(Xd=62500*Yk());var m=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&du(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>Xd?50:800)+r);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function cu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)du(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var fu=null;function du(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,fu=new Map,r.forEach(dE,n),fu=null,cu.call(n))}function dE(n,r){if(!(r.state.loading&4)){var a=fu.get(n);if(a)var c=a.get(null);else{a=new Map,fu.set(n,a);for(var m=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var S=m[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),c=S)}c&&a.set(null,c)}m=r.instance,S=m.getAttribute("data-precedence"),y=a.get(S)||c,y===c&&a.set(null,m),a.set(S,m),this.count++,c=cu.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),y?y.parentNode.insertBefore(m,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(m,n.firstChild)),r.state.loading|=4}}var Ga={$$typeof:k,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function hE(n,r,a,c,m,y,S,M,$){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=la(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=la(0),this.hiddenUpdates=la(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function F0(n,r,a,c,m,y,S,M,$,W,le,oe){return n=new hE(n,r,a,S,$,W,le,oe,M),r=1,y===!0&&(r|=24),y=ln(3,null,null,r),n.current=y,y.stateNode=n,r=Cf(),r.refCount++,n.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:a,cache:r},Mf(y),n}function X0(n){return n?(n=sl,n):sl}function G0(n,r,a,c,m,y){m=X0(m),c.context===null?c.context=m:c.pendingContext=m,c=Yi(r),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=Fi(n,c,r),a!==null&&(Kt(a,n,r),Ca(a,n,r))}function Z0(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<r?a:r}}function Gd(n,r){Z0(n,r),(n=n.alternate)&&Z0(n,r)}function Q0(n){if(n.tag===13||n.tag===31){var r=Sr(n,67108864);r!==null&&Kt(r,n,67108864),Gd(n,67108864)}}function K0(n){if(n.tag===13||n.tag===31){var r=cn();r=aa(r);var a=Sr(n,r);a!==null&&Kt(a,n,r),Gd(n,r)}}var hu=!0;function pE(n,r,a,c){var m=D.T;D.T=null;var y=V.p;try{V.p=2,Zd(n,r,a,c)}finally{V.p=y,D.T=m}}function mE(n,r,a,c){var m=D.T;D.T=null;var y=V.p;try{V.p=8,Zd(n,r,a,c)}finally{V.p=y,D.T=m}}function Zd(n,r,a,c){if(hu){var m=Qd(c);if(m===null)Od(n,r,c,pu,a),W0(n,c);else if(yE(m,n,r,a,c))c.stopPropagation();else if(W0(n,c),r&4&&-1<gE.indexOf(n)){for(;m!==null;){var y=Oi(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=ii(y.pendingLanes);if(S!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var $=1<<31-Ge(S);M.entanglements[1]|=$,S&=~$}Pn(y),(Xe&6)===0&&(Qs=kt()+500,Va(0))}}break;case 31:case 13:M=Sr(y,2),M!==null&&Kt(M,y,2),Js(),Gd(y,2)}if(y=Qd(c),y===null&&Od(n,r,c,pu,a),y===m)break;m=y}m!==null&&c.stopPropagation()}else Od(n,r,c,null,a)}}function Qd(n){return n=Kc(n),Kd(n)}var pu=null;function Kd(n){if(pu=null,n=Di(n),n!==null){var r=s(n);if(r===null)n=null;else{var a=r.tag;if(a===13){if(n=u(r),n!==null)return n;n=null}else if(a===31){if(n=f(r),n!==null)return n;n=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return pu=n,null}function J0(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ri()){case re:return 2;case he:return 8;case we:case je:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Jd=!1,ir=null,rr=null,lr=null,Za=new Map,Qa=new Map,ar=[],gE="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 W0(n,r){switch(n){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":rr=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":Za.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qa.delete(r.pointerId)}}function Ka(n,r,a,c,m,y){return n===null||n.nativeEvent!==y?(n={blockedOn:r,domEventName:a,eventSystemFlags:c,nativeEvent:y,targetContainers:[m]},r!==null&&(r=Oi(r),r!==null&&Q0(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,m!==null&&r.indexOf(m)===-1&&r.push(m),n)}function yE(n,r,a,c,m){switch(r){case"focusin":return ir=Ka(ir,n,r,a,c,m),!0;case"dragenter":return rr=Ka(rr,n,r,a,c,m),!0;case"mouseover":return lr=Ka(lr,n,r,a,c,m),!0;case"pointerover":var y=m.pointerId;return Za.set(y,Ka(Za.get(y)||null,n,r,a,c,m)),!0;case"gotpointercapture":return y=m.pointerId,Qa.set(y,Ka(Qa.get(y)||null,n,r,a,c,m)),!0}return!1}function ex(n){var r=Di(n.target);if(r!==null){var a=s(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){n.blockedOn=r,ns(n.priority,function(){K0(a)});return}}else if(r===31){if(r=f(a),r!==null){n.blockedOn=r,ns(n.priority,function(){K0(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function mu(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var a=Qd(n.nativeEvent);if(a===null){a=n.nativeEvent;var c=new a.constructor(a.type,a);Qc=c,a.target.dispatchEvent(c),Qc=null}else return r=Oi(a),r!==null&&Q0(r),n.blockedOn=a,!1;r.shift()}return!0}function tx(n,r,a){mu(n)&&a.delete(r)}function xE(){Jd=!1,ir!==null&&mu(ir)&&(ir=null),rr!==null&&mu(rr)&&(rr=null),lr!==null&&mu(lr)&&(lr=null),Za.forEach(tx),Qa.forEach(tx)}function gu(n,r){n.blockedOn===r&&(n.blockedOn=null,Jd||(Jd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,xE)))}var yu=null;function nx(n){yu!==n&&(yu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yu===n&&(yu=null);for(var r=0;r<n.length;r+=3){var a=n[r],c=n[r+1],m=n[r+2];if(typeof c!="function"){if(Kd(c||a)===null)continue;break}var y=Oi(a);y!==null&&(n.splice(r,3),r-=3,Qf(y,{pending:!0,data:m,method:a.method,action:c},c,m))}}))}function zl(n){function r($){return gu($,n)}ir!==null&&gu(ir,n),rr!==null&&gu(rr,n),lr!==null&&gu(lr,n),Za.forEach(r),Qa.forEach(r);for(var a=0;a<ar.length;a++){var c=ar[a];c.blockedOn===n&&(c.blockedOn=null)}for(;0<ar.length&&(a=ar[0],a.blockedOn===null);)ex(a),a.blockedOn===null&&ar.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var m=a[c],y=a[c+1],S=m[Ot]||null;if(typeof y=="function")S||nx(a);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(m=y,S=y[Ot]||null)M=S.formAction;else if(Kd(m)!==null)continue}else M=S.action;typeof M=="function"?a[c+1]=M:(a.splice(c,3),c-=3),nx(a)}}}function ix(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return m=S})},focusReset:"manual",scroll:"manual"})}function r(){m!==null&&(m(),m=null),c||setTimeout(a,20)}function a(){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,m=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),m!==null&&(m(),m=null)}}}function Wd(n){this._internalRoot=n}xu.prototype.render=Wd.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(l(409));var a=r.current,c=cn();G0(a,c,n,r,null,null)},xu.prototype.unmount=Wd.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;G0(n.current,2,null,n,null,null),Js(),r[ri]=null}};function xu(n){this._internalRoot=n}xu.prototype.unstable_scheduleHydration=function(n){if(n){var r=ts();n={blockedOn:null,target:n,priority:r};for(var a=0;a<ar.length&&r!==0&&r<ar[a].priority;a++);ar.splice(a,0,n),a===0&&ex(n)}};var rx=t.version;if(rx!=="19.2.3")throw Error(l(527,rx,"19.2.3"));V.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(l(188)):(n=Object.keys(n).join(","),Error(l(268,n)));return n=d(r),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var bE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bu.isDisabled&&bu.supportsFiber)try{Tt=bu.inject(bE),dt=bu}catch{}}return Wa.createRoot=function(n,r){if(!o(n))throw Error(l(299));var a=!1,c="",m=fy,y=dy,S=hy;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=F0(n,1,!1,null,null,a,c,null,m,y,S,ix),n[ri]=r.current,Dd(n),new Wd(r)},Wa.hydrateRoot=function(n,r,a){if(!o(n))throw Error(l(299));var c=!1,m="",y=fy,S=dy,M=hy,$=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(M=a.onRecoverableError),a.formState!==void 0&&($=a.formState)),r=F0(n,1,!0,r,a??null,c,m,$,y,S,M,ix),r.context=X0(null),a=r.current,c=cn(),c=aa(c),m=Yi(c),m.callback=null,Fi(a,m,c),a=c,r.current.lanes=a,mr(r,a),Pn(r),n[ri]=r.current,Dd(n),new xu(r)},Wa.version="19.2.3",Wa}var px;function TE(){if(px)return nh.exports;px=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=_E(),nh.exports}var AE=TE();var mx="popstate";function ME(e={}){function t(l,o){let{pathname:s,search:u,hash:f}=l.location;return Vh("",{pathname:s,search:u,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function i(l,o){return typeof o=="string"?o:xo(o)}return zE(t,i,null,e)}function st(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jE(){return Math.random().toString(36).substring(2,10)}function gx(e,t){return{usr:e.state,key:e.key,idx:t}}function Vh(e,t,i=null,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Jl(t):t,state:i,key:t&&t.key||l||jE()}}function xo({pathname:e="/",search:t="",hash:i=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Jl(e){let t={};if(e){let i=e.indexOf("#");i>=0&&(t.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(t.search=e.substring(l),e=e.substring(0,l)),e&&(t.pathname=e)}return t}function zE(e,t,i,l={}){let{window:o=document.defaultView,v5Compat:s=!1}=l,u=o.history,f="POP",h=null,d=g();d==null&&(d=0,u.replaceState({...u.state,idx:d},""));function g(){return(u.state||{idx:null}).idx}function p(){f="POP";let C=g(),N=C==null?null:C-d;d=C,h&&h({action:f,location:E.location,delta:N})}function b(C,N){f="PUSH";let _=Vh(E.location,C,N);d=g()+1;let k=gx(_,d),T=E.createHref(_);try{u.pushState(k,"",T)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;o.location.assign(T)}s&&h&&h({action:f,location:E.location,delta:1})}function v(C,N){f="REPLACE";let _=Vh(E.location,C,N);d=g();let k=gx(_,d),T=E.createHref(_);u.replaceState(k,"",T),s&&h&&h({action:f,location:E.location,delta:0})}function w(C){return RE(C)}let E={get action(){return f},get location(){return e(o,u)},listen(C){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(mx,p),h=C,()=>{o.removeEventListener(mx,p),h=null}},createHref(C){return t(o,C)},createURL:w,encodeLocation(C){let N=w(C);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:v,go(C){return u.go(C)}};return E}function RE(e,t=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),st(i,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:xo(e);return l=l.replace(/ $/,"%20"),!t&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function zb(e,t,i="/"){return DE(e,t,i,!1)}function DE(e,t,i,l){let o=typeof t=="string"?Jl(t):t,s=Ti(o.pathname||"/",i);if(s==null)return null;let u=Rb(e);OE(u);let f=null;for(let h=0;f==null&&h<u.length;++h){let d=FE(s);f=PE(u[h],d,l)}return f}function Rb(e,t=[],i=[],l="",o=!1){let s=(u,f,h=o,d)=>{let g={relativePath:d===void 0?u.path||"":d,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&h)return;st(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let p=Ci([l,g.relativePath]),b=i.concat(g);u.children&&u.children.length>0&&(st(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Rb(u.children,t,b,p,h)),!(u.path==null&&!u.index)&&t.push({path:p,score:VE(p,u.index),routesMeta:b})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))s(u,f);else for(let h of Db(u.path))s(u,f,!0,h)}),t}function Db(e){let t=e.split("/");if(t.length===0)return[];let[i,...l]=t,o=i.endsWith("?"),s=i.replace(/\?$/,"");if(l.length===0)return o?[s,""]:[s];let u=Db(l.join("/")),f=[];return f.push(...u.map(h=>h===""?s:[s,h].join("/"))),o&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function OE(e){e.sort((t,i)=>t.score!==i.score?i.score-t.score:$E(t.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var LE=/^:[\w-]+$/,BE=3,HE=2,UE=1,IE=10,qE=-2,yx=e=>e==="*";function VE(e,t){let i=e.split("/"),l=i.length;return i.some(yx)&&(l+=qE),t&&(l+=HE),i.filter(o=>!yx(o)).reduce((o,s)=>o+(LE.test(s)?BE:s===""?UE:IE),l)}function $E(e,t){return e.length===t.length&&e.slice(0,-1).every((l,o)=>l===t[o])?e[e.length-1]-t[t.length-1]:0}function PE(e,t,i=!1){let{routesMeta:l}=e,o={},s="/",u=[];for(let f=0;f<l.length;++f){let h=l[f],d=f===l.length-1,g=s==="/"?t:t.slice(s.length)||"/",p=Zu({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},g),b=h.route;if(!p&&d&&i&&!l[l.length-1].route.index&&(p=Zu({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!p)return null;Object.assign(o,p.params),u.push({params:o,pathname:Ci([s,p.pathname]),pathnameBase:QE(Ci([s,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(s=Ci([s,p.pathnameBase]))}return u}function Zu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,l]=YE(e.path,e.caseSensitive,e.end),o=t.match(i);if(!o)return null;let s=o[0],u=s.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:l.reduce((d,{paramName:g,isOptional:p},b)=>{if(g==="*"){let w=f[b]||"";u=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const v=f[b];return p&&!v?d[g]=void 0:d[g]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:u,pattern:e}}function YE(e,t=!1,i=!0){Zn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h)=>(l.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),l]}function FE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ti(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}var XE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function GE(e,t="/"){let{pathname:i,search:l="",hash:o=""}=typeof e=="string"?Jl(e):e,s;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?s=xx(i.substring(1),"/"):s=xx(i,t)):s=t,{pathname:s,search:KE(l),hash:JE(o)}}function xx(e,t){let i=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function ah(e,t,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ZE(e){return e.filter((t,i)=>i===0||t.route.path&&t.route.path.length>0)}function Ob(e){let t=ZE(e);return t.map((i,l)=>l===t.length-1?i.pathname:i.pathnameBase)}function Lb(e,t,i,l=!1){let o;typeof e=="string"?o=Jl(e):(o={...e},st(!o.pathname||!o.pathname.includes("?"),ah("?","pathname","search",o)),st(!o.pathname||!o.pathname.includes("#"),ah("#","pathname","hash",o)),st(!o.search||!o.search.includes("#"),ah("#","search","hash",o)));let s=e===""||o.pathname==="",u=s?"/":o.pathname,f;if(u==null)f=i;else{let p=t.length-1;if(!l&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),p-=1;o.pathname=b.join("/")}f=p>=0?t[p]:"/"}let h=GE(o,f),d=u&&u!=="/"&&u.endsWith("/"),g=(s||u===".")&&i.endsWith("/");return!h.pathname.endsWith("/")&&(d||g)&&(h.pathname+="/"),h}var Ci=e=>e.join("/").replace(/\/\/+/g,"/"),QE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,JE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,WE=class{constructor(e,t,i,l=!1){this.status=e,this.statusText=t||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function eN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function tN(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Bb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Hb(e,t){let i=e;if(typeof i!="string"||!XE.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,o=!1;if(Bb)try{let s=new URL(window.location.href),u=i.startsWith("//")?new URL(s.protocol+i):new URL(i),f=Ti(u.pathname,t);u.origin===s.origin&&f!=null?i=f+u.search+u.hash:o=!0}catch{Zn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ub=["POST","PUT","PATCH","DELETE"];new Set(Ub);var nN=["GET",...Ub];new Set(nN);var Wl=R.createContext(null);Wl.displayName="DataRouter";var pc=R.createContext(null);pc.displayName="DataRouterState";var iN=R.createContext(!1),Ib=R.createContext({isTransitioning:!1});Ib.displayName="ViewTransition";var rN=R.createContext(new Map);rN.displayName="Fetchers";var lN=R.createContext(null);lN.displayName="Await";var Nn=R.createContext(null);Nn.displayName="Navigation";var Oo=R.createContext(null);Oo.displayName="Location";var Mi=R.createContext({outlet:null,matches:[],isDataRoute:!1});Mi.displayName="Route";var Cp=R.createContext(null);Cp.displayName="RouteError";var qb="REACT_ROUTER_ERROR",aN="REDIRECT",oN="ROUTE_ERROR_RESPONSE";function sN(e){if(e.startsWith(`${qb}:${aN}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function uN(e){if(e.startsWith(`${qb}:${oN}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new WE(t.status,t.statusText,t.data)}catch{}}function cN(e,{relative:t}={}){st(Lo(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=R.useContext(Nn),{hash:o,pathname:s,search:u}=Bo(e,{relative:t}),f=s;return i!=="/"&&(f=s==="/"?i:Ci([i,s])),l.createHref({pathname:f,search:u,hash:o})}function Lo(){return R.useContext(Oo)!=null}function Yr(){return st(Lo(),"useLocation() may be used only in the context of a <Router> component."),R.useContext(Oo).location}var Vb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $b(e){R.useContext(Nn).static||R.useLayoutEffect(e)}function _p(){let{isDataRoute:e}=R.useContext(Mi);return e?kN():fN()}function fN(){st(Lo(),"useNavigate() may be used only in the context of a <Router> component.");let e=R.useContext(Wl),{basename:t,navigator:i}=R.useContext(Nn),{matches:l}=R.useContext(Mi),{pathname:o}=Yr(),s=JSON.stringify(Ob(l)),u=R.useRef(!1);return $b(()=>{u.current=!0}),R.useCallback((h,d={})=>{if(Zn(u.current,Vb),!u.current)return;if(typeof h=="number"){i.go(h);return}let g=Lb(h,JSON.parse(s),o,d.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ci([t,g.pathname])),(d.replace?i.replace:i.push)(g,d.state,d)},[t,i,s,o,e])}R.createContext(null);function Bo(e,{relative:t}={}){let{matches:i}=R.useContext(Mi),{pathname:l}=Yr(),o=JSON.stringify(Ob(i));return R.useMemo(()=>Lb(e,JSON.parse(o),l,t==="path"),[e,o,l,t])}function dN(e,t){return Pb(e,t)}function Pb(e,t,i,l,o){st(Lo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=R.useContext(Nn),{matches:u}=R.useContext(Mi),f=u[u.length-1],h=f?f.params:{},d=f?f.pathname:"/",g=f?f.pathnameBase:"/",p=f&&f.route;{let _=p&&p.path||"";Fb(d,!p||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let b=Yr(),v;if(t){let _=typeof t=="string"?Jl(t):t;st(g==="/"||_.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${_.pathname}" was given in the \`location\` prop.`),v=_}else v=b;let w=v.pathname||"/",E=w;if(g!=="/"){let _=g.replace(/^\//,"").split("/");E="/"+w.replace(/^\//,"").split("/").slice(_.length).join("/")}let C=zb(e,{pathname:E});Zn(p||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Zn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=yN(C&&C.map(_=>Object.assign({},_,{params:Object.assign({},h,_.params),pathname:Ci([g,s.encodeLocation?s.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?g:Ci([g,s.encodeLocation?s.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),u,i,l,o);return t&&N?R.createElement(Oo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},N):N}function hN(){let e=SN(),t=eN(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},s={padding:"2px 4px",backgroundColor:l},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:s},"ErrorBoundary")," or"," ",R.createElement("code",{style:s},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},t),i?R.createElement("pre",{style:o},i):null,u)}var pN=R.createElement(hN,null),Yb=class extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=uN(e.digest);i&&(e=i)}let t=e!==void 0?R.createElement(Mi.Provider,{value:this.props.routeContext},R.createElement(Cp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?R.createElement(mN,{error:e},t):t}};Yb.contextType=iN;var oh=new WeakMap;function mN({children:e,error:t}){let{basename:i}=R.useContext(Nn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let l=sN(t.digest);if(l){let o=oh.get(t);if(o)throw o;let s=Hb(l.location,i);if(Bb&&!oh.get(t))if(s.isExternal||l.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:l.replace}));throw oh.set(t,u),u}return R.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function gN({routeContext:e,match:t,children:i}){let l=R.useContext(Wl);return l&&l.static&&l.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=t.route.id),R.createElement(Mi.Provider,{value:e},i)}function yN(e,t=[],i=null,l=null,o=null){if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let s=e,u=i?.errors;if(u!=null){let g=s.findIndex(p=>p.route.id&&u?.[p.route.id]!==void 0);st(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let f=!1,h=-1;if(i)for(let g=0;g<s.length;g++){let p=s[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=g),p.route.id){let{loaderData:b,errors:v}=i,w=p.route.loader&&!b.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||w){f=!0,h>=0?s=s.slice(0,h+1):s=[s[0]];break}}}let d=i&&l?(g,p)=>{l(g,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:tN(i.matches),errorInfo:p})}:void 0;return s.reduceRight((g,p,b)=>{let v,w=!1,E=null,C=null;i&&(v=u&&p.route.id?u[p.route.id]:void 0,E=p.route.errorElement||pN,f&&(h<0&&b===0?(Fb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):h===b&&(w=!0,C=p.route.hydrateFallbackElement||null)));let N=t.concat(s.slice(0,b+1)),_=()=>{let k;return v?k=E:w?k=C:p.route.Component?k=R.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=g,R.createElement(gN,{match:p,routeContext:{outlet:g,matches:N,isDataRoute:i!=null},children:k})};return i&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?R.createElement(Yb,{location:i.location,revalidation:i.revalidation,component:E,error:v,children:_(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:d}):_()},null)}function Tp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xN(e){let t=R.useContext(Wl);return st(t,Tp(e)),t}function bN(e){let t=R.useContext(pc);return st(t,Tp(e)),t}function vN(e){let t=R.useContext(Mi);return st(t,Tp(e)),t}function Ap(e){let t=vN(e),i=t.matches[t.matches.length-1];return st(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function wN(){return Ap("useRouteId")}function SN(){let e=R.useContext(Cp),t=bN("useRouteError"),i=Ap("useRouteError");return e!==void 0?e:t.errors?.[i]}function kN(){let{router:e}=xN("useNavigate"),t=Ap("useNavigate"),i=R.useRef(!1);return $b(()=>{i.current=!0}),R.useCallback(async(o,s={})=>{Zn(i.current,Vb),i.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var bx={};function Fb(e,t,i){!t&&!bx[e]&&(bx[e]=!0,Zn(!1,i))}R.memo(EN);function EN({routes:e,future:t,state:i,onError:l}){return Pb(e,void 0,i,l,t)}function $h(e){st(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function NN({basename:e="/",children:t=null,location:i,navigationType:l="POP",navigator:o,static:s=!1,unstable_useTransitions:u}){st(!Lo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=R.useMemo(()=>({basename:f,navigator:o,static:s,unstable_useTransitions:u,future:{}}),[f,o,s,u]);typeof i=="string"&&(i=Jl(i));let{pathname:d="/",search:g="",hash:p="",state:b=null,key:v="default"}=i,w=R.useMemo(()=>{let E=Ti(d,f);return E==null?null:{location:{pathname:E,search:g,hash:p,state:b,key:v},navigationType:l}},[f,d,g,p,b,v,l]);return Zn(w!=null,`<Router basename="${f}"> is not able to match the URL "${d}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:R.createElement(Nn.Provider,{value:h},R.createElement(Oo.Provider,{children:t,value:w}))}function CN({children:e,location:t}){return dN(Ph(e),t)}function Ph(e,t=[]){let i=[];return R.Children.forEach(e,(l,o)=>{if(!R.isValidElement(l))return;let s=[...t,o];if(l.type===R.Fragment){i.push.apply(i,Ph(l.props.children,s));return}st(l.type===$h,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),st(!l.props.index||!l.props.children,"An index route cannot have child routes.");let u={id:l.props.id||s.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(u.children=Ph(l.props.children,s)),i.push(u)}),i}var Lu="get",Bu="application/x-www-form-urlencoded";function mc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _N(e){return mc(e)&&e.tagName.toLowerCase()==="button"}function TN(e){return mc(e)&&e.tagName.toLowerCase()==="form"}function AN(e){return mc(e)&&e.tagName.toLowerCase()==="input"}function MN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jN(e,t){return e.button===0&&(!t||t==="_self")&&!MN(e)}var vu=null;function zN(){if(vu===null)try{new FormData(document.createElement("form"),0),vu=!1}catch{vu=!0}return vu}var RN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sh(e){return e!=null&&!RN.has(e)?(Zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bu}"`),null):e}function DN(e,t){let i,l,o,s,u;if(TN(e)){let f=e.getAttribute("action");l=f?Ti(f,t):null,i=e.getAttribute("method")||Lu,o=sh(e.getAttribute("enctype"))||Bu,s=new FormData(e)}else if(_N(e)||AN(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(l=h?Ti(h,t):null,i=e.getAttribute("formmethod")||f.getAttribute("method")||Lu,o=sh(e.getAttribute("formenctype"))||sh(f.getAttribute("enctype"))||Bu,s=new FormData(f,e),!zN()){let{name:d,type:g,value:p}=e;if(g==="image"){let b=d?`${d}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else d&&s.append(d,p)}}else{if(mc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Lu,l=null,o=Bu,u=e}return s&&o==="text/plain"&&(u=s,s=void 0),{action:l,method:i.toLowerCase(),encType:o,formData:s,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Mp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ON(e,t,i,l){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:t&&Ti(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function LN(e,t){if(e.id in t)return t[e.id];try{let i=await import(e.module);return t[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function BN(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function HN(e,t,i){let l=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let u=await LN(s,i);return u.links?u.links():[]}return[]}));return VN(l.flat(1).filter(BN).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function vx(e,t,i,l,o,s){let u=(h,d)=>i[d]?h.route.id!==i[d].route.id:!0,f=(h,d)=>i[d].pathname!==h.pathname||i[d].route.path?.endsWith("*")&&i[d].params["*"]!==h.params["*"];return s==="assets"?t.filter((h,d)=>u(h,d)||f(h,d)):s==="data"?t.filter((h,d)=>{let g=l.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(u(h,d)||f(h,d))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function UN(e,t,{includeHydrateFallback:i}={}){return IN(e.map(l=>{let o=t.routes[l.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function IN(e){return[...new Set(e)]}function qN(e){let t={},i=Object.keys(e).sort();for(let l of i)t[l]=e[l];return t}function VN(e,t){let i=new Set;return new Set(t),e.reduce((l,o)=>{let s=JSON.stringify(qN(o));return i.has(s)||(i.add(s),l.push({key:s,link:o})),l},[])}function Xb(){let e=R.useContext(Wl);return Mp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $N(){let e=R.useContext(pc);return Mp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var jp=R.createContext(void 0);jp.displayName="FrameworkContext";function Gb(){let e=R.useContext(jp);return Mp(e,"You must render this element inside a <HydratedRouter> element"),e}function PN(e,t){let i=R.useContext(jp),[l,o]=R.useState(!1),[s,u]=R.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:d,onMouseLeave:g,onTouchStart:p}=t,b=R.useRef(null);R.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let E=N=>{N.forEach(_=>{u(_.isIntersecting)})},C=new IntersectionObserver(E,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),R.useEffect(()=>{if(l){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[l]);let v=()=>{o(!0)},w=()=>{o(!1),u(!1)};return i?e!=="intent"?[s,b,{}]:[s,b,{onFocus:eo(f,v),onBlur:eo(h,w),onMouseEnter:eo(d,v),onMouseLeave:eo(g,w),onTouchStart:eo(p,v)}]:[!1,b,{}]}function eo(e,t){return i=>{e&&e(i),i.defaultPrevented||t(i)}}function YN({page:e,...t}){let{router:i}=Xb(),l=R.useMemo(()=>zb(i.routes,e,i.basename),[i.routes,e,i.basename]);return l?R.createElement(XN,{page:e,matches:l,...t}):null}function FN(e){let{manifest:t,routeModules:i}=Gb(),[l,o]=R.useState([]);return R.useEffect(()=>{let s=!1;return HN(e,t,i).then(u=>{s||o(u)}),()=>{s=!0}},[e,t,i]),l}function XN({page:e,matches:t,...i}){let l=Yr(),{future:o,manifest:s,routeModules:u}=Gb(),{basename:f}=Xb(),{loaderData:h,matches:d}=$N(),g=R.useMemo(()=>vx(e,t,d,s,l,"data"),[e,t,d,s,l]),p=R.useMemo(()=>vx(e,t,d,s,l,"assets"),[e,t,d,s,l]),b=R.useMemo(()=>{if(e===l.pathname+l.search+l.hash)return[];let E=new Set,C=!1;if(t.forEach(_=>{let k=s.routes[_.route.id];!k||!k.hasLoader||(!g.some(T=>T.route.id===_.route.id)&&_.route.id in h&&u[_.route.id]?.shouldRevalidate||k.hasClientLoader?C=!0:E.add(_.route.id))}),E.size===0)return[];let N=ON(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return C&&E.size>0&&N.searchParams.set("_routes",t.filter(_=>E.has(_.route.id)).map(_=>_.route.id).join(",")),[N.pathname+N.search]},[f,o.unstable_trailingSlashAwareDataRequests,h,l,s,g,t,e,u]),v=R.useMemo(()=>UN(p,s),[p,s]),w=FN(p);return R.createElement(R.Fragment,null,b.map(E=>R.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),v.map(E=>R.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),w.map(({key:E,link:C})=>R.createElement("link",{key:E,nonce:i.nonce,...C,crossOrigin:C.crossOrigin??i.crossOrigin})))}function GN(...e){return t=>{e.forEach(i=>{typeof i=="function"?i(t):i!=null&&(i.current=t)})}}var ZN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ZN&&(window.__reactRouterVersion="7.13.0")}catch{}function QN({basename:e,children:t,unstable_useTransitions:i,window:l}){let o=R.useRef();o.current==null&&(o.current=ME({window:l,v5Compat:!0}));let s=o.current,[u,f]=R.useState({action:s.action,location:s.location}),h=R.useCallback(d=>{i===!1?f(d):R.startTransition(()=>f(d))},[i]);return R.useLayoutEffect(()=>s.listen(h),[s,h]),R.createElement(NN,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:s,unstable_useTransitions:i})}var Zb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qb=R.forwardRef(function({onClick:t,discover:i="render",prefetch:l="none",relative:o,reloadDocument:s,replace:u,state:f,target:h,to:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},w){let{basename:E,unstable_useTransitions:C}=R.useContext(Nn),N=typeof d=="string"&&Zb.test(d),_=Hb(d,E);d=_.to;let k=cN(d,{relative:o}),[T,B,A]=PN(l,v),L=eC(d,{replace:u,state:f,target:h,preventScrollReset:g,relative:o,viewTransition:p,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function X(U){t&&t(U),U.defaultPrevented||L(U)}let Z=R.createElement("a",{...v,...A,href:_.absoluteURL||k,onClick:_.isExternal||s?t:X,ref:GN(w,B),target:h,"data-discover":!N&&i==="render"?"true":void 0});return T&&!N?R.createElement(R.Fragment,null,Z,R.createElement(YN,{page:k})):Z});Qb.displayName="Link";var KN=R.forwardRef(function({"aria-current":t="page",caseSensitive:i=!1,className:l="",end:o=!1,style:s,to:u,viewTransition:f,children:h,...d},g){let p=Bo(u,{relative:d.relative}),b=Yr(),v=R.useContext(pc),{navigator:w,basename:E}=R.useContext(Nn),C=v!=null&&lC(p)&&f===!0,N=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,_=b.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(_=_.toLowerCase(),k=k?k.toLowerCase():null,N=N.toLowerCase()),k&&E&&(k=Ti(k,E)||k);const T=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let B=_===N||!o&&_.startsWith(N)&&_.charAt(T)==="/",A=k!=null&&(k===N||!o&&k.startsWith(N)&&k.charAt(N.length)==="/"),L={isActive:B,isPending:A,isTransitioning:C},X=B?t:void 0,Z;typeof l=="function"?Z=l(L):Z=[l,B?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let U=typeof s=="function"?s(L):s;return R.createElement(Qb,{...d,"aria-current":X,className:Z,ref:g,style:U,to:u,viewTransition:f},typeof h=="function"?h(L):h)});KN.displayName="NavLink";var JN=R.forwardRef(({discover:e="render",fetcherKey:t,navigate:i,reloadDocument:l,replace:o,state:s,method:u=Lu,action:f,onSubmit:h,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},w)=>{let{unstable_useTransitions:E}=R.useContext(Nn),C=iC(),N=rC(f,{relative:d}),_=u.toLowerCase()==="get"?"get":"post",k=typeof f=="string"&&Zb.test(f),T=B=>{if(h&&h(B),B.defaultPrevented)return;B.preventDefault();let A=B.nativeEvent.submitter,L=A?.getAttribute("formmethod")||u,X=()=>C(A||B.currentTarget,{fetcherKey:t,method:L,navigate:i,replace:o,state:s,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:b});E&&i!==!1?R.startTransition(()=>X()):X()};return R.createElement("form",{ref:w,method:_,action:N,onSubmit:l?h:T,...v,"data-discover":!k&&e==="render"?"true":void 0})});JN.displayName="Form";function WN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kb(e){let t=R.useContext(Wl);return st(t,WN(e)),t}function eC(e,{target:t,replace:i,state:l,preventScrollReset:o,relative:s,viewTransition:u,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let d=_p(),g=Yr(),p=Bo(e,{relative:s});return R.useCallback(b=>{if(jN(b,t)){b.preventDefault();let v=i!==void 0?i:xo(g)===xo(p),w=()=>d(e,{replace:v,state:l,preventScrollReset:o,relative:s,viewTransition:u,unstable_defaultShouldRevalidate:f});h?R.startTransition(()=>w()):w()}},[g,d,p,i,l,t,e,o,s,u,f,h])}var tC=0,nC=()=>`__${String(++tC)}__`;function iC(){let{router:e}=Kb("useSubmit"),{basename:t}=R.useContext(Nn),i=wN(),l=e.fetch,o=e.navigate;return R.useCallback(async(s,u={})=>{let{action:f,method:h,encType:d,formData:g,body:p}=DN(s,t);if(u.navigate===!1){let b=u.fetcherKey||nC();await l(b,i,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:p,formMethod:u.method||h,formEncType:u.encType||d,flushSync:u.flushSync})}else await o(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:p,formMethod:u.method||h,formEncType:u.encType||d,replace:u.replace,state:u.state,fromRouteId:i,flushSync:u.flushSync,viewTransition:u.viewTransition})},[l,o,t,i])}function rC(e,{relative:t}={}){let{basename:i}=R.useContext(Nn),l=R.useContext(Mi);st(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),s={...Bo(e||".",{relative:t})},u=Yr();if(e==null){s.search=u.search;let f=new URLSearchParams(s.search),h=f.getAll("index");if(h.some(g=>g==="")){f.delete("index"),h.filter(p=>p).forEach(p=>f.append("index",p));let g=f.toString();s.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(s.pathname=s.pathname==="/"?i:Ci([i,s.pathname])),xo(s)}function lC(e,{relative:t}={}){let i=R.useContext(Ib);st(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=Kb("useViewTransitionState"),o=Bo(e,{relative:t});if(!i.isTransitioning)return!1;let s=Ti(i.currentLocation.pathname,l)||i.currentLocation.pathname,u=Ti(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Zu(o.pathname,u)!=null||Zu(o.pathname,s)!=null}jb();const Jb=(...e)=>e.filter((t,i,l)=>!!t&&t.trim()!==""&&l.indexOf(t)===i).join(" ").trim();const aC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const oC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,l)=>l?l.toUpperCase():i.toLowerCase());const wx=e=>{const t=oC(e);return t.charAt(0).toUpperCase()+t.slice(1)};var sC={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 uC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const cC=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:o="",children:s,iconNode:u,...f},h)=>R.createElement("svg",{ref:h,...sC,width:t,height:t,stroke:e,strokeWidth:l?Number(i)*24/Number(t):i,className:Jb("lucide",o),...!s&&!uC(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>R.createElement(d,g)),...Array.isArray(s)?s:[s]]));const Ce=(e,t)=>{const i=R.forwardRef(({className:l,...o},s)=>R.createElement(cC,{ref:s,iconNode:t,className:Jb(`lucide-${aC(wx(e))}`,`lucide-${e}`,l),...o}));return i.displayName=wx(e),i};const fC=[["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"}]],zp=Ce("anchor",fC);const dC=[["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"}]],hC=Ce("bot",dC);const pC=[["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"}]],gc=Ce("chart-column",pC);const mC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],gC=Ce("check",mC);const yC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Wb=Ce("chevron-down",yC);const xC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bC=Ce("chevron-right",xC);const vC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],wC=Ce("chevron-up",vC);const SC=[["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"}]],Yh=Ce("circle-alert",SC);const kC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],yc=Ce("circle-check-big",kC);const EC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],NC=Ce("circle-check",EC);const CC=[["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"}]],Rp=Ce("circle-x",CC);const _C=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],TC=Ce("cpu",_C);const AC=[["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"}]],Qu=Ce("download",AC);const MC=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],jC=Ce("ellipsis-vertical",MC);const zC=[["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"}]],RC=Ce("eye-off",zC);const DC=[["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"}]],ev=Ce("eye",DC);const OC=[["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 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],LC=Ce("file-code",OC);const BC=[["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"}]],bo=Ce("file-text",BC);const HC=[["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"}]],Fh=Ce("folder-open",HC);const UC=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],IC=Ce("folder",UC);const qC=[["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"}]],VC=Ce("globe",qC);const $C=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],PC=Ce("house",$C);const YC=[["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"}]],tv=Ce("image",YC);const FC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],XC=Ce("info",FC);const GC=[["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"}]],ZC=Ce("key",GC);const QC=[["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"}]],KC=Ce("link-2",QC);const JC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ku=Ce("loader-circle",JC);const WC=[["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"}]],e_=Ce("maximize-2",WC);const t_=[["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"}]],xc=Ce("message-square",t_);const n_=[["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"}]],i_=Ce("minimize-2",n_);const r_=[["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"}]],vo=Ce("play",r_);const l_=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Sx=Ce("plus",l_);const a_=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],o_=Ce("refresh-cw",a_);const s_=[["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"}]],u_=Ce("save",s_);const c_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],f_=Ce("search",c_);const d_=[["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"}]],h_=Ce("send",d_);const p_=[["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"}]],m_=Ce("server",p_);const g_=[["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"}]],y_=Ce("settings-2",g_);const x_=[["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"}]],Dp=Ce("settings",x_);const b_=[["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"}]],Ho=Ce("sparkles",b_);const v_=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bc=Ce("terminal",v_);const w_=[["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"}]],wo=Ce("trash-2",w_);const S_=[["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"}]],k_=Ce("triangle-alert",S_);const E_=[["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"}]],N_=Ce("upload",E_);const C_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vc=Ce("x",C_);const __=[["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"}]],Uo=Ce("zap",__),kx=e=>{let t;const i=new Set,l=(d,g)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const b=t;t=g??(typeof p!="object"||p===null)?p:Object.assign({},t,p),i.forEach(v=>v(t,b))}},o=()=>t,f={setState:l,getState:o,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=t=e(l,o,f);return f},T_=(e=>e?kx(e):kx),A_=e=>e;function M_(e,t=A_){const i=so.useSyncExternalStore(e.subscribe,so.useCallback(()=>t(e.getState()),[e,t]),so.useCallback(()=>t(e.getInitialState()),[e,t]));return so.useDebugValue(i),i}const Ex=e=>{const t=T_(e),i=l=>M_(t,l);return Object.assign(i,t),i},Io=(e=>e?Ex(e):Ex),j_=Io(e=>({projects:[],galleryItems:[],isLoading:!1,error:null,currentProject:null,setProjects:t=>e({projects:t}),setGalleryItems:t=>e({galleryItems:t}),setLoading:t=>e({isLoading:t}),setError:t=>e({error:t}),setCurrentProject:t=>e({currentProject:t}),fetchProjects:async()=>{e({isLoading:!0,error:null});try{const t=await fetch("/api/projects");if(!t.ok)throw new Error("Failed to fetch projects");const i=await t.json();e({projects:i.projects,galleryItems:i.gallery||[]})}catch(t){const i=t instanceof Error?t.message:"Unknown error";e({error:i})}finally{e({isLoading:!1})}},createProject:async(t,i)=>{e({isLoading:!0,error:null});try{const l=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,description:i})});if(!l.ok)throw new Error("Failed to create project");const o=await l.json();return e(s=>({projects:[o,...s.projects]})),o}catch(l){const o=l instanceof Error?l.message:"Unknown error";return e({error:o}),null}finally{e({isLoading:!1})}},deleteProject:async t=>{try{if(!(await fetch(`/api/projects/${t}`,{method:"DELETE"})).ok)throw new Error("Failed to delete project");return e(l=>({projects:l.projects.filter(o=>o.id!==t)})),!0}catch(i){const l=i instanceof Error?i.message:"Unknown error";return e({error:l}),!1}}})),Nx=["from-purple-600 to-blue-600","from-pink-600 to-rose-600","from-emerald-600 to-teal-600","from-amber-600 to-orange-600","from-indigo-600 to-violet-600","from-cyan-600 to-blue-600"];function z_(e){const t=e.split("").reduce((i,l)=>i+l.charCodeAt(0),0);return Nx[t%Nx.length]}function R_({project:e,onClick:t}){const i=z_(e.name);return x.jsxs("div",{onClick:t,className:"group relative w-72 h-56 rounded-2xl overflow-hidden cursor-pointer transition-all duration-300 hover:scale-[1.02] hover:shadow-xl hover:shadow-black/20",children:[x.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${i}`}),x.jsx("div",{className:"absolute top-4 right-4 w-24 h-24 rounded-2xl bg-white/10 backdrop-blur-sm transform rotate-12"}),x.jsx("button",{onClick:l=>{l.stopPropagation()},className:"absolute top-3 right-3 p-1 rounded-full opacity-0 group-hover:opacity-100 hover:bg-white/20 transition-all z-10",children:x.jsx(jC,{className:"w-5 h-5 text-white"})}),x.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-5 bg-gradient-to-t from-black/60 to-transparent",children:[x.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:e.name}),x.jsx("p",{className:"text-sm text-white/80 line-clamp-2 mb-3",children:e.description}),x.jsxs("div",{className:"flex items-center gap-4 text-white/70 text-xs",children:[x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(Uo,{className:"w-3.5 h-3.5"}),x.jsxs("span",{children:[e.skillCount," skills"]})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(TC,{className:"w-3.5 h-3.5"}),x.jsxs("span",{children:[e.agentCount," agents"]})]})]})]})]})}function D_({item:e,onClick:t}){return x.jsxs("div",{onClick:t,className:"group relative w-56 h-56 rounded-2xl overflow-hidden cursor-pointer transition-all duration-300 hover:scale-[1.02] hover:shadow-lg hover:shadow-black/20",children:[e.thumbnail?x.jsx("img",{src:e.thumbnail,alt:e.name,className:"w-full h-full object-cover"}):x.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-700 to-gray-800"}),x.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex flex-col justify-end p-4",children:[x.jsx("h4",{className:"text-white font-semibold text-sm mb-1",children:e.name}),x.jsx("p",{className:"text-white/70 text-xs line-clamp-2 mb-2",children:e.description}),x.jsxs("div",{className:"flex items-center gap-2 text-white/60 text-xs",children:[x.jsx(Qu,{className:"w-3 h-3"}),x.jsx("span",{children:e.downloads})]})]})]})}function O_({isOpen:e,onClose:t,onCreate:i}){const[l,o]=R.useState(""),[s,u]=R.useState("");if(!e)return null;const f=h=>{h.preventDefault(),l.trim()&&(i(l.trim(),s.trim()),o(""),u(""),t())};return x.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[x.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),x.jsxs("div",{className:"relative w-full max-w-md bg-surface border border-border rounded-2xl shadow-2xl",children:[x.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"p-2 bg-accent/20 rounded-lg",children:x.jsx(IC,{className:"w-5 h-5 text-accent"})}),x.jsx("h2",{className:"text-lg font-semibold text-white",children:"New Project"})]}),x.jsx("button",{onClick:t,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:x.jsx(vc,{className:"w-5 h-5 text-gray-400"})})]}),x.jsxs("form",{onSubmit:f,className:"p-6 space-y-4",children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Project Name"}),x.jsx("input",{type:"text",value:l,onChange:h=>o(h.target.value),placeholder:"my-awesome-project",className:"w-full px-4 py-3 bg-canvas border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent",autoFocus:!0})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Description"}),x.jsx("textarea",{value:s,onChange:h=>u(h.target.value),placeholder:"What will this project do?",rows:3,className:"w-full px-4 py-3 bg-canvas border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]}),x.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[x.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-gray-400 hover:text-white transition-colors",children:"Cancel"}),x.jsx("button",{type:"submit",disabled:!l.trim(),className:"px-6 py-2 bg-accent hover:bg-accent-hover disabled:opacity-50 disabled:cursor-not-allowed rounded-lg font-medium text-white transition-colors",children:"Create"})]})]})]})]})}function L_(e,t){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 Xh=e=>t=>{try{const i=e(t);return i instanceof Promise?i:{then(l){return Xh(l)(i)},catch(l){return this}}}catch(i){return{then(l){return this},catch(l){return Xh(l)(i)}}}},B_=(e,t)=>(i,l,o)=>{let s={storage:L_(()=>localStorage),partialize:C=>C,version:0,merge:(C,N)=>({...N,...C}),...t},u=!1,f=0;const h=new Set,d=new Set;let g=s.storage;if(!g)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),i(...C)},l,o);const p=()=>{const C=s.partialize({...l()});return g.setItem(s.name,{state:C,version:s.version})},b=o.setState;o.setState=(C,N)=>(b(C,N),p());const v=e((...C)=>(i(...C),p()),l,o);o.getInitialState=()=>v;let w;const E=()=>{var C,N;if(!g)return;const _=++f;u=!1,h.forEach(T=>{var B;return T((B=l())!=null?B:v)});const k=((N=s.onRehydrateStorage)==null?void 0:N.call(s,(C=l())!=null?C:v))||void 0;return Xh(g.getItem.bind(g))(s.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==s.version){if(s.migrate){const B=s.migrate(T.state,T.version);return B instanceof Promise?B.then(A=>[!0,A]):[!0,B]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,T.state];return[!1,void 0]}).then(T=>{var B;if(_!==f)return;const[A,L]=T;if(w=s.merge(L,(B=l())!=null?B:v),i(w,!0),A)return p()}).then(()=>{_===f&&(k?.(w,void 0),w=l(),u=!0,d.forEach(T=>T(w)))}).catch(T=>{_===f&&k?.(void 0,T)})};return o.persist={setOptions:C=>{s={...s,...C},C.storage&&(g=C.storage)},clearStorage:()=>{g?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>u,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},s.skipHydration||E(),w||v},nv=B_,Op=Io()(nv(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://makecc-proxy.vercel.app",setApiMode:t=>e({apiMode:t}),setApiKey:t=>e({apiKey:t}),setProxyUrl:t=>e({proxyUrl:t})}),{name:"makecc-settings"}));function iv({isOpen:e,onClose:t}){const{apiMode:i,apiKey:l,proxyUrl:o,setApiMode:s,setApiKey:u,setProxyUrl:f}=Op(),[h,d]=R.useState(i),[g,p]=R.useState(l),[b,v]=R.useState(o),[w,E]=R.useState(!1);if(R.useEffect(()=>{e&&(d(i),p(l),v(o))},[e,i,l,o]),!e)return null;const C=async()=>{if(s(h),u(g),f(b),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(N){console.error("Failed to save API key:",N)}t()};return x.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:x.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[x.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[x.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),x.jsx("button",{onClick:t,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:x.jsx(vc,{className:"w-5 h-5 text-gray-400"})})]}),x.jsxs("div",{className:"p-6 space-y-6",children:[x.jsxs("div",{className:"space-y-3",children:[x.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("label",{className:`
12
+ flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
13
+ ${h==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
14
+ `,children:[x.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:h==="proxy",onChange:()=>d("proxy"),className:"sr-only"}),x.jsx(m_,{className:`w-5 h-5 ${h==="proxy"?"text-accent":"text-gray-400"}`}),x.jsxs("div",{className:"flex-1",children:[x.jsx("div",{className:`font-medium ${h==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),x.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),h==="proxy"&&x.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),x.jsxs("label",{className:`
15
+ flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
16
+ ${h==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
17
+ `,children:[x.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),x.jsx(ZC,{className:`w-5 h-5 ${h==="direct"?"text-accent":"text-gray-400"}`}),x.jsxs("div",{className:"flex-1",children:[x.jsx("div",{className:`font-medium ${h==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),x.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),h==="direct"&&x.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),h==="proxy"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),x.jsx("input",{type:"text",value:b,onChange:N=>v(N.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"}),x.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),h==="direct"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),x.jsxs("div",{className:"relative",children:[x.jsx("input",{type:w?"text":"password",value:g,onChange:N=>p(N.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"}),x.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?x.jsx(RC,{className:"w-4 h-4"}):x.jsx(ev,{className:"w-4 h-4"})})]}),x.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),x.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[x.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),x.jsx("button",{onClick:C,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function H_(){const e=_p(),{projects:t,galleryItems:i,isLoading:l,fetchProjects:o,createProject:s,setCurrentProject:u}=j_(),[f,h]=R.useState(!1),[d,g]=R.useState(!1),[p,b]=R.useState("");R.useEffect(()=>{o()},[o]);const v=C=>{u(C),e(`/project/${encodeURIComponent(C.name)}`)},w=async(C,N)=>{const _=await s(C,N);_&&v(_)},E=i.filter(C=>C.name.toLowerCase().includes(p.toLowerCase())||C.description.toLowerCase().includes(p.toLowerCase()));return x.jsxs("div",{className:"min-h-screen bg-canvas",children:[x.jsxs("header",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-surface",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-amber-500 to-orange-600 flex items-center justify-center",children:x.jsx("span",{className:"text-white font-bold text-sm",children:"M"})}),x.jsx("span",{className:"text-lg font-semibold text-white",children:"makecc"}),x.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-700 text-gray-300 rounded-full",children:"beta"})]}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsx("button",{onClick:()=>g(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"Settings",children:x.jsx(Dp,{className:"w-5 h-5 text-gray-400"})})})]}),x.jsxs("main",{className:"max-w-6xl mx-auto px-6 py-12",children:[x.jsx("div",{className:"text-center mb-12",children:x.jsxs("h1",{className:"text-4xl md:text-5xl font-bold text-white mb-4",children:["Build, edit and share AI skills",x.jsx("br",{}),x.jsx("span",{className:"text-gray-400",children:"using natural language"})]})}),x.jsxs("section",{className:"mb-16",children:[x.jsxs("div",{className:"flex items-center justify-between mb-6",children:[x.jsx("h2",{className:"text-xl font-semibold text-white",children:"Your projects"}),x.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-2 px-4 py-2 border border-border hover:bg-surface-hover rounded-lg transition-colors",children:[x.jsx(Sx,{className:"w-4 h-4 text-gray-400"}),x.jsx("span",{className:"text-sm font-medium text-white",children:"Create New"})]})]}),l?x.jsx("div",{className:"flex items-center justify-center py-16",children:x.jsx("div",{className:"w-8 h-8 border-2 border-accent border-t-transparent rounded-full animate-spin"})}):t.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[x.jsx("div",{className:"w-16 h-16 mb-4 rounded-2xl bg-gray-800 flex items-center justify-center",children:x.jsx(Sx,{className:"w-8 h-8 text-gray-600"})}),x.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No projects yet"}),x.jsx("p",{className:"text-gray-400 mb-4",children:"Create your first project to get started"}),x.jsx("button",{onClick:()=>h(!0),className:"px-6 py-2 bg-accent hover:bg-accent-hover rounded-lg font-medium text-white transition-colors",children:"Create Project"})]}):x.jsx("div",{className:"flex flex-wrap gap-6",children:t.map(C=>x.jsx(R_,{project:C,onClick:()=>v(C)},C.id))})]}),x.jsxs("section",{children:[x.jsxs("div",{className:"flex items-center justify-between mb-6",children:[x.jsx("h2",{className:"text-xl font-semibold text-white",children:"Gallery"}),x.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-surface border border-border rounded-lg",children:[x.jsx(f_,{className:"w-4 h-4 text-gray-500"}),x.jsx("input",{type:"text",value:p,onChange:C=>b(C.target.value),placeholder:"Search",className:"bg-transparent border-none outline-none text-sm text-white placeholder-gray-500 w-40"})]})]}),E.length===0?x.jsx("div",{className:"text-center py-12 text-gray-500",children:p?"No templates found":"Gallery templates coming soon"}):x.jsx("div",{className:"flex flex-wrap gap-4",children:E.map(C=>x.jsx(D_,{item:C,onClick:()=>{console.log("Clone gallery item:",C.id)}},C.id))})]})]}),x.jsx(O_,{isOpen:f,onClose:()=>h(!1),onCreate:w}),x.jsx(iv,{isOpen:d,onClose:()=>g(!1)})]})}function St(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let i=0,l;i<e.length;i++)(l=St(e[i]))!==""&&(t+=(t&&" ")+l);else for(let i in e)e[i]&&(t+=(t&&" ")+i);return t}var U_={value:()=>{}};function wc(){for(var e=0,t=arguments.length,i={},l;e<t;++e){if(!(l=arguments[e]+"")||l in i||/[\s.]/.test(l))throw new Error("illegal type: "+l);i[l]=[]}return new Hu(i)}function Hu(e){this._=e}function I_(e,t){return e.trim().split(/^|\s+/).map(function(i){var l="",o=i.indexOf(".");if(o>=0&&(l=i.slice(o+1),i=i.slice(0,o)),i&&!t.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:l}})}Hu.prototype=wc.prototype={constructor:Hu,on:function(e,t){var i=this._,l=I_(e+"",i),o,s=-1,u=l.length;if(arguments.length<2){for(;++s<u;)if((o=(e=l[s]).type)&&(o=q_(i[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<u;)if(o=(e=l[s]).type)i[o]=Cx(i[o],e.name,t);else if(t==null)for(o in i)i[o]=Cx(i[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new Hu(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var i=new Array(o),l=0,o,s;l<o;++l)i[l]=arguments[l+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],l=0,o=s.length;l<o;++l)s[l].value.apply(t,i)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var l=this._[e],o=0,s=l.length;o<s;++o)l[o].value.apply(t,i)}};function q_(e,t){for(var i=0,l=e.length,o;i<l;++i)if((o=e[i]).name===t)return o.value}function Cx(e,t,i){for(var l=0,o=e.length;l<o;++l)if(e[l].name===t){e[l]=U_,e=e.slice(0,l).concat(e.slice(l+1));break}return i!=null&&e.push({name:t,value:i}),e}var Gh="http://www.w3.org/1999/xhtml";const _x={svg:"http://www.w3.org/2000/svg",xhtml:Gh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Sc(e){var t=e+="",i=t.indexOf(":");return i>=0&&(t=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),_x.hasOwnProperty(t)?{space:_x[t],local:e}:e}function V_(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===Gh&&t.documentElement.namespaceURI===Gh?t.createElement(e):t.createElementNS(i,e)}}function $_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function rv(e){var t=Sc(e);return(t.local?$_:V_)(t)}function P_(){}function Lp(e){return e==null?P_:function(){return this.querySelector(e)}}function Y_(e){typeof e!="function"&&(e=Lp(e));for(var t=this._groups,i=t.length,l=new Array(i),o=0;o<i;++o)for(var s=t[o],u=s.length,f=l[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 pn(l,this._parents)}function F_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function X_(){return[]}function lv(e){return e==null?X_:function(){return this.querySelectorAll(e)}}function G_(e){return function(){return F_(e.apply(this,arguments))}}function Z_(e){typeof e=="function"?e=G_(e):e=lv(e);for(var t=this._groups,i=t.length,l=[],o=[],s=0;s<i;++s)for(var u=t[s],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(l.push(e.call(h,h.__data__,d,u)),o.push(h));return new pn(l,o)}function av(e){return function(){return this.matches(e)}}function ov(e){return function(t){return t.matches(e)}}var Q_=Array.prototype.find;function K_(e){return function(){return Q_.call(this.children,e)}}function J_(){return this.firstElementChild}function W_(e){return this.select(e==null?J_:K_(typeof e=="function"?e:ov(e)))}var e4=Array.prototype.filter;function t4(){return Array.from(this.children)}function n4(e){return function(){return e4.call(this.children,e)}}function i4(e){return this.selectAll(e==null?t4:n4(typeof e=="function"?e:ov(e)))}function r4(e){typeof e!="function"&&(e=av(e));for(var t=this._groups,i=t.length,l=new Array(i),o=0;o<i;++o)for(var s=t[o],u=s.length,f=l[o]=[],h,d=0;d<u;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new pn(l,this._parents)}function sv(e){return new Array(e.length)}function l4(){return new pn(this._enter||this._groups.map(sv),this._parents)}function Ju(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ju.prototype={constructor:Ju,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function a4(e){return function(){return e}}function o4(e,t,i,l,o,s){for(var u=0,f,h=t.length,d=s.length;u<d;++u)(f=t[u])?(f.__data__=s[u],l[u]=f):i[u]=new Ju(e,s[u]);for(;u<h;++u)(f=t[u])&&(o[u]=f)}function s4(e,t,i,l,o,s,u){var f,h,d=new Map,g=t.length,p=s.length,b=new Array(g),v;for(f=0;f<g;++f)(h=t[f])&&(b[f]=v=u.call(h,h.__data__,f,t)+"",d.has(v)?o[f]=h:d.set(v,h));for(f=0;f<p;++f)v=u.call(e,s[f],f,s)+"",(h=d.get(v))?(l[f]=h,h.__data__=s[f],d.delete(v)):i[f]=new Ju(e,s[f]);for(f=0;f<g;++f)(h=t[f])&&d.get(b[f])===h&&(o[f]=h)}function u4(e){return e.__data__}function c4(e,t){if(!arguments.length)return Array.from(this,u4);var i=t?s4:o4,l=this._parents,o=this._groups;typeof e!="function"&&(e=a4(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=l[d],p=o[d],b=p.length,v=f4(e.call(g,g&&g.__data__,d,l)),w=v.length,E=f[d]=new Array(w),C=u[d]=new Array(w),N=h[d]=new Array(b);i(g,p,E,C,N,v,t);for(var _=0,k=0,T,B;_<w;++_)if(T=E[_]){for(_>=k&&(k=_+1);!(B=C[k])&&++k<w;);T._next=B||null}}return u=new pn(u,l),u._enter=f,u._exit=h,u}function f4(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function d4(){return new pn(this._exit||this._groups.map(sv),this._parents)}function h4(e,t,i){var l=this.enter(),o=this,s=this.exit();return typeof e=="function"?(l=e(l),l&&(l=l.selection())):l=l.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),i==null?s.remove():i(s),l&&o?l.merge(o).order():o}function p4(e){for(var t=e.selection?e.selection():e,i=this._groups,l=t._groups,o=i.length,s=l.length,u=Math.min(o,s),f=new Array(o),h=0;h<u;++h)for(var d=i[h],g=l[h],p=d.length,b=f[h]=new Array(p),v,w=0;w<p;++w)(v=d[w]||g[w])&&(b[w]=v);for(;h<o;++h)f[h]=i[h];return new pn(f,this._parents)}function m4(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var l=e[t],o=l.length-1,s=l[o],u;--o>=0;)(u=l[o])&&(s&&u.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(u,s),s=u);return this}function g4(e){e||(e=y4);function t(p,b){return p&&b?e(p.__data__,b.__data__):!p-!b}for(var i=this._groups,l=i.length,o=new Array(l),s=0;s<l;++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(t)}return new pn(o,this._parents).order()}function y4(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function x4(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function b4(){return Array.from(this)}function v4(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var l=e[t],o=0,s=l.length;o<s;++o){var u=l[o];if(u)return u}return null}function w4(){let e=0;for(const t of this)++e;return e}function S4(){return!this.node()}function k4(e){for(var t=this._groups,i=0,l=t.length;i<l;++i)for(var o=t[i],s=0,u=o.length,f;s<u;++s)(f=o[s])&&e.call(f,f.__data__,s,o);return this}function E4(e){return function(){this.removeAttribute(e)}}function N4(e){return function(){this.removeAttributeNS(e.space,e.local)}}function C4(e,t){return function(){this.setAttribute(e,t)}}function _4(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function T4(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function A4(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function M4(e,t){var i=Sc(e);if(arguments.length<2){var l=this.node();return i.local?l.getAttributeNS(i.space,i.local):l.getAttribute(i)}return this.each((t==null?i.local?N4:E4:typeof t=="function"?i.local?A4:T4:i.local?_4:C4)(i,t))}function uv(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function j4(e){return function(){this.style.removeProperty(e)}}function z4(e,t,i){return function(){this.style.setProperty(e,t,i)}}function R4(e,t,i){return function(){var l=t.apply(this,arguments);l==null?this.style.removeProperty(e):this.style.setProperty(e,l,i)}}function D4(e,t,i){return arguments.length>1?this.each((t==null?j4:typeof t=="function"?R4:z4)(e,t,i??"")):Vl(this.node(),e)}function Vl(e,t){return e.style.getPropertyValue(t)||uv(e).getComputedStyle(e,null).getPropertyValue(t)}function O4(e){return function(){delete this[e]}}function L4(e,t){return function(){this[e]=t}}function B4(e,t){return function(){var i=t.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function H4(e,t){return arguments.length>1?this.each((t==null?O4:typeof t=="function"?B4:L4)(e,t)):this.node()[e]}function cv(e){return e.trim().split(/^|\s+/)}function Bp(e){return e.classList||new fv(e)}function fv(e){this._node=e,this._names=cv(e.getAttribute("class")||"")}fv.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function dv(e,t){for(var i=Bp(e),l=-1,o=t.length;++l<o;)i.add(t[l])}function hv(e,t){for(var i=Bp(e),l=-1,o=t.length;++l<o;)i.remove(t[l])}function U4(e){return function(){dv(this,e)}}function I4(e){return function(){hv(this,e)}}function q4(e,t){return function(){(t.apply(this,arguments)?dv:hv)(this,e)}}function V4(e,t){var i=cv(e+"");if(arguments.length<2){for(var l=Bp(this.node()),o=-1,s=i.length;++o<s;)if(!l.contains(i[o]))return!1;return!0}return this.each((typeof t=="function"?q4:t?U4:I4)(i,t))}function $4(){this.textContent=""}function P4(e){return function(){this.textContent=e}}function Y4(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function F4(e){return arguments.length?this.each(e==null?$4:(typeof e=="function"?Y4:P4)(e)):this.node().textContent}function X4(){this.innerHTML=""}function G4(e){return function(){this.innerHTML=e}}function Z4(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Q4(e){return arguments.length?this.each(e==null?X4:(typeof e=="function"?Z4:G4)(e)):this.node().innerHTML}function K4(){this.nextSibling&&this.parentNode.appendChild(this)}function J4(){return this.each(K4)}function W4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function eT(){return this.each(W4)}function tT(e){var t=typeof e=="function"?e:rv(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function nT(){return null}function iT(e,t){var i=typeof e=="function"?e:rv(e),l=t==null?nT:typeof t=="function"?t:Lp(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),l.apply(this,arguments)||null)})}function rT(){var e=this.parentNode;e&&e.removeChild(this)}function lT(){return this.each(rT)}function aT(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oT(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function sT(e){return this.select(e?oT:aT)}function uT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function cT(e){return function(t){e.call(this,t,this.__data__)}}function fT(e){return e.trim().split(/^|\s+/).map(function(t){var i="",l=t.indexOf(".");return l>=0&&(i=t.slice(l+1),t=t.slice(0,l)),{type:t,name:i}})}function dT(e){return function(){var t=this.__on;if(t){for(var i=0,l=-1,o=t.length,s;i<o;++i)s=t[i],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++l]=s;++l?t.length=l:delete this.__on}}}function hT(e,t,i){return function(){var l=this.__on,o,s=cT(t);if(l){for(var u=0,f=l.length;u<f;++u)if((o=l[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=t;return}}this.addEventListener(e.type,s,i),o={type:e.type,name:e.name,value:t,listener:s,options:i},l?l.push(o):this.__on=[o]}}function pT(e,t,i){var l=fT(e+""),o,s=l.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=l[o]).type===g.type&&u.name===g.name)return g.value}return}for(f=t?hT:dT,o=0;o<s;++o)this.each(f(l[o],t,i));return this}function pv(e,t,i){var l=uv(e),o=l.CustomEvent;typeof o=="function"?o=new o(t,i):(o=l.document.createEvent("Event"),i?(o.initEvent(t,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function mT(e,t){return function(){return pv(this,e,t)}}function gT(e,t){return function(){return pv(this,e,t.apply(this,arguments))}}function yT(e,t){return this.each((typeof t=="function"?gT:mT)(e,t))}function*xT(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var l=e[t],o=0,s=l.length,u;o<s;++o)(u=l[o])&&(yield u)}var mv=[null];function pn(e,t){this._groups=e,this._parents=t}function qo(){return new pn([[document.documentElement]],mv)}function bT(){return this}pn.prototype=qo.prototype={constructor:pn,select:Y_,selectAll:Z_,selectChild:W_,selectChildren:i4,filter:r4,data:c4,enter:l4,exit:d4,join:h4,merge:p4,selection:bT,order:m4,sort:g4,call:x4,nodes:b4,node:v4,size:w4,empty:S4,each:k4,attr:M4,style:D4,property:H4,classed:V4,text:F4,html:Q4,raise:J4,lower:eT,append:tT,insert:iT,remove:lT,clone:sT,datum:uT,on:pT,dispatch:yT,[Symbol.iterator]:xT};function dn(e){return typeof e=="string"?new pn([[document.querySelector(e)]],[document.documentElement]):new pn([[e]],mv)}function vT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zn(e,t){if(e=vT(e),t===void 0&&(t=e.currentTarget),t){var i=t.ownerSVGElement||t;if(i.createSVGPoint){var l=i.createSVGPoint();return l.x=e.clientX,l.y=e.clientY,l=l.matrixTransform(t.getScreenCTM().inverse()),[l.x,l.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const wT={passive:!1},So={capture:!0,passive:!1};function uh(e){e.stopImmediatePropagation()}function Ul(e){e.preventDefault(),e.stopImmediatePropagation()}function gv(e){var t=e.document.documentElement,i=dn(e).on("dragstart.drag",Ul,So);"onselectstart"in t?i.on("selectstart.drag",Ul,So):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yv(e,t){var i=e.document.documentElement,l=dn(e).on("dragstart.drag",null);t&&(l.on("click.drag",Ul,So),setTimeout(function(){l.on("click.drag",null)},0)),"onselectstart"in i?l.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const wu=e=>()=>e;function Zh(e,{sourceEvent:t,subject:i,target:l,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:t,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:l,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}})}Zh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ST(e){return!e.ctrlKey&&!e.button}function kT(){return this.parentNode}function ET(e,t){return t??{x:e.x,y:e.y}}function NT(){return navigator.maxTouchPoints||"ontouchstart"in this}function xv(){var e=ST,t=kT,i=ET,l=NT,o={},s=wc("start","drag","end"),u=0,f,h,d,g,p=0;function b(T){T.on("mousedown.drag",v).filter(l).on("touchstart.drag",C).on("touchmove.drag",N,wT).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(T,B){if(!(g||!e.call(this,T,B))){var A=k(this,t.call(this,T,B),T,B,"mouse");A&&(dn(T.view).on("mousemove.drag",w,So).on("mouseup.drag",E,So),gv(T.view),uh(T),d=!1,f=T.clientX,h=T.clientY,A("start",T))}}function w(T){if(Ul(T),!d){var B=T.clientX-f,A=T.clientY-h;d=B*B+A*A>p}o.mouse("drag",T)}function E(T){dn(T.view).on("mousemove.drag mouseup.drag",null),yv(T.view,d),Ul(T),o.mouse("end",T)}function C(T,B){if(e.call(this,T,B)){var A=T.changedTouches,L=t.call(this,T,B),X=A.length,Z,U;for(Z=0;Z<X;++Z)(U=k(this,L,T,B,A[Z].identifier,A[Z]))&&(uh(T),U("start",T,A[Z]))}}function N(T){var B=T.changedTouches,A=B.length,L,X;for(L=0;L<A;++L)(X=o[B[L].identifier])&&(Ul(T),X("drag",T,B[L]))}function _(T){var B=T.changedTouches,A=B.length,L,X;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),L=0;L<A;++L)(X=o[B[L].identifier])&&(uh(T),X("end",T,B[L]))}function k(T,B,A,L,X,Z){var U=s.copy(),I=zn(Z||A,B),P,ee,H;if((H=i.call(T,new Zh("beforestart",{sourceEvent:A,target:b,identifier:X,active:u,x:I[0],y:I[1],dx:0,dy:0,dispatch:U}),L))!=null)return P=H.x-I[0]||0,ee=H.y-I[1]||0,function q(D,V,F){var K=I,z;switch(D){case"start":o[X]=q,z=u++;break;case"end":delete o[X],--u;case"drag":I=zn(F||V,B),z=u;break}U.call(D,T,new Zh(D,{sourceEvent:V,subject:H,target:b,identifier:X,active:z,x:I[0]+P,y:I[1]+ee,dx:I[0]-K[0],dy:I[1]-K[1],dispatch:U}),L)}}return b.filter=function(T){return arguments.length?(e=typeof T=="function"?T:wu(!!T),b):e},b.container=function(T){return arguments.length?(t=typeof T=="function"?T:wu(T),b):t},b.subject=function(T){return arguments.length?(i=typeof T=="function"?T:wu(T),b):i},b.touchable=function(T){return arguments.length?(l=typeof T=="function"?T:wu(!!T),b):l},b.on=function(){var T=s.on.apply(s,arguments);return T===s?b:T},b.clickDistance=function(T){return arguments.length?(p=(T=+T)*T,b):Math.sqrt(p)},b}function Hp(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function bv(e,t){var i=Object.create(e.prototype);for(var l in t)i[l]=t[l];return i}function Vo(){}var ko=.7,Wu=1/ko,Il="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",CT=/^#([0-9a-f]{3,8})$/,_T=new RegExp(`^rgb\\(${Il},${Il},${Il}\\)$`),TT=new RegExp(`^rgb\\(${Xn},${Xn},${Xn}\\)$`),AT=new RegExp(`^rgba\\(${Il},${Il},${Il},${Eo}\\)$`),MT=new RegExp(`^rgba\\(${Xn},${Xn},${Xn},${Eo}\\)$`),jT=new RegExp(`^hsl\\(${Eo},${Xn},${Xn}\\)$`),zT=new RegExp(`^hsla\\(${Eo},${Xn},${Xn},${Eo}\\)$`),Tx={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};Hp(Vo,Ir,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ax,formatHex:Ax,formatHex8:RT,formatHsl:DT,formatRgb:Mx,toString:Mx});function Ax(){return this.rgb().formatHex()}function RT(){return this.rgb().formatHex8()}function DT(){return vv(this).formatHsl()}function Mx(){return this.rgb().formatRgb()}function Ir(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=CT.exec(e))?(i=t[1].length,t=parseInt(t[1],16),i===6?jx(t):i===3?new Wt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):i===8?Su(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):i===4?Su(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_T.exec(e))?new Wt(t[1],t[2],t[3],1):(t=TT.exec(e))?new Wt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=AT.exec(e))?Su(t[1],t[2],t[3],t[4]):(t=MT.exec(e))?Su(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jT.exec(e))?Dx(t[1],t[2]/100,t[3]/100,1):(t=zT.exec(e))?Dx(t[1],t[2]/100,t[3]/100,t[4]):Tx.hasOwnProperty(e)?jx(Tx[e]):e==="transparent"?new Wt(NaN,NaN,NaN,0):null}function jx(e){return new Wt(e>>16&255,e>>8&255,e&255,1)}function Su(e,t,i,l){return l<=0&&(e=t=i=NaN),new Wt(e,t,i,l)}function OT(e){return e instanceof Vo||(e=Ir(e)),e?(e=e.rgb(),new Wt(e.r,e.g,e.b,e.opacity)):new Wt}function Qh(e,t,i,l){return arguments.length===1?OT(e):new Wt(e,t,i,l??1)}function Wt(e,t,i,l){this.r=+e,this.g=+t,this.b=+i,this.opacity=+l}Hp(Wt,Qh,bv(Vo,{brighter(e){return e=e==null?Wu:Math.pow(Wu,e),new Wt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new Wt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wt(Hr(this.r),Hr(this.g),Hr(this.b),ec(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:zx,formatHex:zx,formatHex8:LT,formatRgb:Rx,toString:Rx}));function zx(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}`}function LT(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}${Br((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rx(){const e=ec(this.opacity);return`${e===1?"rgb(":"rgba("}${Hr(this.r)}, ${Hr(this.g)}, ${Hr(this.b)}${e===1?")":`, ${e})`}`}function ec(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Br(e){return e=Hr(e),(e<16?"0":"")+e.toString(16)}function Dx(e,t,i,l){return l<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new Dn(e,t,i,l)}function vv(e){if(e instanceof Dn)return new Dn(e.h,e.s,e.l,e.opacity);if(e instanceof Vo||(e=Ir(e)),!e)return new Dn;if(e instanceof Dn)return e;e=e.rgb();var t=e.r/255,i=e.g/255,l=e.b/255,o=Math.min(t,i,l),s=Math.max(t,i,l),u=NaN,f=s-o,h=(s+o)/2;return f?(t===s?u=(i-l)/f+(i<l)*6:i===s?u=(l-t)/f+2:u=(t-i)/f+4,f/=h<.5?s+o:2-s-o,u*=60):f=h>0&&h<1?0:u,new Dn(u,f,h,e.opacity)}function BT(e,t,i,l){return arguments.length===1?vv(e):new Dn(e,t,i,l??1)}function Dn(e,t,i,l){this.h=+e,this.s=+t,this.l=+i,this.opacity=+l}Hp(Dn,BT,bv(Vo,{brighter(e){return e=e==null?Wu:Math.pow(Wu,e),new Dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new Dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,l=i+(i<.5?i:1-i)*t,o=2*i-l;return new Wt(ch(e>=240?e-240:e+120,o,l),ch(e,o,l),ch(e<120?e+240:e-120,o,l),this.opacity)},clamp(){return new Dn(Ox(this.h),ku(this.s),ku(this.l),ec(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=ec(this.opacity);return`${e===1?"hsl(":"hsla("}${Ox(this.h)}, ${ku(this.s)*100}%, ${ku(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ox(e){return e=(e||0)%360,e<0?e+360:e}function ku(e){return Math.max(0,Math.min(1,e||0))}function ch(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}const Up=e=>()=>e;function HT(e,t){return function(i){return e+i*t}}function UT(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(l){return Math.pow(e+l*t,i)}}function IT(e){return(e=+e)==1?wv:function(t,i){return i-t?UT(t,i,e):Up(isNaN(t)?i:t)}}function wv(e,t){var i=t-e;return i?HT(e,i):Up(isNaN(e)?t:e)}const tc=(function e(t){var i=IT(t);function l(o,s){var u=i((o=Qh(o)).r,(s=Qh(s)).r),f=i(o.g,s.g),h=i(o.b,s.b),d=wv(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 l.gamma=e,l})(1);function qT(e,t){t||(t=[]);var i=e?Math.min(t.length,e.length):0,l=t.slice(),o;return function(s){for(o=0;o<i;++o)l[o]=e[o]*(1-s)+t[o]*s;return l}}function VT(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $T(e,t){var i=t?t.length:0,l=e?Math.min(i,e.length):0,o=new Array(l),s=new Array(i),u;for(u=0;u<l;++u)o[u]=ho(e[u],t[u]);for(;u<i;++u)s[u]=t[u];return function(f){for(u=0;u<l;++u)s[u]=o[u](f);return s}}function PT(e,t){var i=new Date;return e=+e,t=+t,function(l){return i.setTime(e*(1-l)+t*l),i}}function Fn(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}function YT(e,t){var i={},l={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?i[o]=ho(e[o],t[o]):l[o]=t[o];return function(s){for(o in i)l[o]=i[o](s);return l}}var Kh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fh=new RegExp(Kh.source,"g");function FT(e){return function(){return e}}function XT(e){return function(t){return e(t)+""}}function Sv(e,t){var i=Kh.lastIndex=fh.lastIndex=0,l,o,s,u=-1,f=[],h=[];for(e=e+"",t=t+"";(l=Kh.exec(e))&&(o=fh.exec(t));)(s=o.index)>i&&(s=t.slice(i,s),f[u]?f[u]+=s:f[++u]=s),(l=l[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:Fn(l,o)})),i=fh.lastIndex;return i<t.length&&(s=t.slice(i),f[u]?f[u]+=s:f[++u]=s),f.length<2?h[0]?XT(h[0].x):FT(t):(t=h.length,function(d){for(var g=0,p;g<t;++g)f[(p=h[g]).i]=p.x(d);return f.join("")})}function ho(e,t){var i=typeof t,l;return t==null||i==="boolean"?Up(t):(i==="number"?Fn:i==="string"?(l=Ir(t))?(t=l,tc):Sv:t instanceof Ir?tc:t instanceof Date?PT:VT(t)?qT:Array.isArray(t)?$T:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?YT:Fn)(e,t)}var Lx=180/Math.PI,Jh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kv(e,t,i,l,o,s){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*i+t*l)&&(i-=e*h,l-=t*h),(f=Math.sqrt(i*i+l*l))&&(i/=f,l/=f,h/=f),e*l<t*i&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Lx,skewX:Math.atan(h)*Lx,scaleX:u,scaleY:f}}var Eu;function GT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Jh:kv(t.a,t.b,t.c,t.d,t.e,t.f)}function ZT(e){return e==null||(Eu||(Eu=document.createElementNS("http://www.w3.org/2000/svg","g")),Eu.setAttribute("transform",e),!(e=Eu.transform.baseVal.consolidate()))?Jh:(e=e.matrix,kv(e.a,e.b,e.c,e.d,e.e,e.f))}function Ev(e,t,i,l){function o(d){return d.length?d.pop()+" ":""}function s(d,g,p,b,v,w){if(d!==p||g!==b){var E=v.push("translate(",null,t,null,i);w.push({i:E-4,x:Fn(d,p)},{i:E-2,x:Fn(g,b)})}else(p||b)&&v.push("translate("+p+t+b+i)}function u(d,g,p,b){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),b.push({i:p.push(o(p)+"rotate(",null,l)-2,x:Fn(d,g)})):g&&p.push(o(p)+"rotate("+g+l)}function f(d,g,p,b){d!==g?b.push({i:p.push(o(p)+"skewX(",null,l)-2,x:Fn(d,g)}):g&&p.push(o(p)+"skewX("+g+l)}function h(d,g,p,b,v,w){if(d!==p||g!==b){var E=v.push(o(v)+"scale(",null,",",null,")");w.push({i:E-4,x:Fn(d,p)},{i:E-2,x:Fn(g,b)})}else(p!==1||b!==1)&&v.push(o(v)+"scale("+p+","+b+")")}return function(d,g){var p=[],b=[];return d=e(d),g=e(g),s(d.translateX,d.translateY,g.translateX,g.translateY,p,b),u(d.rotate,g.rotate,p,b),f(d.skewX,g.skewX,p,b),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,p,b),d=g=null,function(v){for(var w=-1,E=b.length,C;++w<E;)p[(C=b[w]).i]=C.x(v);return p.join("")}}}var QT=Ev(GT,"px, ","px)","deg)"),KT=Ev(ZT,", ",")",")"),JT=1e-12;function Bx(e){return((e=Math.exp(e))+1/e)/2}function WT(e){return((e=Math.exp(e))-1/e)/2}function e3(e){return((e=Math.exp(2*e))-1)/(e+1)}const Uu=(function e(t,i,l){function o(s,u){var f=s[0],h=s[1],d=s[2],g=u[0],p=u[1],b=u[2],v=g-f,w=p-h,E=v*v+w*w,C,N;if(E<JT)N=Math.log(b/d)/t,C=function(L){return[f+L*v,h+L*w,d*Math.exp(t*L*N)]};else{var _=Math.sqrt(E),k=(b*b-d*d+l*E)/(2*d*i*_),T=(b*b-d*d-l*E)/(2*b*i*_),B=Math.log(Math.sqrt(k*k+1)-k),A=Math.log(Math.sqrt(T*T+1)-T);N=(A-B)/t,C=function(L){var X=L*N,Z=Bx(B),U=d/(i*_)*(Z*e3(t*X+B)-WT(B));return[f+U*v,h+U*w,d*Z/Bx(t*X+B)]}}return C.duration=N*1e3*t/Math.SQRT2,C}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 $l=0,uo=0,to=0,Nv=1e3,nc,co,ic=0,qr=0,kc=0,No=typeof performance=="object"&&performance.now?performance:Date,Cv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ip(){return qr||(Cv(t3),qr=No.now()+kc)}function t3(){qr=0}function rc(){this._call=this._time=this._next=null}rc.prototype=_v.prototype={constructor:rc,restart:function(e,t,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Ip():+i)+(t==null?0:+t),!this._next&&co!==this&&(co?co._next=this:nc=this,co=this),this._call=e,this._time=i,Wh()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wh())}};function _v(e,t,i){var l=new rc;return l.restart(e,t,i),l}function n3(){Ip(),++$l;for(var e=nc,t;e;)(t=qr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--$l}function Hx(){qr=(ic=No.now())+kc,$l=uo=0;try{n3()}finally{$l=0,r3(),qr=0}}function i3(){var e=No.now(),t=e-ic;t>Nv&&(kc-=t,ic=e)}function r3(){for(var e,t=nc,i,l=1/0;t;)t._call?(l>t._time&&(l=t._time),e=t,t=t._next):(i=t._next,t._next=null,t=e?e._next=i:nc=i);co=e,Wh(l)}function Wh(e){if(!$l){uo&&(uo=clearTimeout(uo));var t=e-qr;t>24?(e<1/0&&(uo=setTimeout(Hx,e-No.now()-kc)),to&&(to=clearInterval(to))):(to||(ic=No.now(),to=setInterval(i3,Nv)),$l=1,Cv(Hx))}}function Ux(e,t,i){var l=new rc;return t=t==null?0:+t,l.restart(o=>{l.stop(),e(o+t)},t,i),l}var l3=wc("start","end","cancel","interrupt"),a3=[],Tv=0,Ix=1,ep=2,Iu=3,qx=4,tp=5,qu=6;function Ec(e,t,i,l,o,s){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;o3(e,i,{name:t,index:l,group:o,on:l3,tween:a3,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Tv})}function qp(e,t){var i=Hn(e,t);if(i.state>Tv)throw new Error("too late; already scheduled");return i}function Wn(e,t){var i=Hn(e,t);if(i.state>Iu)throw new Error("too late; already running");return i}function Hn(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function o3(e,t,i){var l=e.__transition,o;l[t]=i,i.timer=_v(s,0,i.time);function s(d){i.state=Ix,i.timer.restart(u,i.delay,i.time),i.delay<=d&&u(d-i.delay)}function u(d){var g,p,b,v;if(i.state!==Ix)return h();for(g in l)if(v=l[g],v.name===i.name){if(v.state===Iu)return Ux(u);v.state===qx?(v.state=qu,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete l[g]):+g<t&&(v.state=qu,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete l[g])}if(Ux(function(){i.state===Iu&&(i.state=qx,i.timer.restart(f,i.delay,i.time),f(d))}),i.state=ep,i.on.call("start",e,e.__data__,i.index,i.group),i.state===ep){for(i.state=Iu,o=new Array(b=i.tween.length),g=0,p=-1;g<b;++g)(v=i.tween[g].value.call(e,e.__data__,i.index,i.group))&&(o[++p]=v);o.length=p+1}}function f(d){for(var g=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=tp,1),p=-1,b=o.length;++p<b;)o[p].call(e,g);i.state===tp&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=qu,i.timer.stop(),delete l[t];for(var d in l)return;delete e.__transition}}function Vu(e,t){var i=e.__transition,l,o,s=!0,u;if(i){t=t==null?null:t+"";for(u in i){if((l=i[u]).name!==t){s=!1;continue}o=l.state>ep&&l.state<tp,l.state=qu,l.timer.stop(),l.on.call(o?"interrupt":"cancel",e,e.__data__,l.index,l.group),delete i[u]}s&&delete e.__transition}}function s3(e){return this.each(function(){Vu(this,e)})}function u3(e,t){var i,l;return function(){var o=Wn(this,e),s=o.tween;if(s!==i){l=i=s;for(var u=0,f=l.length;u<f;++u)if(l[u].name===t){l=l.slice(),l.splice(u,1);break}}o.tween=l}}function c3(e,t,i){var l,o;if(typeof i!="function")throw new Error;return function(){var s=Wn(this,e),u=s.tween;if(u!==l){o=(l=u).slice();for(var f={name:t,value:i},h=0,d=o.length;h<d;++h)if(o[h].name===t){o[h]=f;break}h===d&&o.push(f)}s.tween=o}}function f3(e,t){var i=this._id;if(e+="",arguments.length<2){for(var l=Hn(this.node(),i).tween,o=0,s=l.length,u;o<s;++o)if((u=l[o]).name===e)return u.value;return null}return this.each((t==null?u3:c3)(i,e,t))}function Vp(e,t,i){var l=e._id;return e.each(function(){var o=Wn(this,l);(o.value||(o.value={}))[t]=i.apply(this,arguments)}),function(o){return Hn(o,l).value[t]}}function Av(e,t){var i;return(typeof t=="number"?Fn:t instanceof Ir?tc:(i=Ir(t))?(t=i,tc):Sv)(e,t)}function d3(e){return function(){this.removeAttribute(e)}}function h3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function p3(e,t,i){var l,o=i+"",s;return function(){var u=this.getAttribute(e);return u===o?null:u===l?s:s=t(l=u,i)}}function m3(e,t,i){var l,o=i+"",s;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===l?s:s=t(l=u,i)}}function g3(e,t,i){var l,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===l&&h===o?s:(o=h,s=t(l=u,f)))}}function y3(e,t,i){var l,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===l&&h===o?s:(o=h,s=t(l=u,f)))}}function x3(e,t){var i=Sc(e),l=i==="transform"?KT:Av;return this.attrTween(e,typeof t=="function"?(i.local?y3:g3)(i,l,Vp(this,"attr."+e,t)):t==null?(i.local?h3:d3)(i):(i.local?m3:p3)(i,l,t))}function b3(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}function v3(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}function w3(e,t){var i,l;function o(){var s=t.apply(this,arguments);return s!==l&&(i=(l=s)&&v3(e,s)),i}return o._value=t,o}function S3(e,t){var i,l;function o(){var s=t.apply(this,arguments);return s!==l&&(i=(l=s)&&b3(e,s)),i}return o._value=t,o}function k3(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;var l=Sc(e);return this.tween(i,(l.local?w3:S3)(l,t))}function E3(e,t){return function(){qp(this,e).delay=+t.apply(this,arguments)}}function N3(e,t){return t=+t,function(){qp(this,e).delay=t}}function C3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?E3:N3)(t,e)):Hn(this.node(),t).delay}function _3(e,t){return function(){Wn(this,e).duration=+t.apply(this,arguments)}}function T3(e,t){return t=+t,function(){Wn(this,e).duration=t}}function A3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_3:T3)(t,e)):Hn(this.node(),t).duration}function M3(e,t){if(typeof t!="function")throw new Error;return function(){Wn(this,e).ease=t}}function j3(e){var t=this._id;return arguments.length?this.each(M3(t,e)):Hn(this.node(),t).ease}function z3(e,t){return function(){var i=t.apply(this,arguments);if(typeof i!="function")throw new Error;Wn(this,e).ease=i}}function R3(e){if(typeof e!="function")throw new Error;return this.each(z3(this._id,e))}function D3(e){typeof e!="function"&&(e=av(e));for(var t=this._groups,i=t.length,l=new Array(i),o=0;o<i;++o)for(var s=t[o],u=s.length,f=l[o]=[],h,d=0;d<u;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Ai(l,this._parents,this._name,this._id)}function O3(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,l=t.length,o=i.length,s=Math.min(l,o),u=new Array(l),f=0;f<s;++f)for(var h=t[f],d=i[f],g=h.length,p=u[f]=new Array(g),b,v=0;v<g;++v)(b=h[v]||d[v])&&(p[v]=b);for(;f<l;++f)u[f]=t[f];return new Ai(u,this._parents,this._name,this._id)}function L3(e){return(e+"").trim().split(/^|\s+/).every(function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||t==="start"})}function B3(e,t,i){var l,o,s=L3(t)?qp:Wn;return function(){var u=s(this,e),f=u.on;f!==l&&(o=(l=f).copy()).on(t,i),u.on=o}}function H3(e,t){var i=this._id;return arguments.length<2?Hn(this.node(),i).on.on(e):this.each(B3(i,e,t))}function U3(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}function I3(){return this.on("end.remove",U3(this._id))}function q3(e){var t=this._name,i=this._id;typeof e!="function"&&(e=Lp(e));for(var l=this._groups,o=l.length,s=new Array(o),u=0;u<o;++u)for(var f=l[u],h=f.length,d=s[u]=new Array(h),g,p,b=0;b<h;++b)(g=f[b])&&(p=e.call(g,g.__data__,b,f))&&("__data__"in g&&(p.__data__=g.__data__),d[b]=p,Ec(d[b],t,i,b,d,Hn(g,i)));return new Ai(s,this._parents,t,i)}function V3(e){var t=this._name,i=this._id;typeof e!="function"&&(e=lv(e));for(var l=this._groups,o=l.length,s=[],u=[],f=0;f<o;++f)for(var h=l[f],d=h.length,g,p=0;p<d;++p)if(g=h[p]){for(var b=e.call(g,g.__data__,p,h),v,w=Hn(g,i),E=0,C=b.length;E<C;++E)(v=b[E])&&Ec(v,t,i,E,b,w);s.push(b),u.push(g)}return new Ai(s,u,t,i)}var $3=qo.prototype.constructor;function P3(){return new $3(this._groups,this._parents)}function Y3(e,t){var i,l,o;return function(){var s=Vl(this,e),u=(this.style.removeProperty(e),Vl(this,e));return s===u?null:s===i&&u===l?o:o=t(i=s,l=u)}}function Mv(e){return function(){this.style.removeProperty(e)}}function F3(e,t,i){var l,o=i+"",s;return function(){var u=Vl(this,e);return u===o?null:u===l?s:s=t(l=u,i)}}function X3(e,t,i){var l,o,s;return function(){var u=Vl(this,e),f=i(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),Vl(this,e))),u===h?null:u===l&&h===o?s:(o=h,s=t(l=u,f))}}function G3(e,t){var i,l,o,s="style."+t,u="end."+s,f;return function(){var h=Wn(this,e),d=h.on,g=h.value[s]==null?f||(f=Mv(t)):void 0;(d!==i||o!==g)&&(l=(i=d).copy()).on(u,o=g),h.on=l}}function Z3(e,t,i){var l=(e+="")=="transform"?QT:Av;return t==null?this.styleTween(e,Y3(e,l)).on("end.style."+e,Mv(e)):typeof t=="function"?this.styleTween(e,X3(e,l,Vp(this,"style."+e,t))).each(G3(this._id,e)):this.styleTween(e,F3(e,l,t),i).on("end.style."+e,null)}function Q3(e,t,i){return function(l){this.style.setProperty(e,t.call(this,l),i)}}function K3(e,t,i){var l,o;function s(){var u=t.apply(this,arguments);return u!==o&&(l=(o=u)&&Q3(e,u,i)),l}return s._value=t,s}function J3(e,t,i){var l="style."+(e+="");if(arguments.length<2)return(l=this.tween(l))&&l._value;if(t==null)return this.tween(l,null);if(typeof t!="function")throw new Error;return this.tween(l,K3(e,t,i??""))}function W3(e){return function(){this.textContent=e}}function eA(e){return function(){var t=e(this);this.textContent=t??""}}function tA(e){return this.tween("text",typeof e=="function"?eA(Vp(this,"text",e)):W3(e==null?"":e+""))}function nA(e){return function(t){this.textContent=e.call(this,t)}}function iA(e){var t,i;function l(){var o=e.apply(this,arguments);return o!==i&&(t=(i=o)&&nA(o)),t}return l._value=e,l}function rA(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,iA(e))}function lA(){for(var e=this._name,t=this._id,i=jv(),l=this._groups,o=l.length,s=0;s<o;++s)for(var u=l[s],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Hn(h,t);Ec(h,e,i,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Ai(l,this._parents,e,i)}function aA(){var e,t,i=this,l=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=Wn(this,l),g=d.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),o===0&&s()})}var oA=0;function Ai(e,t,i,l){this._groups=e,this._parents=t,this._name=i,this._id=l}function jv(){return++oA}var Ei=qo.prototype;Ai.prototype={constructor:Ai,select:q3,selectAll:V3,selectChild:Ei.selectChild,selectChildren:Ei.selectChildren,filter:D3,merge:O3,selection:P3,transition:lA,call:Ei.call,nodes:Ei.nodes,node:Ei.node,size:Ei.size,empty:Ei.empty,each:Ei.each,on:H3,attr:x3,attrTween:k3,style:Z3,styleTween:J3,text:tA,textTween:rA,remove:I3,tween:f3,delay:C3,duration:A3,ease:j3,easeVarying:R3,end:aA,[Symbol.iterator]:Ei[Symbol.iterator]};function sA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var uA={time:null,delay:0,duration:250,ease:sA};function cA(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}function fA(e){var t,i;e instanceof Ai?(t=e._id,e=e._name):(t=jv(),(i=uA).time=Ip(),e=e==null?null:e+"");for(var l=this._groups,o=l.length,s=0;s<o;++s)for(var u=l[s],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Ec(h,e,t,d,u,i||cA(h,t));return new Ai(l,this._parents,e,t)}qo.prototype.interrupt=s3;qo.prototype.transition=fA;const Nu=e=>()=>e;function dA(e,{sourceEvent:t,target:i,transform:l,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:l,enumerable:!0,configurable:!0},_:{value:o}})}function Ni(e,t,i){this.k=e,this.x=t,this.y=i}Ni.prototype={constructor:Ni,scale:function(e){return e===1?this:new Ni(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ni(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nc=new Ni(1,0,0);zv.prototype=Ni.prototype;function zv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Nc;return e.__zoom}function dh(e){e.stopImmediatePropagation()}function no(e){e.preventDefault(),e.stopImmediatePropagation()}function hA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pA(){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 Vx(){return this.__zoom||Nc}function mA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function gA(){return navigator.maxTouchPoints||"ontouchstart"in this}function yA(e,t,i){var l=e.invertX(t[0][0])-i[0][0],o=e.invertX(t[1][0])-i[1][0],s=e.invertY(t[0][1])-i[0][1],u=e.invertY(t[1][1])-i[1][1];return e.translate(o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o),u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u))}function Rv(){var e=hA,t=pA,i=yA,l=mA,o=gA,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=Uu,d=wc("start","zoom","end"),g,p,b,v=500,w=150,E=0,C=10;function N(H){H.property("__zoom",Vx).on("wheel.zoom",X,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",U).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(H,q,D,V){var F=H.selection?H.selection():H;F.property("__zoom",Vx),H!==F?B(H,q,D,V):F.interrupt().each(function(){A(this,arguments).event(V).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},N.scaleBy=function(H,q,D,V){N.scaleTo(H,function(){var F=this.__zoom.k,K=typeof q=="function"?q.apply(this,arguments):q;return F*K},D,V)},N.scaleTo=function(H,q,D,V){N.transform(H,function(){var F=t.apply(this,arguments),K=this.__zoom,z=D==null?T(F):typeof D=="function"?D.apply(this,arguments):D,O=K.invert(z),Y=typeof q=="function"?q.apply(this,arguments):q;return i(k(_(K,Y),z,O),F,u)},D,V)},N.translateBy=function(H,q,D,V){N.transform(H,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),u)},null,V)},N.translateTo=function(H,q,D,V,F){N.transform(H,function(){var K=t.apply(this,arguments),z=this.__zoom,O=V==null?T(K):typeof V=="function"?V.apply(this,arguments):V;return i(Nc.translate(O[0],O[1]).scale(z.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof D=="function"?-D.apply(this,arguments):-D),K,u)},V,F)};function _(H,q){return q=Math.max(s[0],Math.min(s[1],q)),q===H.k?H:new Ni(q,H.x,H.y)}function k(H,q,D){var V=q[0]-D[0]*H.k,F=q[1]-D[1]*H.k;return V===H.x&&F===H.y?H:new Ni(H.k,V,F)}function T(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function B(H,q,D,V){H.on("start.zoom",function(){A(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(V).end()}).tween("zoom",function(){var F=this,K=arguments,z=A(F,K).event(V),O=t.apply(F,K),Y=D==null?T(O):typeof D=="function"?D.apply(F,K):D,j=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),ne=F.__zoom,ue=typeof q=="function"?q.apply(F,K):q,ce=h(ne.invert(Y).concat(j/ne.k),ue.invert(Y).concat(j/ue.k));return function(de){if(de===1)de=ue;else{var se=ce(de),pe=j/se[2];de=new Ni(pe,Y[0]-se[0]*pe,Y[1]-se[1]*pe)}z.zoom(null,de)}})}function A(H,q,D){return!D&&H.__zooming||new L(H,q)}function L(H,q){this.that=H,this.args=q,this.active=0,this.sourceEvent=null,this.extent=t.apply(H,q),this.taps=0}L.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,q){return this.mouse&&H!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var q=dn(this.that).datum();d.call(H,this.that,new dA(H,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:d}),q)}};function X(H,...q){if(!e.apply(this,arguments))return;var D=A(this,q).event(H),V=this.__zoom,F=Math.max(s[0],Math.min(s[1],V.k*Math.pow(2,l.apply(this,arguments)))),K=zn(H);if(D.wheel)(D.mouse[0][0]!==K[0]||D.mouse[0][1]!==K[1])&&(D.mouse[1]=V.invert(D.mouse[0]=K)),clearTimeout(D.wheel);else{if(V.k===F)return;D.mouse=[K,V.invert(K)],Vu(this),D.start()}no(H),D.wheel=setTimeout(z,w),D.zoom("mouse",i(k(_(V,F),D.mouse[0],D.mouse[1]),D.extent,u));function z(){D.wheel=null,D.end()}}function Z(H,...q){if(b||!e.apply(this,arguments))return;var D=H.currentTarget,V=A(this,q,!0).event(H),F=dn(H.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",j,!0),K=zn(H,D),z=H.clientX,O=H.clientY;gv(H.view),dh(H),V.mouse=[K,this.__zoom.invert(K)],Vu(this),V.start();function Y(ne){if(no(ne),!V.moved){var ue=ne.clientX-z,ce=ne.clientY-O;V.moved=ue*ue+ce*ce>E}V.event(ne).zoom("mouse",i(k(V.that.__zoom,V.mouse[0]=zn(ne,D),V.mouse[1]),V.extent,u))}function j(ne){F.on("mousemove.zoom mouseup.zoom",null),yv(ne.view,V.moved),no(ne),V.event(ne).end()}}function U(H,...q){if(e.apply(this,arguments)){var D=this.__zoom,V=zn(H.changedTouches?H.changedTouches[0]:H,this),F=D.invert(V),K=D.k*(H.shiftKey?.5:2),z=i(k(_(D,K),V,F),t.apply(this,q),u);no(H),f>0?dn(this).transition().duration(f).call(B,z,V,H):dn(this).call(N.transform,z,V,H)}}function I(H,...q){if(e.apply(this,arguments)){var D=H.touches,V=D.length,F=A(this,q,H.changedTouches.length===V).event(H),K,z,O,Y;for(dh(H),z=0;z<V;++z)O=D[z],Y=zn(O,this),Y=[Y,this.__zoom.invert(Y),O.identifier],F.touch0?!F.touch1&&F.touch0[2]!==Y[2]&&(F.touch1=Y,F.taps=0):(F.touch0=Y,K=!0,F.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(F.taps<2&&(p=Y[0],g=setTimeout(function(){g=null},v)),Vu(this),F.start())}}function P(H,...q){if(this.__zooming){var D=A(this,q).event(H),V=H.changedTouches,F=V.length,K,z,O,Y;for(no(H),K=0;K<F;++K)z=V[K],O=zn(z,this),D.touch0&&D.touch0[2]===z.identifier?D.touch0[0]=O:D.touch1&&D.touch1[2]===z.identifier&&(D.touch1[0]=O);if(z=D.that.__zoom,D.touch1){var j=D.touch0[0],ne=D.touch0[1],ue=D.touch1[0],ce=D.touch1[1],de=(de=ue[0]-j[0])*de+(de=ue[1]-j[1])*de,se=(se=ce[0]-ne[0])*se+(se=ce[1]-ne[1])*se;z=_(z,Math.sqrt(de/se)),O=[(j[0]+ue[0])/2,(j[1]+ue[1])/2],Y=[(ne[0]+ce[0])/2,(ne[1]+ce[1])/2]}else if(D.touch0)O=D.touch0[0],Y=D.touch0[1];else return;D.zoom("touch",i(k(z,O,Y),D.extent,u))}}function ee(H,...q){if(this.__zooming){var D=A(this,q).event(H),V=H.changedTouches,F=V.length,K,z;for(dh(H),b&&clearTimeout(b),b=setTimeout(function(){b=null},v),K=0;K<F;++K)z=V[K],D.touch0&&D.touch0[2]===z.identifier?delete D.touch0:D.touch1&&D.touch1[2]===z.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(z=zn(z,this),Math.hypot(p[0]-z[0],p[1]-z[1])<C)){var O=dn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return N.wheelDelta=function(H){return arguments.length?(l=typeof H=="function"?H:Nu(+H),N):l},N.filter=function(H){return arguments.length?(e=typeof H=="function"?H:Nu(!!H),N):e},N.touchable=function(H){return arguments.length?(o=typeof H=="function"?H:Nu(!!H),N):o},N.extent=function(H){return arguments.length?(t=typeof H=="function"?H:Nu([[+H[0][0],+H[0][1]],[+H[1][0],+H[1][1]]]),N):t},N.scaleExtent=function(H){return arguments.length?(s[0]=+H[0],s[1]=+H[1],N):[s[0],s[1]]},N.translateExtent=function(H){return arguments.length?(u[0][0]=+H[0][0],u[1][0]=+H[1][0],u[0][1]=+H[0][1],u[1][1]=+H[1][1],N):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},N.constrain=function(H){return arguments.length?(i=H,N):i},N.duration=function(H){return arguments.length?(f=+H,N):f},N.interpolate=function(H){return arguments.length?(h=H,N):h},N.on=function(){var H=d.on.apply(d,arguments);return H===d?N:H},N.clickDistance=function(H){return arguments.length?(E=(H=+H)*H,N):Math.sqrt(E)},N.tapDistance=function(H){return arguments.length?(C=+H,N):C},N}const Qn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:i,targetHandle:l})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:l}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Co=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Dv=["Enter"," ","Escape"],Ov={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:i})=>`Moved selected node ${e}. New position, x: ${t}, 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 Pl;(function(e){e.Strict="strict",e.Loose="loose"})(Pl||(Pl={}));var Ur;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ur||(Ur={}));var _o;(function(e){e.Partial="partial",e.Full="full"})(_o||(_o={}));const Lv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var fr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(fr||(fr={}));var lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lc||(lc={}));var ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ye||(ye={}));const $x={[ye.Left]:ye.Right,[ye.Right]:ye.Left,[ye.Top]:ye.Bottom,[ye.Bottom]:ye.Top};function Bv(e){return e===null?null:e?"valid":"invalid"}const Hv=e=>"id"in e&&"source"in e&&"target"in e,xA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),$p=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),$o=(e,t=[0,0])=>{const{width:i,height:l}=ji(e),o=e.origin??t,s=i*o[0],u=l*o[1];return{x:e.position.x-s,y:e.position.y-u}},bA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((l,o)=>{const s=typeof o=="string";let u=!t.nodeLookup&&!s?o:void 0;t.nodeLookup&&(u=s?t.nodeLookup.get(o):$p(o)?o:t.nodeLookup.get(o.id));const f=u?ac(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cc(l,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _c(i)},Po=(e,t={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},l=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(i=Cc(i,ac(o)),l=!0)}),l?_c(i):{x:0,y:0,width:0,height:0}},Pp=(e,t,[i,l,o]=[0,0,1],s=!1,u=!1)=>{const f={...Fo(t,[i,l,o]),width:t.width/o,height:t.height/o},h=[];for(const d of e.values()){const{measured:g,selectable:p=!0,hidden:b=!1}=d;if(u&&!p||b)continue;const v=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,E=To(f,Fl(d)),C=(v??0)*(w??0),N=s&&E>0;(!d.internals.handleBounds||N||E>=C||d.dragging)&&h.push(d)}return h},vA=(e,t)=>{const i=new Set;return e.forEach(l=>{i.add(l.id)}),t.filter(l=>i.has(l.source)||i.has(l.target))};function wA(e,t){const i=new Map,l=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(t?.includeHiddenNodes||!o.hidden)&&(!l||l.has(o.id))&&i.set(o.id,o)}),i}async function SA({nodes:e,width:t,height:i,panZoom:l,minZoom:o,maxZoom:s},u){if(e.size===0)return Promise.resolve(!0);const f=wA(e,u),h=Po(f),d=Yp(h,t,i,u?.minZoom??o,u?.maxZoom??s,u?.padding??.1);return await l.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Uv({nodeId:e,nextPosition:t,nodeLookup:i,nodeOrigin:l=[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??l;let p=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)s?.("005",Qn.error005());else{const v=f.measured.width,w=f.measured.height;v&&w&&(p=[[h,d],[h+v,d+w]])}else f&&Xl(u.extent)&&(p=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const b=Xl(p)?Vr(t,p,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&s?.("015",Qn.error015()),{position:{x:b.x-h+(u.measured.width??0)*g[0],y:b.y-d+(u.measured.height??0)*g[1]},positionAbsolute:b}}async function kA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:i,edges:l,onBeforeDelete:o}){const s=new Set(e.map(b=>b.id)),u=[];for(const b of i){if(b.deletable===!1)continue;const v=s.has(b.id),w=!v&&b.parentId&&u.find(E=>E.id===b.parentId);(v||w)&&u.push(b)}const f=new Set(t.map(b=>b.id)),h=l.filter(b=>b.deletable!==!1),g=vA(u,h);for(const b of h)f.has(b.id)&&!g.find(w=>w.id===b.id)&&g.push(b);if(!o)return{edges:g,nodes:u};const p=await o({nodes:u,edges:g});return typeof p=="boolean"?p?{edges:g,nodes:u}:{edges:[],nodes:[]}:p}const Yl=(e,t=0,i=1)=>Math.min(Math.max(e,t),i),Vr=(e={x:0,y:0},t,i)=>({x:Yl(e.x,t[0][0],t[1][0]-(i?.width??0)),y:Yl(e.y,t[0][1],t[1][1]-(i?.height??0))});function Iv(e,t,i){const{width:l,height:o}=ji(i),{x:s,y:u}=i.internals.positionAbsolute;return Vr(e,[[s,u],[s+l,u+o]],t)}const Px=(e,t,i)=>e<t?Yl(Math.abs(e-t),1,t)/t:e>i?-Yl(Math.abs(e-i),1,t)/t:0,qv=(e,t,i=15,l=40)=>{const o=Px(e.x,l,t.width-l)*i,s=Px(e.y,l,t.height-l)*i;return[o,s]},Cc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),np=({x:e,y:t,width:i,height:l})=>({x:e,y:t,x2:e+i,y2:t+l}),_c=({x:e,y:t,x2:i,y2:l})=>({x:e,y:t,width:i-e,height:l-t}),Fl=(e,t=[0,0])=>{const{x:i,y:l}=$p(e)?e.internals.positionAbsolute:$o(e,t);return{x:i,y:l,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},ac=(e,t=[0,0])=>{const{x:i,y:l}=$p(e)?e.internals.positionAbsolute:$o(e,t);return{x:i,y:l,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:l+(e.measured?.height??e.height??e.initialHeight??0)}},Vv=(e,t)=>_c(Cc(np(e),np(t))),To=(e,t)=>{const i=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),l=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(i*l)},Yx=e=>On(e.width)&&On(e.height)&&On(e.x)&&On(e.y),On=e=>!isNaN(e)&&isFinite(e),EA=(e,t)=>{},Yo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Fo=({x:e,y:t},[i,l,o],s=!1,u=[1,1])=>{const f={x:(e-i)/o,y:(t-l)/o};return s?Yo(f,u):f},oc=({x:e,y:t},[i,l,o])=>({x:e*o+i,y:t*o+l});function Rl(e,t){if(typeof e=="number")return Math.floor((t-t/(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(t*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 NA(e,t,i){if(typeof e=="string"||typeof e=="number"){const l=Rl(e,i),o=Rl(e,t);return{top:l,right:o,bottom:l,left:o,x:o*2,y:l*2}}if(typeof e=="object"){const l=Rl(e.top??e.y??0,i),o=Rl(e.bottom??e.y??0,i),s=Rl(e.left??e.x??0,t),u=Rl(e.right??e.x??0,t);return{top:l,right:u,bottom:o,left:s,x:s+u,y:l+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function CA(e,t,i,l,o,s){const{x:u,y:f}=oc(e,[t,i,l]),{x:h,y:d}=oc({x:e.x+e.width,y:e.y+e.height},[t,i,l]),g=o-h,p=s-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(p)}}const Yp=(e,t,i,l,o,s)=>{const u=NA(s,t,i),f=(t-u.x)/e.width,h=(i-u.y)/e.height,d=Math.min(f,h),g=Yl(d,l,o),p=e.x+e.width/2,b=e.y+e.height/2,v=t/2-p*g,w=i/2-b*g,E=CA(e,v,w,g,t,i),C={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:v-C.left+C.right,y:w-C.top+C.bottom,zoom:g}},Ao=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Xl(e){return e!=null&&e!=="parent"}function ji(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function $v(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Pv(e,t={width:0,height:0},i,l,o){const s={...e},u=l.get(i);if(u){const f=u.origin||o;s.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],s.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return s}function Fx(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function _A(){let e,t;return{promise:new Promise((l,o)=>{e=l,t=o}),resolve:e,reject:t}}function TA(e){return{...Ov,...e||{}}}function po(e,{snapGrid:t=[0,0],snapToGrid:i=!1,transform:l,containerBounds:o}){const{x:s,y:u}=Ln(e),f=Fo({x:s-(o?.left??0),y:u-(o?.top??0)},l),{x:h,y:d}=i?Yo(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const Fp=e=>({width:e.offsetWidth,height:e.offsetHeight}),Yv=e=>e?.getRootNode?.()||window?.document,AA=["INPUT","SELECT","TEXTAREA"];function Fv(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:AA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Xv=e=>"clientX"in e,Ln=(e,t)=>{const i=Xv(e),l=i?e.clientX:e.touches?.[0].clientX,o=i?e.clientY:e.touches?.[0].clientY;return{x:l-(t?.left??0),y:o-(t?.top??0)}},Xx=(e,t,i,l,o)=>{const s=t.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)/l,y:(f.top-i.top)/l,...Fp(u)}})};function Gv({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:o,sourceControlY:s,targetControlX:u,targetControlY:f}){const h=e*.125+o*.375+u*.375+i*.125,d=t*.125+s*.375+f*.375+l*.125,g=Math.abs(h-e),p=Math.abs(d-t);return[h,d,g,p]}function Cu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gx({pos:e,x1:t,y1:i,x2:l,y2:o,c:s}){switch(e){case ye.Left:return[t-Cu(t-l,s),i];case ye.Right:return[t+Cu(l-t,s),i];case ye.Top:return[t,i-Cu(i-o,s)];case ye.Bottom:return[t,i+Cu(o-i,s)]}}function Zv({sourceX:e,sourceY:t,sourcePosition:i=ye.Bottom,targetX:l,targetY:o,targetPosition:s=ye.Top,curvature:u=.25}){const[f,h]=Gx({pos:i,x1:e,y1:t,x2:l,y2:o,c:u}),[d,g]=Gx({pos:s,x1:l,y1:o,x2:e,y2:t,c:u}),[p,b,v,w]=Gv({sourceX:e,sourceY:t,targetX:l,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${t} C${f},${h} ${d},${g} ${l},${o}`,p,b,v,w]}function Qv({sourceX:e,sourceY:t,targetX:i,targetY:l}){const o=Math.abs(i-e)/2,s=i<e?i+o:i-o,u=Math.abs(l-t)/2,f=l<t?l+u:l-u;return[s,f,o,u]}function MA({sourceNode:e,targetNode:t,selected:i=!1,zIndex:l=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return l;const u=o&&i?l+1e3:l,f=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return u+f}function jA({sourceNode:e,targetNode:t,width:i,height:l,transform:o}){const s=Cc(ac(e),ac(t));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:l/o[2]};return To(u,_c(s))>0}const zA=({source:e,sourceHandle:t,target:i,targetHandle:l})=>`xy-edge__${e}${t||""}-${i}${l||""}`,RA=(e,t)=>t.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)),ip=(e,t,i={})=>{if(!e.source||!e.target)return t;const l=i.getEdgeId||zA;let o;return Hv(e)?o={...e}:o={...e,id:l(e)},RA(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Kv({sourceX:e,sourceY:t,targetX:i,targetY:l}){const[o,s,u,f]=Qv({sourceX:e,sourceY:t,targetX:i,targetY:l});return[`M ${e},${t}L ${i},${l}`,o,s,u,f]}const Zx={[ye.Left]:{x:-1,y:0},[ye.Right]:{x:1,y:0},[ye.Top]:{x:0,y:-1},[ye.Bottom]:{x:0,y:1}},DA=({source:e,sourcePosition:t=ye.Bottom,target:i})=>t===ye.Left||t===ye.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},Qx=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function OA({source:e,sourcePosition:t=ye.Bottom,target:i,targetPosition:l=ye.Top,center:o,offset:s,stepPosition:u}){const f=Zx[t],h=Zx[l],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},p=DA({source:d,sourcePosition:t,target:g}),b=p.x!==0?"x":"y",v=p[b];let w=[],E,C;const N={x:0,y:0},_={x:0,y:0},[,,k,T]=Qv({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(f[b]*h[b]===-1){b==="x"?(E=o.x??d.x+(g.x-d.x)*u,C=o.y??(d.y+g.y)/2):(E=o.x??(d.x+g.x)/2,C=o.y??d.y+(g.y-d.y)*u);const A=[{x:E,y:d.y},{x:E,y:g.y}],L=[{x:d.x,y:C},{x:g.x,y:C}];f[b]===v?w=b==="x"?A:L:w=b==="x"?L:A}else{const A=[{x:d.x,y:g.y}],L=[{x:g.x,y:d.y}];if(b==="x"?w=f.x===v?L:A:w=f.y===v?A:L,t===l){const P=Math.abs(e[b]-i[b]);if(P<=s){const ee=Math.min(s-1,s-P);f[b]===v?N[b]=(d[b]>e[b]?-1:1)*ee:_[b]=(g[b]>i[b]?-1:1)*ee}}if(t!==l){const P=b==="x"?"y":"x",ee=f[b]===h[P],H=d[P]>g[P],q=d[P]<g[P];(f[b]===1&&(!ee&&H||ee&&q)||f[b]!==1&&(!ee&&q||ee&&H))&&(w=b==="x"?A:L)}const X={x:d.x+N.x,y:d.y+N.y},Z={x:g.x+_.x,y:g.y+_.y},U=Math.max(Math.abs(X.x-w[0].x),Math.abs(Z.x-w[0].x)),I=Math.max(Math.abs(X.y-w[0].y),Math.abs(Z.y-w[0].y));U>=I?(E=(X.x+Z.x)/2,C=w[0].y):(E=w[0].x,C=(X.y+Z.y)/2)}return[[e,{x:d.x+N.x,y:d.y+N.y},...w,{x:g.x+_.x,y:g.y+_.y},i],E,C,k,T]}function LA(e,t,i,l){const o=Math.min(Qx(e,t)/2,Qx(t,i)/2,l),{x:s,y:u}=t;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 rp({sourceX:e,sourceY:t,sourcePosition:i=ye.Bottom,targetX:l,targetY:o,targetPosition:s=ye.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[p,b,v,w,E]=OA({source:{x:e,y:t},sourcePosition:i,target:{x:l,y:o},targetPosition:s,center:{x:f,y:h},offset:d,stepPosition:g});return[p.reduce((N,_,k)=>{let T="";return k>0&&k<p.length-1?T=LA(p[k-1],_,p[k+1],u):T=`${k===0?"M":"L"}${_.x} ${_.y}`,N+=T,N},""),b,v,w,E]}function Kx(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function BA(e){const{sourceNode:t,targetNode:i}=e;if(!Kx(t)||!Kx(i))return null;const l=t.internals.handleBounds||Jx(t.handles),o=i.internals.handleBounds||Jx(i.handles),s=Wx(l?.source??[],e.sourceHandle),u=Wx(e.connectionMode===Pl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!s||!u)return e.onError?.("008",Qn.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=s?.position||ye.Bottom,h=u?.position||ye.Top,d=$r(t,s,f),g=$r(i,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function Jx(e){if(!e)return null;const t=[],i=[];for(const l of e)l.width=l.width??1,l.height=l.height??1,l.type==="source"?t.push(l):l.type==="target"&&i.push(l);return{source:t,target:i}}function $r(e,t,i=ye.Left,l=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??ji(e);if(l)return{x:o+u/2,y:s+f/2};switch(t?.position??i){case ye.Top:return{x:o+u/2,y:s};case ye.Right:return{x:o+u,y:s+f/2};case ye.Bottom:return{x:o+u/2,y:s+f};case ye.Left:return{x:o,y:s+f/2}}}function Wx(e,t){return e&&(t?e.find(i=>i.id===t):e[0])||null}function lp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(l=>`${l}=${e[l]}`).join("&")}`:""}function HA(e,{id:t,defaultColor:i,defaultMarkerStart:l,defaultMarkerEnd:o}){const s=new Set;return e.reduce((u,f)=>([f.markerStart||l,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const d=lp(h,t);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 Jv=1e3,UA=10,Xp={nodeOrigin:[0,0],nodeExtent:Co,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},IA={...Xp,checkEquality:!0};function Gp(e,t){const i={...e};for(const l in t)t[l]!==void 0&&(i[l]=t[l]);return i}function qA(e,t,i){const l=Gp(Xp,i);for(const o of e.values())if(o.parentId)Qp(o,e,t,l);else{const s=$o(o,l.nodeOrigin),u=Xl(o.extent)?o.extent:l.nodeExtent,f=Vr(s,u,ji(o));o.internals.positionAbsolute=f}}function VA(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const i=[],l=[];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"&&l.push(s)}return{source:i,target:l}}function Zp(e){return e==="manual"}function ap(e,t,i,l={}){const o=Gp(IA,l),s={i:0},u=new Map(t),f=o?.elevateNodesOnSelect&&!Zp(o.zIndexMode)?Jv:0;let h=e.length>0;t.clear(),i.clear();for(const d of e){let g=u.get(d.id);if(o.checkEquality&&d===g?.internals.userNode)t.set(d.id,g);else{const p=$o(d,o.nodeOrigin),b=Xl(d.extent)?d.extent:o.nodeExtent,v=Vr(p,b,ji(d));g={...o.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:v,handleBounds:VA(d,g),z:Wv(d,f,o.zIndexMode),userNode:d}},t.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&Qp(g,t,i,l,s)}return h}function $A(e,t){if(!e.parentId)return;const i=t.get(e.parentId);i?i.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qp(e,t,i,l,o){const{elevateNodesOnSelect:s,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Gp(Xp,l),d=e.parentId,g=t.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}$A(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*UA),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const p=s&&!Zp(h)?Jv:0,{x:b,y:v,z:w}=PA(e,g,u,f,p,h),{positionAbsolute:E}=e.internals,C=b!==E.x||v!==E.y;(C||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:C?{x:b,y:v}:E,z:w}})}function Wv(e,t,i){const l=On(e.zIndex)?e.zIndex:0;return Zp(i)?l:l+(e.selected?t:0)}function PA(e,t,i,l,o,s){const{x:u,y:f}=t.internals.positionAbsolute,h=ji(e),d=$o(e,i),g=Xl(e.extent)?Vr(d,e.extent,h):d;let p=Vr({x:u+g.x,y:f+g.y},l,h);e.extent==="parent"&&(p=Iv(p,h,t));const b=Wv(e,o,s),v=t.internals.z??0;return{x:p.x,y:p.y,z:v>=b?v+1:b}}function Kp(e,t,i,l=[0,0]){const o=[],s=new Map;for(const u of e){const f=t.get(u.parentId);if(!f)continue;const h=s.get(u.parentId)?.expandedRect??Fl(f),d=Vv(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=ji(f),p=f.origin??l,b=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,v=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),E=Math.max(g.height,Math.round(u.height)),C=(w-g.width)*p[0],N=(E-g.height)*p[1];(b>0||v>0||C||N)&&(o.push({id:h,type:"position",position:{x:f.position.x-b+C,y:f.position.y-v+N}}),i.get(h)?.forEach(_=>{e.some(k=>k.id===_.id)||o.push({id:_.id,type:"position",position:{x:_.position.x+b,y:_.position.y+v}})})),(g.width<u.width||g.height<u.height||b||v)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(b?p[0]*b-C:0),height:E+(v?p[1]*v-N:0)}})}),o}function YA(e,t,i,l,o,s,u){const f=l?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:p}=new window.DOMMatrixReadOnly(g.transform),b=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const E=Fp(v.nodeElement),C=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(C||!w.internals.handleBounds||v.force))){const _=v.nodeElement.getBoundingClientRect(),k=Xl(w.extent)?w.extent:s;let{positionAbsolute:T}=w.internals;w.parentId&&w.extent==="parent"?T=Iv(T,E,t.get(w.parentId)):k&&(T=Vr(T,k,E));const B={...w,measured:E,internals:{...w.internals,positionAbsolute:T,handleBounds:{source:Xx("source",v.nodeElement,_,p,w.id),target:Xx("target",v.nodeElement,_,p,w.id)}}};t.set(w.id,B),w.parentId&&Qp(B,t,i,{nodeOrigin:o,zIndexMode:u}),h=!0,C&&(d.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&b.push({id:w.id,parentId:w.parentId,rect:Fl(B,o)}))}}if(b.length>0){const v=Kp(b,t,i,o);d.push(...v)}return{changes:d,updatedInternals:h}}async function FA({delta:e,panZoom:t,transform:i,translateExtent:l,width:o,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[o,s]],l),f=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(f)}function e1(e,t,i,l,o,s){let u=o;const f=l.get(u)||new Map;l.set(u,f.set(i,t)),u=`${o}-${e}`;const h=l.get(u)||new Map;if(l.set(u,h.set(i,t)),s){u=`${o}-${e}-${s}`;const d=l.get(u)||new Map;l.set(u,d.set(i,t))}}function ew(e,t,i){e.clear(),t.clear();for(const l of i){const{source:o,target:s,sourceHandle:u=null,targetHandle:f=null}=l,h={edgeId:l.id,source:o,target:s,sourceHandle:u,targetHandle:f},d=`${o}-${u}--${s}-${f}`,g=`${s}-${f}--${o}-${u}`;e1("source",h,g,e,o,u),e1("target",h,d,e,s,f),t.set(l.id,l)}}function tw(e,t){if(!e.parentId)return!1;const i=t.get(e.parentId);return i?i.selected?!0:tw(i,t):!1}function t1(e,t,i){let l=e;do{if(l?.matches?.(t))return!0;if(l===i)return!1;l=l?.parentElement}while(l);return!1}function XA(e,t,i,l){const o=new Map;for(const[s,u]of e)if((u.selected||u.id===l)&&(!u.parentId||!tw(u,e))&&(u.draggable||t&&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 hh({nodeId:e,dragItems:t,nodeLookup:i,dragging:l=!0}){const o=[];for(const[u,f]of t){const h=i.get(u)?.internals.userNode;h&&o.push({...h,position:f.position,dragging:l})}if(!e)return[o[0],o];const s=i.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:l}:o[0],o]}function GA({dragItems:e,snapGrid:t,x:i,y:l}){const o=e.values().next().value;if(!o)return null;const s={x:i-o.distance.x,y:l-o.distance.y},u=Yo(s,t);return{x:u.x-s.x,y:u.y-s.y}}function ZA({onNodeMouseDown:e,getStoreItems:t,onDragStart:i,onDrag:l,onDragStop:o}){let s={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,p=!1,b=null,v=!1,w=!1,E=null;function C({noDragClassName:_,handleSelector:k,domNode:T,isSelectable:B,nodeId:A,nodeClickDistance:L=0}){b=dn(T);function X({x:P,y:ee}){const{nodeLookup:H,nodeExtent:q,snapGrid:D,snapToGrid:V,nodeOrigin:F,onNodeDrag:K,onSelectionDrag:z,onError:O,updateNodePositions:Y}=t();s={x:P,y:ee};let j=!1;const ne=f.size>1,ue=ne&&q?np(Po(f)):null,ce=ne&&V?GA({dragItems:f,snapGrid:D,x:P,y:ee}):null;for(const[de,se]of f){if(!H.has(de))continue;let pe={x:P-se.distance.x,y:ee-se.distance.y};V&&(pe=ce?{x:Math.round(pe.x+ce.x),y:Math.round(pe.y+ce.y)}:Yo(pe,D));let ke=null;if(ne&&q&&!se.extent&&ue){const{positionAbsolute:Ee}=se.internals,ze=Ee.x-ue.x+q[0][0],Fe=Ee.x+se.measured.width-ue.x2+q[1][0],$e=Ee.y-ue.y+q[0][1],ft=Ee.y+se.measured.height-ue.y2+q[1][1];ke=[[ze,$e],[Fe,ft]]}const{position:Ne,positionAbsolute:be}=Uv({nodeId:de,nextPosition:pe,nodeLookup:H,nodeExtent:ke||q,nodeOrigin:F,onError:O});j=j||se.position.x!==Ne.x||se.position.y!==Ne.y,se.position=Ne,se.internals.positionAbsolute=be}if(w=w||j,!!j&&(Y(f,!0),E&&(l||K||!A&&z))){const[de,se]=hh({nodeId:A,dragItems:f,nodeLookup:H});l?.(E,f,de,se),K?.(E,de,se),A||z?.(E,se)}}async function Z(){if(!g)return;const{transform:P,panBy:ee,autoPanSpeed:H,autoPanOnNodeDrag:q}=t();if(!q){h=!1,cancelAnimationFrame(u);return}const[D,V]=qv(d,g,H);(D!==0||V!==0)&&(s.x=(s.x??0)-D/P[2],s.y=(s.y??0)-V/P[2],await ee({x:D,y:V})&&X(s)),u=requestAnimationFrame(Z)}function U(P){const{nodeLookup:ee,multiSelectionActive:H,nodesDraggable:q,transform:D,snapGrid:V,snapToGrid:F,selectNodesOnDrag:K,onNodeDragStart:z,onSelectionDragStart:O,unselectNodesAndEdges:Y}=t();p=!0,(!K||!B)&&!H&&A&&(ee.get(A)?.selected||Y()),B&&K&&A&&e?.(A);const j=po(P.sourceEvent,{transform:D,snapGrid:V,snapToGrid:F,containerBounds:g});if(s=j,f=XA(ee,q,j,A),f.size>0&&(i||z||!A&&O)){const[ne,ue]=hh({nodeId:A,dragItems:f,nodeLookup:ee});i?.(P.sourceEvent,f,ne,ue),z?.(P.sourceEvent,ne,ue),A||O?.(P.sourceEvent,ue)}}const I=xv().clickDistance(L).on("start",P=>{const{domNode:ee,nodeDragThreshold:H,transform:q,snapGrid:D,snapToGrid:V}=t();g=ee?.getBoundingClientRect()||null,v=!1,w=!1,E=P.sourceEvent,H===0&&U(P),s=po(P.sourceEvent,{transform:q,snapGrid:D,snapToGrid:V,containerBounds:g}),d=Ln(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:ee,transform:H,snapGrid:q,snapToGrid:D,nodeDragThreshold:V,nodeLookup:F}=t(),K=po(P.sourceEvent,{transform:H,snapGrid:q,snapToGrid:D,containerBounds:g});if(E=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!F.has(A))&&(v=!0),!v){if(!h&&ee&&p&&(h=!0,Z()),!p){const z=Ln(P.sourceEvent,g),O=z.x-d.x,Y=z.y-d.y;Math.sqrt(O*O+Y*Y)>V&&U(P)}(s.x!==K.xSnapped||s.y!==K.ySnapped)&&f&&p&&(d=Ln(P.sourceEvent,g),X(K))}}).on("end",P=>{if(!(!p||v)&&(h=!1,p=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:ee,updateNodePositions:H,onNodeDragStop:q,onSelectionDragStop:D}=t();if(w&&(H(f,!1),w=!1),o||q||!A&&D){const[V,F]=hh({nodeId:A,dragItems:f,nodeLookup:ee,dragging:!1});o?.(P.sourceEvent,f,V,F),q?.(P.sourceEvent,V,F),A||D?.(P.sourceEvent,F)}}}).filter(P=>{const ee=P.target;return!P.button&&(!_||!t1(ee,`.${_}`,T))&&(!k||t1(ee,k,T))});b.call(I)}function N(){b?.on(".drag",null)}return{update:C,destroy:N}}function QA(e,t,i){const l=[],o={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const s of t.values())To(o,Fl(s))>0&&l.push(s);return l}const KA=250;function JA(e,t,i,l){let o=[],s=1/0;const u=QA(e,i,t+KA);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(l.nodeId===d.nodeId&&l.type===d.type&&l.id===d.id)continue;const{x:g,y:p}=$r(f,d,d.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(p-e.y,2));b>t||(b<s?(o=[{...d,x:g,y:p}],s=b):b===s&&o.push({...d,x:g,y:p}))}}if(!o.length)return null;if(o.length>1){const f=l.type==="source"?"target":"source";return o.find(h=>h.type===f)??o[0]}return o[0]}function nw(e,t,i,l,o,s=!1){const u=l.get(e);if(!u)return null;const f=o==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(i?f?.find(d=>d.id===i):f?.[0])??null;return h&&s?{...h,...$r(u,h,h.position,!0)}:h}function iw(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function WA(e,t){let i=null;return t?i=!0:e&&!t&&(i=!1),i}const rw=()=>!0;function e5(e,{connectionMode:t,connectionRadius:i,handleId:l,nodeId:o,edgeUpdaterType:s,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:p,panBy:b,cancelConnection:v,onConnectStart:w,onConnect:E,onConnectEnd:C,isValidConnection:N=rw,onReconnectEnd:_,updateConnection:k,getTransform:T,getFromHandle:B,autoPanSpeed:A,dragThreshold:L=1,handleDomNode:X}){const Z=Yv(e.target);let U=0,I;const{x:P,y:ee}=Ln(e),H=iw(s,X),q=f?.getBoundingClientRect();let D=!1;if(!q||!H)return;const V=nw(o,H,l,h,t);if(!V)return;let F=Ln(e,q),K=!1,z=null,O=!1,Y=null;function j(){if(!g||!q)return;const[Ne,be]=qv(F,q,A);b({x:Ne,y:be}),U=requestAnimationFrame(j)}const ne={...V,nodeId:o,type:H,position:V.position},ue=h.get(o);let de={inProgress:!0,isValid:null,from:$r(ue,ne,ye.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:ue,to:F,toHandle:null,toPosition:$x[ne.position],toNode:null,pointer:F};function se(){D=!0,k(de),w?.(e,{nodeId:o,handleId:l,handleType:H})}L===0&&se();function pe(Ne){if(!D){const{x:ft,y:tn}=Ln(Ne),Rt=ft-P,$t=tn-ee;if(!(Rt*Rt+$t*$t>L*L))return;se()}if(!B()||!ne){ke(Ne);return}const be=T();F=Ln(Ne,q),I=JA(Fo(F,be,!1,[1,1]),i,h,ne),K||(j(),K=!0);const Ee=lw(Ne,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:l,fromType:u?"target":"source",isValidConnection:N,doc:Z,lib:d,flowId:p,nodeLookup:h});Y=Ee.handleDomNode,z=Ee.connection,O=WA(!!I,Ee.isValid);const ze=h.get(o),Fe=ze?$r(ze,ne,ye.Left,!0):de.from,$e={...de,from:Fe,isValid:O,to:Ee.toHandle&&O?oc({x:Ee.toHandle.x,y:Ee.toHandle.y},be):F,toHandle:Ee.toHandle,toPosition:O&&Ee.toHandle?Ee.toHandle.position:$x[ne.position],toNode:Ee.toHandle?h.get(Ee.toHandle.nodeId):null,pointer:F};k($e),de=$e}function ke(Ne){if(!("touches"in Ne&&Ne.touches.length>0)){if(D){(I||Y)&&z&&O&&E?.(z);const{inProgress:be,...Ee}=de,ze={...Ee,toPosition:de.toHandle?de.toPosition:null};C?.(Ne,ze),s&&_?.(Ne,ze)}v(),cancelAnimationFrame(U),K=!1,O=!1,z=null,Y=null,Z.removeEventListener("mousemove",pe),Z.removeEventListener("mouseup",ke),Z.removeEventListener("touchmove",pe),Z.removeEventListener("touchend",ke)}}Z.addEventListener("mousemove",pe),Z.addEventListener("mouseup",ke),Z.addEventListener("touchmove",pe),Z.addEventListener("touchend",ke)}function lw(e,{handle:t,connectionMode:i,fromNodeId:l,fromHandleId:o,fromType:s,doc:u,lib:f,flowId:h,isValidConnection:d=rw,nodeLookup:g}){const p=s==="target",b=t?u.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:v,y:w}=Ln(e),E=u.elementFromPoint(v,w),C=E?.classList.contains(`${f}-flow__handle`)?E:b,N={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const _=iw(void 0,C),k=C.getAttribute("data-nodeid"),T=C.getAttribute("data-handleid"),B=C.classList.contains("connectable"),A=C.classList.contains("connectableend");if(!k||!_)return N;const L={source:p?k:l,sourceHandle:p?T:o,target:p?l:k,targetHandle:p?o:T};N.connection=L;const Z=B&&A&&(i===Pl.Strict?p&&_==="source"||!p&&_==="target":k!==l||T!==o);N.isValid=Z&&d(L),N.toHandle=nw(k,_,T,g,i,!0)}return N}const op={onPointerDown:e5,isValid:lw};function t5({domNode:e,panZoom:t,getTransform:i,getViewScale:l}){const o=dn(e);function s({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:p=!0,zoomable:b=!0,inversePan:v=!1}){const w=k=>{if(k.sourceEvent.type!=="wheel"||!t)return;const T=i(),B=k.sourceEvent.ctrlKey&&Ao()?10:1,A=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*g,L=T[2]*Math.pow(2,A*B);t.scaleTo(L)};let E=[0,0];const C=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])},N=k=>{const T=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!t)return;const B=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],A=[B[0]-E[0],B[1]-E[1]];E=B;const L=l()*Math.max(T[2],Math.log(T[2]))*(v?-1:1),X={x:T[0]-A[0]*L,y:T[1]-A[1]*L},Z=[[0,0],[h,d]];t.setViewportConstrained({x:X.x,y:X.y,zoom:T[2]},Z,f)},_=Rv().on("start",C).on("zoom",p?N:null).on("zoom.wheel",b?w:null);o.call(_,{})}function u(){o.on("zoom",null)}return{update:s,destroy:u,pointer:zn}}const Tc=e=>({x:e.x,y:e.y,zoom:e.k}),ph=({x:e,y:t,zoom:i})=>Nc.translate(e,t).scale(i),Bl=(e,t)=>e.target.closest(`.${t}`),aw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),n5=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,mh=(e,t=0,i=n5,l=()=>{})=>{const o=typeof t=="number"&&t>0;return o||l(),o?e.transition().duration(t).ease(i).on("end",l):e},ow=e=>{const t=e.ctrlKey&&Ao()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function i5({zoomPanValues:e,noWheelClassName:t,d3Selection:i,d3Zoom:l,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(Bl(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const p=i.property("__zoom").k||1;if(g.ctrlKey&&u){const C=zn(g),N=ow(g),_=p*Math.pow(2,N);l.scaleTo(i,_,C,g);return}const b=g.deltaMode===1?20:1;let v=o===Ur.Vertical?0:g.deltaX*b,w=o===Ur.Horizontal?0:g.deltaY*b;!Ao()&&g.shiftKey&&o!==Ur.Vertical&&(v=g.deltaY*b,w=0),l.translateBy(i,-(v/p)*s,-(w/p)*s,{internal:!0});const E=Tc(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 r5({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:i}){return function(l,o){const s=l.type==="wheel",u=!t&&s&&!l.ctrlKey,f=Bl(l,e);if(l.ctrlKey&&s&&f&&l.preventDefault(),u||f)return null;l.preventDefault(),i.call(this,l,o)}}function l5({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:i}){return l=>{if(l.sourceEvent?.internal)return;const o=Tc(l.transform);e.mouseButton=l.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,l.sourceEvent?.type==="mousedown"&&t(!0),i&&i?.(l.sourceEvent,o)}}function a5({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:i,onTransformChange:l,onPanZoom:o}){return s=>{e.usedRightMouseButton=!!(i&&aw(t,e.mouseButton??0)),s.sourceEvent?.sync||l([s.transform.x,s.transform.y,s.transform.k]),o&&!s.sourceEvent?.internal&&o?.(s.sourceEvent,Tc(s.transform))}}function o5({zoomPanValues:e,panOnDrag:t,panOnScroll:i,onDraggingChange:l,onPanZoomEnd:o,onPaneContextMenu:s}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&aw(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&s(u.sourceEvent),e.usedRightMouseButton=!1,l(!1),o)){const f=Tc(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,f)},i?150:0)}}}function s5({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:i,panOnDrag:l,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return p=>{const b=e||t,v=i&&p.ctrlKey,w=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Bl(p,`${d}-flow__node`)||Bl(p,`${d}-flow__edge`)))return!0;if(!l&&!b&&!o&&!s&&!i||u||g&&!w||Bl(p,f)&&w||Bl(p,h)&&(!w||o&&w&&!e)||!i&&p.ctrlKey&&w)return!1;if(!i&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!b&&!o&&!v&&w||!l&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(l)&&!l.includes(p.button)&&p.type==="mousedown")return!1;const E=Array.isArray(l)&&l.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||w)&&E}}function u5({domNode:e,minZoom:t,maxZoom:i,translateExtent:l,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(),p=Rv().scaleExtent([t,i]).translateExtent(l),b=dn(e).call(p);_({x:o.x,y:o.y,zoom:Yl(o.zoom,t,i)},[[0,0],[g.width,g.height]],l);const v=b.on("wheel.zoom"),w=b.on("dblclick.zoom");p.wheelDelta(ow);function E(I,P){return b?new Promise(ee=>{p?.interpolate(P?.interpolate==="linear"?ho:Uu).transform(mh(b,P?.duration,P?.ease,()=>ee(!0)),I)}):Promise.resolve(!1)}function C({noWheelClassName:I,noPanClassName:P,onPaneContextMenu:ee,userSelectionActive:H,panOnScroll:q,panOnDrag:D,panOnScrollMode:V,panOnScrollSpeed:F,preventScrolling:K,zoomOnPinch:z,zoomOnScroll:O,zoomOnDoubleClick:Y,zoomActivationKeyPressed:j,lib:ne,onTransformChange:ue,connectionInProgress:ce,paneClickDistance:de,selectionOnDrag:se}){H&&!d.isZoomingOrPanning&&N();const pe=q&&!j&&!H;p.clickDistance(se?1/0:!On(de)||de<0?0:de);const ke=pe?i5({zoomPanValues:d,noWheelClassName:I,d3Selection:b,d3Zoom:p,panOnScrollMode:V,panOnScrollSpeed:F,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:f}):r5({noWheelClassName:I,preventScrolling:K,d3ZoomHandler:v});if(b.on("wheel.zoom",ke,{passive:!1}),!H){const be=l5({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});p.on("start",be);const Ee=a5({zoomPanValues:d,panOnDrag:D,onPaneContextMenu:!!ee,onPanZoom:s,onTransformChange:ue});p.on("zoom",Ee);const ze=o5({zoomPanValues:d,panOnDrag:D,panOnScroll:q,onPaneContextMenu:ee,onPanZoomEnd:f,onDraggingChange:h});p.on("end",ze)}const Ne=s5({zoomActivationKeyPressed:j,panOnDrag:D,zoomOnScroll:O,panOnScroll:q,zoomOnDoubleClick:Y,zoomOnPinch:z,userSelectionActive:H,noPanClassName:P,noWheelClassName:I,lib:ne,connectionInProgress:ce});p.filter(Ne),Y?b.on("dblclick.zoom",w):b.on("dblclick.zoom",null)}function N(){p.on("zoom",null)}async function _(I,P,ee){const H=ph(I),q=p?.constrain()(H,P,ee);return q&&await E(q),new Promise(D=>D(q))}async function k(I,P){const ee=ph(I);return await E(ee,P),new Promise(H=>H(ee))}function T(I){if(b){const P=ph(I),ee=b.property("__zoom");(ee.k!==I.zoom||ee.x!==I.x||ee.y!==I.y)&&p?.transform(b,P,null,{sync:!0})}}function B(){const I=b?zv(b.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function A(I,P){return b?new Promise(ee=>{p?.interpolate(P?.interpolate==="linear"?ho:Uu).scaleTo(mh(b,P?.duration,P?.ease,()=>ee(!0)),I)}):Promise.resolve(!1)}function L(I,P){return b?new Promise(ee=>{p?.interpolate(P?.interpolate==="linear"?ho:Uu).scaleBy(mh(b,P?.duration,P?.ease,()=>ee(!0)),I)}):Promise.resolve(!1)}function X(I){p?.scaleExtent(I)}function Z(I){p?.translateExtent(I)}function U(I){const P=!On(I)||I<0?0:I;p?.clickDistance(P)}return{update:C,destroy:N,setViewport:k,setViewportConstrained:_,getViewport:B,scaleTo:A,scaleBy:L,setScaleExtent:X,setTranslateExtent:Z,syncViewport:T,setClickDistance:U}}var Gl;(function(e){e.Line="line",e.Handle="handle"})(Gl||(Gl={}));function c5({width:e,prevWidth:t,height:i,prevHeight:l,affectsX:o,affectsY:s}){const u=e-t,f=i-l,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 n1(e){const t=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),l=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:i,affectsX:l,affectsY:o}}function sr(e,t){return Math.max(0,t-e)}function ur(e,t){return Math.max(0,e-t)}function _u(e,t,i){return Math.max(0,t-e,e-i)}function i1(e,t){return e?!t:t}function f5(e,t,i,l,o,s,u,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:g,isVertical:p}=t,b=g&&p,{xSnapped:v,ySnapped:w}=i,{minWidth:E,maxWidth:C,minHeight:N,maxHeight:_}=l,{x:k,y:T,width:B,height:A,aspectRatio:L}=e;let X=Math.floor(g?v-e.pointerX:0),Z=Math.floor(p?w-e.pointerY:0);const U=B+(h?-X:X),I=A+(d?-Z:Z),P=-s[0]*B,ee=-s[1]*A;let H=_u(U,E,C),q=_u(I,N,_);if(u){let F=0,K=0;h&&X<0?F=sr(k+X+P,u[0][0]):!h&&X>0&&(F=ur(k+U+P,u[1][0])),d&&Z<0?K=sr(T+Z+ee,u[0][1]):!d&&Z>0&&(K=ur(T+I+ee,u[1][1])),H=Math.max(H,F),q=Math.max(q,K)}if(f){let F=0,K=0;h&&X>0?F=ur(k+X,f[0][0]):!h&&X<0&&(F=sr(k+U,f[1][0])),d&&Z>0?K=ur(T+Z,f[0][1]):!d&&Z<0&&(K=sr(T+I,f[1][1])),H=Math.max(H,F),q=Math.max(q,K)}if(o){if(g){const F=_u(U/L,N,_)*L;if(H=Math.max(H,F),u){let K=0;!h&&!d||h&&!d&&b?K=ur(T+ee+U/L,u[1][1])*L:K=sr(T+ee+(h?X:-X)/L,u[0][1])*L,H=Math.max(H,K)}if(f){let K=0;!h&&!d||h&&!d&&b?K=sr(T+U/L,f[1][1])*L:K=ur(T+(h?X:-X)/L,f[0][1])*L,H=Math.max(H,K)}}if(p){const F=_u(I*L,E,C)/L;if(q=Math.max(q,F),u){let K=0;!h&&!d||d&&!h&&b?K=ur(k+I*L+P,u[1][0])/L:K=sr(k+(d?Z:-Z)*L+P,u[0][0])/L,q=Math.max(q,K)}if(f){let K=0;!h&&!d||d&&!h&&b?K=sr(k+I*L,f[1][0])/L:K=ur(k+(d?Z:-Z)*L,f[0][0])/L,q=Math.max(q,K)}}}Z=Z+(Z<0?q:-q),X=X+(X<0?H:-H),o&&(b?U>I*L?Z=(i1(h,d)?-X:X)/L:X=(i1(h,d)?-Z:Z)*L:g?(Z=X/L,d=h):(X=Z*L,h=d));const D=h?k+X:k,V=d?T+Z:T;return{width:B+(h?-X:X),height:A+(d?-Z:Z),x:s[0]*X*(h?-1:1)+D,y:s[1]*Z*(d?-1:1)+V}}const sw={width:0,height:0,x:0,y:0},d5={...sw,pointerX:0,pointerY:0,aspectRatio:1};function h5(e){return[[0,0],[e.measured.width,e.measured.height]]}function p5(e,t,i){const l=t.position.x+e.position.x,o=t.position.y+e.position.y,s=e.measured.width??0,u=e.measured.height??0,f=i[0]*s,h=i[1]*u;return[[l-f,o-h],[l+s-f,o+u-h]]}function m5({domNode:e,nodeId:t,getStoreItems:i,onChange:l,onEnd:o}){const s=dn(e);let u={controlDirection:n1("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:p,resizeDirection:b,onResizeStart:v,onResize:w,onResizeEnd:E,shouldResize:C}){let N={...sw},_={...d5};u={boundaries:g,resizeDirection:b,keepAspectRatio:p,controlDirection:n1(d)};let k,T=null,B=[],A,L,X,Z=!1;const U=xv().on("start",I=>{const{nodeLookup:P,transform:ee,snapGrid:H,snapToGrid:q,nodeOrigin:D,paneDomNode:V}=i();if(k=P.get(t),!k)return;T=V?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:K}=po(I.sourceEvent,{transform:ee,snapGrid:H,snapToGrid:q,containerBounds:T});N={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},_={...N,pointerX:F,pointerY:K,aspectRatio:N.width/N.height},A=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(A=P.get(k.parentId),L=A&&k.extent==="parent"?h5(A):void 0),B=[],X=void 0;for(const[z,O]of P)if(O.parentId===t&&(B.push({id:z,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const Y=p5(O,k,O.origin??D);X?X=[[Math.min(Y[0][0],X[0][0]),Math.min(Y[0][1],X[0][1])],[Math.max(Y[1][0],X[1][0]),Math.max(Y[1][1],X[1][1])]]:X=Y}v?.(I,{...N})}).on("drag",I=>{const{transform:P,snapGrid:ee,snapToGrid:H,nodeOrigin:q}=i(),D=po(I.sourceEvent,{transform:P,snapGrid:ee,snapToGrid:H,containerBounds:T}),V=[];if(!k)return;const{x:F,y:K,width:z,height:O}=N,Y={},j=k.origin??q,{width:ne,height:ue,x:ce,y:de}=f5(_,u.controlDirection,D,u.boundaries,u.keepAspectRatio,j,L,X),se=ne!==z,pe=ue!==O,ke=ce!==F&&se,Ne=de!==K&&pe;if(!ke&&!Ne&&!se&&!pe)return;if((ke||Ne||j[0]===1||j[1]===1)&&(Y.x=ke?ce:N.x,Y.y=Ne?de:N.y,N.x=Y.x,N.y=Y.y,B.length>0)){const Fe=ce-F,$e=de-K;for(const ft of B)ft.position={x:ft.position.x-Fe+j[0]*(ne-z),y:ft.position.y-$e+j[1]*(ue-O)},V.push(ft)}if((se||pe)&&(Y.width=se&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ne:N.width,Y.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?ue:N.height,N.width=Y.width,N.height=Y.height),A&&k.expandParent){const Fe=j[0]*(Y.width??0);Y.x&&Y.x<Fe&&(N.x=Fe,_.x=_.x-(Y.x-Fe));const $e=j[1]*(Y.height??0);Y.y&&Y.y<$e&&(N.y=$e,_.y=_.y-(Y.y-$e))}const be=c5({width:N.width,prevWidth:z,height:N.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ee={...N,direction:be};C?.(I,Ee)!==!1&&(Z=!0,w?.(I,Ee),l(Y,V))}).on("end",I=>{Z&&(E?.(I,{...N}),o?.({...N}),Z=!1)});s.call(U)}function h(){s.on(".drag",null)}return{update:f,destroy:h}}var gh={exports:{}},yh={},xh={exports:{}},bh={};var r1;function g5(){if(r1)return bh;r1=1;var e=Do();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var i=typeof Object.is=="function"?Object.is:t,l=e.useState,o=e.useEffect,s=e.useLayoutEffect,u=e.useDebugValue;function f(p,b){var v=b(),w=l({inst:{value:v,getSnapshot:b}}),E=w[0].inst,C=w[1];return s(function(){E.value=v,E.getSnapshot=b,h(E)&&C({inst:E})},[p,v,b]),o(function(){return h(E)&&C({inst:E}),p(function(){h(E)&&C({inst:E})})},[p]),u(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!i(p,v)}catch{return!0}}function d(p,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return bh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,bh}var l1;function y5(){return l1||(l1=1,xh.exports=g5()),xh.exports}var a1;function x5(){if(a1)return yh;a1=1;var e=Do(),t=y5();function i(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var l=typeof Object.is=="function"?Object.is:i,o=t.useSyncExternalStore,s=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return yh.useSyncExternalStoreWithSelector=function(d,g,p,b,v){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 N(A){if(!_){if(_=!0,k=A,A=b(A),v!==void 0&&E.hasValue){var L=E.value;if(v(L,A))return T=L}return T=A}if(L=T,l(k,A))return L;var X=b(A);return v!==void 0&&v(L,X)?(k=A,L):(k=A,T=X)}var _=!1,k,T,B=p===void 0?null:p;return[function(){return N(g())},B===null?void 0:function(){return N(B())}]},[g,p,b,v]);var C=o(d,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=C},[C]),h(C),C},yh}var o1;function b5(){return o1||(o1=1,gh.exports=x5()),gh.exports}var v5=b5();const w5=hc(v5),S5={},s1=e=>{let t;const i=new Set,l=(g,p)=>{const b=typeof g=="function"?g(t):g;if(!Object.is(b,t)){const v=t;t=p??(typeof b!="object"||b===null)?b:Object.assign({},t,b),i.forEach(w=>w(t,v))}},o=()=>t,h={setState:l,getState:o,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g)),destroy:()=>{(S5?"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=t=e(l,o,h);return h},k5=e=>e?s1(e):s1,{useDebugValue:E5}=so,{useSyncExternalStoreWithSelector:N5}=w5,C5=e=>e;function uw(e,t=C5,i){const l=N5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,i);return E5(l),l}const u1=(e,t)=>{const i=k5(e),l=(o,s=t)=>uw(i,o,s);return Object.assign(l,i),l},_5=(e,t)=>e?u1(e,t):u1;function at(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[l,o]of e)if(!Object.is(o,t.get(l)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const l of e)if(!t.has(l))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(const l of i)if(!Object.prototype.hasOwnProperty.call(t,l)||!Object.is(e[l],t[l]))return!1;return!0}const Ac=R.createContext(null),T5=Ac.Provider,cw=Qn.error001();function Ve(e,t){const i=R.useContext(Ac);if(i===null)throw new Error(cw);return uw(i,e,t)}function ot(){const e=R.useContext(Ac);if(e===null)throw new Error(cw);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const c1={display:"none"},A5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},fw="react-flow__node-desc",dw="react-flow__edge-desc",M5="react-flow__aria-live",j5=e=>e.ariaLiveMessage,z5=e=>e.ariaLabelConfig;function R5({rfId:e}){const t=Ve(j5);return x.jsx("div",{id:`${M5}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:A5,children:t})}function D5({rfId:e,disableKeyboardA11y:t}){const i=Ve(z5);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${fw}-${e}`,style:c1,children:t?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${dw}-${e}`,style:c1,children:i["edge.a11yDescription.default"]}),!t&&x.jsx(R5,{rfId:e})]})}const Mc=R.forwardRef(({position:e="top-left",children:t,className:i,style:l,...o},s)=>{const u=`${e}`.split("-");return x.jsx("div",{className:St(["react-flow__panel",i,...u]),style:l,ref:s,...o,children:t})});Mc.displayName="Panel";function O5({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:x.jsx(Mc,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:x.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const L5=e=>{const t=[],i=[];for(const[,l]of e.nodeLookup)l.selected&&t.push(l.internals.userNode);for(const[,l]of e.edgeLookup)l.selected&&i.push(l);return{selectedNodes:t,selectedEdges:i}},Tu=e=>e.id;function B5(e,t){return at(e.selectedNodes.map(Tu),t.selectedNodes.map(Tu))&&at(e.selectedEdges.map(Tu),t.selectedEdges.map(Tu))}function H5({onSelectionChange:e}){const t=ot(),{selectedNodes:i,selectedEdges:l}=Ve(L5,B5);return R.useEffect(()=>{const o={nodes:i,edges:l};e?.(o),t.getState().onSelectionChangeHandlers.forEach(s=>s(o))},[i,l,e]),null}const U5=e=>!!e.onSelectionChangeHandlers;function I5({onSelectionChange:e}){const t=Ve(U5);return e||t?x.jsx(H5,{onSelectionChange:e}):null}const hw=[0,0],q5={x:0,y:0,zoom:1},V5=["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"],f1=[...V5,"rfId"],$5=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}),d1={translateExtent:Co,nodeOrigin:hw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function P5(e){const{setNodes:t,setEdges:i,setMinZoom:l,setMaxZoom:o,setTranslateExtent:s,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ve($5,at),d=ot();R.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=d1,f()}),[]);const g=R.useRef(d1);return R.useEffect(()=>{for(const p of f1){const b=e[p],v=g.current[p];b!==v&&(typeof e[p]>"u"||(p==="nodes"?t(b):p==="edges"?i(b):p==="minZoom"?l(b):p==="maxZoom"?o(b):p==="translateExtent"?s(b):p==="nodeExtent"?u(b):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:TA(b)}):p==="fitView"?d.setState({fitViewQueued:b}):p==="fitViewOptions"?d.setState({fitViewOptions:b}):d.setState({[p]:b})))}g.current=e},f1.map(p=>e[p])),null}function h1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Y5(e){const[t,i]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){i(e);return}const l=h1(),o=()=>i(l?.matches?"dark":"light");return o(),l?.addEventListener("change",o),()=>{l?.removeEventListener("change",o)}},[e]),t!==null?t:h1()?.matches?"dark":"light"}const p1=typeof document<"u"?document:null;function Mo(e=null,t={target:p1,actInsideInputWithModifier:!0}){const[i,l]=R.useState(!1),o=R.useRef(!1),s=R.useRef(new Set([])),[u,f]=R.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
18
+ `).replace(`
19
+
20
+ `,`
21
+ +`).split(`
22
+ `)),g=d.reduce((p,b)=>p.concat(...b),[]);return[d,g]}return[[],[]]},[e]);return R.useEffect(()=>{const h=t?.target??p1,d=t?.actInsideInputWithModifier??!0;if(e!==null){const g=v=>{if(o.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!o.current||o.current&&!d)&&Fv(v))return!1;const E=g1(v.code,f);if(s.current.add(v[E]),m1(u,s.current,!1)){const C=v.composedPath?.()?.[0]||v.target,N=C?.nodeName==="BUTTON"||C?.nodeName==="A";t.preventDefault!==!1&&(o.current||!N)&&v.preventDefault(),l(!0)}},p=v=>{const w=g1(v.code,f);m1(u,s.current,!0)?(l(!1),s.current.clear()):s.current.delete(v[w]),v.key==="Meta"&&s.current.clear(),o.current=!1},b=()=>{s.current.clear(),l(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",p),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",p),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[e,l]),i}function m1(e,t,i){return e.filter(l=>i||l.length===t.size).some(l=>l.every(o=>t.has(o)))}function g1(e,t){return t.includes(e)?"code":"key"}const F5=()=>{const e=ot();return R.useMemo(()=>({zoomIn:t=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,i)=>{const{panZoom:l}=e.getState();return l?l.scaleTo(t,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,i)=>{const{transform:[l,o,s],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??l,y:t.y??o,zoom:t.zoom??s},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,i,l]=e.getState().transform;return{x:t,y:i,zoom:l}},setCenter:async(t,i,l)=>e.getState().setCenter(t,i,l),fitBounds:async(t,i)=>{const{width:l,height:o,minZoom:s,maxZoom:u,panZoom:f}=e.getState(),h=Yp(t,l,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:(t,i={})=>{const{transform:l,snapGrid:o,snapToGrid:s,domNode:u}=e.getState();if(!u)return t;const{x:f,y:h}=u.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},g=i.snapGrid??o,p=i.snapToGrid??s;return Fo(d,l,p,g)},flowToScreenPosition:t=>{const{transform:i,domNode:l}=e.getState();if(!l)return t;const{x:o,y:s}=l.getBoundingClientRect(),u=oc(t,i);return{x:u.x+o,y:u.y+s}}}),[])};function pw(e,t){const i=[],l=new Map,o=[];for(const s of e)if(s.type==="add"){o.push(s);continue}else if(s.type==="remove"||s.type==="replace")l.set(s.id,[s]);else{const u=l.get(s.id);u?u.push(s):l.set(s.id,[s])}for(const s of t){const u=l.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)X5(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 X5(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function $u(e,t){return pw(e,t)}function mw(e,t){return pw(e,t)}function Lr(e,t){return{id:e,type:"select",selected:t}}function Hl(e,t=new Set,i=!1){const l=[];for(const[o,s]of e){const u=t.has(o);!(s.selected===void 0&&!u)&&s.selected!==u&&(i&&(s.selected=u),l.push(Lr(s.id,u)))}return l}function y1({items:e=[],lookup:t}){const i=[],l=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const u=t.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 t)l.get(o)===void 0&&i.push({id:o,type:"remove"});return i}function x1(e){return{id:e.id,type:"remove"}}const b1=e=>xA(e),G5=e=>Hv(e);function gw(e){return R.forwardRef(e)}const Z5=typeof window<"u"?R.useLayoutEffect:R.useEffect;function v1(e){const[t,i]=R.useState(BigInt(0)),[l]=R.useState(()=>Q5(()=>i(o=>o+BigInt(1))));return Z5(()=>{const o=l.get();o.length&&(e(o),l.reset())},[t]),l}function Q5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:i=>{t.push(i),e()}}}const yw=R.createContext(null);function K5({children:e}){const t=ot(),i=R.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:p,nodeLookup:b,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let E=h;for(const N of f)E=typeof N=="function"?N(E):N;let C=y1({items:E,lookup:b});for(const N of w.values())C=N(C);g&&d(E),C.length>0?p?.(C):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:_,setNodes:k}=t.getState();N&&k(_)})},[]),l=v1(i),o=R.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:p,edgeLookup:b}=t.getState();let v=h;for(const w of f)v=typeof w=="function"?w(v):w;g?d(v):p&&p(y1({items:v,lookup:b}))},[]),s=v1(o),u=R.useMemo(()=>({nodeQueue:l,edgeQueue:s}),[]);return x.jsx(yw.Provider,{value:u,children:e})}function J5(){const e=R.useContext(yw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const W5=e=>!!e.panZoom;function Jp(){const e=F5(),t=ot(),i=J5(),l=Ve(W5),o=R.useMemo(()=>{const s=p=>t.getState().nodeLookup.get(p),u=p=>{i.nodeQueue.push(p)},f=p=>{i.edgeQueue.push(p)},h=p=>{const{nodeLookup:b,nodeOrigin:v}=t.getState(),w=b1(p)?p:b.get(p.id),E=w.parentId?Pv(w.position,w.measured,w.parentId,b,v):w.position,C={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return Fl(C)},d=(p,b,v={replace:!1})=>{u(w=>w.map(E=>{if(E.id===p){const C=typeof b=="function"?b(E):b;return v.replace&&b1(C)?C:{...E,...C}}return E}))},g=(p,b,v={replace:!1})=>{f(w=>w.map(E=>{if(E.id===p){const C=typeof b=="function"?b(E):b;return v.replace&&G5(C)?C:{...E,...C}}return E}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>s(p)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(b=>({...b}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:u,setEdges:f,addNodes:p=>{const b=Array.isArray(p)?p:[p];i.nodeQueue.push(v=>[...v,...b])},addEdges:p=>{const b=Array.isArray(p)?p:[p];i.edgeQueue.push(v=>[...v,...b])},toObject:()=>{const{nodes:p=[],edges:b=[],transform:v}=t.getState(),[w,E,C]=v;return{nodes:p.map(N=>({...N})),edges:b.map(N=>({...N})),viewport:{x:w,y:E,zoom:C}}},deleteElements:async({nodes:p=[],edges:b=[]})=>{const{nodes:v,edges:w,onNodesDelete:E,onEdgesDelete:C,triggerNodeChanges:N,triggerEdgeChanges:_,onDelete:k,onBeforeDelete:T}=t.getState(),{nodes:B,edges:A}=await kA({nodesToRemove:p,edgesToRemove:b,nodes:v,edges:w,onBeforeDelete:T}),L=A.length>0,X=B.length>0;if(L){const Z=A.map(x1);C?.(A),_(Z)}if(X){const Z=B.map(x1);E?.(B),N(Z)}return(X||L)&&k?.({nodes:B,edges:A}),{deletedNodes:B,deletedEdges:A}},getIntersectingNodes:(p,b=!0,v)=>{const w=Yx(p),E=w?p:h(p),C=v!==void 0;return E?(v||t.getState().nodes).filter(N=>{const _=t.getState().nodeLookup.get(N.id);if(_&&!w&&(N.id===p.id||!_.internals.positionAbsolute))return!1;const k=Fl(C?N:_),T=To(k,E);return b&&T>0||T>=k.width*k.height||T>=E.width*E.height}):[]},isNodeIntersecting:(p,b,v=!0)=>{const E=Yx(p)?p:h(p);if(!E)return!1;const C=To(E,b);return v&&C>0||C>=b.width*b.height||C>=E.width*E.height},updateNode:d,updateNodeData:(p,b,v={replace:!1})=>{d(p,w=>{const E=typeof b=="function"?b(w):b;return v.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},v)},updateEdge:g,updateEdgeData:(p,b,v={replace:!1})=>{g(p,w=>{const E=typeof b=="function"?b(w):b;return v.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},v)},getNodesBounds:p=>{const{nodeLookup:b,nodeOrigin:v}=t.getState();return bA(p,{nodeLookup:b,nodeOrigin:v})},getHandleConnections:({type:p,id:b,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}-${p}${b?`-${b}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:b,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}${p?b?`-${p}-${b}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const b=t.getState().fitViewResolver??_A();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:b}),i.nodeQueue.push(v=>[...v]),b.promise}}},[]);return R.useMemo(()=>({...o,...e,viewportInitialized:l}),[l])}const w1=e=>e.selected,eM=typeof window<"u"?window:void 0;function tM({deleteKeyCode:e,multiSelectionKeyCode:t}){const i=ot(),{deleteElements:l}=Jp(),o=Mo(e,{actInsideInputWithModifier:!1}),s=Mo(t,{target:eM});R.useEffect(()=>{if(o){const{edges:u,nodes:f}=i.getState();l({nodes:f.filter(w1),edges:u.filter(w1)}),i.setState({nodesSelectionActive:!1})}},[o]),R.useEffect(()=>{i.setState({multiSelectionActive:s})},[s])}function nM(e){const t=ot();R.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const l=Fp(e.current);(l.height===0||l.width===0)&&t.getState().onError?.("004",Qn.error004()),t.setState({width:l.width||500,height:l.height||500})};if(e.current){i(),window.addEventListener("resize",i);const l=new ResizeObserver(()=>i());return l.observe(e.current),()=>{window.removeEventListener("resize",i),l&&e.current&&l.unobserve(e.current)}}},[])}const jc={position:"absolute",width:"100%",height:"100%",top:0,left:0},iM=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function rM({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:i=!0,panOnScroll:l=!1,panOnScrollSpeed:o=.5,panOnScrollMode:s=Ur.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:p,zoomActivationKeyCode:b,preventScrolling:v=!0,children:w,noWheelClassName:E,noPanClassName:C,onViewportChange:N,isControlledViewport:_,paneClickDistance:k,selectionOnDrag:T}){const B=ot(),A=R.useRef(null),{userSelectionActive:L,lib:X,connectionInProgress:Z}=Ve(iM,at),U=Mo(b),I=R.useRef();nM(A);const P=R.useCallback(ee=>{N?.({x:ee[0],y:ee[1],zoom:ee[2]}),_||B.setState({transform:ee})},[N,_]);return R.useEffect(()=>{if(A.current){I.current=u5({domNode:A.current,minZoom:g,maxZoom:p,translateExtent:d,viewport:h,onDraggingChange:D=>B.setState({paneDragging:D}),onPanZoomStart:(D,V)=>{const{onViewportChangeStart:F,onMoveStart:K}=B.getState();K?.(D,V),F?.(V)},onPanZoom:(D,V)=>{const{onViewportChange:F,onMove:K}=B.getState();K?.(D,V),F?.(V)},onPanZoomEnd:(D,V)=>{const{onViewportChangeEnd:F,onMoveEnd:K}=B.getState();K?.(D,V),F?.(V)}});const{x:ee,y:H,zoom:q}=I.current.getViewport();return B.setState({panZoom:I.current,transform:[ee,H,q],domNode:A.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),R.useEffect(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:o,panOnScrollMode:s,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:U,preventScrolling:v,noPanClassName:C,userSelectionActive:L,noWheelClassName:E,lib:X,onTransformChange:P,connectionInProgress:Z,selectionOnDrag:T,paneClickDistance:k})},[e,t,i,l,o,s,u,f,U,v,C,L,E,X,P,Z,T,k]),x.jsx("div",{className:"react-flow__renderer",ref:A,style:jc,children:w})}const lM=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function aM(){const{userSelectionActive:e,userSelectionRect:t}=Ve(lM,at);return e&&t?x.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const vh=(e,t)=>i=>{i.target===t.current&&e?.(i)},oM=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function sM({isSelecting:e,selectionKeyPressed:t,selectionMode:i=_o.Full,panOnDrag:l,paneClickDistance:o,selectionOnDrag:s,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:p,onPaneMouseMove:b,onPaneMouseLeave:v,children:w}){const E=ot(),{userSelectionActive:C,elementsSelectable:N,dragging:_,connectionInProgress:k}=Ve(oM,at),T=N&&(e||C),B=R.useRef(null),A=R.useRef(),L=R.useRef(new Set),X=R.useRef(new Set),Z=R.useRef(!1),U=F=>{if(Z.current||k){Z.current=!1;return}h?.(F),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},I=F=>{if(Array.isArray(l)&&l?.includes(2)){F.preventDefault();return}d?.(F)},P=g?F=>g(F):void 0,ee=F=>{Z.current&&(F.stopPropagation(),Z.current=!1)},H=F=>{const{domNode:K}=E.getState();if(A.current=K?.getBoundingClientRect(),!A.current)return;const z=F.target===B.current;if(!z&&!!F.target.closest(".nokey")||!e||!(s&&z||t)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),Z.current=!1;const{x:j,y:ne}=Ln(F.nativeEvent,A.current);E.setState({userSelectionRect:{width:0,height:0,startX:j,startY:ne,x:j,y:ne}}),z||(F.stopPropagation(),F.preventDefault())},q=F=>{const{userSelectionRect:K,transform:z,nodeLookup:O,edgeLookup:Y,connectionLookup:j,triggerNodeChanges:ne,triggerEdgeChanges:ue,defaultEdgeOptions:ce,resetSelectedElements:de}=E.getState();if(!A.current||!K)return;const{x:se,y:pe}=Ln(F.nativeEvent,A.current),{startX:ke,startY:Ne}=K;if(!Z.current){const $e=t?0:o;if(Math.hypot(se-ke,pe-Ne)<=$e)return;de(),u?.(F)}Z.current=!0;const be={startX:ke,startY:Ne,x:se<ke?se:ke,y:pe<Ne?pe:Ne,width:Math.abs(se-ke),height:Math.abs(pe-Ne)},Ee=L.current,ze=X.current;L.current=new Set(Pp(O,be,z,i===_o.Partial,!0).map($e=>$e.id)),X.current=new Set;const Fe=ce?.selectable??!0;for(const $e of L.current){const ft=j.get($e);if(ft)for(const{edgeId:tn}of ft.values()){const Rt=Y.get(tn);Rt&&(Rt.selectable??Fe)&&X.current.add(tn)}}if(!Fx(Ee,L.current)){const $e=Hl(O,L.current,!0);ne($e)}if(!Fx(ze,X.current)){const $e=Hl(Y,X.current);ue($e)}E.setState({userSelectionRect:be,userSelectionActive:!0,nodesSelectionActive:!1})},D=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!C&&F.target===B.current&&E.getState().userSelectionRect&&U?.(F),E.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f?.(F),E.setState({nodesSelectionActive:L.current.size>0})))},V=l===!0||Array.isArray(l)&&l.includes(0);return x.jsxs("div",{className:St(["react-flow__pane",{draggable:V,dragging:_,selection:e}]),onClick:T?void 0:vh(U,B),onContextMenu:vh(I,B),onWheel:vh(P,B),onPointerEnter:T?void 0:p,onPointerMove:T?q:b,onPointerUp:T?D:void 0,onPointerDownCapture:T?H:void 0,onClickCapture:T?ee:void 0,onPointerLeave:v,ref:B,style:jc,children:[w,x.jsx(aM,{})]})}function sp({id:e,store:t,unselect:i=!1,nodeRef:l}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:u,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",Qn.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(i||d.selected&&u)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>l?.current?.blur())):o([e])}function xw({nodeRef:e,disabled:t=!1,noDragClassName:i,handleSelector:l,nodeId:o,isSelectable:s,nodeClickDistance:u}){const f=ot(),[h,d]=R.useState(!1),g=R.useRef();return R.useEffect(()=>{g.current=ZA({getStoreItems:()=>f.getState(),onNodeMouseDown:p=>{sp({id:p,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),R.useEffect(()=>{if(t)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:i,handleSelector:l,domNode:e.current,isSelectable:s,nodeId:o,nodeClickDistance:u}),()=>{g.current?.destroy()}},[i,l,t,s,e,o]),h}const uM=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function bw(){const e=ot();return R.useCallback(i=>{const{nodeExtent:l,snapToGrid:o,snapGrid:s,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),p=new Map,b=uM(u),v=o?s[0]:5,w=o?s[1]:5,E=i.direction.x*v*i.factor,C=i.direction.y*w*i.factor;for(const[,N]of d){if(!b(N))continue;let _={x:N.internals.positionAbsolute.x+E,y:N.internals.positionAbsolute.y+C};o&&(_=Yo(_,s));const{position:k,positionAbsolute:T}=Uv({nodeId:N.id,nextPosition:_,nodeLookup:d,nodeExtent:l,nodeOrigin:g,onError:f});N.position=k,N.internals.positionAbsolute=T,p.set(N.id,N)}h(p)},[])}const Wp=R.createContext(null),cM=Wp.Provider;Wp.Consumer;const vw=()=>R.useContext(Wp),fM=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),dM=(e,t,i)=>l=>{const{connectionClickStartHandle:o,connectionMode:s,connection:u}=l,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===t&&h?.type===i;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===i,connectingTo:g,clickConnecting:o?.nodeId===e&&o?.id===t&&o?.type===i,isPossibleEndHandle:s===Pl.Strict?f?.type!==i:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!o,valid:g&&d}};function hM({type:e="source",position:t=ye.Top,isValidConnection:i,isConnectable:l=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:p,...b},v){const w=u||null,E=e==="target",C=ot(),N=vw(),{connectOnClick:_,noPanClassName:k,rfId:T}=Ve(fM,at),{connectingFrom:B,connectingTo:A,clickConnecting:L,isPossibleEndHandle:X,connectionInProcess:Z,clickConnectionInProcess:U,valid:I}=Ve(dM(N,w,e),at);N||C.getState().onError?.("010",Qn.error010());const P=q=>{const{defaultEdgeOptions:D,onConnect:V,hasDefaultEdges:F}=C.getState(),K={...D,...q};if(F){const{edges:z,setEdges:O}=C.getState();O(ip(K,z))}V?.(K),f?.(K)},ee=q=>{if(!N)return;const D=Xv(q.nativeEvent);if(o&&(D&&q.button===0||!D)){const V=C.getState();op.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:E,handleId:w,nodeId:N,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:V.onConnectEnd,updateConnection:V.updateConnection,onConnect:P,isValidConnection:i||V.isValidConnection,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}D?g?.(q):p?.(q)},H=q=>{const{onClickConnectStart:D,onClickConnectEnd:V,connectionClickStartHandle:F,connectionMode:K,isValidConnection:z,lib:O,rfId:Y,nodeLookup:j,connection:ne}=C.getState();if(!N||!F&&!o)return;if(!F){D?.(q.nativeEvent,{nodeId:N,handleId:w,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:N,type:e,id:w}});return}const ue=Yv(q.target),ce=i||z,{connection:de,isValid:se}=op.isValid(q.nativeEvent,{handle:{nodeId:N,id:w,type:e},connectionMode:K,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:ce,flowId:Y,doc:ue,lib:O,nodeLookup:j});se&&de&&P(de);const pe=structuredClone(ne);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,V?.(q,pe),C.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":w,"data-nodeid":N,"data-handlepos":t,"data-id":`${T}-${N}-${w}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",k,d,{source:!E,target:E,connectable:l,connectablestart:o,connectableend:s,clickconnecting:L,connectingfrom:B,connectingto:A,valid:I,connectionindicator:l&&(!Z||X)&&(Z||U?s:o)}]),onMouseDown:ee,onTouchStart:ee,onClick:_?H:void 0,ref:v,...b,children:h})}const Zl=R.memo(gw(hM));function pM({data:e,isConnectable:t,sourcePosition:i=ye.Bottom}){return x.jsxs(x.Fragment,{children:[e?.label,x.jsx(Zl,{type:"source",position:i,isConnectable:t})]})}function mM({data:e,isConnectable:t,targetPosition:i=ye.Top,sourcePosition:l=ye.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(Zl,{type:"target",position:i,isConnectable:t}),e?.label,x.jsx(Zl,{type:"source",position:l,isConnectable:t})]})}function gM(){return null}function yM({data:e,isConnectable:t,targetPosition:i=ye.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(Zl,{type:"target",position:i,isConnectable:t}),e?.label]})}const sc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},S1={input:pM,default:mM,output:yM,group:gM};function xM(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 bM=e=>{const{width:t,height:i,x:l,y:o}=Po(e.nodeLookup,{filter:s=>!!s.selected});return{width:On(t)?t:null,height:On(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${l}px,${o}px)`}};function vM({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:i}){const l=ot(),{width:o,height:s,transformString:u,userSelectionActive:f}=Ve(bM,at),h=bw(),d=R.useRef(null);if(R.useEffect(()=>{i||d.current?.focus({preventScroll:!0})},[i]),xw({nodeRef:d}),f||!o||!s)return null;const g=e?b=>{const v=l.getState().nodes.filter(w=>w.selected);e(b,v)}:void 0,p=b=>{Object.prototype.hasOwnProperty.call(sc,b.key)&&(b.preventDefault(),h({direction:sc[b.key],factor:b.shiftKey?4:1}))};return x.jsx("div",{className:St(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:x.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:p,style:{width:o,height:s}})})}const k1=typeof window<"u"?window:void 0,wM=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ww({children:e,onPaneClick:t,onPaneMouseEnter:i,onPaneMouseMove:l,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:p,onSelectionStart:b,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:N,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:T,panOnScrollSpeed:B,panOnScrollMode:A,zoomOnDoubleClick:L,panOnDrag:X,defaultViewport:Z,translateExtent:U,minZoom:I,maxZoom:P,preventScrolling:ee,onSelectionContextMenu:H,noWheelClassName:q,noPanClassName:D,disableKeyboardA11y:V,onViewportChange:F,isControlledViewport:K}){const{nodesSelectionActive:z,userSelectionActive:O}=Ve(wM,at),Y=Mo(d,{target:k1}),j=Mo(E,{target:k1}),ne=j||X,ue=j||T,ce=g&&ne!==!0,de=Y||O||ce;return tM({deleteKeyCode:h,multiSelectionKeyCode:w}),x.jsx(rM,{onPaneContextMenu:s,elementsSelectable:N,zoomOnScroll:_,zoomOnPinch:k,panOnScroll:ue,panOnScrollSpeed:B,panOnScrollMode:A,zoomOnDoubleClick:L,panOnDrag:!Y&&ne,defaultViewport:Z,translateExtent:U,minZoom:I,maxZoom:P,zoomActivationKeyCode:C,preventScrolling:ee,noWheelClassName:q,noPanClassName:D,onViewportChange:F,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:ce,children:x.jsxs(sM,{onSelectionStart:b,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:i,onPaneMouseMove:l,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:u,panOnDrag:ne,isSelecting:!!de,selectionMode:p,selectionKeyPressed:Y,paneClickDistance:f,selectionOnDrag:ce,children:[e,z&&x.jsx(vM,{onSelectionContextMenu:H,noPanClassName:D,disableKeyboardA11y:V})]})})}ww.displayName="FlowRenderer";const SM=R.memo(ww),kM=e=>t=>e?Pp(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(i=>i.id):Array.from(t.nodeLookup.keys());function EM(e){return Ve(R.useCallback(kM(e),[e]),at)}const NM=e=>e.updateNodeInternals;function CM(){const e=Ve(NM),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const l=new Map;i.forEach(o=>{const s=o.target.getAttribute("data-id");l.set(s,{id:s,nodeElement:o.target,force:!0})}),e(l)}));return R.useEffect(()=>()=>{t?.disconnect()},[t]),t}function _M({node:e,nodeType:t,hasDimensions:i,resizeObserver:l}){const o=ot(),s=R.useRef(null),u=R.useRef(null),f=R.useRef(e.sourcePosition),h=R.useRef(e.targetPosition),d=R.useRef(t),g=i&&!!e.internals.handleBounds;return R.useEffect(()=>{s.current&&!e.hidden&&(!g||u.current!==s.current)&&(u.current&&l?.unobserve(u.current),l?.observe(s.current),u.current=s.current)},[g,e.hidden]),R.useEffect(()=>()=>{u.current&&(l?.unobserve(u.current),u.current=null)},[]),R.useEffect(()=>{if(s.current){const p=d.current!==t,b=f.current!==e.sourcePosition,v=h.current!==e.targetPosition;(p||b||v)&&(d.current=t,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,t,e.sourcePosition,e.targetPosition]),s}function TM({id:e,onClick:t,onMouseEnter:i,onMouseMove:l,onMouseLeave:o,onContextMenu:s,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:p,noDragClassName:b,noPanClassName:v,disableKeyboardA11y:w,rfId:E,nodeTypes:C,nodeClickDistance:N,onError:_}){const{node:k,internals:T,isParent:B}=Ve(se=>{const pe=se.nodeLookup.get(e),ke=se.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:ke}},at);let A=k.type||"default",L=C?.[A]||S1[A];L===void 0&&(_?.("003",Qn.error003(A)),A="default",L=C?.default||S1.default);const X=!!(k.draggable||f&&typeof k.draggable>"u"),Z=!!(k.selectable||h&&typeof k.selectable>"u"),U=!!(k.connectable||d&&typeof k.connectable>"u"),I=!!(k.focusable||g&&typeof k.focusable>"u"),P=ot(),ee=$v(k),H=_M({node:k,nodeType:A,hasDimensions:ee,resizeObserver:p}),q=xw({nodeRef:H,disabled:k.hidden||!X,noDragClassName:b,handleSelector:k.dragHandle,nodeId:e,isSelectable:Z,nodeClickDistance:N}),D=bw();if(k.hidden)return null;const V=ji(k),F=xM(k),K=Z||X||t||i||l||o,z=i?se=>i(se,{...T.userNode}):void 0,O=l?se=>l(se,{...T.userNode}):void 0,Y=o?se=>o(se,{...T.userNode}):void 0,j=s?se=>s(se,{...T.userNode}):void 0,ne=u?se=>u(se,{...T.userNode}):void 0,ue=se=>{const{selectNodesOnDrag:pe,nodeDragThreshold:ke}=P.getState();Z&&(!pe||!X||ke>0)&&sp({id:e,store:P,nodeRef:H}),t&&t(se,{...T.userNode})},ce=se=>{if(!(Fv(se.nativeEvent)||w)){if(Dv.includes(se.key)&&Z){const pe=se.key==="Escape";sp({id:e,store:P,unselect:pe,nodeRef:H})}else if(X&&k.selected&&Object.prototype.hasOwnProperty.call(sc,se.key)){se.preventDefault();const{ariaLabelConfig:pe}=P.getState();P.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),D({direction:sc[se.key],factor:se.shiftKey?4:1})}}},de=()=>{if(w||!H.current?.matches(":focus-visible"))return;const{transform:se,width:pe,height:ke,autoPanOnNodeFocus:Ne,setCenter:be}=P.getState();if(!Ne)return;Pp(new Map([[e,k]]),{x:0,y:0,width:pe,height:ke},se,!0).length>0||be(k.position.x+V.width/2,k.position.y+V.height/2,{zoom:se[2]})};return x.jsx("div",{className:St(["react-flow__node",`react-flow__node-${A}`,{[v]:X},k.className,{selected:k.selected,selectable:Z,parent:B,draggable:X,dragging:q}]),ref:H,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:ee?"visible":"hidden",...k.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:O,onMouseLeave:Y,onContextMenu:j,onClick:ue,onDoubleClick:ne,onKeyDown:I?ce:void 0,tabIndex:I?0:void 0,onFocus:I?de:void 0,role:k.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${fw}-${E}`,"aria-label":k.ariaLabel,...k.domAttributes,children:x.jsx(cM,{value:e,children:x.jsx(L,{id:e,data:k.data,type:A,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:k.selected??!1,selectable:Z,draggable:X,deletable:k.deletable??!0,isConnectable:U,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:q,dragHandle:k.dragHandle,zIndex:T.z,parentId:k.parentId,...V})})})}var AM=R.memo(TM);const MM=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Sw(e){const{nodesDraggable:t,nodesConnectable:i,nodesFocusable:l,elementsSelectable:o,onError:s}=Ve(MM,at),u=EM(e.onlyRenderVisibleElements),f=CM();return x.jsx("div",{className:"react-flow__nodes",style:jc,children:u.map(h=>x.jsx(AM,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:i,nodesFocusable:l,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:s},h))})}Sw.displayName="NodeRenderer";const jM=R.memo(Sw);function zM(e){return Ve(R.useCallback(i=>{if(!e)return i.edges.map(o=>o.id);const l=[];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&&jA({sourceNode:s,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&l.push(o.id)}return l},[e]),at)}const RM=({color:e="none",strokeWidth:t=1})=>{const i={strokeWidth:t,...e&&{stroke:e}};return x.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},DM=({color:e="none",strokeWidth:t=1})=>{const i={strokeWidth:t,...e&&{stroke:e,fill:e}};return x.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},E1={[lc.Arrow]:RM,[lc.ArrowClosed]:DM};function OM(e){const t=ot();return R.useMemo(()=>Object.prototype.hasOwnProperty.call(E1,e)?E1[e]:(t.getState().onError?.("009",Qn.error009(e)),null),[e])}const LM=({id:e,type:t,color:i,width:l=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=OM(t);return h?x.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${l}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:x.jsx(h,{color:i,strokeWidth:u})}):null},kw=({defaultColor:e,rfId:t})=>{const i=Ve(s=>s.edges),l=Ve(s=>s.defaultEdgeOptions),o=R.useMemo(()=>HA(i,{id:t,defaultColor:e,defaultMarkerStart:l?.markerStart,defaultMarkerEnd:l?.markerEnd}),[i,l,t,e]);return o.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:o.map(s=>x.jsx(LM,{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};kw.displayName="MarkerDefinitions";var BM=R.memo(kw);function Ew({x:e,y:t,label:i,labelStyle:l,labelShowBg:o=!0,labelBgStyle:s,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[p,b]=R.useState({x:1,y:0,width:0,height:0}),v=St(["react-flow__edge-textwrapper",d]),w=R.useRef(null);return R.useEffect(()=>{if(w.current){const E=w.current.getBBox();b({x:E.x,y:E.y,width:E.width,height:E.height})}},[i]),i?x.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:v,visibility:p.width?"visible":"hidden",...g,children:[o&&x.jsx("rect",{width:p.width+2*u[0],x:-u[0],y:-u[1],height:p.height+2*u[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),x.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:w,style:l,children:i}),h]}):null}Ew.displayName="EdgeText";const HM=R.memo(Ew);function zc({path:e,labelX:t,labelY:i,label:l,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...g,d:e,fill:"none",className:St(["react-flow__edge-path",g.className])}),d?x.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,l&&On(t)&&On(i)?x.jsx(HM,{x:t,y:i,label:l,labelStyle:o,labelShowBg:s,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function N1({pos:e,x1:t,y1:i,x2:l,y2:o}){return e===ye.Left||e===ye.Right?[.5*(t+l),i]:[t,.5*(i+o)]}function Nw({sourceX:e,sourceY:t,sourcePosition:i=ye.Bottom,targetX:l,targetY:o,targetPosition:s=ye.Top}){const[u,f]=N1({pos:i,x1:e,y1:t,x2:l,y2:o}),[h,d]=N1({pos:s,x1:l,y1:o,x2:e,y2:t}),[g,p,b,v]=Gv({sourceX:e,sourceY:t,targetX:l,targetY:o,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${u},${f} ${h},${d} ${l},${o}`,g,p,b,v]}function Cw(e){return R.memo(({id:t,sourceX:i,sourceY:l,targetX:o,targetY:s,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:p,labelBgPadding:b,labelBgBorderRadius:v,style:w,markerEnd:E,markerStart:C,interactionWidth:N})=>{const[_,k,T]=Nw({sourceX:i,sourceY:l,sourcePosition:u,targetX:o,targetY:s,targetPosition:f}),B=e.isInternal?void 0:t;return x.jsx(zc,{id:B,path:_,labelX:k,labelY:T,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:p,labelBgPadding:b,labelBgBorderRadius:v,style:w,markerEnd:E,markerStart:C,interactionWidth:N})})}const UM=Cw({isInternal:!1}),_w=Cw({isInternal:!0});UM.displayName="SimpleBezierEdge";_w.displayName="SimpleBezierEdgeInternal";function Tw(e){return R.memo(({id:t,sourceX:i,sourceY:l,targetX:o,targetY:s,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:p,style:b,sourcePosition:v=ye.Bottom,targetPosition:w=ye.Top,markerEnd:E,markerStart:C,pathOptions:N,interactionWidth:_})=>{const[k,T,B]=rp({sourceX:i,sourceY:l,sourcePosition:v,targetX:o,targetY:s,targetPosition:w,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),A=e.isInternal?void 0:t;return x.jsx(zc,{id:A,path:k,labelX:T,labelY:B,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:p,style:b,markerEnd:E,markerStart:C,interactionWidth:_})})}const Aw=Tw({isInternal:!1}),Mw=Tw({isInternal:!0});Aw.displayName="SmoothStepEdge";Mw.displayName="SmoothStepEdgeInternal";function jw(e){return R.memo(({id:t,...i})=>{const l=e.isInternal?void 0:t;return x.jsx(Aw,{...i,id:l,pathOptions:R.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const IM=jw({isInternal:!1}),zw=jw({isInternal:!0});IM.displayName="StepEdge";zw.displayName="StepEdgeInternal";function Rw(e){return R.memo(({id:t,sourceX:i,sourceY:l,targetX:o,targetY:s,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:p,style:b,markerEnd:v,markerStart:w,interactionWidth:E})=>{const[C,N,_]=Kv({sourceX:i,sourceY:l,targetX:o,targetY:s}),k=e.isInternal?void 0:t;return x.jsx(zc,{id:k,path:C,labelX:N,labelY:_,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:p,style:b,markerEnd:v,markerStart:w,interactionWidth:E})})}const qM=Rw({isInternal:!1}),Dw=Rw({isInternal:!0});qM.displayName="StraightEdge";Dw.displayName="StraightEdgeInternal";function Ow(e){return R.memo(({id:t,sourceX:i,sourceY:l,targetX:o,targetY:s,sourcePosition:u=ye.Bottom,targetPosition:f=ye.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:p,labelBgPadding:b,labelBgBorderRadius:v,style:w,markerEnd:E,markerStart:C,pathOptions:N,interactionWidth:_})=>{const[k,T,B]=Zv({sourceX:i,sourceY:l,sourcePosition:u,targetX:o,targetY:s,targetPosition:f,curvature:N?.curvature}),A=e.isInternal?void 0:t;return x.jsx(zc,{id:A,path:k,labelX:T,labelY:B,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:p,labelBgPadding:b,labelBgBorderRadius:v,style:w,markerEnd:E,markerStart:C,interactionWidth:_})})}const VM=Ow({isInternal:!1}),Lw=Ow({isInternal:!0});VM.displayName="BezierEdge";Lw.displayName="BezierEdgeInternal";const C1={default:Lw,straight:Dw,step:zw,smoothstep:Mw,simplebezier:_w},_1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$M=(e,t,i)=>i===ye.Left?e-t:i===ye.Right?e+t:e,PM=(e,t,i)=>i===ye.Top?e-t:i===ye.Bottom?e+t:e,T1="react-flow__edgeupdater";function A1({position:e,centerX:t,centerY:i,radius:l=10,onMouseDown:o,onMouseEnter:s,onMouseOut:u,type:f}){return x.jsx("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:u,className:St([T1,`${T1}-${f}`]),cx:$M(t,l,e),cy:PM(i,l,e),r:l,stroke:"transparent",fill:"transparent"})}function YM({isReconnectable:e,reconnectRadius:t,edge:i,sourceX:l,sourceY:o,targetX:s,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:p,setReconnecting:b,setUpdateHover:v}){const w=ot(),E=(T,B)=>{if(T.button!==0)return;const{autoPanOnConnect:A,domNode:L,isValidConnection:X,connectionMode:Z,connectionRadius:U,lib:I,onConnectStart:P,onConnectEnd:ee,cancelConnection:H,nodeLookup:q,rfId:D,panBy:V,updateConnection:F}=w.getState(),K=B.type==="target",z=(j,ne)=>{b(!1),p?.(j,i,B.type,ne)},O=j=>d?.(i,j),Y=(j,ne)=>{b(!0),g?.(T,i,B.type),P?.(j,ne)};op.onPointerDown(T.nativeEvent,{autoPanOnConnect:A,connectionMode:Z,connectionRadius:U,domNode:L,handleId:B.id,nodeId:B.nodeId,nodeLookup:q,isTarget:K,edgeUpdaterType:B.type,lib:I,flowId:D,cancelConnection:H,panBy:V,isValidConnection:X,onConnect:O,onConnectStart:Y,onConnectEnd:ee,onReconnectEnd:z,updateConnection:F,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},C=T=>E(T,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),N=T=>E(T,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),_=()=>v(!0),k=()=>v(!1);return x.jsxs(x.Fragment,{children:[(e===!0||e==="source")&&x.jsx(A1,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:C,onMouseEnter:_,onMouseOut:k,type:"source"}),(e===!0||e==="target")&&x.jsx(A1,{position:h,centerX:s,centerY:u,radius:t,onMouseDown:N,onMouseEnter:_,onMouseOut:k,type:"target"})]})}function FM({id:e,edgesFocusable:t,edgesReconnectable:i,elementsSelectable:l,onClick:o,onDoubleClick:s,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:p,onReconnectStart:b,onReconnectEnd:v,rfId:w,edgeTypes:E,noPanClassName:C,onError:N,disableKeyboardA11y:_}){let k=Ve(be=>be.edgeLookup.get(e));const T=Ve(be=>be.defaultEdgeOptions);k=T?{...T,...k}:k;let B=k.type||"default",A=E?.[B]||C1[B];A===void 0&&(N?.("011",Qn.error011(B)),B="default",A=E?.default||C1.default);const L=!!(k.focusable||t&&typeof k.focusable>"u"),X=typeof p<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),Z=!!(k.selectable||l&&typeof k.selectable>"u"),U=R.useRef(null),[I,P]=R.useState(!1),[ee,H]=R.useState(!1),q=ot(),{zIndex:D,sourceX:V,sourceY:F,targetX:K,targetY:z,sourcePosition:O,targetPosition:Y}=Ve(R.useCallback(be=>{const Ee=be.nodeLookup.get(k.source),ze=be.nodeLookup.get(k.target);if(!Ee||!ze)return{zIndex:k.zIndex,..._1};const Fe=BA({id:e,sourceNode:Ee,targetNode:ze,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:be.connectionMode,onError:N});return{zIndex:MA({selected:k.selected,zIndex:k.zIndex,sourceNode:Ee,targetNode:ze,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode}),...Fe||_1}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),at),j=R.useMemo(()=>k.markerStart?`url('#${lp(k.markerStart,w)}')`:void 0,[k.markerStart,w]),ne=R.useMemo(()=>k.markerEnd?`url('#${lp(k.markerEnd,w)}')`:void 0,[k.markerEnd,w]);if(k.hidden||V===null||F===null||K===null||z===null)return null;const ue=be=>{const{addSelectedEdges:Ee,unselectNodesAndEdges:ze,multiSelectionActive:Fe}=q.getState();Z&&(q.setState({nodesSelectionActive:!1}),k.selected&&Fe?(ze({nodes:[],edges:[k]}),U.current?.blur()):Ee([e])),o&&o(be,k)},ce=s?be=>{s(be,{...k})}:void 0,de=u?be=>{u(be,{...k})}:void 0,se=f?be=>{f(be,{...k})}:void 0,pe=h?be=>{h(be,{...k})}:void 0,ke=d?be=>{d(be,{...k})}:void 0,Ne=be=>{if(!_&&Dv.includes(be.key)&&Z){const{unselectNodesAndEdges:Ee,addSelectedEdges:ze}=q.getState();be.key==="Escape"?(U.current?.blur(),Ee({edges:[k]})):ze([e])}};return x.jsx("svg",{style:{zIndex:D},children:x.jsxs("g",{className:St(["react-flow__edge",`react-flow__edge-${B}`,k.className,C,{selected:k.selected,animated:k.animated,inactive:!Z&&!o,updating:I,selectable:Z}]),onClick:ue,onDoubleClick:ce,onContextMenu:de,onMouseEnter:se,onMouseMove:pe,onMouseLeave:ke,onKeyDown:L?Ne:void 0,tabIndex:L?0:void 0,role:k.ariaRole??(L?"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":L?`${dw}-${w}`:void 0,ref:U,...k.domAttributes,children:[!ee&&x.jsx(A,{id:e,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:Z,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:V,sourceY:F,targetX:K,targetY:z,sourcePosition:O,targetPosition:Y,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:j,markerEnd:ne,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),X&&x.jsx(YM,{edge:k,isReconnectable:X,reconnectRadius:g,onReconnect:p,onReconnectStart:b,onReconnectEnd:v,sourceX:V,sourceY:F,targetX:K,targetY:z,sourcePosition:O,targetPosition:Y,setUpdateHover:P,setReconnecting:H})]})})}var XM=R.memo(FM);const GM=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Bw({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:i,edgeTypes:l,noPanClassName:o,onReconnect:s,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:p,onEdgeDoubleClick:b,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:C,edgesReconnectable:N,elementsSelectable:_,onError:k}=Ve(GM,at),T=zM(t);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(BM,{defaultColor:e,rfId:i}),T.map(B=>x.jsx(XM,{id:B,edgesFocusable:C,edgesReconnectable:N,elementsSelectable:_,noPanClassName:o,onReconnect:s,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:p,onDoubleClick:b,onReconnectStart:v,onReconnectEnd:w,rfId:i,onError:k,edgeTypes:l,disableKeyboardA11y:E},B))]})}Bw.displayName="EdgeRenderer";const ZM=R.memo(Bw),QM=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function KM({children:e}){const t=Ve(QM);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function JM(e){const t=Jp(),i=R.useRef(!1);R.useEffect(()=>{!i.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),i.current=!0)},[e,t.viewportInitialized])}const WM=e=>e.panZoom?.syncViewport;function ej(e){const t=Ve(WM),i=ot();return R.useEffect(()=>{e&&(t?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function tj(e){return e.connection.inProgress?{...e.connection,to:Fo(e.connection.to,e.transform)}:{...e.connection}}function nj(e){return tj}function ij(e){const t=nj();return Ve(t,at)}const rj=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function lj({containerStyle:e,style:t,type:i,component:l}){const{nodesConnectable:o,width:s,height:u,isValid:f,inProgress:h}=Ve(rj,at);return!(s&&o&&h)?null:x.jsx("svg",{style:e,width:s,height:u,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:St(["react-flow__connection",Bv(f)]),children:x.jsx(Hw,{style:t,type:i,CustomComponent:l,isValid:f})})})}const Hw=({style:e,type:t=fr.Bezier,CustomComponent:i,isValid:l})=>{const{inProgress:o,from:s,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:p,toPosition:b,pointer:v}=ij();if(!o)return;if(i)return x.jsx(i,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:b,connectionStatus:Bv(l),toNode:g,toHandle:p,pointer:v});let w="";const E={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:b};switch(t){case fr.Bezier:[w]=Zv(E);break;case fr.SimpleBezier:[w]=Nw(E);break;case fr.Step:[w]=rp({...E,borderRadius:0});break;case fr.SmoothStep:[w]=rp(E);break;default:[w]=Kv(E)}return x.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};Hw.displayName="ConnectionLine";const aj={};function M1(e=aj){R.useRef(e),ot(),R.useEffect(()=>{},[e])}function oj(){ot(),R.useRef(!1),R.useEffect(()=>{},[])}function Uw({nodeTypes:e,edgeTypes:t,onInit:i,onNodeClick:l,onEdgeClick:o,onNodeDoubleClick:s,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:p,onSelectionStart:b,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:N,selectionKeyCode:_,selectionOnDrag:k,selectionMode:T,multiSelectionKeyCode:B,panActivationKeyCode:A,zoomActivationKeyCode:L,deleteKeyCode:X,onlyRenderVisibleElements:Z,elementsSelectable:U,defaultViewport:I,translateExtent:P,minZoom:ee,maxZoom:H,preventScrolling:q,defaultMarkerColor:D,zoomOnScroll:V,zoomOnPinch:F,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:O,zoomOnDoubleClick:Y,panOnDrag:j,onPaneClick:ne,onPaneMouseEnter:ue,onPaneMouseMove:ce,onPaneMouseLeave:de,onPaneScroll:se,onPaneContextMenu:pe,paneClickDistance:ke,nodeClickDistance:Ne,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:ze,onEdgeMouseLeave:Fe,reconnectRadius:$e,onReconnect:ft,onReconnectStart:tn,onReconnectEnd:Rt,noDragClassName:$t,noWheelClassName:Cn,noPanClassName:ti,disableKeyboardA11y:ni,nodeExtent:kt,rfId:Ri,viewport:re,onViewportChange:he}){return M1(e),M1(t),oj(),JM(i),ej(re),x.jsx(SM,{onPaneClick:ne,onPaneMouseEnter:ue,onPaneMouseMove:ce,onPaneMouseLeave:de,onPaneContextMenu:pe,onPaneScroll:se,paneClickDistance:ke,deleteKeyCode:X,selectionKeyCode:_,selectionOnDrag:k,selectionMode:T,onSelectionStart:b,onSelectionEnd:v,multiSelectionKeyCode:B,panActivationKeyCode:A,zoomActivationKeyCode:L,elementsSelectable:U,zoomOnScroll:V,zoomOnPinch:F,zoomOnDoubleClick:Y,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:O,panOnDrag:j,defaultViewport:I,translateExtent:P,minZoom:ee,maxZoom:H,onSelectionContextMenu:p,preventScrolling:q,noDragClassName:$t,noWheelClassName:Cn,noPanClassName:ti,disableKeyboardA11y:ni,onViewportChange:he,isControlledViewport:!!re,children:x.jsxs(KM,{children:[x.jsx(ZM,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:ft,onReconnectStart:tn,onReconnectEnd:Rt,onlyRenderVisibleElements:Z,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:ze,onEdgeMouseLeave:Fe,reconnectRadius:$e,defaultMarkerColor:D,noPanClassName:ti,disableKeyboardA11y:ni,rfId:Ri}),x.jsx(lj,{style:E,type:w,component:C,containerStyle:N}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(jM,{nodeTypes:e,onNodeClick:l,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ne,onlyRenderVisibleElements:Z,noPanClassName:ti,noDragClassName:$t,disableKeyboardA11y:ni,nodeExtent:kt,rfId:Ri}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}Uw.displayName="GraphView";const sj=R.memo(Uw),j1=({nodes:e,edges:t,defaultNodes:i,defaultEdges:l,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:p,zIndexMode:b="basic"}={})=>{const v=new Map,w=new Map,E=new Map,C=new Map,N=l??t??[],_=i??e??[],k=g??[0,0],T=p??Co;ew(E,C,N);const B=ap(_,v,w,{nodeOrigin:k,nodeExtent:T,zIndexMode:b});let A=[0,0,1];if(u&&o&&s){const L=Po(v,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:X,y:Z,zoom:U}=Yp(L,o,s,h,d,f?.padding??.1);A=[X,Z,U]}return{rfId:"1",width:o??0,height:s??0,transform:A,nodes:_,nodesInitialized:B,nodeLookup:v,parentLookup:w,edges:N,edgeLookup:C,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:l!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Co,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Pl.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:{...Lv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:EA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ov,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},uj=({nodes:e,edges:t,defaultNodes:i,defaultEdges:l,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:p,zIndexMode:b})=>_5((v,w)=>{async function E(){const{nodeLookup:C,panZoom:N,fitViewOptions:_,fitViewResolver:k,width:T,height:B,minZoom:A,maxZoom:L}=w();N&&(await SA({nodes:C,width:T,height:B,panZoom:N,minZoom:A,maxZoom:L},_),k?.resolve(!0),v({fitViewResolver:null}))}return{...j1({nodes:e,edges:t,width:o,height:s,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:p,defaultNodes:i,defaultEdges:l,zIndexMode:b}),setNodes:C=>{const{nodeLookup:N,parentLookup:_,nodeOrigin:k,elevateNodesOnSelect:T,fitViewQueued:B,zIndexMode:A}=w(),L=ap(C,N,_,{nodeOrigin:k,nodeExtent:p,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:A});B&&L?(E(),v({nodes:C,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:C,nodesInitialized:L})},setEdges:C=>{const{connectionLookup:N,edgeLookup:_}=w();ew(N,_,C),v({edges:C})},setDefaultNodesAndEdges:(C,N)=>{if(C){const{setNodes:_}=w();_(C),v({hasDefaultNodes:!0})}if(N){const{setEdges:_}=w();_(N),v({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:N,nodeLookup:_,parentLookup:k,domNode:T,nodeOrigin:B,nodeExtent:A,debug:L,fitViewQueued:X,zIndexMode:Z}=w(),{changes:U,updatedInternals:I}=YA(C,_,k,T,B,A,Z);I&&(qA(_,k,{nodeOrigin:B,nodeExtent:A,zIndexMode:Z}),X?(E(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),U?.length>0&&(L&&console.log("React Flow: trigger node changes",U),N?.(U)))},updateNodePositions:(C,N=!1)=>{const _=[];let k=[];const{nodeLookup:T,triggerNodeChanges:B,connection:A,updateConnection:L,onNodesChangeMiddlewareMap:X}=w();for(const[Z,U]of C){const I=T.get(Z),P=!!(I?.expandParent&&I?.parentId&&U?.position),ee={id:Z,type:"position",position:P?{x:Math.max(0,U.position.x),y:Math.max(0,U.position.y)}:U.position,dragging:N};if(I&&A.inProgress&&A.fromNode.id===I.id){const H=$r(I,A.fromHandle,ye.Left,!0);L({...A,from:H})}P&&I.parentId&&_.push({id:Z,parentId:I.parentId,rect:{...U.internals.positionAbsolute,width:U.measured.width??0,height:U.measured.height??0}}),k.push(ee)}if(_.length>0){const{parentLookup:Z,nodeOrigin:U}=w(),I=Kp(_,T,Z,U);k.push(...I)}for(const Z of X.values())k=Z(k);B(k)},triggerNodeChanges:C=>{const{onNodesChange:N,setNodes:_,nodes:k,hasDefaultNodes:T,debug:B}=w();if(C?.length){if(T){const A=$u(C,k);_(A)}B&&console.log("React Flow: trigger node changes",C),N?.(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:N,setEdges:_,edges:k,hasDefaultEdges:T,debug:B}=w();if(C?.length){if(T){const A=mw(C,k);_(A)}B&&console.log("React Flow: trigger edge changes",C),N?.(C)}},addSelectedNodes:C=>{const{multiSelectionActive:N,edgeLookup:_,nodeLookup:k,triggerNodeChanges:T,triggerEdgeChanges:B}=w();if(N){const A=C.map(L=>Lr(L,!0));T(A);return}T(Hl(k,new Set([...C]),!0)),B(Hl(_))},addSelectedEdges:C=>{const{multiSelectionActive:N,edgeLookup:_,nodeLookup:k,triggerNodeChanges:T,triggerEdgeChanges:B}=w();if(N){const A=C.map(L=>Lr(L,!0));B(A);return}B(Hl(_,new Set([...C]))),T(Hl(k,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:N}={})=>{const{edges:_,nodes:k,nodeLookup:T,triggerNodeChanges:B,triggerEdgeChanges:A}=w(),L=C||k,X=N||_,Z=L.map(I=>{const P=T.get(I.id);return P&&(P.selected=!1),Lr(I.id,!1)}),U=X.map(I=>Lr(I.id,!1));B(Z),A(U)},setMinZoom:C=>{const{panZoom:N,maxZoom:_}=w();N?.setScaleExtent([C,_]),v({minZoom:C})},setMaxZoom:C=>{const{panZoom:N,minZoom:_}=w();N?.setScaleExtent([_,C]),v({maxZoom:C})},setTranslateExtent:C=>{w().panZoom?.setTranslateExtent(C),v({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:N,triggerNodeChanges:_,triggerEdgeChanges:k,elementsSelectable:T}=w();if(!T)return;const B=N.reduce((L,X)=>X.selected?[...L,Lr(X.id,!1)]:L,[]),A=C.reduce((L,X)=>X.selected?[...L,Lr(X.id,!1)]:L,[]);_(B),k(A)},setNodeExtent:C=>{const{nodes:N,nodeLookup:_,parentLookup:k,nodeOrigin:T,elevateNodesOnSelect:B,nodeExtent:A,zIndexMode:L}=w();C[0][0]===A[0][0]&&C[0][1]===A[0][1]&&C[1][0]===A[1][0]&&C[1][1]===A[1][1]||(ap(N,_,k,{nodeOrigin:T,nodeExtent:C,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:L}),v({nodeExtent:C}))},panBy:C=>{const{transform:N,width:_,height:k,panZoom:T,translateExtent:B}=w();return FA({delta:C,panZoom:T,transform:N,translateExtent:B,width:_,height:k})},setCenter:async(C,N,_)=>{const{width:k,height:T,maxZoom:B,panZoom:A}=w();if(!A)return Promise.resolve(!1);const L=typeof _?.zoom<"u"?_.zoom:B;return await A.setViewport({x:k/2-C*L,y:T/2-N*L,zoom:L},{duration:_?.duration,ease:_?.ease,interpolate:_?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...Lv}})},updateConnection:C=>{v({connection:C})},reset:()=>v({...j1()})}},Object.is);function Iw({initialNodes:e,initialEdges:t,defaultNodes:i,defaultEdges:l,initialWidth:o,initialHeight:s,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:p,zIndexMode:b,children:v}){const[w]=R.useState(()=>uj({nodes:e,edges:t,defaultNodes:i,defaultEdges:l,width:o,height:s,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:p,zIndexMode:b}));return x.jsx(T5,{value:w,children:x.jsx(K5,{children:v})})}function cj({children:e,nodes:t,edges:i,defaultNodes:l,defaultEdges:o,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:p,nodeExtent:b,zIndexMode:v}){return R.useContext(Ac)?x.jsx(x.Fragment,{children:e}):x.jsx(Iw,{initialNodes:t,initialEdges:i,defaultNodes:l,defaultEdges:o,initialWidth:s,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:p,nodeExtent:b,zIndexMode:v,children:e})}const fj={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function dj({nodes:e,edges:t,defaultNodes:i,defaultEdges:l,className:o,nodeTypes:s,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:p,onMoveEnd:b,onConnect:v,onConnectStart:w,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:N,onNodeMouseEnter:_,onNodeMouseMove:k,onNodeMouseLeave:T,onNodeContextMenu:B,onNodeDoubleClick:A,onNodeDragStart:L,onNodeDrag:X,onNodeDragStop:Z,onNodesDelete:U,onEdgesDelete:I,onDelete:P,onSelectionChange:ee,onSelectionDragStart:H,onSelectionDrag:q,onSelectionDragStop:D,onSelectionContextMenu:V,onSelectionStart:F,onSelectionEnd:K,onBeforeDelete:z,connectionMode:O,connectionLineType:Y=fr.Bezier,connectionLineStyle:j,connectionLineComponent:ne,connectionLineContainerStyle:ue,deleteKeyCode:ce="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:se=!1,selectionMode:pe=_o.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:Ne=Ao()?"Meta":"Control",zoomActivationKeyCode:be=Ao()?"Meta":"Control",snapToGrid:Ee,snapGrid:ze,onlyRenderVisibleElements:Fe=!1,selectNodesOnDrag:$e,nodesDraggable:ft,autoPanOnNodeFocus:tn,nodesConnectable:Rt,nodesFocusable:$t,nodeOrigin:Cn=hw,edgesFocusable:ti,edgesReconnectable:ni,elementsSelectable:kt=!0,defaultViewport:Ri=q5,minZoom:re=.5,maxZoom:he=2,translateExtent:we=Co,preventScrolling:je=!0,nodeExtent:Ie,defaultMarkerColor:Ut="#b1b1b7",zoomOnScroll:_n=!0,zoomOnPinch:Tt=!0,panOnScroll:dt=!1,panOnScrollSpeed:Dt=.5,panOnScrollMode:Ge=Ur.Free,zoomOnDoubleClick:Un=!0,panOnDrag:nn=!0,onPaneClick:qc,onPaneMouseEnter:Xr,onPaneMouseMove:Gr,onPaneMouseLeave:Zr,onPaneScroll:ii,onPaneContextMenu:Qr,paneClickDistance:pr=1,nodeClickDistance:Vc=0,children:Ko,onReconnect:la,onReconnectStart:mr,onReconnectEnd:$c,onEdgeContextMenu:Jo,onEdgeDoubleClick:Wo,onEdgeMouseEnter:es,onEdgeMouseMove:aa,onEdgeMouseLeave:oa,reconnectRadius:ts=10,onNodesChange:ns,onEdgesChange:In,noDragClassName:Et="nodrag",noWheelClassName:Ot="nowheel",noPanClassName:ri="nopan",fitView:Kr,fitViewOptions:is,connectOnClick:Pc,attributionPosition:rs,proOptions:gr,defaultEdgeOptions:sa,elevateNodesOnSelect:Di=!0,elevateEdgesOnSelect:Oi=!1,disableKeyboardA11y:Li=!1,autoPanOnConnect:Bi,autoPanOnNodeDrag:mt,autoPanSpeed:ls,connectionRadius:as,isValidConnection:li,onError:Hi,style:Yc,id:ua,nodeDragThreshold:os,connectionDragThreshold:Fc,viewport:Jr,onViewportChange:Wr,width:Tn,height:Pt,colorMode:ss="light",debug:Xc,onScroll:el,ariaLabelConfig:us,zIndexMode:yr="basic",...Gc},Yt){const xr=ua||"1",cs=Y5(ss),ca=R.useCallback(ai=>{ai.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),el?.(ai)},[el]);return x.jsx("div",{"data-testid":"rf__wrapper",...Gc,onScroll:ca,style:{...Yc,...fj},ref:Yt,className:St(["react-flow",o,cs]),id:ua,role:"application",children:x.jsxs(cj,{nodes:e,edges:t,width:Tn,height:Pt,fitView:Kr,fitViewOptions:is,minZoom:re,maxZoom:he,nodeOrigin:Cn,nodeExtent:Ie,zIndexMode:yr,children:[x.jsx(sj,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:_,onNodeMouseMove:k,onNodeMouseLeave:T,onNodeContextMenu:B,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:u,connectionLineType:Y,connectionLineStyle:j,connectionLineComponent:ne,connectionLineContainerStyle:ue,selectionKeyCode:de,selectionOnDrag:se,selectionMode:pe,deleteKeyCode:ce,multiSelectionKeyCode:Ne,panActivationKeyCode:ke,zoomActivationKeyCode:be,onlyRenderVisibleElements:Fe,defaultViewport:Ri,translateExtent:we,minZoom:re,maxZoom:he,preventScrolling:je,zoomOnScroll:_n,zoomOnPinch:Tt,zoomOnDoubleClick:Un,panOnScroll:dt,panOnScrollSpeed:Dt,panOnScrollMode:Ge,panOnDrag:nn,onPaneClick:qc,onPaneMouseEnter:Xr,onPaneMouseMove:Gr,onPaneMouseLeave:Zr,onPaneScroll:ii,onPaneContextMenu:Qr,paneClickDistance:pr,nodeClickDistance:Vc,onSelectionContextMenu:V,onSelectionStart:F,onSelectionEnd:K,onReconnect:la,onReconnectStart:mr,onReconnectEnd:$c,onEdgeContextMenu:Jo,onEdgeDoubleClick:Wo,onEdgeMouseEnter:es,onEdgeMouseMove:aa,onEdgeMouseLeave:oa,reconnectRadius:ts,defaultMarkerColor:Ut,noDragClassName:Et,noWheelClassName:Ot,noPanClassName:ri,rfId:xr,disableKeyboardA11y:Li,nodeExtent:Ie,viewport:Jr,onViewportChange:Wr}),x.jsx(P5,{nodes:e,edges:t,defaultNodes:i,defaultEdges:l,onConnect:v,onConnectStart:w,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:N,nodesDraggable:ft,autoPanOnNodeFocus:tn,nodesConnectable:Rt,nodesFocusable:$t,edgesFocusable:ti,edgesReconnectable:ni,elementsSelectable:kt,elevateNodesOnSelect:Di,elevateEdgesOnSelect:Oi,minZoom:re,maxZoom:he,nodeExtent:Ie,onNodesChange:ns,onEdgesChange:In,snapToGrid:Ee,snapGrid:ze,connectionMode:O,translateExtent:we,connectOnClick:Pc,defaultEdgeOptions:sa,fitView:Kr,fitViewOptions:is,onNodesDelete:U,onEdgesDelete:I,onDelete:P,onNodeDragStart:L,onNodeDrag:X,onNodeDragStop:Z,onSelectionDrag:q,onSelectionDragStart:H,onSelectionDragStop:D,onMove:g,onMoveStart:p,onMoveEnd:b,noPanClassName:ri,nodeOrigin:Cn,rfId:xr,autoPanOnConnect:Bi,autoPanOnNodeDrag:mt,autoPanSpeed:ls,onError:Hi,connectionRadius:as,isValidConnection:li,selectNodesOnDrag:$e,nodeDragThreshold:os,connectionDragThreshold:Fc,onBeforeDelete:z,debug:Xc,ariaLabelConfig:us,zIndexMode:yr}),x.jsx(I5,{onSelectionChange:ee}),Ko,x.jsx(O5,{proOptions:gr,position:rs}),x.jsx(D5,{rfId:xr,disableKeyboardA11y:Li})]})})}var hj=gw(dj);function pj({dimensions:e,lineWidth:t,variant:i,className:l}){return x.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:St(["react-flow__background-pattern",i,l])})}function mj({radius:e,className:t}){return x.jsx("circle",{cx:e,cy:e,r:e,className:St(["react-flow__background-pattern","dots",t])})}var _i;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(_i||(_i={}));const gj={[_i.Dots]:1,[_i.Lines]:1,[_i.Cross]:6},yj=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function qw({id:e,variant:t=_i.Dots,gap:i=20,size:l,lineWidth:o=1,offset:s=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const p=R.useRef(null),{transform:b,patternId:v}=Ve(yj,at),w=l||gj[t],E=t===_i.Dots,C=t===_i.Cross,N=Array.isArray(i)?i:[i,i],_=[N[0]*b[2]||1,N[1]*b[2]||1],k=w*b[2],T=Array.isArray(s)?s:[s,s],B=C?[k,k]:_,A=[T[0]*b[2]||1+B[0]/2,T[1]*b[2]||1+B[1]/2],L=`${v}${e||""}`;return x.jsxs("svg",{className:St(["react-flow__background",d]),style:{...h,...jc,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:p,"data-testid":"rf__background",children:[x.jsx("pattern",{id:L,x:b[0]%_[0],y:b[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:E?x.jsx(mj,{radius:k/2,className:g}):x.jsx(pj,{dimensions:B,lineWidth:o,variant:t,className:g})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}qw.displayName="Background";const xj=R.memo(qw);function bj(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function vj(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function wj(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.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 Sj(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 kj(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 Au({children:e,className:t,...i}){return x.jsx("button",{type:"button",className:St(["react-flow__controls-button",t]),...i,children:e})}const Ej=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Vw({style:e,showZoom:t=!0,showFitView:i=!0,showInteractive:l=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:p="bottom-left",orientation:b="vertical","aria-label":v}){const w=ot(),{isInteractive:E,minZoomReached:C,maxZoomReached:N,ariaLabelConfig:_}=Ve(Ej,at),{zoomIn:k,zoomOut:T,fitView:B}=Jp(),A=()=>{k(),s?.()},L=()=>{T(),u?.()},X=()=>{B(o),f?.()},Z=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h?.(!E)},U=b==="horizontal"?"horizontal":"vertical";return x.jsxs(Mc,{className:St(["react-flow__controls",U,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":v??_["controls.ariaLabel"],children:[t&&x.jsxs(x.Fragment,{children:[x.jsx(Au,{onClick:A,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:N,children:x.jsx(bj,{})}),x.jsx(Au,{onClick:L,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:C,children:x.jsx(vj,{})})]}),i&&x.jsx(Au,{className:"react-flow__controls-fitview",onClick:X,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:x.jsx(wj,{})}),l&&x.jsx(Au,{className:"react-flow__controls-interactive",onClick:Z,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:E?x.jsx(kj,{}):x.jsx(Sj,{})}),g]})}Vw.displayName="Controls";const Nj=R.memo(Vw);function Cj({id:e,x:t,y:i,width:l,height:o,style:s,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:p,selected:b,onClick:v}){const{background:w,backgroundColor:E}=s||{},C=u||w||E;return x.jsx("rect",{className:St(["react-flow__minimap-node",{selected:b},d]),x:t,y:i,rx:g,ry:g,width:l,height:o,style:{fill:C,stroke:f,strokeWidth:h},shapeRendering:p,onClick:v?N=>v(N,e):void 0})}const _j=R.memo(Cj),Tj=e=>e.nodes.map(t=>t.id),wh=e=>e instanceof Function?e:()=>e;function Aj({nodeStrokeColor:e,nodeColor:t,nodeClassName:i="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:s=_j,onClick:u}){const f=Ve(Tj,at),h=wh(t),d=wh(e),g=wh(i),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:f.map(b=>x.jsx(jj,{id:b,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:l,nodeStrokeWidth:o,NodeComponent:s,onClick:u,shapeRendering:p},b))})}function Mj({id:e,nodeColorFunc:t,nodeStrokeColorFunc:i,nodeClassNameFunc:l,nodeBorderRadius:o,nodeStrokeWidth:s,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:p,width:b,height:v}=Ve(w=>{const{internals:E}=w.nodeLookup.get(e),C=E.userNode,{x:N,y:_}=E.positionAbsolute,{width:k,height:T}=ji(C);return{node:C,x:N,y:_,width:k,height:T}},at);return!d||d.hidden||!$v(d)?null:x.jsx(f,{x:g,y:p,width:b,height:v,style:d.style,selected:!!d.selected,className:l(d),color:t(d),borderRadius:o,strokeColor:i(d),strokeWidth:s,shapeRendering:u,onClick:h,id:d.id})}const jj=R.memo(Mj);var zj=R.memo(Aj);const Rj=200,Dj=150,Oj=e=>!e.hidden,Lj=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Vv(Po(e.nodeLookup,{filter:Oj}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Bj="react-flow__minimap-desc";function $w({style:e,className:t,nodeStrokeColor:i,nodeColor:l,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:p,position:b="bottom-right",onClick:v,onNodeClick:w,pannable:E=!1,zoomable:C=!1,ariaLabel:N,inversePan:_,zoomStep:k=1,offsetScale:T=5}){const B=ot(),A=R.useRef(null),{boundingRect:L,viewBB:X,rfId:Z,panZoom:U,translateExtent:I,flowWidth:P,flowHeight:ee,ariaLabelConfig:H}=Ve(Lj,at),q=e?.width??Rj,D=e?.height??Dj,V=L.width/q,F=L.height/D,K=Math.max(V,F),z=K*q,O=K*D,Y=T*K,j=L.x-(z-L.width)/2-Y,ne=L.y-(O-L.height)/2-Y,ue=z+Y*2,ce=O+Y*2,de=`${Bj}-${Z}`,se=R.useRef(0),pe=R.useRef();se.current=K,R.useEffect(()=>{if(A.current&&U)return pe.current=t5({domNode:A.current,panZoom:U,getTransform:()=>B.getState().transform,getViewScale:()=>se.current}),()=>{pe.current?.destroy()}},[U]),R.useEffect(()=>{pe.current?.update({translateExtent:I,width:P,height:ee,inversePan:_,pannable:E,zoomStep:k,zoomable:C})},[E,C,_,k,I,P,ee]);const ke=v?Ee=>{const[ze,Fe]=pe.current?.pointer(Ee)||[0,0];v(Ee,{x:ze,y:Fe})}:void 0,Ne=w?R.useCallback((Ee,ze)=>{const Fe=B.getState().nodeLookup.get(ze).internals.userNode;w(Ee,Fe)},[]):void 0,be=N??H["minimap.ariaLabel"];return x.jsx(Mc,{position:b,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 p=="number"?p*K:void 0,"--xy-minimap-node-background-color-props":typeof l=="string"?l: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:St(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:q,height:D,viewBox:`${j} ${ne} ${ue} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:A,onClick:ke,children:[be&&x.jsx("title",{id:de,children:be}),x.jsx(zj,{onClick:Ne,nodeColor:l,nodeStrokeColor:i,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:f}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${j-Y},${ne-Y}h${ue+Y*2}v${ce+Y*2}h${-ue-Y*2}z
23
+ M${X.x},${X.y}h${X.width}v${X.height}h${-X.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}$w.displayName="MiniMap";const Hj=R.memo($w),Uj=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Ij={[Gl.Line]:"right",[Gl.Handle]:"bottom-right"};function qj({nodeId:e,position:t,variant:i=Gl.Handle,className:l,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:p=!1,resizeDirection:b,autoScale:v=!0,shouldResize:w,onResizeStart:E,onResize:C,onResizeEnd:N}){const _=vw(),k=typeof e=="string"?e:_,T=ot(),B=R.useRef(null),A=i===Gl.Handle,L=Ve(R.useCallback(Uj(A&&v),[A,v]),at),X=R.useRef(null),Z=t??Ij[i];R.useEffect(()=>{if(!(!B.current||!k))return X.current||(X.current=m5({domNode:B.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:I,transform:P,snapGrid:ee,snapToGrid:H,nodeOrigin:q,domNode:D}=T.getState();return{nodeLookup:I,transform:P,snapGrid:ee,snapToGrid:H,nodeOrigin:q,paneDomNode:D}},onChange:(I,P)=>{const{triggerNodeChanges:ee,nodeLookup:H,parentLookup:q,nodeOrigin:D}=T.getState(),V=[],F={x:I.x,y:I.y},K=H.get(k);if(K&&K.expandParent&&K.parentId){const z=K.origin??D,O=I.width??K.measured.width??0,Y=I.height??K.measured.height??0,j={id:K.id,parentId:K.parentId,rect:{width:O,height:Y,...Pv({x:I.x??K.position.x,y:I.y??K.position.y},{width:O,height:Y},K.parentId,H,z)}},ne=Kp([j],H,q,D);V.push(...ne),F.x=I.x?Math.max(z[0]*O,I.x):void 0,F.y=I.y?Math.max(z[1]*Y,I.y):void 0}if(F.x!==void 0&&F.y!==void 0){const z={id:k,type:"position",position:{...F}};V.push(z)}if(I.width!==void 0&&I.height!==void 0){const O={id:k,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};V.push(O)}for(const z of P){const O={...z,type:"position"};V.push(O)}ee(V)},onEnd:({width:I,height:P})=>{const ee={id:k,type:"dimensions",resizing:!1,dimensions:{width:I,height:P}};T.getState().triggerNodeChanges([ee])}})),X.current.update({controlPosition:Z,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:p,resizeDirection:b,onResizeStart:E,onResize:C,onResizeEnd:N,shouldResize:w}),()=>{X.current?.destroy()}},[Z,f,h,d,g,p,E,C,N,w]);const U=Z.split("-");return x.jsx("div",{className:St(["react-flow__resize-control","nodrag",...U,i,l]),ref:B,style:{...o,scale:L,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:s})}R.memo(qj);const Vj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ql=(e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Vj[i[e]&63];return t};const Kn=Io()(nv(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:Ql(),workflowName:"Untitled Workflow",isDraft:!0,addNode:t=>e(i=>({nodes:[...i.nodes,t]})),updateNode:(t,i)=>e(l=>({nodes:l.nodes.map(o=>o.id===t?{...o,data:{...o.data,...i}}:o)})),updateNodeStatus:(t,i,l)=>e(o=>({nodes:o.nodes.map(s=>s.id===t?{...s,data:{...s.data,status:i,progress:l??s.data.progress}}:s)})),removeNode:t=>e(i=>({nodes:i.nodes.filter(l=>l.id!==t),edges:i.edges.filter(l=>l.source!==t&&l.target!==t),selectedNodeId:i.selectedNodeId===t?null:i.selectedNodeId})),setSelectedNode:t=>e({selectedNodeId:t}),addEdge:t=>e(i=>({edges:[...i.edges,t]})),removeEdge:t=>e(i=>({edges:i.edges.filter(l=>l.id!==t)})),setWorkflowName:t=>e({workflowName:t}),loadWorkflow:t=>e({nodes:t.nodes,edges:t.edges,workflowName:t.name||"Imported Workflow",selectedNodeId:null}),mergeExistingConfig:t=>e(i=>{const l=new Set(t.map(d=>d.id)),o=["skill-","agent-","command-","hook-"],s=d=>o.some(g=>d.startsWith(g)),u=i.nodes.filter(d=>s(d.id)?l.has(d.id):!0),f=new Set(u.map(d=>d.id)),h=t.filter(d=>!f.has(d.id));return{nodes:[...u,...h]}}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:Ql(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:t=>e({nodes:t}),setEdges:t=>e({edges:t})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),Pw=e=>e.nodes.find(t=>t.id===e.selectedNodeId),ea=Io((e,t)=>({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}),t().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),t().addLog("info","Workflow execution stopped")},setCurrentNode:i=>{e({currentNodeId:i}),i&&t().addLog("info","Processing node",i)},markNodeCompleted:(i,l)=>{e(o=>{const s=new Set(o.completedNodes);s.add(i);const u=new Map(o.results);return l!==void 0&&u.set(i,l),{completedNodes:s,results:u}}),t().addLog("success","Node completed",i)},markNodeFailed:(i,l)=>{e(o=>{const s=new Set(o.failedNodes);return s.add(i),{failedNodes:s}}),t().addLog("error",l||"Node failed",i)},setWorkflowResults:(i,l)=>{e({workflowResults:i,outputDir:l||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,l,o,s)=>{const u={id:Ql(),timestamp:Date.now(),level:i,message:l,nodeId:o,details:s};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})})),Jn=Object.create(null);Jn.open="0";Jn.close="1";Jn.ping="2";Jn.pong="3";Jn.message="4";Jn.upgrade="5";Jn.noop="6";const Pu=Object.create(null);Object.keys(Jn).forEach(e=>{Pu[Jn[e]]=e});const up={type:"error",data:"parser error"},Yw=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fw=typeof ArrayBuffer=="function",Xw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,em=({type:e,data:t},i,l)=>Yw&&t instanceof Blob?i?l(t):z1(t,l):Fw&&(t instanceof ArrayBuffer||Xw(t))?i?l(t):z1(new Blob([t]),l):l(Jn[e]+(t||"")),z1=(e,t)=>{const i=new FileReader;return i.onload=function(){const l=i.result.split(",")[1];t("b"+(l||""))},i.readAsDataURL(e)};function R1(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Sh;function $j(e,t){if(Yw&&e.data instanceof Blob)return e.data.arrayBuffer().then(R1).then(t);if(Fw&&(e.data instanceof ArrayBuffer||Xw(e.data)))return t(R1(e.data));em(e,!1,i=>{Sh||(Sh=new TextEncoder),t(Sh.encode(i))})}const D1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<D1.length;e++)fo[D1.charCodeAt(e)]=e;const Pj=e=>{let t=e.length*.75,i=e.length,l,o=0,s,u,f,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),g=new Uint8Array(d);for(l=0;l<i;l+=4)s=fo[e.charCodeAt(l)],u=fo[e.charCodeAt(l+1)],f=fo[e.charCodeAt(l+2)],h=fo[e.charCodeAt(l+3)],g[o++]=s<<2|u>>4,g[o++]=(u&15)<<4|f>>2,g[o++]=(f&3)<<6|h&63;return d},Yj=typeof ArrayBuffer=="function",tm=(e,t)=>{if(typeof e!="string")return{type:"message",data:Gw(e,t)};const i=e.charAt(0);return i==="b"?{type:"message",data:Fj(e.substring(1),t)}:Pu[i]?e.length>1?{type:Pu[i],data:e.substring(1)}:{type:Pu[i]}:up},Fj=(e,t)=>{if(Yj){const i=Pj(e);return Gw(i,t)}else return{base64:!0,data:e}},Gw=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Zw="",Xj=(e,t)=>{const i=e.length,l=new Array(i);let o=0;e.forEach((s,u)=>{em(s,!1,f=>{l[u]=f,++o===i&&t(l.join(Zw))})})},Gj=(e,t)=>{const i=e.split(Zw),l=[];for(let o=0;o<i.length;o++){const s=tm(i[o],t);if(l.push(s),s.type==="error")break}return l};function Zj(){return new TransformStream({transform(e,t){$j(e,i=>{const l=i.length;let o;if(l<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,l);else if(l<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,l)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(l))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(i)})}})}let kh;function Mu(e){return e.reduce((t,i)=>t+i.length,0)}function ju(e,t){if(e[0].length===t)return e.shift();const i=new Uint8Array(t);let l=0;for(let o=0;o<t;o++)i[o]=e[0][l++],l===e[0].length&&(e.shift(),l=0);return e.length&&l<e[0].length&&(e[0]=e[0].slice(l)),i}function Qj(e,t){kh||(kh=new TextDecoder);const i=[];let l=0,o=-1,s=!1;return new TransformStream({transform(u,f){for(i.push(u);;){if(l===0){if(Mu(i)<1)break;const h=ju(i,1);s=(h[0]&128)===128,o=h[0]&127,o<126?l=3:o===126?l=1:l=2}else if(l===1){if(Mu(i)<2)break;const h=ju(i,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),l=3}else if(l===2){if(Mu(i)<8)break;const h=ju(i,8),d=new DataView(h.buffer,h.byteOffset,h.length),g=d.getUint32(0);if(g>Math.pow(2,21)-1){f.enqueue(up);break}o=g*Math.pow(2,32)+d.getUint32(4),l=3}else{if(Mu(i)<o)break;const h=ju(i,o);f.enqueue(tm(s?h:kh.decode(h),t)),l=0}if(o===0||o>e){f.enqueue(up);break}}}})}const Qw=4;function wt(e){if(e)return Kj(e)}function Kj(e){for(var t in wt.prototype)e[t]=wt.prototype[t];return e}wt.prototype.on=wt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};wt.prototype.once=function(e,t){function i(){this.off(e,i),t.apply(this,arguments)}return i.fn=t,this.on(e,i),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var l,o=0;o<i.length;o++)if(l=i[o],l===t||l.fn===t){i.splice(o,1);break}return i.length===0&&delete this._callbacks["$"+e],this};wt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+e],l=1;l<arguments.length;l++)t[l-1]=arguments[l];if(i){i=i.slice(0);for(var l=0,o=i.length;l<o;++l)i[l].apply(this,t)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};wt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Rc=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),kn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Jj="arraybuffer";function Kw(e,...t){return t.reduce((i,l)=>(e.hasOwnProperty(l)&&(i[l]=e[l]),i),{})}const Wj=kn.setTimeout,ez=kn.clearTimeout;function Dc(e,t){t.useNativeTimers?(e.setTimeoutFn=Wj.bind(kn),e.clearTimeoutFn=ez.bind(kn)):(e.setTimeoutFn=kn.setTimeout.bind(kn),e.clearTimeoutFn=kn.clearTimeout.bind(kn))}const tz=1.33;function nz(e){return typeof e=="string"?iz(e):Math.ceil((e.byteLength||e.size)*tz)}function iz(e){let t=0,i=0;for(let l=0,o=e.length;l<o;l++)t=e.charCodeAt(l),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(l++,i+=4);return i}function Jw(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function rz(e){let t="";for(let i in e)e.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return t}function lz(e){let t={},i=e.split("&");for(let l=0,o=i.length;l<o;l++){let s=i[l].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class az extends Error{constructor(t,i,l){super(t),this.description=i,this.context=l,this.type="TransportError"}}class nm extends wt{constructor(t){super(),this.writable=!1,Dc(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,l){return super.emitReserved("error",new az(t,i,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const i=tm(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const i=rz(t);return i.length?"?"+i:""}}class oz extends nm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||i()})),this.writable||(l++,this.once("drain",function(){--l||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const i=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};Gj(t,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Xj(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Jw()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}}let Ww=!1;try{Ww=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const sz=Ww;function uz(){}class cz extends oz{constructor(t){if(super(t),typeof location<"u"){const i=location.protocol==="https:";let l=location.port;l||(l=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||l!==t.port}}doWrite(t,i){const l=this.request({method:"POST",data:t});l.on("success",i),l.on("error",(o,s)=>{this.onError("xhr post error",o,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,l)=>{this.onError("xhr poll error",i,l)}),this.pollXhr=t}}class Gn extends wt{constructor(t,i,l){super(),this.createRequest=t,Dc(this,l),this._opts=l,this._method=l.method||"GET",this._uri=i,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var t;const i=Kw(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(i);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&l.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var o;l.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Gn.requestsCount++,Gn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=uz,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Gn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Gn.requestsCount=0;Gn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",O1);else if(typeof addEventListener=="function"){const e="onpagehide"in kn?"pagehide":"unload";addEventListener(e,O1,!1)}}function O1(){for(let e in Gn.requests)Gn.requests.hasOwnProperty(e)&&Gn.requests[e].abort()}const fz=(function(){const e=e2({xdomain:!1});return e&&e.responseType!==null})();class dz extends cz{constructor(t){super(t);const i=t&&t.forceBase64;this.supportsBinary=fz&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Gn(e2,this.uri(),t)}}function e2(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||sz))return new XMLHttpRequest}catch{}if(!t)try{return new kn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const t2=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class hz extends nm{get name(){return"websocket"}doOpen(){const t=this.uri(),i=this.opts.protocols,l=t2?{}:Kw(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,l)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let i=0;i<t.length;i++){const l=t[i],o=i===t.length-1;em(l,this.supportsBinary,s=>{try{this.doWrite(l,s)}catch{}o&&Rc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Jw()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}}const Eh=kn.WebSocket||kn.MozWebSocket;class pz extends hz{createSocket(t,i,l){return t2?new Eh(t,i,l):i?new Eh(t,i):new Eh(t)}doWrite(t,i){this.ws.send(i)}}class mz extends nm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const i=Qj(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=t.readable.pipeThrough(i).getReader(),o=Zj();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const s=()=>{l.read().then(({done:f,value:h})=>{f||(this.onPacket(h),s())}).catch(f=>{})};s();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let i=0;i<t.length;i++){const l=t[i],o=i===t.length-1;this._writer.write(l).then(()=>{o&&Rc(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const gz={websocket:pz,webtransport:mz,polling:dz},yz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,xz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function cp(e){if(e.length>8e3)throw"URI too long";const t=e,i=e.indexOf("["),l=e.indexOf("]");i!=-1&&l!=-1&&(e=e.substring(0,i)+e.substring(i,l).replace(/:/g,";")+e.substring(l,e.length));let o=yz.exec(e||""),s={},u=14;for(;u--;)s[xz[u]]=o[u]||"";return i!=-1&&l!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=bz(s,s.path),s.queryKey=vz(s,s.query),s}function bz(e,t){const i=/\/{2,9}/g,l=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&l.splice(0,1),t.slice(-1)=="/"&&l.splice(l.length-1,1),l}function vz(e,t){const i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,o,s){o&&(i[o]=s)}),i}const fp=typeof addEventListener=="function"&&typeof removeEventListener=="function",Yu=[];fp&&addEventListener("offline",()=>{Yu.forEach(e=>e())},!1);class dr extends wt{constructor(t,i){if(super(),this.binaryType=Jj,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(i=t,t=null),t){const l=cp(t);i.hostname=l.host,i.secure=l.protocol==="https"||l.protocol==="wss",i.port=l.port,l.query&&(i.query=l.query)}else i.host&&(i.hostname=cp(i.host).host);Dc(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(l=>{const o=l.prototype.name;this.transports.push(o),this._transportsByName[o]=l}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=lz(this.opts.query)),fp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Yu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const i=Object.assign({},this.opts.query);i.EIO=Qw,i.transport=t,this.id&&(i.sid=this.id);const l=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&dr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(t);i.open(),this.setTransport(i)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",dr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=t.data,this._onError(i);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let l=0;l<this.writeBuffer.length;l++){const o=this.writeBuffer[l].data;if(o&&(i+=nz(o)),l>0&&i>this._maxPayload)return this.writeBuffer.slice(0,l);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Rc(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,i,l){return this._sendPacket("message",t,i,l),this}send(t,i,l){return this._sendPacket("message",t,i,l),this}_sendPacket(t,i,l,o){if(typeof i=="function"&&(o=i,i=void 0),typeof l=="function"&&(o=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const s={type:t,data:i,options:l};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),t()},l=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():t()}):this.upgrading?l():t()),this}_onError(t){if(dr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),fp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=Yu.indexOf(this._offlineEventListener);l!==-1&&Yu.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,i),this.writeBuffer=[],this._prevBufferLen=0}}}dr.protocol=Qw;class wz extends dr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let i=this.createTransport(t),l=!1;dr.priorWebsocketSuccess=!1;const o=()=>{l||(i.send([{type:"ping",data:"probe"}]),i.once("packet",p=>{if(!l)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;dr.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=i.name,this.emitReserved("upgradeError",b)}}))};function s(){l||(l=!0,g(),i.close(),i=null)}const u=p=>{const b=new Error("probe error: "+p);b.transport=i.name,s(),this.emitReserved("upgradeError",b)};function f(){u("transport closed")}function h(){u("socket closed")}function d(p){i&&p.name!==i.name&&s()}const g=()=>{i.removeListener("open",o),i.removeListener("error",u),i.removeListener("close",f),this.off("close",h),this.off("upgrading",d)};i.once("open",o),i.once("error",u),i.once("close",f),this.once("close",h),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{l||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const i=[];for(let l=0;l<t.length;l++)~this.transports.indexOf(t[l])&&i.push(t[l]);return i}}let Sz=class extends wz{constructor(t,i={}){const l=typeof t=="object"?t:i;(!l.transports||l.transports&&typeof l.transports[0]=="string")&&(l.transports=(l.transports||["polling","websocket","webtransport"]).map(o=>gz[o]).filter(o=>!!o)),super(t,l)}};function kz(e,t="",i){let l=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),l=cp(e)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const s=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+s+":"+l.port+t,l.href=l.protocol+"://"+s+(i&&i.port===l.port?"":":"+l.port),l}const Ez=typeof ArrayBuffer=="function",Nz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,n2=Object.prototype.toString,Cz=typeof Blob=="function"||typeof Blob<"u"&&n2.call(Blob)==="[object BlobConstructor]",_z=typeof File=="function"||typeof File<"u"&&n2.call(File)==="[object FileConstructor]";function im(e){return Ez&&(e instanceof ArrayBuffer||Nz(e))||Cz&&e instanceof Blob||_z&&e instanceof File}function Fu(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,l=e.length;i<l;i++)if(Fu(e[i]))return!0;return!1}if(im(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Fu(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&Fu(e[i]))return!0;return!1}function Tz(e){const t=[],i=e.data,l=e;return l.data=dp(i,t),l.attachments=t.length,{packet:l,buffers:t}}function dp(e,t){if(!e)return e;if(im(e)){const i={_placeholder:!0,num:t.length};return t.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let l=0;l<e.length;l++)i[l]=dp(e[l],t);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const l in e)Object.prototype.hasOwnProperty.call(e,l)&&(i[l]=dp(e[l],t));return i}return e}function Az(e,t){return e.data=hp(e.data,t),delete e.attachments,e}function hp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=hp(e[i],t);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=hp(e[i],t));return e}const Mz=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ue||(Ue={}));class jz{constructor(t){this.replacer=t}encode(t){return(t.type===Ue.EVENT||t.type===Ue.ACK)&&Fu(t)?this.encodeAsBinary({type:t.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===Ue.BINARY_EVENT||t.type===Ue.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){const i=Tz(t),l=this.encodeAsString(i.packet),o=i.buffers;return o.unshift(l),o}}class rm extends wt{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);const l=i.type===Ue.BINARY_EVENT;l||i.type===Ue.BINARY_ACK?(i.type=l?Ue.EVENT:Ue.ACK,this.reconstructor=new zz(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(im(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0;const l={type:Number(t.charAt(0))};if(Ue[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Ue.BINARY_EVENT||l.type===Ue.BINARY_ACK){const s=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);const u=t.substring(s,i);if(u!=Number(u)||t.charAt(i)!=="-")throw new Error("Illegal attachments");l.attachments=Number(u)}if(t.charAt(i+1)==="/"){const s=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););l.nsp=t.substring(s,i)}else l.nsp="/";const o=t.charAt(i+1);if(o!==""&&Number(o)==o){const s=i+1;for(;++i;){const u=t.charAt(i);if(u==null||Number(u)!=u){--i;break}if(i===t.length)break}l.id=Number(t.substring(s,i+1))}if(t.charAt(++i)){const s=this.tryParse(t.substr(i));if(rm.isPayloadValid(l.type,s))l.data=s;else throw new Error("invalid payload")}return l}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case Ue.CONNECT:return L1(i);case Ue.DISCONNECT:return i===void 0;case Ue.CONNECT_ERROR:return typeof i=="string"||L1(i);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&Mz.indexOf(i[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class zz{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const i=Az(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function L1(e){return Object.prototype.toString.call(e)==="[object Object]"}const Rz=Object.freeze(Object.defineProperty({__proto__:null,Decoder:rm,Encoder:jz,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function Rn(e,t,i){return e.on(t,i),function(){e.off(t,i)}}const Dz=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class i2 extends wt{constructor(t,i,l){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=i,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Rn(t,"open",this.onopen.bind(this)),Rn(t,"packet",this.onpacket.bind(this)),Rn(t,"error",this.onerror.bind(this)),Rn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...i){var l,o,s;if(Dz.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const u={type:Ue.EVENT,data:i};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const g=this.ids++,p=i.pop();this._registerAckCallback(g,p),u.id=g}const f=(o=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!f||(h?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(t,i){var l;const o=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(o===void 0){this.acks[t]=i;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===t&&this.sendBuffer.splice(f,1);i.call(this,new Error("operation has timed out"))},o),u=(...f)=>{this.io.clearTimeoutFn(s),i.apply(this,f)};u.withError=!0,this.acks[t]=u}emitWithAck(t,...i){return new Promise((l,o)=>{const s=(u,f)=>u?o(u):l(f);s.withError=!0,i.push(s),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...s)=>(this._queue[0],o!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(o)):(this._queue.shift(),i&&i(null,...s)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(l=>String(l.id)===t)){const l=this.acks[t];delete this.acks[t],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ue.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(t);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(t);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const l=new Error(t.data.message);l.data=t.data.data,this.emitReserved("connect_error",l);break}}onevent(t){const i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const l of i)l.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const i=this;let l=!1;return function(...o){l||(l=!0,i.packet({type:Ue.ACK,id:t,data:o}))}}onack(t){const i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const i=this._anyListeners;for(let l=0;l<i.length;l++)if(t===i[l])return i.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const i=this._anyOutgoingListeners;for(let l=0;l<i.length;l++)if(t===i[l])return i.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const l of i)l.apply(this,t.data)}}}function ta(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ta.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-i:e+i}return Math.min(e,this.max)|0};ta.prototype.reset=function(){this.attempts=0};ta.prototype.setMin=function(e){this.ms=e};ta.prototype.setMax=function(e){this.max=e};ta.prototype.setJitter=function(e){this.jitter=e};class pp extends wt{constructor(t,i){var l;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Dc(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((l=i.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new ta({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;const o=i.parser||Rz;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Sz(this.uri,this.opts);const i=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const o=Rn(i,"open",function(){l.onopen(),t&&t()}),s=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),t?t(f):this.maybeReconnectOnOpen()},u=Rn(i,"error",s);if(this._timeout!==!1){const f=this._timeout,h=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),i.close()},f);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Rn(t,"ping",this.onping.bind(this)),Rn(t,"data",this.ondata.bind(this)),Rn(t,"error",this.onerror.bind(this)),Rn(t,"close",this.onclose.bind(this)),Rn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){Rc(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let l=this.nsps[t];return l?this._autoConnect&&!l.active&&l.connect():(l=new i2(this,t,i),this.nsps[t]=l),l}_destroy(t){const i=Object.keys(this.nsps);for(const l of i)if(this.nsps[l].active)return;this._close()}_packet(t){const i=this.encoder.encode(t);for(let l=0;l<i.length;l++)this.engine.write(i[l],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,i){var l;this.cleanup(),(l=this.engine)===null||l===void 0||l.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},i);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const io={};function Xu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const i=kz(e,t.path||"/socket.io"),l=i.source,o=i.id,s=i.path,u=io[o]&&s in io[o].nsps,f=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let h;return f?h=new pp(l,t):(io[o]||(io[o]=new pp(l,t)),h=io[o]),i.query&&!t.query&&(t.query=i.queryKey),h.socket(i.path,t)}Object.assign(Xu,{Manager:pp,Socket:i2,io:Xu,connect:Xu});const B1=window.location.origin;class Oz{socket;constructor(){this.socket=Xu(B1,{autoConnect:!0,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("[Socket] Connected to server:",B1)}),this.socket.on("disconnect",()=>{console.log("Disconnected from server")}),this.socket.on("connect_error",t=>{console.error("Socket connection error:",t.message)})}on(t,i){this.socket.on(t,i)}off(t,i){i?this.socket.off(t,i):this.socket.off(t)}emit(t,i){this.socket.connected||console.warn("Socket not connected, queuing emit:",t),this.socket.emit(t,i)}executeWorkflow(t){this.emit("execute:workflow",t)}cancelExecution(){this.emit("execute:cancel")}generateSkill(t){console.log("[Socket] Generating skill:",t.prompt.slice(0,50),"connected:",this.socket.connected),this.emit("generate:skill",t)}isConnected(){return this.socket.connected}disconnect(){this.socket.disconnect()}connect(){this.socket.connected||this.socket.connect()}}const Ct=new Oz;function r2(){const{nodes:e,edges:t,workflowName:i,updateNodeStatus:l}=Kn(),{isRunning:o,startExecution:s,stopExecution:u,setCurrentNode:f,markNodeCompleted:h,markNodeFailed:d,setWorkflowResults:g,addLog:p,clearLogs:b}=ea(),[v,w]=R.useState(null),E=R.useRef(null);R.useEffect(()=>{const N=A=>{const{nodeId:L,status:X,progress:Z,result:U,error:I}=A;X==="running"?(l(L,"running",Z||0),f(L)):X==="completed"?(l(L,"completed",100),h(L,U)):X==="error"&&(l(L,"error",0),d(L,I||"Unknown error"))},_=A=>{const L=A.type==="warn"?"warning":A.type==="debug"?"info":A.type;p(L,A.message,A.nodeId)},k=A=>{A.results&&g(A.results),A.outputDir&&w(A.outputDir),u(),p("success","워크플로우 실행 완료!")},T=A=>{u(),p("error",`실행 오류: ${A.error}`)},B=()=>{u(),p("warning","워크플로우 실행이 취소되었습니다.")};return Ct.on("node:update",N),Ct.on("console:log",_),Ct.on("workflow:completed",k),Ct.on("workflow:error",T),Ct.on("workflow:cancelled",B),()=>{Ct.off("node:update",N),Ct.off("console:log",_),Ct.off("workflow:completed",k),Ct.off("workflow:error",T),Ct.off("workflow:cancelled",B)}},[p,h,d,f,g,u,l]);const C=R.useCallback(()=>{if(e.length===0){p("warning","No nodes to execute");return}b(),s(),w(null);const N=`workflow-${Date.now()}`;E.current=N,p("info",`워크플로우 "${i}" 실행 시작 (Claude CLI)...`);const _={};e.forEach(k=>{if(k.type==="input"){const T=k.data,B=T.value||T.defaultValue||T.placeholder||"";B&&(_[k.id]=B)}}),Ct.executeWorkflow({workflowId:N,workflowName:i,nodes:e.map(k=>({id:k.id,type:k.type||"unknown",data:k.data})),edges:t.map(k=>({id:k.id,source:k.source,target:k.target})),inputs:_})},[e,t,i,p,b,s]);return{isRunning:o,execute:C,savedOutputDir:v}}function Lz(e,t,i,l="local"){const o=l==="global"?"~/.claude":".claude",s=Bz(t,o),u=Hz(t,o),f=Uz(e,t,i,o),h=Iz(t);return{skills:s,commands:f,agents:u,mcpSettings:h}}function Bz(e,t){return e.filter(l=>l.type==="skill").filter(l=>l.data.skillType==="custom").map(l=>{const o=l.data,s=na(o.skillId||o.label),u=`${t}/skills/${s}/SKILL.md`,f=qz(o);return{name:s,path:u,content:f}})}function Hz(e,t){return e.filter(l=>l.type==="agent").map(l=>{const o=l.data,s=na(o.label),u=`${t}/agents/${s}.md`,f=Vz(o);return{name:s,path:u,content:f}})}function Uz(e,t,i,l){if(t.length===0)return[];const o=na(e),s=`${l}/commands/${o}.md`,u=$z(e,t,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 t=na(e.skillId||e.label),i=e.description||e.label,l=["---",`name: ${t}`,`description: ${i}`,"---","",`# ${e.label}`,""];return e.mdContent?l.push(e.mdContent):l.push(`Execute the ${e.label} skill.`),l.join(`
24
+ `)}function Vz(e){const t=na(e.label),i=e.description||e.label,l=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",o=e.model||"sonnet",s=["---",`name: ${t}`,`description: ${i}`,`tools: ${l}`,`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(`
25
+ `)}function $z(e,t,i){const l=t.filter(g=>g.type==="input"),o=t.filter(g=>g.type==="output"),s=l.map(g=>`<${na(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];s&&f.push(`argument-hint: ${s}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),l.length>0&&(f.push("## Inputs"),f.push(""),l.forEach(g=>{const p=g.data;f.push(`- **${p.label}**: ${p.description||p.placeholder||"User input"}`)}),f.push("")),f.push("## Workflow Steps"),f.push("");const h=Pz(t,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==="agent"){const p=g.data;p.systemPrompt&&f.push(` - Prompt: ${p.systemPrompt.substring(0,100)}${p.systemPrompt.length>100?"...":""}`),p.tools.length>0&&f.push(` - Tools: ${p.tools.join(", ")}`)}if(g.type==="skill"){const p=g.data;p.skillId&&f.push(` - Invoke skill: ${p.skillId}`)}if(g.type==="hook"){const p=g.data;f.push(` - Hook: ${p.hookEvent} (${p.hookMatcher||"*"})`)}f.push(""),d++}}),o.length>0&&(f.push("## Outputs"),f.push(""),o.forEach(g=>{const p=g.data;f.push(`- **${p.label}**: ${p.outputType} format`)})),f.join(`
26
+ `)}function na(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Pz(e,t){const i=new Map(e.map(f=>[f.id,f])),l=new Map,o=new Map;e.forEach(f=>{l.set(f.id,0),o.set(f.id,[])}),t.forEach(f=>{o.get(f.source)?.push(f.target),l.set(f.target,(l.get(f.target)||0)+1)});const s=[];l.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=(l.get(d)||0)-1;l.set(d,g),g===0&&s.push(d)})}return u}async function l2(){try{const e=await fetch("/api/load/claude-config");if(!e.ok)throw new Error(`Failed to load config: ${e.statusText}`);const t=await e.json();return Yz(t)}catch(e){return console.error("Failed to load Claude config:",e),[]}}function Yz(e){const t=[];let i=0;const l=280,o=150;for(const s of e.skills)t.push({id:s.id,type:"skill",position:{x:100+i,y:o},data:{label:s.label,description:s.description,status:"idle",skillType:"custom",skillId:s.skillId,skillPath:s.skillPath}}),i+=l;for(const s of e.agents)t.push({id:s.id,type:"agent",position:{x:100+i,y:o},data:{label:s.label,description:s.description,role:"custom",tools:s.tools,model:s.model,skills:s.skills,systemPrompt:s.systemPrompt,status:"idle",usedInputs:[]}}),i+=l;for(const s of e.hooks)t.push({id:s.id,type:"hook",position:{x:100+i,y:o},data:{label:s.label,description:s.description,hookEvent:s.hookEvent,hookMatcher:s.hookMatcher,hookCommand:s.hookCommand,status:"idle",usedInputs:[]}}),i+=l;return t}function a2(e){var t,i,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(i=a2(e[t]))&&(l&&(l+=" "),l+=i)}else for(i in e)e[i]&&(l&&(l+=" "),l+=i);return l}function qt(){for(var e,t,i=0,l="",o=arguments.length;i<o;i++)(e=arguments[i])&&(t=a2(e))&&(l&&(l+=" "),l+=t);return l}const o2="http://localhost:3001/api";async function Fz(e,t){const i=await fetch(`${o2}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:t})});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.message||"Failed to save workflow")}return i.json()}async function Xz(){const e=await fetch(`${o2}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function Gz(e,t){const i=[];return t.includeSkills&&e.skills.forEach(l=>{i.push({path:l.path,content:l.content,type:"skill"})}),t.includeCommands&&e.commands.forEach(l=>{i.push({path:l.path,content:l.content,type:"command"})}),t.includeAgents&&e.agents.forEach(l=>{i.push({path:l.path,content:l.content,type:"agent"})}),t.includeMcpSettings&&e.mcpSettings&&i.push({path:t.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:i}}function Zz({isOpen:e,onClose:t,config:i}){const[l,o]=R.useState("local"),[s,u]=R.useState(!0),[f,h]=R.useState(!0),[d,g]=R.useState(!0),[p,b]=R.useState(!0),[v,w]=R.useState(""),[E,C]=R.useState([]),[N,_]=R.useState(null),[k,T]=R.useState(!1),[B,A]=R.useState(null),[L,X]=R.useState(null);R.useEffect(()=>{e&&Xz().then(w).catch(()=>w("."))},[e]),R.useEffect(()=>{if(!e)return;Gz(i,{location:l,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:p}).then(({files:ee})=>{C(ee),ee.length>0&&!N&&_(ee[0])})},[e,i,l,s,f,d,p]);const Z=async()=>{T(!0),X(null),A(null);const P={location:l,includeSkills:s,includeCommands:f,includeAgents:d,includeMcpSettings:p};try{const ee=await Fz(i,P);A(ee),ee.success&&setTimeout(()=>t(),2e3)}catch(ee){X(ee instanceof Error?ee.message:"Failed to save")}finally{T(!1)}},U=P=>{switch(P){case"skill":return x.jsx(bo,{className:"w-4 h-4 text-node-skill"});case"agent":return x.jsx(hC,{className:"w-4 h-4 text-node-generate"});case"command":return x.jsx(bc,{className:"w-4 h-4 text-accent"});case"mcp":return x.jsx(Dp,{className:"w-4 h-4 text-node-mcp"});default:return x.jsx(bo,{className:"w-4 h-4 text-gray-400"})}},I=i.skills.length>0||i.commands.length>0||i.agents.length>0||i.mcpSettings;return e?x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:x.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx(Qu,{className:"w-5 h-5 text-accent"}),x.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),x.jsx("button",{onClick:t,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:x.jsx(vc,{className:"w-5 h-5 text-gray-400"})})]}),x.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[x.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("button",{onClick:()=>o("local"),className:qt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",l==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[x.jsx(Fh,{className:"w-4 h-4"}),x.jsxs("div",{children:[x.jsx("div",{className:"text-sm font-medium",children:"Local"}),x.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),x.jsxs("button",{onClick:()=>o("global"),className:qt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",l==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[x.jsx(Fh,{className:"w-4 h-4"}),x.jsxs("div",{children:[x.jsx("div",{className:"text-sm font-medium",children:"Global"}),x.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[x.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"}),x.jsxs("span",{className:qt("text-sm",i.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",i.skills.length,")"]})]}),x.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[x.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"}),x.jsxs("span",{className:qt("text-sm",i.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",i.commands.length,")"]})]}),x.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[x.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"}),x.jsxs("span",{className:qt("text-sm",i.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",i.agents.length,")"]})]}),x.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[x.jsx("input",{type:"checkbox",checked:p,onChange:P=>b(P.target.checked),disabled:!i.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),x.jsx("span",{className:qt("text-sm",i.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),x.jsxs("div",{className:"pt-4 border-t border-border",children:[x.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),x.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:v,children:v||"Loading..."})]})]}),x.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((P,ee)=>x.jsxs("button",{onClick:()=>_(P),className:qt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",N===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[U(P.type),x.jsx("span",{children:P.path.split("/").pop()})]},ee)),E.length===0&&x.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),x.jsx("div",{className:"flex-1 overflow-auto p-4",children:N?x.jsxs("div",{className:"space-y-2",children:[x.jsx("div",{className:"text-xs text-gray-500 font-mono",children:N.path}),x.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:N.content})]}):x.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),x.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[B&&B.success&&x.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[x.jsx(gC,{className:"w-4 h-4"}),x.jsx("span",{children:"Saved successfully!"})]}),B&&!B.success&&x.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[x.jsx(Yh,{className:"w-4 h-4"}),x.jsx("span",{children:"Some files failed to save"})]}),L&&x.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[x.jsx(Yh,{className:"w-4 h-4"}),x.jsx("span",{children:L})]})]}),x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),x.jsxs("button",{onClick:Z,disabled:k||E.length===0||!I,className:qt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",k||E.length===0||!I?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[x.jsx(Qu,{className:"w-4 h-4"}),k?"Saving...":"Export"]})]})]})]})}):null}function Qz(){const e=_p(),{workflowName:t,setWorkflowName:i,isDraft:l,nodes:o,edges:s,clearWorkflow:u,mergeExistingConfig:f}=Kn(),{isRunning:h,execute:d}=r2(),[g,p]=R.useState(!1),[b,v]=R.useState(!1),[w,E]=R.useState(null),[C,N]=R.useState(!1),_=R.useCallback(async()=>{N(!0);try{const L=await l2();L.length>0&&f(L)}catch(L){console.error("Failed to reload config:",L)}finally{N(!1)}},[f]),k=()=>{const L=Lz(t,o,s,"local");E(L),p(!0)},T=()=>{p(!1),E(null)},B=()=>{h||d()},A=()=>{o.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&u()};return x.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsx("button",{onClick:()=>e("/"),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors group",title:"Back to Home",children:x.jsx(PC,{className:"w-5 h-5 text-gray-400 group-hover:text-white transition-colors"})}),x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("input",{type:"text",value:t,onChange:L=>i(L.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"}),l&&x.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),x.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),x.jsxs("button",{onClick:B,disabled:h,className:`
27
+ flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
28
+ ${h?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
29
+ `,children:[x.jsx(vo,{className:"w-4 h-4"}),h?"Running...":"Run"]}),x.jsxs("button",{onClick:k,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[x.jsx(Qu,{className:"w-4 h-4 text-gray-400"}),x.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),x.jsxs("button",{onClick:_,disabled:C,className:`
30
+ flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
31
+ ${C?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-blue-500/20 hover:text-blue-400"}
32
+ `,title:".claude/ 폴더에서 다시 로드",children:[x.jsx(o_,{className:`w-4 h-4 text-gray-400 ${C?"animate-spin":""}`}),x.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Reload"})]}),x.jsxs("button",{onClick:A,disabled:o.length===0,className:`
33
+ flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
34
+ ${o.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
35
+ `,title:"모든 노드 삭제",children:[x.jsx(wo,{className:"w-4 h-4 text-gray-400"}),x.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),x.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:x.jsx(u_,{className:"w-5 h-5 text-gray-400"})}),x.jsx("button",{onClick:()=>v(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:x.jsx(Dp,{className:"w-5 h-5 text-gray-400"})})]}),w&&x.jsx(Zz,{isOpen:g,onClose:T,config:w}),x.jsx(iv,{isOpen:b,onClose:()=>v(!1)})]})}function jo(e){const t={id:e.id,type:e.type,label:e.data.label,description:e.data.description};switch(e.type){case"skill":return{...t,skillId:e.data.skillId,skillPath:e.data.skillPath};case"agent":return{...t,tools:e.data.tools,model:e.data.model,skills:e.data.skills,systemPrompt:e.data.systemPrompt};case"hook":return{...t,hookEvent:e.data.hookEvent,hookMatcher:e.data.hookMatcher,hookCommand:e.data.hookCommand};default:return t}}async function s2(e){if(e.type==="input"||e.type==="output")return!0;try{const t=await fetch("/api/sync/node",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:jo(e)})});return t.ok?!0:(console.error("Failed to sync node:",await t.text()),!1)}catch(t){return console.error("Failed to sync node:",t),!1}}async function u2(e,t){if(e.type==="input"||e.type==="output")return!0;try{const i=await fetch("/api/sync/node",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:jo(e),nodes:t.map(jo)})});return i.ok?!0:(console.error("Failed to delete node:",await i.text()),!1)}catch(i){return console.error("Failed to delete node:",i),!1}}async function H1(e,t){const i=t.find(o=>o.id===e.source),l=t.find(o=>o.id===e.target);if(!i||!l||(i.type==="input"||i.type==="output")&&(l.type==="input"||l.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:l.type},nodes:t.map(jo)})});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 Kz(e,t){const i=t.find(o=>o.id===e.source),l=t.find(o=>o.id===e.target);if(!i||!l)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:l.type},nodes:t.map(jo)})});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 Jz=[{type:"input",label:"User Input",icon:x.jsx(xc,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"agent",label:"Agent",icon:x.jsx(Ho,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:x.jsx(Uo,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"hook",label:"Hook",icon:x.jsx(zp,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:x.jsx(gc,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function Wz(e){const t=Ql(),i={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:t,type:"input",position:i,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"agent":return{id:t,type:"agent",position:i,data:{label:"Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:t,type:"skill",position:i,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"hook":return{id:t,type:"hook",position:i,data:{label:"Hook",description:"Configure tool lifecycle hook...",hookEvent:"PreToolUse",status:"idle",usedInputs:[]}};case"output":return{id:t,type:"output",position:i,data:{label:"Output",description:"Select to edit in editor",outputType:"auto",status:"idle",usedInputs:[]}}}}function eR(){const e=Kn(i=>i.addNode),t=i=>{const l=Wz(i);e(l),s2(l).catch(o=>{console.error("Failed to sync node to filesystem:",o)})};return x.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:Jz.map(i=>x.jsxs("button",{onClick:()=>t(i.type),className:`
36
+ flex items-center gap-2 px-4 py-2 rounded-lg
37
+ bg-surface border border-border
38
+ ${i.hoverColor}
39
+ transition-all duration-200
40
+ hover:border-gray-500
41
+ `,children:[x.jsx("span",{className:i.color,children:i.icon}),x.jsx("span",{className:"text-sm font-medium text-gray-300",children:i.label})]},i.type))})}function tR({status:e}){switch(e){case"running":return x.jsx(Ku,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return x.jsx(NC,{className:"w-4 h-4 text-green-400"});case"error":return x.jsx(Yh,{className:"w-4 h-4 text-red-400"});default:return x.jsx(vo,{className:"w-4 h-4"})}}function nR({data:e,selected:t,children:i,headerIcon:l,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 x.jsxs("div",{className:qt("workflow-node",t&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[x.jsxs("div",{className:qt("node-header flex items-center justify-between",o),children:[x.jsxs("div",{className:"flex items-center gap-2",children:[l,x.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),x.jsx("div",{className:"flex items-center gap-1",children:x.jsx(tR,{status:e.status})})]}),x.jsxs("div",{className:"node-content",children:[e.description&&x.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),i,e.usedInputs&&e.usedInputs.length>0&&x.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[x.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),x.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>x.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:[x.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&x.jsx(Zl,{type:"target",position:ye.Left}),s&&x.jsx(Zl,{type:"source",position:ye.Right})]})}const Xo=R.memo(nR);function iR({data:e,selected:t}){return x.jsx(Xo,{data:e,selected:t,headerIcon:x.jsx(xc,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:x.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&x.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&x.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&x.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=>x.jsx("option",{value:i,children:i},i))})]})})}const rR=R.memo(iR);function lR({data:e,selected:t}){return x.jsx(Xo,{data:e,selected:t,headerIcon:x.jsx(Ho,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:x.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&x.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(i=>x.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&&x.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&&x.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const aR=R.memo(lR);function oR({data:e,selected:t}){return x.jsx(Xo,{data:e,selected:t,headerIcon:x.jsx(Uo,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:x.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&x.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&&x.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const sR=R.memo(oR);function uR({data:e,selected:t}){return x.jsx(Xo,{data:e,selected:t,headerIcon:x.jsx(zp,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:x.jsxs("div",{className:"space-y-2",children:[e.hookEvent&&x.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&&x.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const cR=R.memo(uR);function fR(e){switch(e){case"markdown":case"document":return x.jsx(bo,{className:"w-4 h-4 text-emerald-100"});case"image":return x.jsx(tv,{className:"w-4 h-4 text-emerald-100"});case"webpage":return x.jsx(VC,{className:"w-4 h-4 text-emerald-100"});case"link":return x.jsx(KC,{className:"w-4 h-4 text-emerald-100"});default:return x.jsx(gc,{className:"w-4 h-4 text-emerald-100"})}}function dR({data:e,selected:t}){return x.jsx(Xo,{data:e,selected:t,headerIcon:fR(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:x.jsxs("div",{className:"space-y-2",children:[e.layoutType&&x.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&&x.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const hR=R.memo(dR),Oc=Io(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:t=>e({activeTab:t}),toggleCollapsed:()=>e(t=>({isCollapsed:!t.isCollapsed})),setWidth:t=>e({width:Math.max(300,Math.min(600,t))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1}),openConsolePanel:()=>e({activeTab:"console",isCollapsed:!1})}));function U1(e,t){const{source:i,target:l}=e;if(i===l)return!1;const o=t.find(u=>u.id===i),s=t.find(u=>u.id===l);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 pR={input:rR,agent:aR,skill:sR,hook:cR,output:hR};function mR(){const{nodes:e,edges:t,setNodes:i,setEdges:l,addEdge:o,setSelectedNode:s}=Kn(),u=Oc(T=>T.openStepPanel),[f,h]=R.useState(!1),d=R.useRef([]);R.useEffect(()=>{const T=A=>{A.key==="Shift"&&h(!0)},B=A=>{A.key==="Shift"&&(h(!1),d.current=[])};return window.addEventListener("keydown",T),window.addEventListener("keyup",B),()=>{window.removeEventListener("keydown",T),window.removeEventListener("keyup",B)}},[]);const g=R.useCallback(({nodes:T})=>{if(!f){d.current=[];return}const B=T.map(A=>A.id);if(B.length===2){const[A,L]=B;if(!t.some(Z=>Z.source===A&&Z.target===L||Z.source===L&&Z.target===A)){const Z=e.find(I=>I.id===A),U=e.find(I=>I.id===L);if(Z&&U){let I=A,P=L;(Z.position?.x??0)>(U.position?.x??0)&&(I=L,P=A);const ee={source:I,target:P,sourceHandle:null,targetHandle:null};if(U1(ee,e)){const H={id:`e-${I}-${P}`,source:I,target:P,animated:!0};l(ip({...ee,animated:!0},t)),o(H),H1(H,e).catch(q=>{console.error("Failed to sync edge to filesystem:",q)})}}}}d.current=B},[f,e,t,l,o]),[p,b]=R.useState(null),v=R.useCallback(T=>{const B=T.filter(L=>L.type==="remove"),A=T.filter(L=>L.type!=="remove");if(A.length>0&&i($u(A,e)),B.length>0){const L=B.map(X=>e.find(Z=>Z.id===X.id)).filter(X=>X!==void 0&&X.type!=="input"&&X.type!=="output");L.length>0?b({changes:B,nodesToDelete:L}):i($u(B,e))}},[e,i]),w=R.useCallback(()=>{if(!p)return;const{changes:T,nodesToDelete:B}=p;for(const A of B)u2(A,e).catch(L=>{console.error("Failed to delete node from filesystem:",L)});i($u(T,e)),b(null)},[p,e,i]),E=R.useCallback(()=>{b(null)},[]),C=R.useCallback(T=>{for(const B of T)if(B.type==="remove"){const A=t.find(L=>L.id===B.id);A&&Kz(A,e).catch(L=>{console.error("Failed to remove edge from filesystem:",L)})}l(mw(T,t))},[t,e,l]),N=R.useCallback(T=>{if(!U1(T,e))return;const B={id:`e-${T.source}-${T.target}`,source:T.source,target:T.target,animated:!0};l(ip({...T,animated:!0},t)),o(B),H1(B,e).catch(A=>{console.error("Failed to sync edge to filesystem:",A)})},[e,t,l,o]),_=R.useCallback((T,B)=>{s(B.id),u()},[s,u]),k=R.useCallback(()=>{s(null)},[s]);return x.jsxs(x.Fragment,{children:[x.jsxs(hj,{nodes:e,edges:t,onNodesChange:v,onEdgesChange:C,onConnect:N,onSelectionChange:g,onNodeClick:_,onPaneClick:k,nodeTypes:pR,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,selectionOnDrag:!1,multiSelectionKeyCode:"Shift",children:[x.jsx(xj,{variant:_i.Dots,gap:20,size:1,color:"#333333"}),x.jsx(Nj,{}),x.jsx(Hj,{nodeColor:T=>{switch(T.type){case"input":return"#fef3c7";case"agent":return"#4f46e5";case"skill":return"#06b6d4";case"hook":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]}),p&&x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:x.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 border border-zinc-700 shadow-xl",children:[x.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[x.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:x.jsx("svg",{className:"w-5 h-5 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),x.jsx("h3",{className:"text-lg font-semibold text-white",children:"노드 삭제 확인"})]}),x.jsxs("p",{className:"text-zinc-300 mb-4",children:["다음 노드를 삭제하시겠습니까? 이 작업은 ",x.jsx("span",{className:"text-red-400 font-medium",children:"파일을 삭제"}),"하며 되돌릴 수 없습니다."]}),x.jsx("ul",{className:"bg-zinc-900 rounded-md p-3 mb-6 space-y-2",children:p.nodesToDelete.map(T=>x.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[x.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${T.type==="skill"?"bg-cyan-500/20 text-cyan-300":T.type==="agent"?"bg-indigo-500/20 text-indigo-300":T.type==="hook"?"bg-pink-500/20 text-pink-300":"bg-zinc-500/20 text-zinc-300"}`,children:T.type}),x.jsx("span",{className:"text-white",children:T.data.label})]},T.id))}),x.jsxs("div",{className:"flex gap-3 justify-end",children:[x.jsx("button",{onClick:E,className:"px-4 py-2 rounded-md bg-zinc-700 text-zinc-300 hover:bg-zinc-600 transition-colors",children:"취소"}),x.jsx("button",{onClick:w,className:"px-4 py-2 rounded-md bg-red-600 text-white hover:bg-red-500 transition-colors",children:"삭제"})]})]})})]})}function gR(e,t){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const yR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bR={};function I1(e,t){return(bR.jsx?xR:yR).test(e)}const vR=/[ \t\n\f\r]/g;function wR(e){return typeof e=="object"?e.type==="text"?q1(e.value):!1:q1(e)}function q1(e){return e.replace(vR,"")===""}class Go{constructor(t,i,l){this.normal=i,this.property=t,l&&(this.space=l)}}Go.prototype.normal={};Go.prototype.property={};Go.prototype.space=void 0;function c2(e,t){const i={},l={};for(const o of e)Object.assign(i,o.property),Object.assign(l,o.normal);return new Go(i,l,t)}function mp(e){return e.toLowerCase()}class en{constructor(t,i){this.attribute=i,this.property=t}}en.prototype.attribute="";en.prototype.booleanish=!1;en.prototype.boolean=!1;en.prototype.commaOrSpaceSeparated=!1;en.prototype.commaSeparated=!1;en.prototype.defined=!1;en.prototype.mustUseProperty=!1;en.prototype.number=!1;en.prototype.overloadedBoolean=!1;en.prototype.property="";en.prototype.spaceSeparated=!1;en.prototype.space=void 0;let SR=0;const Me=Fr(),vt=Fr(),gp=Fr(),fe=Fr(),nt=Fr(),ql=Fr(),fn=Fr();function Fr(){return 2**++SR}const yp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Me,booleanish:vt,commaOrSpaceSeparated:fn,commaSeparated:ql,number:fe,overloadedBoolean:gp,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),Nh=Object.keys(yp);class lm extends en{constructor(t,i,l,o){let s=-1;if(super(t,i),V1(this,"space",o),typeof l=="number")for(;++s<Nh.length;){const u=Nh[s];V1(this,Nh[s],(l&yp[u])===yp[u])}}}lm.prototype.defined=!0;function V1(e,t,i){i&&(e[t]=i)}function ia(e){const t={},i={};for(const[l,o]of Object.entries(e.properties)){const s=new lm(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(s.mustUseProperty=!0),t[l]=s,i[mp(l)]=l,i[mp(s.attribute)]=l}return new Go(t,i,e.space)}const f2=ia({properties:{ariaActiveDescendant:null,ariaAtomic:vt,ariaAutoComplete:null,ariaBusy:vt,ariaChecked:vt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:vt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:vt,ariaFlowTo:nt,ariaGrabbed:vt,ariaHasPopup:null,ariaHidden:vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:fe,ariaLive:null,ariaModal:vt,ariaMultiLine:vt,ariaMultiSelectable:vt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:vt,ariaReadOnly:vt,ariaRelevant:null,ariaRequired:vt,ariaRoleDescription:nt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:vt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function d2(e,t){return t in e?e[t]:t}function h2(e,t){return d2(e,t.toLowerCase())}const kR=ia({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ql,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:Me,allowPaymentRequest:Me,allowUserMedia:Me,alt:null,as:null,async:Me,autoCapitalize:null,autoComplete:nt,autoFocus:Me,autoPlay:Me,blocking:nt,capture:null,charSet:null,checked:Me,cite:null,className:nt,cols:fe,colSpan:null,content:null,contentEditable:vt,controls:Me,controlsList:nt,coords:fe|ql,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Me,defer:Me,dir:null,dirName:null,disabled:Me,download:gp,draggable:vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Me,formTarget:null,headers:nt,height:fe,hidden:gp,high:fe,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:Me,inputMode:null,integrity:null,is:null,isMap:Me,itemId:null,itemProp:nt,itemRef:nt,itemScope:Me,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Me,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Me,muted:Me,name:null,nonce:null,noModule:Me,noValidate:Me,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:Me,optimum:fe,pattern:null,ping:nt,placeholder:null,playsInline:Me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Me,referrerPolicy:null,rel:nt,required:Me,reversed:Me,rows:fe,rowSpan:fe,sandbox:nt,scope:null,scoped:Me,seamless:Me,selected:Me,shadowRootClonable:Me,shadowRootDelegatesFocus:Me,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Me,useMap:null,value:vt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Me,declare:Me,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Me,noHref:Me,noShade:Me,noWrap:Me,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:vt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Me,disableRemotePlayback:Me,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:h2}),ER=ia({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:fn,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Me,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:ql,g2:ql,glyphName:ql,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fn,rev:fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fn,requiredFeatures:fn,requiredFonts:fn,requiredFormats:fn,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:d2}),p2=ia({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),m2=ia({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:h2}),g2=ia({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),NR={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"},CR=/[A-Z]/g,$1=/-[a-z]/g,_R=/^data[-\w.:]+$/i;function TR(e,t){const i=mp(t);let l=t,o=en;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&_R.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace($1,MR);l="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!$1.test(s)){let u=s.replace(CR,AR);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=lm}return new o(l,t)}function AR(e){return"-"+e.toLowerCase()}function MR(e){return e.charAt(1).toUpperCase()}const jR=c2([f2,kR,p2,m2,g2],"html"),am=c2([f2,ER,p2,m2,g2],"svg");function zR(e){return e.join(" ").trim()}var Dl={},Ch,P1;function RR(){if(P1)return Ch;P1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,i=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
42
+ `,d="/",g="*",p="",b="comment",v="declaration";function w(C,N){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];N=N||{};var _=1,k=1;function T(H){var q=H.match(t);q&&(_+=q.length);var D=H.lastIndexOf(h);k=~D?H.length-D:k+H.length}function B(){var H={line:_,column:k};return function(q){return q.position=new A(H),Z(),q}}function A(H){this.start=H,this.end={line:_,column:k},this.source=N.source}A.prototype.content=C;function L(H){var q=new Error(N.source+":"+_+":"+k+": "+H);if(q.reason=H,q.filename=N.source,q.line=_,q.column=k,q.source=C,!N.silent)throw q}function X(H){var q=H.exec(C);if(q){var D=q[0];return T(D),C=C.slice(D.length),q}}function Z(){X(i)}function U(H){var q;for(H=H||[];q=I();)q!==!1&&H.push(q);return H}function I(){var H=B();if(!(d!=C.charAt(0)||g!=C.charAt(1))){for(var q=2;p!=C.charAt(q)&&(g!=C.charAt(q)||d!=C.charAt(q+1));)++q;if(q+=2,p===C.charAt(q-1))return L("End of comment missing");var D=C.slice(2,q-2);return k+=2,T(D),C=C.slice(q),k+=2,H({type:b,comment:D})}}function P(){var H=B(),q=X(l);if(q){if(I(),!X(o))return L("property missing ':'");var D=X(s),V=H({type:v,property:E(q[0].replace(e,p)),value:D?E(D[0].replace(e,p)):p});return X(u),V}}function ee(){var H=[];U(H);for(var q;q=P();)q!==!1&&(H.push(q),U(H));return H}return Z(),ee()}function E(C){return C?C.replace(f,p):p}return Ch=w,Ch}var Y1;function DR(){if(Y1)return Dl;Y1=1;var e=Dl&&Dl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.default=i;const t=e(RR());function i(l,o){let s=null;if(!l||typeof l!="string")return s;const u=(0,t.default)(l),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 Dl}var ro={},F1;function OR(){if(F1)return ro;F1=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,i=/^[^-]+$/,l=/^-(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(l,f),d.replace(t,u))};return ro.camelCase=h,ro}var lo,X1;function LR(){if(X1)return lo;X1=1;var e=lo&&lo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(DR()),i=OR();function l(o,s){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(f,h){f&&h&&(u[(0,i.camelCase)(f,s)]=h)}),u}return l.default=l,lo=l,lo}var BR=LR();const HR=hc(BR),y2=x2("end"),om=x2("start");function x2(e){return t;function t(i){const l=i&&i.position&&i.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function UR(e){const t=om(e),i=y2(e);if(t&&i)return{start:t,end:i}}function mo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?G1(e.position):"start"in e||"end"in e?G1(e):"line"in e||"column"in e?xp(e):""}function xp(e){return Z1(e&&e.line)+":"+Z1(e&&e.column)}function G1(e){return xp(e&&e.start)+"-"+xp(e&&e.end)}function Z1(e){return e&&typeof e=="number"?e:1}class Ht extends Error{constructor(t,i,l){super(),typeof i=="string"&&(l=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 t=="string"?o=t:!s.cause&&t&&(u=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?s.ruleId=l:(s.source=l.slice(0,h),s.ruleId=l.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=mo(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}}Ht.prototype.file="";Ht.prototype.name="";Ht.prototype.reason="";Ht.prototype.message="";Ht.prototype.stack="";Ht.prototype.column=void 0;Ht.prototype.line=void 0;Ht.prototype.ancestors=void 0;Ht.prototype.cause=void 0;Ht.prototype.fatal=void 0;Ht.prototype.place=void 0;Ht.prototype.ruleId=void 0;Ht.prototype.source=void 0;const sm={}.hasOwnProperty,IR=new Map,qR=/[A-Z]/g,VR=new Set(["table","tbody","thead","tfoot","tr"]),$R=new Set(["td","th"]),b2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PR(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=t.filePath||void 0;let l;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=JR(i,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=KR(i,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?am:jR,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=v2(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function v2(e,t,i){if(t.type==="element")return YR(e,t,i);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return GR(e,t,i);if(t.type==="mdxjsEsm")return XR(e,t);if(t.type==="root")return ZR(e,t,i);if(t.type==="text")return QR(e,t)}function YR(e,t,i){const l=e.schema;let o=l;t.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=am,e.schema=o),e.ancestors.push(t);const s=S2(e,t.tagName,!1),u=WR(e,t);let f=cm(e,t);return VR.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!wR(h):!0})),w2(e,u,s,t),um(u,f),e.ancestors.pop(),e.schema=l,e.create(t,s,u,i)}function FR(e,t){if(t.data&&t.data.estree&&e.evaluater){const l=t.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}zo(e,t.position)}function XR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zo(e,t.position)}function GR(e,t,i){const l=e.schema;let o=l;t.name==="svg"&&l.space==="html"&&(o=am,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:S2(e,t.name,!0),u=eD(e,t),f=cm(e,t);return w2(e,u,s,t),um(u,f),e.ancestors.pop(),e.schema=l,e.create(t,s,u,i)}function ZR(e,t,i){const l={};return um(l,cm(e,t)),e.create(t,e.Fragment,l,i)}function QR(e,t){return t.value}function w2(e,t,i,l){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(t.node=l)}function um(e,t){if(t.length>0){const i=t.length>1?t:t[0];i&&(e.children=i)}}function KR(e,t,i){return l;function l(o,s,u,f){const d=Array.isArray(u.children)?i:t;return f?d(s,u,f):d(s,u)}}function JR(e,t){return i;function i(l,o,s,u){const f=Array.isArray(s.children),h=om(l);return t(o,s,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function WR(e,t){const i={};let l,o;for(o in t.properties)if(o!=="children"&&sm.call(t.properties,o)){const s=tD(e,o,t.properties[o]);if(s){const[u,f]=s;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&$R.has(t.tagName)?l=f:i[u]=f}}if(l){const s=i.style||(i.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return i}function eD(e,t){const i={};for(const l of t.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const s=l.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 zo(e,t.position);else{const o=l.name;let s;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else zo(e,t.position);else s=l.value===null?!0:l.value;i[o]=s}return i}function cm(e,t){const i=[];let l=-1;const o=e.passKeys?new Map:IR;for(;++l<t.children.length;){const s=t.children[l];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=v2(e,s,u);f!==void 0&&i.push(f)}return i}function tD(e,t,i){const l=TR(e.schema,t);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=l.commaSeparated?gR(i):zR(i)),l.property==="style"){let o=typeof i=="object"?i:nD(e,String(i));return e.stylePropertyNameCase==="css"&&(o=iD(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?NR[l.property]||l.property:l.attribute,i]}}function nD(e,t){try{return HR(t,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const l=i,o=new Ht("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=b2+"#cannot-parse-style-attribute",o}}function S2(e,t,i){let l;if(!i)l={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,u;for(;++s<o.length;){const f=I1(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}l=u}else l=I1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(l.type==="Literal"){const o=l.value;return sm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);zo(e)}function zo(e,t){const i=new Ht("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=b2+"#cannot-handle-mdx-estrees-without-createevaluater",i}function iD(e){const t={};let i;for(i in e)sm.call(e,i)&&(t[rD(i)]=e[i]);return t}function rD(e){let t=e.replace(qR,lD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lD(e){return"-"+e.toLowerCase()}const _h={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"]},aD={};function fm(e,t){const i=aD,l=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return k2(e,l,o)}function k2(e,t,i){if(oD(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Q1(e.children,t,i)}return Array.isArray(e)?Q1(e,t,i):""}function Q1(e,t,i){const l=[];let o=-1;for(;++o<e.length;)l[o]=k2(e[o],t,i);return l.join("")}function oD(e){return!!(e&&typeof e=="object")}const K1=document.createElement("i");function dm(e){const t="&"+e+";";K1.innerHTML=t;const i=K1.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===t?!1:i}function hn(e,t,i,l){const o=e.length;let s=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,i=i>0?i:0,l.length<1e4)u=Array.from(l),u.unshift(t,i),e.splice(...u);else for(i&&e.splice(t,i);s<l.length;)u=l.slice(s,s+1e4),u.unshift(t,0),e.splice(...u),s+=1e4,t+=1e4}function En(e,t){return e.length>0?(hn(e,e.length,0,t),e):t}const J1={}.hasOwnProperty;function E2(e){const t={};let i=-1;for(;++i<e.length;)sD(t,e[i]);return t}function sD(e,t){let i;for(i in t){const o=(J1.call(e,i)?e[i]:void 0)||(e[i]={}),s=t[i];let u;if(s)for(u in s){J1.call(o,u)||(o[u]=[]);const f=s[u];uD(o[u],Array.isArray(f)?f:f?[f]:[])}}}function uD(e,t){let i=-1;const l=[];for(;++i<t.length;)(t[i].add==="after"?e:l).push(t[i]);hn(e,0,0,l)}function N2(e,t){const i=Number.parseInt(e,t);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 Bn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Vt=hr(/[A-Za-z]/),Bt=hr(/[\dA-Za-z]/),cD=hr(/[#-'*+\--9=?A-Z^-~]/);function uc(e){return e!==null&&(e<32||e===127)}const bp=hr(/\d/),fD=hr(/[\dA-Fa-f]/),dD=hr(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}const Lc=hr(new RegExp("\\p{P}|\\p{S}","u")),Pr=hr(/\s/);function hr(e){return t;function t(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function ra(e){const t=[];let i=-1,l=0,o=0;for(;++i<e.length;){const s=e.charCodeAt(i);let u="";if(s===37&&Bt(e.charCodeAt(i+1))&&Bt(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&&(t.push(e.slice(l,i),encodeURIComponent(u)),l=i+o+1,u=""),o&&(i+=o,o=0)}return t.join("")+e.slice(l)}function qe(e,t,i,l){const o=l?l-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(h){return Oe(h)?(e.enter(i),f(h)):t(h)}function f(h){return Oe(h)&&s++<o?(e.consume(h),f):(e.exit(i),t(h))}}const hD={tokenize:pD};function pD(e){const t=e.attempt(this.parser.constructs.contentInitial,l,o);let i;return t;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qe(e,t,"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 ve(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),u)}}const mD={tokenize:gD},W1={tokenize:yD};function gD(e){const t=this,i=[];let l=0,o,s,u;return f;function f(k){if(l<i.length){const T=i[l];return t.containerState=T[1],e.attempt(T[0].continuation,h,d)(k)}return d(k)}function h(k){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();const T=t.events.length;let B=T,A;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){A=t.events[B][1].end;break}N(l);let L=T;for(;L<t.events.length;)t.events[L][1].end={...A},L++;return hn(t.events,B+1,0,t.events.slice(T)),t.events.length=L,d(k)}return f(k)}function d(k){if(l===i.length){if(!o)return b(k);if(o.currentConstruct&&o.currentConstruct.concrete)return w(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(W1,g,p)(k)}function g(k){return o&&_(),N(l),b(k)}function p(k){return t.parser.lazy[t.now().line]=l!==i.length,u=t.now().offset,w(k)}function b(k){return t.containerState={},e.attempt(W1,v,w)(k)}function v(k){return l++,i.push([t.currentConstruct,t.containerState]),b(k)}function w(k){if(k===null){o&&_(),N(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),E(k)}function E(k){if(k===null){C(e.exit("chunkFlow"),!0),N(0),e.consume(k);return}return ve(k)?(e.consume(k),C(e.exit("chunkFlow")),l=0,t.interrupt=void 0,f):(e.consume(k),E)}function C(k,T){const B=t.sliceStream(k);if(T&&B.push(null),k.previous=s,s&&(s.next=k),s=k,o.defineSkip(k.start),o.write(B),t.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 L=t.events.length;let X=L,Z,U;for(;X--;)if(t.events[X][0]==="exit"&&t.events[X][1].type==="chunkFlow"){if(Z){U=t.events[X][1].end;break}Z=!0}for(N(l),A=L;A<t.events.length;)t.events[A][1].end={...U},A++;hn(t.events,X+1,0,t.events.slice(L)),t.events.length=A}}function N(k){let T=i.length;for(;T-- >k;){const B=i[T];t.containerState=B[1],B[0].exit.call(t,e)}i.length=k}function _(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function yD(e,t,i){return qe(e,e.attempt(this.parser.constructs.document,t,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kl(e){if(e===null||tt(e)||Pr(e))return 1;if(Lc(e))return 2}function Bc(e,t,i){const l=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!l.includes(s)&&(t=s(t,i),l.push(s))}return t}const vp={name:"attention",resolveAll:xD,tokenize:bD};function xD(e,t){let i=-1,l,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(l=i;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&t.sliceSerialize(e[l][1]).charCodeAt(0)===t.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[l][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const p={...e[l][1].end},b={...e[i][1].start};eb(p,-h),eb(b,h),u={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:b},s={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[i][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[l][1].end={...u.start},e[i][1].start={...f.end},d=[],e[l][1].end.offset-e[l][1].start.offset&&(d=En(d,[["enter",e[l][1],t],["exit",e[l][1],t]])),d=En(d,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",s,t]]),d=En(d,Bc(t.parser.constructs.insideSpan.null,e.slice(l+1,i),t)),d=En(d,[["exit",s,t],["enter",f,t],["exit",f,t],["exit",o,t]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=En(d,[["enter",e[i][1],t],["exit",e[i][1],t]])):g=0,hn(e,l-1,i-l+3,d),i=l+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function bD(e,t){const i=this.parser.constructs.attentionMarkers.null,l=this.previous,o=Kl(l);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=Kl(h),p=!g||g===2&&o||i.includes(h),b=!o||o===2&&g||i.includes(l);return d._open=!!(s===42?p:p&&(o||!b)),d._close=!!(s===42?b:b&&(g||!p)),t(h)}}function eb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vD={name:"autolink",tokenize:wD};function wD(e,t,i){let l=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(v){return Vt(v)?(e.consume(v),u):v===64?i(v):d(v)}function u(v){return v===43||v===45||v===46||Bt(v)?(l=1,f(v)):d(v)}function f(v){return v===58?(e.consume(v),l=0,h):(v===43||v===45||v===46||Bt(v))&&l++<32?(e.consume(v),f):(l=0,d(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||uc(v)?i(v):(e.consume(v),h)}function d(v){return v===64?(e.consume(v),g):cD(v)?(e.consume(v),d):i(v)}function g(v){return Bt(v)?p(v):i(v)}function p(v){return v===46?(e.consume(v),l=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||Bt(v))&&l++<63){const w=v===45?b:p;return e.consume(v),w}return i(v)}}const Zo={partial:!0,tokenize:SD};function SD(e,t,i){return l;function l(s){return Oe(s)?qe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||ve(s)?t(s):i(s)}}const C2={continuation:{tokenize:ED},exit:ND,name:"blockQuote",tokenize:kD};function kD(e,t,i){const l=this;return o;function o(u){if(u===62){const f=l.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 Oe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function ED(e,t,i){const l=this;return o;function o(u){return Oe(u)?qe(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(C2,t,i)(u)}}function ND(e){e.exit("blockQuote")}const _2={name:"characterEscape",tokenize:CD};function CD(e,t,i){return l;function l(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return dD(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):i(s)}}const T2={name:"characterReference",tokenize:_D};function _D(e,t,i){const l=this;let o=0,s,u;return f;function f(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,u=Bt,g(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=fD,g):(e.enter("characterReferenceValue"),s=7,u=bp,g(p))}function g(p){if(p===59&&o){const b=e.exit("characterReferenceValue");return u===Bt&&!dm(l.sliceSerialize(b))?i(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(p)&&o++<s?(e.consume(p),g):i(p)}}const tb={partial:!0,tokenize:AD},nb={concrete:!0,name:"codeFenced",tokenize:TD};function TD(e,t,i){const l=this,o={partial:!0,tokenize:B};let s=0,u=0,f;return h;function h(A){return d(A)}function d(A){const L=l.events[l.events.length-1];return s=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[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"),Oe(A)?qe(e,p,"whitespace")(A):p(A))}function p(A){return A===null||ve(A)?(e.exit("codeFencedFence"),l.interrupt?t(A):e.check(tb,E,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||ve(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):Oe(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,v,"whitespace")(A)):A===96&&A===f?i(A):(e.consume(A),b)}function v(A){return A===null||ve(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||ve(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===f?i(A):(e.consume(A),w)}function E(A){return e.attempt(o,T,C)(A)}function C(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),N}function N(A){return s>0&&Oe(A)?qe(e,_,"linePrefix",s+1)(A):_(A)}function _(A){return A===null||ve(A)?e.check(tb,E,T)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||ve(A)?(e.exit("codeFlowValue"),_(A)):(e.consume(A),k)}function T(A){return e.exit("codeFenced"),t(A)}function B(A,L,X){let Z=0;return U;function U(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),I}function I(q){return A.enter("codeFencedFence"),Oe(q)?qe(A,P,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):P(q)}function P(q){return q===f?(A.enter("codeFencedFenceSequence"),ee(q)):X(q)}function ee(q){return q===f?(Z++,A.consume(q),ee):Z>=u?(A.exit("codeFencedFenceSequence"),Oe(q)?qe(A,H,"whitespace")(q):H(q)):X(q)}function H(q){return q===null||ve(q)?(A.exit("codeFencedFence"),L(q)):X(q)}}}function AD(e,t,i){const l=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 l.parser.lazy[l.now().line]?i(u):t(u)}}const Th={name:"codeIndented",tokenize:jD},MD={partial:!0,tokenize:zD};function jD(e,t,i){const l=this;return o;function o(d){return e.enter("codeIndented"),qe(e,s,"linePrefix",5)(d)}function s(d){const g=l.events[l.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):ve(d)?e.attempt(MD,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||ve(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function zD(e,t,i){const l=this;return o;function o(u){return l.parser.lazy[l.now().line]?i(u):ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):qe(e,s,"linePrefix",5)(u)}function s(u){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):ve(u)?o(u):i(u)}}const RD={name:"codeText",previous:OD,resolve:DD,tokenize:LD};function DD(e){let t=e.length-4,i=3,l,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(l=i;++l<t;)if(e[l][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[t][1].type="codeTextPadding",i+=2,t-=2;break}}for(l=i-1,t++;++l<=t;)o===void 0?l!==t&&e[l][1].type!=="lineEnding"&&(o=l):(l===t||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),t-=l-o-2,l=o+2),o=void 0);return e}function OD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LD(e,t,i){let l=0,o,s;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),f(p)}function f(p){return p===96?(e.consume(p),l++,f):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?i(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(s=e.enter("codeTextSequence"),o=0,g(p)):ve(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||ve(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function g(p){return p===96?(e.consume(p),o++,g):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",d(p))}}class BD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,i){const l=i??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(t,l):t>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(t,i,l){const o=i||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&ao(this.left,l),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ao(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ao(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const i=this.left.splice(t,Number.POSITIVE_INFINITY);ao(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ao(this.left,i.reverse())}}}function ao(e,t){let i=0;if(t.length<1e4)e.push(...t);else for(;i<t.length;)e.push(...t.slice(i,i+1e4)),i+=1e4}function A2(e){const t={};let i=-1,l,o,s,u,f,h,d;const g=new BD(e);for(;++i<g.length;){for(;i in t;)i=t[i];if(l=g.get(i),i&&l[1].type==="chunkFlow"&&g.get(i-1)[1].type==="listItemPrefix"&&(h=l[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(l[0]==="enter")l[1].contentType&&(Object.assign(t,HD(g,i)),i=t[i],d=!0);else if(l[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&&(l[1].end={...g.get(o)[1].start},f=g.slice(o,i),f.unshift(l),g.splice(o,i-o+1,f))}}return hn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function HD(e,t){const i=e.get(t)[1],l=e.get(t)[2];let o=t-1;const s=[];let u=i._tokenizer;u||(u=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,p,b=-1,v=i,w=0,E=0;const C=[E];for(;v;){for(;e.get(++o)[1]!==v;);s.push(o),v._tokenizer||(g=l.sliceStream(v),v.next||g.push(null),p&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=i;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(E=b+1,C.push(E),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):C.pop(),b=C.length;b--;){const N=f.slice(C[b],C[b+1]),_=s.pop();h.push([_,_+N.length-1]),e.splice(_,2,N)}for(h.reverse(),b=-1;++b<h.length;)d[w+h[b][0]]=w+h[b][1],w+=h[b][1]-h[b][0]-1;return d}const UD={resolve:qD,tokenize:VD},ID={partial:!0,tokenize:$D};function qD(e){return A2(e),e}function VD(e,t){let i;return l;function l(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?s(f):ve(f)?e.check(ID,u,s)(f):(e.consume(f),o)}function s(f){return e.exit("chunkContent"),e.exit("content"),t(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 $D(e,t,i){const l=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),qe(e,s,"linePrefix")}function s(u){if(u===null||ve(u))return i(u);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(l.parser.constructs.flow,i,t)(u)}}function M2(e,t,i,l,o,s,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(N){return N===60?(e.enter(l),e.enter(o),e.enter(s),e.consume(N),e.exit(s),b):N===null||N===32||N===41||uc(N)?i(N):(e.enter(l),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(N))}function b(N){return N===62?(e.enter(s),e.consume(N),e.exit(s),e.exit(o),e.exit(l),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(f),b(N)):N===null||N===60||ve(N)?i(N):(e.consume(N),N===92?w:v)}function w(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function E(N){return!g&&(N===null||N===41||tt(N))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(l),t(N)):g<d&&N===40?(e.consume(N),g++,E):N===41?(e.consume(N),g--,E):N===null||N===32||N===40||uc(N)?i(N):(e.consume(N),N===92?C:E)}function C(N){return N===40||N===41||N===92?(e.consume(N),E):E(N)}}function j2(e,t,i,l,o,s){const u=this;let f=0,h;return d;function d(v){return e.enter(l),e.enter(o),e.consume(v),e.exit(o),e.enter(s),g}function g(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(v):v===93?(e.exit(s),e.enter(o),e.consume(v),e.exit(o),e.exit(l),t):ve(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||ve(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!Oe(v)),v===92?b:p)}function b(v){return v===91||v===92||v===93?(e.consume(v),f++,p):p(v)}}function z2(e,t,i,l,o,s){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(l),e.enter(o),e.consume(b),e.exit(o),u=b===40?41:b,h):i(b)}function h(b){return b===u?(e.enter(o),e.consume(b),e.exit(o),e.exit(l),t):(e.enter(s),d(b))}function d(b){return b===u?(e.exit(s),h(u)):b===null?i(b):ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),qe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===u||b===null||ve(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?p:g)}function p(b){return b===u||b===92?(e.consume(b),g):g(b)}}function go(e,t){let i;return l;function l(o){return ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,l):Oe(o)?qe(e,l,i?"linePrefix":"lineSuffix")(o):t(o)}}const PD={name:"definition",tokenize:FD},YD={partial:!0,tokenize:XD};function FD(e,t,i){const l=this;let o;return s;function s(v){return e.enter("definition"),u(v)}function u(v){return j2.call(l,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=Bn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):i(v)}function h(v){return tt(v)?go(e,d)(v):d(v)}function d(v){return M2(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(YD,p,p)(v)}function p(v){return Oe(v)?qe(e,b,"whitespace")(v):b(v)}function b(v){return v===null||ve(v)?(e.exit("definition"),l.parser.defined.push(o),t(v)):i(v)}}function XD(e,t,i){return l;function l(f){return tt(f)?go(e,o)(f):i(f)}function o(f){return z2(e,s,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return Oe(f)?qe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||ve(f)?t(f):i(f)}}const GD={name:"hardBreakEscape",tokenize:ZD};function ZD(e,t,i){return l;function l(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return ve(s)?(e.exit("hardBreakEscape"),t(s)):i(s)}}const QD={name:"headingAtx",resolve:KD,tokenize:JD};function KD(e,t){let i=e.length-2,l=3,o,s;return e[l][1].type==="whitespace"&&(l+=2),i-2>l&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(l===i-1||i-4>l&&e[i-2][1].type==="whitespace")&&(i-=l+1===i?2:4),i>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[i][1].end},s={type:"chunkText",start:e[l][1].start,end:e[i][1].end,contentType:"text"},hn(e,l,i-l+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function JD(e,t,i){let l=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&&l++<6?(e.consume(g),u):g===null||tt(g)?(e.exit("atxHeadingSequence"),f(g)):i(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||ve(g)?(e.exit("atxHeading"),t(g)):Oe(g)?qe(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||tt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const WD=["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"],ib=["pre","script","style","textarea"],eO={concrete:!0,name:"htmlFlow",resolveTo:iO,tokenize:rO},tO={partial:!0,tokenize:aO},nO={partial:!0,tokenize:lO};function iO(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rO(e,t,i){const l=this;let o,s,u,f,h;return d;function d(j){return g(j)}function g(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),p}function p(j){return j===33?(e.consume(j),b):j===47?(e.consume(j),s=!0,E):j===63?(e.consume(j),o=3,l.interrupt?t:z):Vt(j)?(e.consume(j),u=String.fromCharCode(j),C):i(j)}function b(j){return j===45?(e.consume(j),o=2,v):j===91?(e.consume(j),o=5,f=0,w):Vt(j)?(e.consume(j),o=4,l.interrupt?t:z):i(j)}function v(j){return j===45?(e.consume(j),l.interrupt?t:z):i(j)}function w(j){const ne="CDATA[";return j===ne.charCodeAt(f++)?(e.consume(j),f===ne.length?l.interrupt?t:P:w):i(j)}function E(j){return Vt(j)?(e.consume(j),u=String.fromCharCode(j),C):i(j)}function C(j){if(j===null||j===47||j===62||tt(j)){const ne=j===47,ue=u.toLowerCase();return!ne&&!s&&ib.includes(ue)?(o=1,l.interrupt?t(j):P(j)):WD.includes(u.toLowerCase())?(o=6,ne?(e.consume(j),N):l.interrupt?t(j):P(j)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?i(j):s?_(j):k(j))}return j===45||Bt(j)?(e.consume(j),u+=String.fromCharCode(j),C):i(j)}function N(j){return j===62?(e.consume(j),l.interrupt?t:P):i(j)}function _(j){return Oe(j)?(e.consume(j),_):U(j)}function k(j){return j===47?(e.consume(j),U):j===58||j===95||Vt(j)?(e.consume(j),T):Oe(j)?(e.consume(j),k):U(j)}function T(j){return j===45||j===46||j===58||j===95||Bt(j)?(e.consume(j),T):B(j)}function B(j){return j===61?(e.consume(j),A):Oe(j)?(e.consume(j),B):k(j)}function A(j){return j===null||j===60||j===61||j===62||j===96?i(j):j===34||j===39?(e.consume(j),h=j,L):Oe(j)?(e.consume(j),A):X(j)}function L(j){return j===h?(e.consume(j),h=null,Z):j===null||ve(j)?i(j):(e.consume(j),L)}function X(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||tt(j)?B(j):(e.consume(j),X)}function Z(j){return j===47||j===62||Oe(j)?k(j):i(j)}function U(j){return j===62?(e.consume(j),I):i(j)}function I(j){return j===null||ve(j)?P(j):Oe(j)?(e.consume(j),I):i(j)}function P(j){return j===45&&o===2?(e.consume(j),D):j===60&&o===1?(e.consume(j),V):j===62&&o===4?(e.consume(j),O):j===63&&o===3?(e.consume(j),z):j===93&&o===5?(e.consume(j),K):ve(j)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(tO,Y,ee)(j)):j===null||ve(j)?(e.exit("htmlFlowData"),ee(j)):(e.consume(j),P)}function ee(j){return e.check(nO,H,Y)(j)}function H(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),q}function q(j){return j===null||ve(j)?ee(j):(e.enter("htmlFlowData"),P(j))}function D(j){return j===45?(e.consume(j),z):P(j)}function V(j){return j===47?(e.consume(j),u="",F):P(j)}function F(j){if(j===62){const ne=u.toLowerCase();return ib.includes(ne)?(e.consume(j),O):P(j)}return Vt(j)&&u.length<8?(e.consume(j),u+=String.fromCharCode(j),F):P(j)}function K(j){return j===93?(e.consume(j),z):P(j)}function z(j){return j===62?(e.consume(j),O):j===45&&o===2?(e.consume(j),z):P(j)}function O(j){return j===null||ve(j)?(e.exit("htmlFlowData"),Y(j)):(e.consume(j),O)}function Y(j){return e.exit("htmlFlow"),t(j)}}function lO(e,t,i){const l=this;return o;function o(u){return ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):i(u)}function s(u){return l.parser.lazy[l.now().line]?i(u):t(u)}}function aO(e,t,i){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Zo,t,i)}}const oO={name:"htmlText",tokenize:sO};function sO(e,t,i){const l=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),B):z===63?(e.consume(z),k):Vt(z)?(e.consume(z),X):i(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),s=0,w):Vt(z)?(e.consume(z),_):i(z)}function g(z){return z===45?(e.consume(z),v):i(z)}function p(z){return z===null?i(z):z===45?(e.consume(z),b):ve(z)?(u=p,V(z)):(e.consume(z),p)}function b(z){return z===45?(e.consume(z),v):p(z)}function v(z){return z===62?D(z):z===45?b(z):p(z)}function w(z){const O="CDATA[";return z===O.charCodeAt(s++)?(e.consume(z),s===O.length?E:w):i(z)}function E(z){return z===null?i(z):z===93?(e.consume(z),C):ve(z)?(u=E,V(z)):(e.consume(z),E)}function C(z){return z===93?(e.consume(z),N):E(z)}function N(z){return z===62?D(z):z===93?(e.consume(z),N):E(z)}function _(z){return z===null||z===62?D(z):ve(z)?(u=_,V(z)):(e.consume(z),_)}function k(z){return z===null?i(z):z===63?(e.consume(z),T):ve(z)?(u=k,V(z)):(e.consume(z),k)}function T(z){return z===62?D(z):k(z)}function B(z){return Vt(z)?(e.consume(z),A):i(z)}function A(z){return z===45||Bt(z)?(e.consume(z),A):L(z)}function L(z){return ve(z)?(u=L,V(z)):Oe(z)?(e.consume(z),L):D(z)}function X(z){return z===45||Bt(z)?(e.consume(z),X):z===47||z===62||tt(z)?Z(z):i(z)}function Z(z){return z===47?(e.consume(z),D):z===58||z===95||Vt(z)?(e.consume(z),U):ve(z)?(u=Z,V(z)):Oe(z)?(e.consume(z),Z):D(z)}function U(z){return z===45||z===46||z===58||z===95||Bt(z)?(e.consume(z),U):I(z)}function I(z){return z===61?(e.consume(z),P):ve(z)?(u=I,V(z)):Oe(z)?(e.consume(z),I):Z(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,ee):ve(z)?(u=P,V(z)):Oe(z)?(e.consume(z),P):(e.consume(z),H)}function ee(z){return z===o?(e.consume(z),o=void 0,q):z===null?i(z):ve(z)?(u=ee,V(z)):(e.consume(z),ee)}function H(z){return z===null||z===34||z===39||z===60||z===61||z===96?i(z):z===47||z===62||tt(z)?Z(z):(e.consume(z),H)}function q(z){return z===47||z===62||tt(z)?Z(z):i(z)}function D(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):i(z)}function V(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),F}function F(z){return Oe(z)?qe(e,K,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):K(z)}function K(z){return e.enter("htmlTextData"),u(z)}}const hm={name:"labelEnd",resolveAll:dO,resolveTo:hO,tokenize:pO},uO={tokenize:mO},cO={tokenize:gO},fO={tokenize:yO};function dO(e){let t=-1;const i=[];for(;++t<e.length;){const l=e[t][1];if(i.push(e[t]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",t+=o}}return e.length!==i.length&&hn(e,0,e.length,i),e}function hO(e,t){let i=e.length,l=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")){l=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+l+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=En(f,e.slice(s+1,s+l+3)),f=En(f,[["enter",g,t]]),f=En(f,Bc(t.parser.constructs.insideSpan.null,e.slice(s+l+4,u-3),t)),f=En(f,[["exit",g,t],e[u-2],e[u-1],["exit",d,t]]),f=En(f,e.slice(u+1)),f=En(f,[["exit",h,t]]),hn(e,s,e.length,f),e}function pO(e,t,i){const l=this;let o=l.events.length,s,u;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){s=l.events[o][1];break}return f;function f(b){return s?s._inactive?p(b):(u=l.parser.defined.includes(Bn(l.sliceSerialize({start:s.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):i(b)}function h(b){return b===40?e.attempt(uO,g,u?g:p)(b):b===91?e.attempt(cO,g,u?d:p)(b):u?g(b):p(b)}function d(b){return e.attempt(fO,g,p)(b)}function g(b){return t(b)}function p(b){return s._balanced=!0,i(b)}}function mO(e,t,i){return l;function l(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),o}function o(p){return tt(p)?go(e,s)(p):s(p)}function s(p){return p===41?g(p):M2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return tt(p)?go(e,h)(p):g(p)}function f(p){return i(p)}function h(p){return p===34||p===39||p===40?z2(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function d(p){return tt(p)?go(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):i(p)}}function gO(e,t,i){const l=this;return o;function o(f){return j2.call(l,e,s,u,"reference","referenceMarker","referenceString")(f)}function s(f){return l.parser.defined.includes(Bn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?t(f):i(f)}function u(f){return i(f)}}function yO(e,t,i){return l;function l(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"),t):i(s)}}const xO={name:"labelStartImage",resolveAll:hm.resolveAll,tokenize:bO};function bO(e,t,i){const l=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 l.parser.constructs?i(f):t(f)}}const vO={name:"labelStartLink",resolveAll:hm.resolveAll,tokenize:wO};function wO(e,t,i){const l=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 l.parser.constructs?i(u):t(u)}}const Ah={name:"lineEnding",tokenize:SO};function SO(e,t){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const Gu={name:"thematicBreak",tokenize:kO};function kO(e,t,i){let l=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)):l>=3&&(d===null||ve(d))?(e.exit("thematicBreak"),t(d)):i(d)}function h(d){return d===o?(e.consume(d),l++,h):(e.exit("thematicBreakSequence"),Oe(d)?qe(e,f,"whitespace")(d):f(d))}}const Jt={continuation:{tokenize:_O},exit:AO,name:"list",tokenize:CO},EO={partial:!0,tokenize:MO},NO={partial:!0,tokenize:TO};function CO(e,t,i){const l=this,o=l.events[l.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(v){const w=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:bp(v)){if(l.containerState.type||(l.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Gu,i,d)(v):d(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return i(v)}function h(v){return bp(v)&&++u<10?(e.consume(v),h):(!l.interrupt||u<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):i(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(Zo,l.interrupt?i:g,e.attempt(EO,b,p))}function g(v){return l.containerState.initialBlankLine=!0,s++,b(v)}function p(v){return Oe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):i(v)}function b(v){return l.containerState.size=s+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function _O(e,t,i){const l=this;return l.containerState._closeFlow=void 0,e.check(Zo,o,s);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,qe(e,t,"listItemIndent",l.containerState.size+1)(f)}function s(f){return l.containerState.furtherBlankLines||!Oe(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,u(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(NO,t,u)(f))}function u(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,qe(e,e.attempt(Jt,t,i),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function TO(e,t,i){const l=this;return qe(e,o,"listItemIndent",l.containerState.size+1);function o(s){const u=l.events[l.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===l.containerState.size?t(s):i(s)}}function AO(e){e.exit(this.containerState.type)}function MO(e,t,i){const l=this;return qe(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const u=l.events[l.events.length-1];return!Oe(s)&&u&&u[1].type==="listItemPrefixWhitespace"?t(s):i(s)}}const rb={name:"setextUnderline",resolveTo:jO,tokenize:zO};function jO(e,t){let i=e.length,l,o,s;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){l=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[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",u,t]),e.splice(s+1,0,["exit",e[l][1],t]),e[l][1].end={...e[s][1].end}):e[l][1]=u,e.push(["exit",u,t]),e}function zO(e,t,i){const l=this;let o;return s;function s(d){let g=l.events.length,p;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){p=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||p)?(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"),Oe(d)?qe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||ve(d)?(e.exit("setextHeadingLine"),t(d)):i(d)}}const RO={tokenize:DO};function DO(e){const t=this,i=e.attempt(Zo,l,e.attempt(this.parser.constructs.flowInitial,o,qe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(UD,o)),"linePrefix")));return i;function l(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,i}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,i}}const OO={resolveAll:D2()},LO=R2("string"),BO=R2("text");function R2(e){return{resolveAll:D2(e==="text"?HO:void 0),tokenize:t};function t(i){const l=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 p=o[g];let b=-1;if(p)for(;++b<p.length;){const v=p[b];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function D2(e){return t;function t(i,l){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,l):i}}function HO(e,t){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const l=e[i-1][1],o=t.sliceStream(l);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(t._contentTypeTextTrailing&&i===e.length&&(f=0),f){const d={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?u:l.start._bufferIndex+u,_index:l.start._index+s,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...d.start},l.start.offset===l.end.offset?Object.assign(l,d):(e.splice(i,0,["enter",d,t],["exit",d,t]),i+=2)}i++}return e}const UO={42:Jt,43:Jt,45:Jt,48:Jt,49:Jt,50:Jt,51:Jt,52:Jt,53:Jt,54:Jt,55:Jt,56:Jt,57:Jt,62:C2},IO={91:PD},qO={[-2]:Th,[-1]:Th,32:Th},VO={35:QD,42:Gu,45:[rb,Gu],60:eO,61:rb,95:Gu,96:nb,126:nb},$O={38:T2,92:_2},PO={[-5]:Ah,[-4]:Ah,[-3]:Ah,33:xO,38:T2,42:vp,60:[vD,oO],91:vO,92:[GD,_2],93:hm,95:vp,96:RD},YO={null:[vp,OO]},FO={null:[42,95]},XO={null:[]},GO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FO,contentInitial:IO,disable:XO,document:UO,flow:VO,flowInitial:qO,insideSpan:YO,string:$O,text:PO},Symbol.toStringTag,{value:"Module"}));function ZO(e,t,i){let l={_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:L(B),check:L(A),consume:_,enter:k,exit:T,interrupt:L(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:p};let g=t.tokenize.call(d,h);return t.resolveAll&&s.push(t),d;function p(I){return u=En(u,I),C(),u[u.length-1]!==null?[]:(X(t,0),d.events=Bc(s,d.events,d),d.events)}function b(I,P){return KO(v(I),P)}function v(I){return QO(u,I)}function w(){const{_bufferIndex:I,_index:P,line:ee,column:H,offset:q}=l;return{_bufferIndex:I,_index:P,line:ee,column:H,offset:q}}function E(I){o[I.line]=I.column,U()}function C(){let I;for(;l._index<u.length;){const P=u[l._index];if(typeof P=="string")for(I=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===I&&l._bufferIndex<P.length;)N(P.charCodeAt(l._bufferIndex));else N(P)}}function N(I){g=g(I)}function _(I){ve(I)?(l.line++,l.column=1,l.offset+=I===-3?2:1,U()):I!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===u[l._index].length&&(l._bufferIndex=-1,l._index++)),d.previous=I}function k(I,P){const ee=P||{};return ee.type=I,ee.start=w(),d.events.push(["enter",ee,d]),f.push(ee),ee}function T(I){const P=f.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function B(I,P){X(I,P.from)}function A(I,P){P.restore()}function L(I,P){return ee;function ee(H,q,D){let V,F,K,z;return Array.isArray(H)?Y(H):"tokenize"in H?Y([H]):O(H);function O(ce){return de;function de(se){const pe=se!==null&&ce[se],ke=se!==null&&ce.null,Ne=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Y(Ne)(se)}}function Y(ce){return V=ce,F=0,ce.length===0?D:j(ce[F])}function j(ce){return de;function de(se){return z=Z(),K=ce,ce.partial||(d.currentConstruct=ce),ce.name&&d.parser.constructs.disable.null.includes(ce.name)?ue():ce.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ne,ue)(se)}}function ne(ce){return I(K,z),q}function ue(ce){return z.restore(),++F<V.length?j(V[F]):D}}}function X(I,P){I.resolveAll&&!s.includes(I)&&s.push(I),I.resolve&&hn(d.events,P,d.events.length-P,I.resolve(d.events.slice(P),d)),I.resolveTo&&(d.events=I.resolveTo(d.events,d))}function Z(){const I=w(),P=d.previous,ee=d.currentConstruct,H=d.events.length,q=Array.from(f);return{from:H,restore:D};function D(){l=I,d.previous=P,d.currentConstruct=ee,d.events.length=H,f=q,U()}}function U(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function QO(e,t){const i=t.start._index,l=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let u;if(i===o)u=[e[i].slice(l,s)];else{if(u=e.slice(i,o),l>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(l):u.shift()}s>0&&u.push(e[o].slice(0,s))}return u}function KO(e,t){let i=-1;const l=[];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=`
43
+ `;break}case-3:{u=`\r
44
+ `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,l.push(u)}return l.join("")}function JO(e){const l={constructs:E2([GO,...(e||{}).extensions||[]]),content:o(hD),defined:[],document:o(mD),flow:o(RO),lazy:{},string:o(LO),text:o(BO)};return l;function o(s){return u;function u(f){return ZO(l,s,f)}}}function WO(e){for(;!A2(e););return e}const lb=/[\0\t\n\r]/g;function e6(){let e=1,t="",i=!0,l;return o;function o(s,u,f){const h=[];let d,g,p,b,v;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),p=0,t="",i&&(s.charCodeAt(0)===65279&&p++,i=void 0);p<s.length;){if(lb.lastIndex=p,d=lb.exec(s),b=d&&d.index!==void 0?d.index:s.length,v=s.charCodeAt(b),!d){t=s.slice(p);break}if(v===10&&p===b&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),p<b&&(h.push(s.slice(p,b)),e+=b-p),v){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:l=!0,e=1}p=b+1}return f&&(l&&h.push(-5),t&&h.push(t),h.push(null)),h}}const t6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function n6(e){return e.replace(t6,i6)}function i6(e,t,i){if(t)return t;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),s=o===120||o===88;return N2(i.slice(s?2:1),s?16:10)}return dm(i)||e}const O2={}.hasOwnProperty;function r6(e,t,i){return typeof t!="string"&&(i=t,t=void 0),l6(i)(WO(JO(i).document().write(e6()(e,t,!0))))}function l6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Rt),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:s(Fe),blockQuote:s(ke),characterEscape:Z,characterReference:Z,codeFenced:s(Ne),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ne,u),codeText:s(be,u),codeTextData:Z,data:Z,codeFlowValue:Z,definition:s(Ee),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(ze),hardBreakEscape:s($e),hardBreakTrailing:s($e),htmlFlow:s(ft,u),htmlFlowData:Z,htmlText:s(ft,u),htmlTextData:Z,image:s(tn),label:u,link:s(Rt),listItem:s(Cn),listItemValue:b,listOrdered:s($t,p),listUnordered:s($t),paragraph:s(ti),reference:j,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Fe),strong:s(ni),thematicBreak:s(Ri)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:pe,autolinkProtocol:se,blockQuote:h(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ce,characterReference:de,codeFenced:h(C),codeFencedFence:E,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:U,codeIndented:h(N),codeText:h(q),codeTextData:U,data:U,definition:h(),definitionDestinationString:T,definitionLabelString:_,definitionTitleString:k,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(ee),htmlFlowData:U,htmlText:h(H),htmlTextData:U,image:h(V),label:K,labelText:F,lineEnding:I,link:h(D),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ne,resourceDestinationString:z,resourceTitleString:O,resource:Y,setextHeading:h(X),setextHeadingLineSequence:L,setextHeadingText:A,strong:h(),thematicBreak:h()}};L2(t,(e||{}).mdastExtensions||[]);const i={};return l;function l(re){let he={type:"root",children:[]};const we={stack:[he],tokenStack:[],config:t,enter:f,exit:d,buffer:u,resume:g,data:i},je=[];let Ie=-1;for(;++Ie<re.length;)if(re[Ie][1].type==="listOrdered"||re[Ie][1].type==="listUnordered")if(re[Ie][0]==="enter")je.push(Ie);else{const Ut=je.pop();Ie=o(re,Ut,Ie)}for(Ie=-1;++Ie<re.length;){const Ut=t[re[Ie][0]];O2.call(Ut,re[Ie][1].type)&&Ut[re[Ie][1].type].call(Object.assign({sliceSerialize:re[Ie][2].sliceSerialize},we),re[Ie][1])}if(we.tokenStack.length>0){const Ut=we.tokenStack[we.tokenStack.length-1];(Ut[1]||ab).call(we,void 0,Ut[0])}for(he.position={start:cr(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:cr(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)he=t.transforms[Ie](he)||he;return he}function o(re,he,we){let je=he-1,Ie=-1,Ut=!1,_n,Tt,dt,Dt;for(;++je<=we;){const Ge=re[je];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?Ie++:Ie--,Dt=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(_n&&!Dt&&!Ie&&!dt&&(dt=je),Dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dt=void 0}if(!Ie&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||Ie===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(_n){let Un=je;for(Tt=void 0;Un--;){const nn=re[Un];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;Tt&&(re[Tt][1].type="lineEndingBlank",Ut=!0),nn[1].type="lineEnding",Tt=Un}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}dt&&(!Tt||dt<Tt)&&(_n._spread=!0),_n.end=Object.assign({},Tt?re[Tt][1].start:Ge[1].end),re.splice(Tt||je,0,["exit",_n,Ge[2]]),je++,we++}if(Ge[1].type==="listItemPrefix"){const Un={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};_n=Un,re.splice(je,0,["enter",Un,Ge[2]]),je++,we++,dt=void 0,Dt=!0}}}return re[he][1]._spread=Ut,we}function s(re,he){return we;function we(je){f.call(this,re(je),je),he&&he.call(this,je)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(re,he,we){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([he,we||void 0]),re.position={start:cr(he.start),end:void 0}}function h(re){return he;function he(we){re&&re.call(this,we),d.call(this,we)}}function d(re,he){const we=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==re.type&&(he?he.call(this,re,je[0]):(je[1]||ab).call(this,re,je[0]));else throw new Error("Cannot close `"+re.type+"` ("+mo({start:re.start,end:re.end})+"): it’s not open");we.position.end=cr(re.end)}function g(){return fm(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(re){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function v(){const re=this.resume(),he=this.stack[this.stack.length-1];he.lang=re}function w(){const re=this.resume(),he=this.stack[this.stack.length-1];he.meta=re}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re.replace(/(\r?\n|\r)$/g,"")}function _(re){const he=this.resume(),we=this.stack[this.stack.length-1];we.label=he,we.identifier=Bn(this.sliceSerialize(re)).toLowerCase()}function k(){const re=this.resume(),he=this.stack[this.stack.length-1];he.title=re}function T(){const re=this.resume(),he=this.stack[this.stack.length-1];he.url=re}function B(re){const he=this.stack[this.stack.length-1];if(!he.depth){const we=this.sliceSerialize(re).length;he.depth=we}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function L(re){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(re){const we=this.stack[this.stack.length-1].children;let je=we[we.length-1];(!je||je.type!=="text")&&(je=kt(),je.position={start:cr(re.start),end:void 0},we.push(je)),this.stack.push(je)}function U(re){const he=this.stack.pop();he.value+=this.sliceSerialize(re),he.position.end=cr(re.end)}function I(re){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=he.children[he.children.length-1];we.position.end=cr(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(he.type)&&(Z.call(this,re),U.call(this,re))}function P(){this.data.atHardBreak=!0}function ee(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re}function H(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re}function q(){const re=this.resume(),he=this.stack[this.stack.length-1];he.value=re}function D(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=he,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function V(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=he,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function F(re){const he=this.sliceSerialize(re),we=this.stack[this.stack.length-2];we.label=n6(he),we.identifier=Bn(he).toLowerCase()}function K(){const re=this.stack[this.stack.length-1],he=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const je=re.children;we.children=je}else we.alt=he}function z(){const re=this.resume(),he=this.stack[this.stack.length-1];he.url=re}function O(){const re=this.resume(),he=this.stack[this.stack.length-1];he.title=re}function Y(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ne(re){const he=this.resume(),we=this.stack[this.stack.length-1];we.label=he,we.identifier=Bn(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function ue(re){this.data.characterReferenceType=re.type}function ce(re){const he=this.sliceSerialize(re),we=this.data.characterReferenceType;let je;we?(je=N2(he,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=dm(he);const Ie=this.stack[this.stack.length-1];Ie.value+=je}function de(re){const he=this.stack.pop();he.position.end=cr(re.end)}function se(re){U.call(this,re);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(re)}function pe(re){U.call(this,re);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(re)}function ke(){return{type:"blockquote",children:[]}}function Ne(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function ft(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function $t(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function Cn(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function ti(){return{type:"paragraph",children:[]}}function ni(){return{type:"strong",children:[]}}function kt(){return{type:"text",value:""}}function Ri(){return{type:"thematicBreak"}}}function cr(e){return{line:e.line,column:e.column,offset:e.offset}}function L2(e,t){let i=-1;for(;++i<t.length;){const l=t[i];Array.isArray(l)?L2(e,l):a6(e,l)}}function a6(e,t){let i;for(i in t)if(O2.call(t,i))switch(i){case"canContainEols":{const l=t[i];l&&e[i].push(...l);break}case"transforms":{const l=t[i];l&&e[i].push(...l);break}case"enter":case"exit":{const l=t[i];l&&Object.assign(e[i],l);break}}}function ab(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mo({start:t.start,end:t.end})+") is still open")}function o6(e){const t=this;t.parser=i;function i(l){return r6(l,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function s6(e,t){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,i),e.applyData(t,i)}function u6(e,t){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,i),[e.applyData(t,i),{type:"text",value:`
45
+ `}]}function c6(e,t){const i=t.value?t.value+`
46
+ `:"",l={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:l,children:[{type:"text",value:i}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function f6(e,t){const i={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function d6(e,t){const i={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function h6(e,t){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),o=ra(l.toLowerCase()),s=e.footnoteOrder.indexOf(l);let u,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),u=e.footnoteOrder.length):u=s+1,f+=1,e.footnoteCounts.set(l,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(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function p6(e,t){const i={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function m6(e,t){if(e.options.allowDangerousHtml){const i={type:"raw",value:t.value};return e.patch(t,i),e.applyData(t,i)}}function B2(e,t){const i=t.referenceType;let l="]";if(i==="collapsed"?l+="[]":i==="full"&&(l+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+l}];const o=e.all(t),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+=l:o.push({type:"text",value:l}),o}function g6(e,t){const i=String(t.identifier).toUpperCase(),l=e.definitionById.get(i);if(!l)return B2(e,t);const o={src:ra(l.url||""),alt:t.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function y6(e,t){const i={src:ra(t.url)};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),t.title!==null&&t.title!==void 0&&(i.title=t.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function x6(e,t){const i={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,i);const l={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(t,l),e.applyData(t,l)}function b6(e,t){const i=String(t.identifier).toUpperCase(),l=e.definitionById.get(i);if(!l)return B2(e,t);const o={href:ra(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function v6(e,t){const i={href:ra(t.url)};t.title!==null&&t.title!==void 0&&(i.title=t.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function w6(e,t,i){const l=e.all(t),o=i?S6(i):H2(t),s={},u=[];if(typeof t.checked=="boolean"){const g=l[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},l.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const g=l[f];(o||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
47
+ `}),g.type==="element"&&g.tagName==="p"&&!o?u.push(...g.children):u.push(g)}const h=l[l.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
48
+ `});const d={type:"element",tagName:"li",properties:s,children:u};return e.patch(t,d),e.applyData(t,d)}function S6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const i=e.children;let l=-1;for(;!t&&++l<i.length;)t=H2(i[l])}return t}function H2(e){const t=e.spread;return t??e.children.length>1}function k6(e,t){const i={},l=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(i.start=t.start);++o<l.length;){const u=l[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:t.ordered?"ol":"ul",properties:i,children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)}function E6(e,t){const i={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function N6(e,t){const i={type:"root",children:e.wrap(e.all(t))};return e.patch(t,i),e.applyData(t,i)}function C6(e,t){const i={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function _6(e,t){const i=e.all(t),l=i.shift(),o=[];if(l){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(t.children[0],u),o.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=om(t.children[1]),h=y2(t.children[t.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(t,s),e.applyData(t,s)}function T6(e,t,i){const l=i?i.children:void 0,s=(l?l.indexOf(t):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,f=u?u.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const p=t.children[h],b={},v=u?u[h]:void 0;v&&(b.align=v);let w={type:"element",tagName:s,properties:b,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,g),e.applyData(t,g)}function A6(e,t){const i={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}const ob=9,sb=32;function M6(e){const t=String(e),i=/\r?\n|\r/g;let l=i.exec(t),o=0;const s=[];for(;l;)s.push(ub(t.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=i.exec(t);return s.push(ub(t.slice(o),o>0,!1)),s.join("")}function ub(e,t,i){let l=0,o=e.length;if(t){let s=e.codePointAt(l);for(;s===ob||s===sb;)l++,s=e.codePointAt(l)}if(i){let s=e.codePointAt(o-1);for(;s===ob||s===sb;)o--,s=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function j6(e,t){const i={type:"text",value:M6(String(t.value))};return e.patch(t,i),e.applyData(t,i)}function z6(e,t){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,i),e.applyData(t,i)}const R6={blockquote:s6,break:u6,code:c6,delete:f6,emphasis:d6,footnoteReference:h6,heading:p6,html:m6,imageReference:g6,image:y6,inlineCode:x6,linkReference:b6,link:v6,listItem:w6,list:k6,paragraph:E6,root:N6,strong:C6,table:_6,tableCell:A6,tableRow:T6,text:j6,thematicBreak:z6,toml:zu,yaml:zu,definition:zu,footnoteDefinition:zu};function zu(){}const U2=-1,Hc=0,yo=1,cc=2,pm=3,mm=4,gm=5,ym=6,I2=7,q2=8,cb=typeof self=="object"?self:globalThis,D6=(e,t)=>{const i=(o,s)=>(e.set(s,o),o),l=o=>{if(e.has(o))return e.get(o);const[s,u]=t[o];switch(s){case Hc:case U2:return i(u,o);case yo:{const f=i([],o);for(const h of u)f.push(l(h));return f}case cc:{const f=i({},o);for(const[h,d]of u)f[l(h)]=l(d);return f}case pm:return i(new Date(u),o);case mm:{const{source:f,flags:h}=u;return i(new RegExp(f,h),o)}case gm:{const f=i(new Map,o);for(const[h,d]of u)f.set(l(h),l(d));return f}case ym:{const f=i(new Set,o);for(const h of u)f.add(l(h));return f}case I2:{const{name:f,message:h}=u;return i(new cb[f](h),o)}case q2: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 cb[s](u),o)};return l},fb=e=>D6(new Map,e)(0),Ol="",{toString:O6}={},{keys:L6}=Object,oo=e=>{const t=typeof e;if(t!=="object"||!e)return[Hc,t];const i=O6.call(e).slice(8,-1);switch(i){case"Array":return[yo,Ol];case"Object":return[cc,Ol];case"Date":return[pm,Ol];case"RegExp":return[mm,Ol];case"Map":return[gm,Ol];case"Set":return[ym,Ol];case"DataView":return[yo,i]}return i.includes("Array")?[yo,i]:i.includes("Error")?[I2,i]:[cc,i]},Ru=([e,t])=>e===Hc&&(t==="function"||t==="symbol"),B6=(e,t,i,l)=>{const o=(u,f)=>{const h=l.push(u)-1;return i.set(f,h),h},s=u=>{if(i.has(u))return i.get(u);let[f,h]=oo(u);switch(f){case Hc:{let g=u;switch(h){case"bigint":f=q2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return o([U2],u)}return o([f,g],u)}case yo:{if(h){let b=u;return h==="DataView"?b=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(u)),o([h,[...b]],u)}const g=[],p=o([f,g],u);for(const b of u)g.push(s(b));return p}case cc:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return s(u.toJSON());const g=[],p=o([f,g],u);for(const b of L6(u))(e||!Ru(oo(u[b])))&&g.push([s(b),s(u[b])]);return p}case pm:return o([f,u.toISOString()],u);case mm:{const{source:g,flags:p}=u;return o([f,{source:g,flags:p}],u)}case gm:{const g=[],p=o([f,g],u);for(const[b,v]of u)(e||!(Ru(oo(b))||Ru(oo(v))))&&g.push([s(b),s(v)]);return p}case ym:{const g=[],p=o([f,g],u);for(const b of u)(e||!Ru(oo(b)))&&g.push(s(b));return p}}const{message:d}=u;return o([f,{name:h,message:d}],u)};return s},db=(e,{json:t,lossy:i}={})=>{const l=[];return B6(!(t||i),!!t,new Map,l)(e),l},fc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fb(db(e,t)):structuredClone(e):(e,t)=>fb(db(e,t));function H6(e,t){const i=[{type:"text",value:"↩"}];return t>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),i}function U6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function I6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||H6,l=e.options.footnoteBackLabel||U6,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),p=String(d.identifier).toUpperCase(),b=ra(p.toLowerCase());let v=0;const w=[],E=e.footnoteCounts.get(p);for(;E!==void 0&&++v<=E;){w.length>0&&w.push({type:"text",value:" "});let _=typeof i=="string"?i:i(h,v);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,v),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const C=g[g.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const _=C.children[C.children.length-1];_&&_.type==="text"?_.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else g.push(...w);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(d,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...fc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
49
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
50
+ `}]}}const Uc=(function(e){if(e==null)return P6;if(typeof e=="function")return Ic(e);if(typeof e=="object")return Array.isArray(e)?q6(e):V6(e);if(typeof e=="string")return $6(e);throw new Error("Expected function, string, or object as test")});function q6(e){const t=[];let i=-1;for(;++i<e.length;)t[i]=Uc(e[i]);return Ic(l);function l(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function V6(e){const t=e;return Ic(i);function i(l){const o=l;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function $6(e){return Ic(t);function t(i){return i&&i.type===e}}function Ic(e){return t;function t(i,l,o){return!!(Y6(i)&&e.call(this,i,typeof l=="number"?l:void 0,o||void 0))}}function P6(){return!0}function Y6(e){return e!==null&&typeof e=="object"&&"type"in e}const V2=[],F6=!0,wp=!1,X6="skip";function $2(e,t,i,l){let o;typeof t=="function"&&typeof i!="function"?(l=i,i=t):o=t;const s=Uc(o),u=l?-1:1;f(e,void 0,[])();function f(h,d,g){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=V2,w,E,C;if((!t||s(h,d,g[g.length-1]||void 0))&&(v=G6(i(h,g)),v[0]===wp))return v;if("children"in h&&h.children){const N=h;if(N.children&&v[0]!==X6)for(E=(l?N.children.length:-1)+u,C=g.concat(N);E>-1&&E<N.children.length;){const _=N.children[E];if(w=f(_,E,C)(),w[0]===wp)return w;E=typeof w[1]=="number"?w[1]:E+u}}return v}}}function G6(e){return Array.isArray(e)?e:typeof e=="number"?[F6,e]:e==null?V2:[e]}function xm(e,t,i,l){let o,s,u;typeof t=="function"&&typeof i!="function"?(s=void 0,u=t,o=i):(s=t,u=i,o=l),$2(e,s,f,o);function f(h,d){const g=d[d.length-1],p=g?g.children.indexOf(h):void 0;return u(h,p,g)}}const Sp={}.hasOwnProperty,Z6={};function Q6(e,t){const i=t||Z6,l=new Map,o=new Map,s=new Map,u={...R6,...i.handlers},f={all:d,applyData:J6,definitionById:l,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:h,options:i,patch:K6,wrap:eL};return xm(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?l:o,b=String(g.identifier).toUpperCase();p.has(b)||p.set(b,g)}}),f;function h(g,p){const b=g.type,v=f.handlers[b];if(Sp.call(f.handlers,b)&&v)return v(f,g,p);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in g){const{children:E,...C}=g,N=fc(C);return N.children=f.all(g),N}return fc(g)}return(f.options.unknownHandler||W6)(f,g,p)}function d(g){const p=[];if("children"in g){const b=g.children;let v=-1;for(;++v<b.length;){const w=f.one(b[v],g);if(w){if(v&&b[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=hb(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=hb(E.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function K6(e,t){e.position&&(t.position=UR(e))}function J6(e,t){let i=t;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof l=="string")if(i.type==="element")i.tagName=l;else{const u="children"in i?i.children:[i];i={type:"element",tagName:l,properties:{},children:u}}i.type==="element"&&s&&Object.assign(i.properties,fc(s)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function W6(e,t){const i=t.data||{},l="value"in t&&!(Sp.call(i,"hProperties")||Sp.call(i,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function eL(e,t){const i=[];let l=-1;for(t&&i.push({type:"text",value:`
51
+ `});++l<e.length;)l&&i.push({type:"text",value:`
52
+ `}),i.push(e[l]);return t&&e.length>0&&i.push({type:"text",value:`
53
+ `}),i}function hb(e){let t=0,i=e.charCodeAt(t);for(;i===9||i===32;)t++,i=e.charCodeAt(t);return e.slice(t)}function pb(e,t){const i=Q6(e,t),l=i.one(e,void 0),o=I6(i),s=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
54
+ `},o),s}function tL(e,t){return e&&"run"in e?async function(i,l){const o=pb(i,{file:l,...t});await e.run(o,l)}:function(i,l){return pb(i,{file:l,...e||t})}}function mb(e){if(e)throw e}var Mh,gb;function nL(){if(gb)return Mh;gb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},s=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!p)return!1;var b;for(b in d);return typeof b>"u"||e.call(d,b)},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(l)return l(d,g).value}else return;return d[g]};return Mh=function h(){var d,g,p,b,v,w,E=arguments[0],C=1,N=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},C=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});C<N;++C)if(d=arguments[C],d!=null)for(g in d)p=f(E,g),b=f(d,g),E!==b&&(_&&b&&(s(b)||(v=o(b)))?(v?(v=!1,w=p&&o(p)?p:[]):w=p&&s(p)?p:{},u(E,{name:g,newValue:h(_,w,b)})):typeof b<"u"&&u(E,{name:g,newValue:b}));return E},Mh}var iL=nL();const jh=hc(iL);function kp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rL(){const e=[],t={run:i,use:l};return t;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 p=-1;if(h){u(h);return}for(;++p<o.length;)(d[p]===null||d[p]===void 0)&&(d[p]=o[p]);o=d,g?lL(g,f)(...d):u(null,...d)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function lL(e,t){let i;return l;function l(...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,t(u,...f))}function s(u){o(null,u)}}const Yn={basename:aL,dirname:oL,extname:sL,join:uL,sep:"/"};function aL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qo(e);let i=0,l=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){i=o+1;break}}else l<0&&(s=!0,l=o+1);return l<0?"":e.slice(i,l)}if(t===e)return"";let u=-1,f=t.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)===t.codePointAt(f--)?f<0&&(l=o):(f=-1,l=u));return i===l?l=u:l<0&&(l=e.length),e.slice(i,l)}function oL(e){if(Qo(e),e.length===0)return".";let t=-1,i=e.length,l;for(;--i;)if(e.codePointAt(i)===47){if(l){t=i;break}}else l||(l=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sL(e){Qo(e);let t=e.length,i=-1,l=0,o=-1,s=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){l=t+1;break}continue}i<0&&(u=!0,i=t+1),f===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||i<0||s===0||s===1&&o===i-1&&o===l+1?"":e.slice(o,i)}function uL(...e){let t=-1,i;for(;++t<e.length;)Qo(e[t]),e[t]&&(i=i===void 0?e[t]:i+"/"+e[t]);return i===void 0?".":cL(i)}function cL(e){Qo(e);const t=e.codePointAt(0)===47;let i=fL(e,!t);return i.length===0&&!t&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),t?"/"+i:i}function fL(e,t){let i="",l=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||l!==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="",l=0):(i=i.slice(0,h),l=i.length-1-i.lastIndexOf("/")),o=u,s=0;continue}}else if(i.length>0){i="",l=0,o=u,s=0;continue}}t&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+e.slice(o+1,u):i=e.slice(o+1,u),l=u-o-1;o=u,s=0}else f===46&&s>-1?s++:s=-1}return i}function Qo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dL={cwd:hL};function hL(){return"/"}function Ep(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pL(e){if(typeof e=="string")e=new URL(e);else if(!Ep(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mL(e)}function mL(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const t=e.pathname;let i=-1;for(;++i<t.length;)if(t.codePointAt(i)===37&&t.codePointAt(i+1)===50){const l=t.codePointAt(i+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const zh=["history","path","basename","stem","extname","dirname"];class P2{constructor(t){let i;t?Ep(t)?i={path:t}:typeof t=="string"||gL(t)?i={value:t}:i=t:i={},this.cwd="cwd"in i?"":dL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<zh.length;){const s=zh[l];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let o;for(o in i)zh.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(t){Dh(t,"basename"),Rh(t,"basename"),this.path=Yn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(t){yb(this.basename,"dirname"),this.path=Yn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(t){if(Rh(t,"extname"),yb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ep(t)&&(t=pL(t)),Dh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(t){Dh(t,"stem"),Rh(t,"stem"),this.path=Yn.join(this.dirname||"",t+(this.extname||""))}fail(t,i,l){const o=this.message(t,i,l);throw o.fatal=!0,o}info(t,i,l){const o=this.message(t,i,l);return o.fatal=void 0,o}message(t,i,l){const o=new Ht(t,i,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rh(e,t){if(e&&e.includes(Yn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yn.sep+"`")}function Dh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function yb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yL=(function(e){const l=this.constructor.prototype,o=l[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,l),s}),xL={}.hasOwnProperty;class bm extends yL{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=rL()}copy(){const t=new bm;let i=-1;for(;++i<this.attachers.length;){const l=this.attachers[i];t.use(...l)}return t.data(jh(!0,{},this.namespace)),t}data(t,i){return typeof t=="string"?arguments.length===2?(Bh("data",this.frozen),this.namespace[t]=i,this):xL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=i.call(t,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const i=Du(t),l=this.parser||this.Parser;return Oh("parse",l),l(String(i),i)}process(t,i){const l=this;return this.freeze(),Oh("process",this.parser||this.Parser),Lh("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(s,u){const f=Du(t),h=l.parse(f);l.run(h,f,function(g,p,b){if(g||!p||!b)return d(g);const v=p,w=l.stringify(v,b);wL(w)?b.value=w:b.result=w,d(g,b)});function d(g,p){g||!p?u(g):s?s(p):i(void 0,p)}}}processSync(t){let i=!1,l;return this.freeze(),Oh("processSync",this.parser||this.Parser),Lh("processSync",this.compiler||this.Compiler),this.process(t,o),bb("processSync","process",i),l;function o(s,u){i=!0,mb(s),l=u}}run(t,i,l){xb(t),this.freeze();const o=this.transformers;return!l&&typeof i=="function"&&(l=i,i=void 0),l?s(void 0,l):new Promise(s);function s(u,f){const h=Du(i);o.run(t,h,d);function d(g,p,b){const v=p||t;g?f(g):u?u(v):l(void 0,v,b)}}}runSync(t,i){let l=!1,o;return this.run(t,i,s),bb("runSync","run",l),o;function s(u,f){mb(u),o=f,l=!0}}stringify(t,i){this.freeze();const l=Du(i),o=this.compiler||this.Compiler;return Lh("stringify",o),xb(t),o(t,l)}use(t,...i){const l=this.attachers,o=this.namespace;if(Bh("use",this.frozen),t!=null)if(typeof t=="function")h(t,i);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...p]=d;h(g,p)}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=jh(!0,o.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const p=d[g];s(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let p=-1,b=-1;for(;++p<l.length;)if(l[p][0]===d){b=p;break}if(b===-1)l.push([d,...g]);else if(g.length>0){let[v,...w]=g;const E=l[b][1];kp(E)&&kp(v)&&(v=jh(!0,E,v)),l[b]=[d,v,...w]}}}}const bL=new bm().freeze();function Oh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xb(e){if(!kp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bb(e,t,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Du(e){return vL(e)?e:new P2(e)}function vL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wL(e){return typeof e=="string"||SL(e)}function SL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vb=[],wb={allowDangerousHtml:!0},EL=/^(https?|ircs?|mailto|xmpp)$/i,NL=[{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 Sb(e){const t=CL(e),i=_L(e);return TL(t.runSync(t.parse(i),i),e)}function CL(e){const t=e.rehypePlugins||vb,i=e.remarkPlugins||vb,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...wb}:wb;return bL().use(o6).use(i).use(tL,l).use(t)}function _L(e){const t=e.children||"",i=new P2;return typeof t=="string"&&(i.value=t),i}function TL(e,t){const i=t.allowedElements,l=t.allowElement,o=t.components,s=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||AL;for(const g of NL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+kL+g.id,void 0);return xm(e,d),PR(e,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function d(g,p,b){if(g.type==="raw"&&b&&typeof p=="number")return u?b.children.splice(p,1):b.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let v;for(v in _h)if(Object.hasOwn(_h,v)&&Object.hasOwn(g.properties,v)){const w=g.properties[v],E=_h[v];(E===null||E.includes(g.tagName))&&(g.properties[v]=h(String(w||""),v,g))}}if(g.type==="element"){let v=i?!i.includes(g.tagName):s?s.includes(g.tagName):!1;if(!v&&l&&typeof p=="number"&&(v=!l(g,p,b)),v&&b&&typeof p=="number")return f&&g.children?b.children.splice(p,1,...g.children):b.children.splice(p,1),p}}}function AL(e){const t=e.indexOf(":"),i=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||i!==-1&&t>i||l!==-1&&t>l||EL.test(e.slice(0,t))?e:""}function kb(e,t){const i=String(e);if(typeof t!="string")throw new TypeError("Expected character");let l=0,o=i.indexOf(t);for(;o!==-1;)l++,o=i.indexOf(t,o+t.length);return l}function ML(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jL(e,t,i){const o=Uc((i||{}).ignore||[]),s=zL(t);let u=-1;for(;++u<s.length;)$2(e,"text",f);function f(d,g){let p=-1,b;for(;++p<g.length;){const v=g[p],w=b?b.children:void 0;if(o(v,w?w.indexOf(v):void 0,b))return;b=v}if(b)return h(d,g)}function h(d,g){const p=g[g.length-1],b=s[u][0],v=s[u][1];let w=0;const C=p.children.indexOf(d);let N=!1,_=[];b.lastIndex=0;let k=b.exec(d.value);for(;k;){const T=k.index,B={index:k.index,input:k.input,stack:[...g,d]};let A=v(...k,B);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?b.lastIndex=T+1:(w!==T&&_.push({type:"text",value:d.value.slice(w,T)}),Array.isArray(A)?_.push(...A):A&&_.push(A),w=T+k[0].length,N=!0),!b.global)break;k=b.exec(d.value)}return N?(w<d.value.length&&_.push({type:"text",value:d.value.slice(w)}),p.children.splice(C,1,..._)):_=[d],C+_.length}}function zL(e){const t=[];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 l=-1;for(;++l<i.length;){const o=i[l];t.push([RL(o[0]),DL(o[1])])}return t}function RL(e){return typeof e=="string"?new RegExp(ML(e),"g"):e}function DL(e){return typeof e=="function"?e:function(){return e}}const Hh="phrasing",Uh=["autolink","link","image","label"];function OL(){return{transforms:[VL],enter:{literalAutolink:BL,literalAutolinkEmail:Ih,literalAutolinkHttp:Ih,literalAutolinkWww:Ih},exit:{literalAutolink:qL,literalAutolinkEmail:IL,literalAutolinkHttp:HL,literalAutolinkWww:UL}}}function LL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Hh,notInConstruct:Uh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Hh,notInConstruct:Uh},{character:":",before:"[ps]",after:"\\/",inConstruct:Hh,notInConstruct:Uh}]}}function BL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ih(e){this.config.enter.autolinkProtocol.call(this,e)}function HL(e){this.config.exit.autolinkProtocol.call(this,e)}function UL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function IL(e){this.config.exit.autolinkEmail.call(this,e)}function qL(e){this.exit(e)}function VL(e){jL(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$L],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),PL]],{ignore:["link","linkReference"]})}function $L(e,t,i,l,o){let s="";if(!Y2(o)||(/^w/i.test(t)&&(i=t+i,t="",s="http://"),!YL(i)))return!1;const u=FL(i+l);if(!u[0])return!1;const f={type:"link",title:null,url:s+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function PL(e,t,i,l){return!Y2(l,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+i,children:[{type:"text",value:t+"@"+i}]}}function YL(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function FL(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let i=t[0],l=i.indexOf(")");const o=kb(e,"(");let s=kb(e,")");for(;l!==-1&&o>s;)e+=i.slice(0,l+1),i=i.slice(l+1),l=i.indexOf(")"),s++;return[e,i]}function Y2(e,t){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Pr(i)||Lc(i))&&(!t||i!==47)}F2.peek=t8;function XL(){this.buffer()}function GL(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ZL(){this.buffer()}function QL(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KL(e){const t=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Bn(this.sliceSerialize(e)).toLowerCase(),i.label=t}function JL(e){this.exit(e)}function WL(e){const t=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Bn(this.sliceSerialize(e)).toLowerCase(),i.label=t}function e8(e){this.exit(e)}function t8(){return"["}function F2(e,t,i,l){const o=i.createTracker(l);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 n8(){return{enter:{gfmFootnoteCallString:XL,gfmFootnoteCall:GL,gfmFootnoteDefinitionLabelString:ZL,gfmFootnoteDefinition:QL},exit:{gfmFootnoteCallString:KL,gfmFootnoteCall:JL,gfmFootnoteDefinitionLabelString:WL,gfmFootnoteDefinition:e8}}}function i8(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:i,footnoteReference:F2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(l,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(l),{before:h,after:"]"})),g(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((t?`
55
+ `:" ")+s.indentLines(s.containerFlow(l,f.current()),t?X2:r8))),d(),h}}function r8(e,t,i){return t===0?e:X2(e,t,i)}function X2(e,t,i){return(i?"":" ")+e}const l8=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];G2.peek=c8;function a8(){return{canContainEols:["delete"],enter:{strikethrough:s8},exit:{strikethrough:u8}}}function o8(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:l8}],handlers:{delete:G2}}}function s8(e){this.enter({type:"delete",children:[]},e)}function u8(e){this.exit(e)}function G2(e,t,i,l){const o=i.createTracker(l),s=i.enter("strikethrough");let u=o.move("~~");return u+=i.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function c8(){return"~"}function f8(e){return e.length}function d8(e,t){const i=t||{},l=(i.align||[]).concat(),o=i.stringLength||f8,s=[],u=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const E=[],C=[];let N=-1;for(e[g].length>d&&(d=e[g].length);++N<e[g].length;){const _=h8(e[g][N]);if(i.alignDelimiters!==!1){const k=o(_);C[N]=k,(h[N]===void 0||k>h[N])&&(h[N]=k)}E.push(_)}u[g]=E,f[g]=C}let p=-1;if(typeof l=="object"&&"length"in l)for(;++p<d;)s[p]=Eb(l[p]);else{const E=Eb(l);for(;++p<d;)s[p]=E}p=-1;const b=[],v=[];for(;++p<d;){const E=s[p];let C="",N="";E===99?(C=":",N=":"):E===108?C=":":E===114&&(N=":");let _=i.alignDelimiters===!1?1:Math.max(1,h[p]-C.length-N.length);const k=C+"-".repeat(_)+N;i.alignDelimiters!==!1&&(_=C.length+_+N.length,_>h[p]&&(h[p]=_),v[p]=_),b[p]=k}u.splice(1,0,b),f.splice(1,0,v),g=-1;const w=[];for(;++g<u.length;){const E=u[g],C=f[g];p=-1;const N=[];for(;++p<d;){const _=E[p]||"";let k="",T="";if(i.alignDelimiters!==!1){const B=h[p]-(C[p]||0),A=s[p];A===114?k=" ".repeat(B):A===99?B%2?(k=" ".repeat(B/2+.5),T=" ".repeat(B/2-.5)):(k=" ".repeat(B/2),T=k):T=" ".repeat(B)}i.delimiterStart!==!1&&!p&&N.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&_==="")&&(i.delimiterStart!==!1||p)&&N.push(" "),i.alignDelimiters!==!1&&N.push(k),N.push(_),i.alignDelimiters!==!1&&N.push(T),i.padding!==!1&&N.push(" "),(i.delimiterEnd!==!1||p!==d-1)&&N.push("|")}w.push(i.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return w.join(`
56
+ `)}function h8(e){return e==null?"":String(e)}function Eb(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function p8(e,t,i,l){const o=i.enter("blockquote"),s=i.createTracker(l);s.move("> "),s.shift(2);const u=i.indentLines(i.containerFlow(e,s.current()),m8);return o(),u}function m8(e,t,i){return">"+(i?"":" ")+e}function g8(e,t){return Nb(e,t.inConstruct,!0)&&!Nb(e,t.notInConstruct,!1)}function Nb(e,t,i){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return i;let l=-1;for(;++l<t.length;)if(e.includes(t[l]))return!0;return!1}function Cb(e,t,i,l){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
57
+ `&&g8(i.stack,i.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
58
+ `}function y8(e,t){const i=String(e);let l=i.indexOf(t),o=l,s=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++s>u&&(u=s):s=1,o=l+t.length,l=i.indexOf(t,o);return u}function x8(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function b8(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function v8(e,t,i,l){const o=b8(i),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(x8(e,i)){const p=i.enter("codeIndented"),b=i.indentLines(s,w8);return p(),b}const f=i.createTracker(l),h=o.repeat(Math.max(y8(s,o)+1,3)),d=i.enter("codeFenced");let g=f.move(h);if(e.lang){const p=i.enter(`codeFencedLang${u}`);g+=f.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),p()}if(e.lang&&e.meta){const p=i.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(i.safe(e.meta,{before:g,after:`
59
+ `,encode:["`"],...f.current()})),p()}return g+=f.move(`
60
+ `),s&&(g+=f.move(s+`
61
+ `)),g+=f.move(h),d(),g}function w8(e,t,i){return(i?"":" ")+e}function vm(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function S8(e,t,i,l){const o=vm(i),s=o==='"'?"Quote":"Apostrophe",u=i.enter("definition");let f=i.enter("label");const h=i.createTracker(l);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?" ":`
62
+ `,...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 k8(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ro(e){return"&#x"+e.toString(16).toUpperCase()+";"}function dc(e,t,i){const l=Kl(e),o=Kl(t);return l===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===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}}Z2.peek=E8;function Z2(e,t,i,l){const o=k8(i),s=i.enter("emphasis"),u=i.createTracker(l),f=u.move(o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const d=h.charCodeAt(0),g=dc(l.before.charCodeAt(l.before.length-1),d,o);g.inside&&(h=Ro(d)+h.slice(1));const p=h.charCodeAt(h.length-1),b=dc(l.after.charCodeAt(0),p,o);b.inside&&(h=h.slice(0,-1)+Ro(p));const v=u.move(o);return s(),i.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+h+v}function E8(e,t,i){return i.options.emphasis||"*"}function N8(e,t){let i=!1;return xm(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return i=!0,wp}),!!((!e.depth||e.depth<3)&&fm(e)&&(t.options.setext||i))}function C8(e,t,i,l){const o=Math.max(Math.min(6,e.depth||1),1),s=i.createTracker(l);if(N8(e,i)){const g=i.enter("headingSetext"),p=i.enter("phrasing"),b=i.containerPhrasing(e,{...s.current(),before:`
63
+ `,after:`
64
+ `});return p(),g(),b+`
65
+ `+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
66
+ `))+1))}const u="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");s.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
67
+ `,...s.current()});return/^[\t ]/.test(d)&&(d=Ro(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),h(),f(),d}Q2.peek=_8;function Q2(e){return e.value||""}function _8(){return"<"}K2.peek=T8;function K2(e,t,i,l){const o=vm(i),s=o==='"'?"Quote":"Apostrophe",u=i.enter("image");let f=i.enter("label");const h=i.createTracker(l);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 T8(){return"!"}J2.peek=A8;function J2(e,t,i,l){const o=e.referenceType,s=i.enter("imageReference");let u=i.enter("label");const f=i.createTracker(l);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 p=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,s(),o==="full"||!d||d!==p?h+=f.move(p+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function A8(){return"!"}W2.peek=M8;function W2(e,t,i){let l=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++s<i.unsafe.length;){const u=i.unsafe[s],f=i.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(l);){let d=h.index;l.charCodeAt(d)===10&&l.charCodeAt(d-1)===13&&d--,l=l.slice(0,d)+" "+l.slice(h.index+1)}}return o+l+o}function M8(){return"`"}function eS(e,t){const i=fm(e);return!!(!t.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))}tS.peek=j8;function tS(e,t,i,l){const o=vm(i),s=o==='"'?"Quote":"Apostrophe",u=i.createTracker(l);let f,h;if(eS(e,i)){const g=i.stack;i.stack=[],f=i.enter("autolink");let p=u.move("<");return p+=u.move(i.containerPhrasing(e,{before:p,after:">",...u.current()})),p+=u.move(">"),f(),i.stack=g,p}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 j8(e,t,i){return eS(e,i)?"<":"["}nS.peek=z8;function nS(e,t,i,l){const o=e.referenceType,s=i.enter("linkReference");let u=i.enter("label");const f=i.createTracker(l);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 p=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=g,s(),o==="full"||!d||d!==p?h+=f.move(p+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function z8(){return"["}function wm(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function R8(e){const t=wm(e),i=e.options.bulletOther;if(!i)return t==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+i+"`) to be different");return i}function D8(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iS(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function O8(e,t,i,l){const o=i.enter("list"),s=i.bulletCurrent;let u=e.ordered?D8(i):wm(i);const f=e.ordered?u==="."?")":".":R8(i);let h=t&&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),iS(i)===u&&g){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),i.bulletCurrent=u;const d=i.containerFlow(e,l);return i.bulletLastUsed=u,i.bulletCurrent=s,o(),d}function L8(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function B8(e,t,i,l){const o=L8(i);let s=i.bulletCurrent||wm(i);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(i.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let u=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=i.createTracker(l);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(p,b,v){return b?(v?"":" ".repeat(u))+p:(v?s:s+" ".repeat(u-s.length))+p}}function H8(e,t,i,l){const o=i.enter("paragraph"),s=i.enter("phrasing"),u=i.containerPhrasing(e,l);return s(),o(),u}const U8=Uc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function I8(e,t,i,l){return(e.children.some(function(u){return U8(u)})?i.containerPhrasing:i.containerFlow).call(i,e,l)}function q8(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rS.peek=V8;function rS(e,t,i,l){const o=q8(i),s=i.enter("strong"),u=i.createTracker(l),f=u.move(o+o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const d=h.charCodeAt(0),g=dc(l.before.charCodeAt(l.before.length-1),d,o);g.inside&&(h=Ro(d)+h.slice(1));const p=h.charCodeAt(h.length-1),b=dc(l.after.charCodeAt(0),p,o);b.inside&&(h=h.slice(0,-1)+Ro(p));const v=u.move(o+o);return s(),i.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+h+v}function V8(e,t,i){return i.options.strong||"*"}function $8(e,t,i,l){return i.safe(e.value,l)}function P8(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Y8(e,t,i){const l=(iS(i)+(i.options.ruleSpaces?" ":"")).repeat(P8(i));return i.options.ruleSpaces?l.slice(0,-1):l}const lS={blockquote:p8,break:Cb,code:v8,definition:S8,emphasis:Z2,hardBreak:Cb,heading:C8,html:Q2,image:K2,imageReference:J2,inlineCode:W2,link:tS,linkReference:nS,list:O8,listItem:B8,paragraph:H8,root:I8,strong:rS,text:$8,thematicBreak:Y8};function F8(){return{enter:{table:X8,tableData:_b,tableHeader:_b,tableRow:Z8},exit:{codeText:Q8,table:G8,tableData:qh,tableHeader:qh,tableRow:qh}}}function X8(e){const t=e._align;this.enter({type:"table",align:t.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function G8(e){this.exit(e),this.data.inTable=void 0}function Z8(e){this.enter({type:"tableRow",children:[]},e)}function qh(e){this.exit(e)}function _b(e){this.enter({type:"tableCell",children:[]},e)}function Q8(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,K8));const i=this.stack[this.stack.length-1];i.type,i.value=t,this.exit(e)}function K8(e,t){return t==="|"?t:e}function J8(e){const t=e||{},i=t.tableCellPadding,l=t.tablePipeAlign,o=t.stringLength,s=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
68
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:h,tableRow:f}};function u(v,w,E,C){return d(g(v,E,C),v.align)}function f(v,w,E,C){const N=p(v,E,C),_=d([N]);return _.slice(0,_.indexOf(`
69
+ `))}function h(v,w,E,C){const N=E.enter("tableCell"),_=E.enter("phrasing"),k=E.containerPhrasing(v,{...C,before:s,after:s});return _(),N(),k}function d(v,w){return d8(v,{align:w,alignDelimiters:l,padding:i,stringLength:o})}function g(v,w,E){const C=v.children;let N=-1;const _=[],k=w.enter("table");for(;++N<C.length;)_[N]=p(C[N],w,E);return k(),_}function p(v,w,E){const C=v.children;let N=-1;const _=[],k=w.enter("tableRow");for(;++N<C.length;)_[N]=h(C[N],v,w,E);return k(),_}function b(v,w,E){let C=lS.inlineCode(v,w,E);return E.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function W8(){return{exit:{taskListCheckValueChecked:Tb,taskListCheckValueUnchecked:Tb,paragraph:t9}}}function e9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:n9}}}function Tb(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function t9(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const l=i.children[0];if(l&&l.type==="text"){const o=t.children;let s=-1,u;for(;++s<o.length;){const f=o[s];if(f.type==="paragraph"){u=f;break}}u===i&&(l.value=l.value.slice(1),l.value.length===0?i.children.shift():i.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,i.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function n9(e,t,i,l){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(l);s&&f.move(u);let h=lS.listItem(e,t,i,{...l,...f.current()});return s&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function i9(){return[OL(),n8(),a8(),F8(),W8()]}function r9(e){return{extensions:[LL(),i8(e),o8(),J8(e),e9()]}}const l9={tokenize:f9,partial:!0},aS={tokenize:d9,partial:!0},oS={tokenize:h9,partial:!0},sS={tokenize:p9,partial:!0},a9={tokenize:m9,partial:!0},uS={name:"wwwAutolink",tokenize:u9,previous:fS},cS={name:"protocolAutolink",tokenize:c9,previous:dS},zi={name:"emailAutolink",tokenize:s9,previous:hS},ei={};function o9(){return{text:ei}}let Or=48;for(;Or<123;)ei[Or]=zi,Or++,Or===58?Or=65:Or===91&&(Or=97);ei[43]=zi;ei[45]=zi;ei[46]=zi;ei[95]=zi;ei[72]=[zi,cS];ei[104]=[zi,cS];ei[87]=[zi,uS];ei[119]=[zi,uS];function s9(e,t,i){const l=this;let o,s;return u;function u(p){return!Np(p)||!hS.call(l,l.previous)||Sm(l.events)?i(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(p))}function f(p){return Np(p)?(e.consume(p),f):p===64?(e.consume(p),h):i(p)}function h(p){return p===46?e.check(a9,g,d)(p):p===45||p===95||Bt(p)?(s=!0,e.consume(p),h):g(p)}function d(p){return e.consume(p),o=!0,h}function g(p){return s&&o&&Vt(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):i(p)}}function u9(e,t,i){const l=this;return o;function o(u){return u!==87&&u!==119||!fS.call(l,l.previous)||Sm(l.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l9,e.attempt(aS,e.attempt(oS,s),i),i)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function c9(e,t,i){const l=this;let o="",s=!1;return u;function u(p){return(p===72||p===104)&&dS.call(l,l.previous)&&!Sm(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(p),e.consume(p),f):i(p)}function f(p){if(Vt(p)&&o.length<5)return o+=String.fromCodePoint(p),e.consume(p),f;if(p===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(p),h}return i(p)}function h(p){return p===47?(e.consume(p),s?d:(s=!0,h)):i(p)}function d(p){return p===null||uc(p)||tt(p)||Pr(p)||Lc(p)?i(p):e.attempt(aS,e.attempt(oS,g),i)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function f9(e,t,i){let l=0;return o;function o(u){return(u===87||u===119)&&l<3?(l++,e.consume(u),o):u===46&&l===3?(e.consume(u),s):i(u)}function s(u){return u===null?i(u):t(u)}}function d9(e,t,i){let l,o,s;return u;function u(d){return d===46||d===95?e.check(sS,h,f)(d):d===null||tt(d)||Pr(d)||d!==45&&Lc(d)?h(d):(s=!0,e.consume(d),u)}function f(d){return d===95?l=!0:(o=l,l=void 0),e.consume(d),u}function h(d){return o||l||!s?i(d):t(d)}}function h9(e,t){let i=0,l=0;return o;function o(u){return u===40?(i++,e.consume(u),o):u===41&&l<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(sS,t,s)(u):u===null||tt(u)||Pr(u)?t(u):(e.consume(u),o)}function s(u){return u===41&&l++,e.consume(u),o}}function p9(e,t,i){return l;function l(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),l):f===38?(e.consume(f),s):f===93?(e.consume(f),o):f===60||f===null||tt(f)||Pr(f)?t(f):i(f)}function o(f){return f===null||f===40||f===91||tt(f)||Pr(f)?t(f):l(f)}function s(f){return Vt(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),l):Vt(f)?(e.consume(f),u):i(f)}}function m9(e,t,i){return l;function l(s){return e.consume(s),o}function o(s){return Bt(s)?i(s):t(s)}}function fS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||tt(e)}function dS(e){return!Vt(e)}function hS(e){return!(e===47||Np(e))}function Np(e){return e===43||e===45||e===46||e===95||Bt(e)}function Sm(e){let t=e.length,i=!1;for(;t--;){const l=e[t][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){i=!0;break}if(l._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const g9={tokenize:E9,partial:!0};function y9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:w9,continuation:{tokenize:S9},exit:k9}},text:{91:{name:"gfmFootnoteCall",tokenize:v9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:x9,resolveTo:b9}}}}function x9(e,t,i){const l=this;let o=l.events.length;const s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u;for(;o--;){const h=l.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=Bn(l.sliceSerialize({start:u.end,end:l.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function b9(e,t){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 l={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",l,t],e[i+3],e[i+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",u,t],["exit",u,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",l,t]];return e.splice(i,e.length-i+1,...f),e}function v9(e,t,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let s=0,u;return f;function f(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?i(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(s>999||p===93&&!u||p===null||p===91||tt(p))return i(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(Bn(l.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):i(p)}return tt(p)||(u=!0),s++,e.consume(p),p===92?g:d}function g(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function w9(e,t,i){const l=this,o=l.parser.gfmFootnotes||(l.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||tt(w))return i(w);if(w===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return s=Bn(l.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return tt(w)||(f=!0),u++,e.consume(w),w===92?p:g}function p(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function b(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(s)||o.push(s),qe(e,v,"gfmFootnoteDefinitionWhitespace")):i(w)}function v(w){return t(w)}}function S9(e,t,i){return e.check(Zo,t,e.attempt(g9,t,i))}function k9(e){e.exit("gfmFootnoteDefinition")}function E9(e,t,i){const l=this;return qe(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const u=l.events[l.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(s):i(s)}}function N9(e){let i=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:s,resolveAll:o};return i==null&&(i=!0),{text:{126:l},insideSpan:{null:[l]},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)},p={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},b=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",p,f]],v=f.parser.constructs.insideSpan.null;v&&hn(b,b.length,0,Bc(v,u.slice(d+1,h),f)),hn(b,b.length,0,[["exit",p,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),hn(u,d-1,h-d+3,b),h=d+b.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 p=0;return b;function b(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const E=Kl(d);if(w===126)return p>1?h(w):(u.consume(w),p++,v);if(p<2&&!i)return h(w);const C=u.exit("strikethroughSequenceTemporary"),N=Kl(w);return C._open=!N||N===2&&!!E,C._close=!E||E===2&&!!N,f(w)}}}class C9{constructor(){this.map=[]}add(t,i,l){_9(this,t,i,l)}consume(t){if(this.map.sort(function(s,u){return s[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const l=[];for(;i>0;)i-=1,l.push(t.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),t.length=this.map[i][0];l.push(t.slice()),t.length=0;let o=l.pop();for(;o;){for(const s of o)t.push(s);o=l.pop()}this.map.length=0}}function _9(e,t,i,l){let o=0;if(!(i===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=i,e.map[o][2].push(...l);return}o+=1}e.map.push([t,i,l])}}function T9(e,t){let i=!1;const l=[];for(;t<e.length;){const o=e[t];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=l.length-1;l[s]=l[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);t+=1}return l}function A9(){return{flow:{null:{name:"table",tokenize:M9,resolveAll:j9}}}}function M9(e,t,i){const l=this;let o=0,s=0,u;return f;function f(U){let I=l.events.length-1;for(;I>-1;){const H=l.events[I][1].type;if(H==="lineEnding"||H==="linePrefix")I--;else break}const P=I>-1?l.events[I][1].type:null,ee=P==="tableHead"||P==="tableRow"?A:h;return ee===A&&l.parser.lazy[l.now().line]?i(U):ee(U)}function h(U){return e.enter("tableHead"),e.enter("tableRow"),d(U)}function d(U){return U===124||(u=!0,s+=1),g(U)}function g(U){return U===null?i(U):ve(U)?s>1?(s=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),v):i(U):Oe(U)?qe(e,g,"whitespace")(U):(s+=1,u&&(u=!1,o+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),p(U)))}function p(U){return U===null||U===124||tt(U)?(e.exit("data"),g(U)):(e.consume(U),U===92?b:p)}function b(U){return U===92||U===124?(e.consume(U),p):p(U)}function v(U){return l.interrupt=!1,l.parser.lazy[l.now().line]?i(U):(e.enter("tableDelimiterRow"),u=!1,Oe(U)?qe(e,w,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):w(U))}function w(U){return U===45||U===58?C(U):U===124?(u=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),E):B(U)}function E(U){return Oe(U)?qe(e,C,"whitespace")(U):C(U)}function C(U){return U===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),N):U===45?(s+=1,N(U)):U===null||ve(U)?T(U):B(U)}function N(U){return U===45?(e.enter("tableDelimiterFiller"),_(U)):B(U)}function _(U){return U===45?(e.consume(U),_):U===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(U))}function k(U){return Oe(U)?qe(e,T,"whitespace")(U):T(U)}function T(U){return U===124?w(U):U===null||ve(U)?!u||o!==s?B(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):B(U)}function B(U){return i(U)}function A(U){return e.enter("tableRow"),L(U)}function L(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),L):U===null||ve(U)?(e.exit("tableRow"),t(U)):Oe(U)?qe(e,L,"whitespace")(U):(e.enter("data"),X(U))}function X(U){return U===null||U===124||tt(U)?(e.exit("data"),L(U)):(e.consume(U),U===92?Z:X)}function Z(U){return U===92||U===124?(e.consume(U),X):X(U)}}function j9(e,t){let i=-1,l=!0,o=0,s=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,p;const b=new C9;for(;++i<e.length;){const v=e[i],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(Ab(b,t,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.add(i,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(l=!0,p=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)},b.add(i,0,[["enter",g,t]])),o=w.type==="tableDelimiterRow"?2:g?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(l=!1,u[2]===0&&(s[1]!==0&&(u[0]=u[1],p=Ou(b,t,s,o,void 0,p),s=[0,0,0,0]),u[2]=i)):w.type==="tableCellDivider"&&(l?l=!1:(s[1]!==0&&(u[0]=u[1],p=Ou(b,t,s,o,void 0,p)),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],p=Ou(b,t,s,o,i,p)):u[1]!==0&&(p=Ou(b,t,u,o,i,p)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&Ab(b,t,h,d,g),b.consume(t.events),i=-1;++i<t.events.length;){const v=t.events[i];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=T9(t.events,i))}return e}function Ou(e,t,i,l,o,s){const u=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(s.end=Object.assign({},Ll(t.events,i[0])),e.add(i[0],0,[["exit",s,t]]));const h=Ll(t.events,i[1]);if(s={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",s,t]]),i[2]!==0){const d=Ll(t.events,i[2]),g=Ll(t.events,i[3]),p={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",p,t]]),l!==2){const b=t.events[i[2]],v=t.events[i[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[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",p,t]])}return o!==void 0&&(s.end=Object.assign({},Ll(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function Ab(e,t,i,l,o){const s=[],u=Ll(t.events,i);o&&(o.end=Object.assign({},u),s.push(["exit",o,t])),l.end=Object.assign({},u),s.push(["exit",l,t]),e.add(i+1,0,s)}function Ll(e,t){const i=e[t],l=i[0]==="enter"?"start":"end";return i[1][l]}const z9={name:"tasklistCheck",tokenize:D9};function R9(){return{text:{91:z9}}}function D9(e,t,i){const l=this;return o;function o(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),s)}function s(h){return tt(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 ve(h)?t(h):Oe(h)?e.check({tokenize:O9},t,i)(h):i(h)}}function O9(e,t,i){return qe(e,l,"whitespace");function l(o){return o===null?i(o):t(o)}}function L9(e){return E2([o9(),y9(),N9(e),A9(),R9()])}const B9={};function Mb(e){const t=this,i=e||B9,l=t.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),s=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),u=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(L9(i)),s.push(i9()),u.push(r9(i))}function H9(){const{isRunning:e,results:t,workflowResults:i,logs:l}=ea(),{nodes:o,selectedNodeId:s,updateNode:u}=Kn(),f=Kn(Pw),{execute:h,savedOutputDir:d}=r2(),[g,p]=R.useState("");R.useEffect(()=>{if(f?.type==="input"){const _=f.data;p(_.value||"")}},[s,f]);const b=o.filter(_=>_.type==="output"),v=b.length>0?t.get(b[0].id):null,w=f?.type==="input",E=w?f.data:null,C=_=>{p(_),s&&u(s,{value:_})},N=()=>{h()};return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(ev,{className:"w-5 h-5 text-gray-400"}),x.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&x.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&x.jsx("div",{className:"p-4 border-b border-border",children:x.jsx("div",{className:"space-y-3",children:o.map(_=>x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:`w-2 h-2 rounded-full ${_.data.status==="completed"?"bg-green-500":_.data.status==="running"?"bg-blue-500 animate-pulse":_.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),x.jsx("span",{className:"text-sm text-gray-300",children:_.data.label}),_.data.status==="running"&&_.data.progress!==void 0&&x.jsxs("span",{className:"text-xs text-gray-500",children:[_.data.progress,"%"]})]},_.id))})}),x.jsxs("div",{className:"p-4 border-b border-border",children:[x.jsxs("button",{onClick:N,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:[x.jsx(vo,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),o.length===0&&x.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[w&&E&&x.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(xc,{className:"w-5 h-5 text-amber-500"}),x.jsx("h4",{className:"text-md font-medium text-white",children:E.label})]}),E.inputType==="text"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Enter your input"}),x.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:E.placeholder||"Type your message here...",value:g||E.value||"",onChange:_=>C(_.target.value)})]}),E.inputType==="file"&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Upload a file"}),x.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:[x.jsx(N_,{className:"w-8 h-8 text-gray-500 mb-2"}),x.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),E.fileTypes&&x.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",E.fileTypes.join(", ")]})]})]}),E.inputType==="select"&&E.options&&x.jsxs("div",{className:"space-y-2",children:[x.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Select an option"}),x.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:g||E.value||"",onChange:_=>C(_.target.value),children:[x.jsx("option",{value:"",children:"Select..."}),E.options.map(_=>x.jsx("option",{value:_,children:_},_))]})]})]}),d&&x.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx(Fh,{className:"w-5 h-5 text-green-400"}),x.jsx("h4",{className:"text-sm font-medium text-green-300",children:"파일 저장 완료"})]}),x.jsx("p",{className:"text-xs text-gray-400 break-all",children:d})]}),i.length>0?x.jsx("div",{className:"space-y-4",children:i.map(_=>x.jsxs("div",{className:`p-4 rounded-lg border ${_.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[x.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.success?x.jsx(yc,{className:"w-5 h-5 text-green-500"}):x.jsx(Rp,{className:"w-5 h-5 text-red-500"}),x.jsx("h5",{className:"text-sm font-medium text-white",children:_.label})]}),_.error&&x.jsx("p",{className:"text-sm text-red-400 mb-3",children:_.error}),_.files&&_.files.length>0&&x.jsxs("div",{className:"space-y-2 mb-3",children:[x.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),_.files.map((k,T)=>x.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[k.type==="image"?x.jsx(tv,{className:"w-4 h-4 text-purple-400"}):x.jsx(bo,{className:"w-4 h-4 text-blue-400"}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("p",{className:"text-sm text-white truncate",children:k.name}),x.jsx("p",{className:"text-xs text-gray-500 truncate",children:k.path})]})]},T))]}),_.result&&x.jsxs("details",{className:"group",open:!0,children:[x.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),x.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:x.jsx("div",{className:"markdown-content text-sm",children:x.jsx(Sb,{remarkPlugins:[Mb],children:_.result.length>2e3?_.result.substring(0,2e3)+"...":_.result})})})]})]},_.nodeId))}):v?x.jsx("div",{className:"markdown-content",children:x.jsx(Sb,{remarkPlugins:[Mb],children:typeof v=="string"?v:JSON.stringify(v,null,2)})}):l.length>0?x.jsxs("div",{className:"space-y-2",children:[x.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),l.slice(-20).map(_=>x.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[x.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(_.timestamp).toLocaleTimeString("ko-KR")}),x.jsx("span",{className:_.level==="error"?"text-red-400":_.level==="warning"?"text-yellow-400":_.level==="success"?"text-green-400":"text-gray-300",children:_.message})]},_.id))]}):x.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[x.jsx(bo,{className:"w-12 h-12 mb-4 opacity-50"}),x.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),x.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]})]})}function pS({level:e}){switch(e){case"success":return x.jsx(yc,{className:"w-4 h-4 text-green-400"});case"error":return x.jsx(Rp,{className:"w-4 h-4 text-red-400"});case"warning":return x.jsx(k_,{className:"w-4 h-4 text-yellow-400"});default:return x.jsx(XC,{className:"w-4 h-4 text-blue-400"})}}function mS(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function U9({isOpen:e,onClose:t}){const{logs:i,clearLogs:l,isRunning:o}=ea(),[s,u]=R.useState(!1),[f,h]=R.useState(250),d=R.useRef(null);R.useEffect(()=>{d.current&&!s&&d.current.scrollIntoView({behavior:"smooth"})},[i,s]);const g=p=>{p.preventDefault();const b=p.clientY,v=f,w=C=>{const N=b-C.clientY,_=Math.min(Math.max(v+N,100),500);h(_)},E=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",E)};return e?x.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&&x.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),x.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bc,{className:"w-4 h-4 text-amber-500"}),x.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),o&&x.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[x.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),x.jsxs("span",{className:"text-xs text-gray-500",children:["(",i.length," logs)"]})]}),x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("button",{onClick:l,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:x.jsx(wo,{className:"w-4 h-4 text-gray-400"})}),x.jsx("button",{onClick:()=>u(!s),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:s?"Expand":"Minimize",children:s?x.jsx(wC,{className:"w-4 h-4 text-gray-400"}):x.jsx(Wb,{className:"w-4 h-4 text-gray-400"})}),x.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?x.jsx(i_,{className:"w-4 h-4 text-gray-400"}):x.jsx(e_,{className:"w-4 h-4 text-gray-400"})}),x.jsx("button",{onClick:t,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:x.jsx(vc,{className:"w-4 h-4 text-gray-400"})})]})]}),!s&&x.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:i.length===0?x.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:x.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):x.jsxs("div",{className:"space-y-1",children:[i.map(p=>x.jsxs("div",{className:qt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",p.level==="error"&&"bg-red-500/10",p.level==="warning"&&"bg-yellow-500/10",p.level==="success"&&"bg-green-500/10"),children:[x.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",mS(p.timestamp),"]"]}),x.jsx(pS,{level:p.level}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("span",{className:qt("text-xs",p.level==="error"&&"text-red-400",p.level==="warning"&&"text-yellow-400",p.level==="success"&&"text-green-400",p.level==="info"&&"text-gray-300"),children:p.message}),p.nodeId&&x.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",p.nodeId.slice(0,8),"]"]}),p.details&&x.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof p.details=="string"?p.details:JSON.stringify(p.details,null,2)})]})]},p.id)),x.jsx("div",{ref:d})]})})]}):null}function I9(){const{logs:e,clearLogs:t,isRunning:i}=ea(),l=R.useRef(null);return R.useEffect(()=>{l.current&&l.current.scrollIntoView({behavior:"smooth"})},[e]),x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bc,{className:"w-5 h-5 text-amber-500"}),x.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),i&&x.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[x.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),x.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),x.jsx("button",{onClick:t,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:x.jsx(wo,{className:"w-4 h-4"})})]}),x.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?x.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:x.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):x.jsxs("div",{className:"space-y-1",children:[e.map(o=>x.jsxs("div",{className:qt("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:[x.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",mS(o.timestamp),"]"]}),x.jsx(pS,{level:o.level}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("span",{className:qt("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&&x.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",o.nodeId.slice(0,8),"]"]}),o.details&&x.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)),x.jsx("div",{ref:l})]})})]})}const q9=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],V9=[{id:"image-gen-nanobanana",name:"Image Generator",description:"Google Gemini API를 사용한 AI 이미지 생성",keywords:["이미지","image","그림","사진","picture","illustration","graphic"]},{id:"ppt-generator",name:"PPT Generator",description:"한국어에 최적화된 미니멀 프레젠테이션 생성",keywords:["ppt","발표","presentation","slides","powerpoint","슬라이드"]},{id:"video-gen-veo3",name:"Video Generator",description:"Google Veo3 API를 사용한 AI 영상 생성",keywords:["영상","video","동영상","animation","애니메이션"]},{id:"pdf",name:"PDF",description:"PDF 텍스트 추출, 생성, 병합/분할, 폼 처리",keywords:["pdf","문서","document"]},{id:"docx",name:"Word Document",description:"Word 문서 생성, 편집, 변경 추적, 주석",keywords:["워드","docx","word","한글","문서"]},{id:"xlsx",name:"Excel",description:"스프레드시트 생성, 편집, 수식, 데이터 분석",keywords:["엑셀","xlsx","excel","스프레드시트","spreadsheet","표"]},{id:"pptx",name:"PowerPoint",description:"PPT 생성, 편집, 레이아웃, 스피커 노트",keywords:["pptx","powerpoint","presentation"]},{id:"git-commit-push",name:"Git Commit/Push",description:"Git 변경사항 분석, 커밋 메시지 작성, 푸시/PR 생성",keywords:["git","commit","push","pr","pull request","커밋","푸시"]}],$9=[{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 P9(e){switch(e){case"input":return x.jsx(xc,{className:"w-5 h-5 text-yellow-400"});case"agent":return x.jsx(Ho,{className:"w-5 h-5 text-purple-400"});case"skill":return x.jsx(Uo,{className:"w-5 h-5 text-cyan-400"});case"hook":return x.jsx(zp,{className:"w-5 h-5 text-pink-400"});case"output":return x.jsx(gc,{className:"w-5 h-5 text-emerald-400"});default:return null}}function Y9(e){switch(e){case"input":return"User Input";case"agent":return"Agent";case"skill":return"Skill";case"hook":return"Hook";case"output":return"Output";default:return"Node"}}function F9({node:e}){const{updateNode:t,removeNode:i,nodes:l}=Kn(),[o,s]=R.useState(!1),u=R.useRef(null),f=R.useCallback(v=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{s2(v).catch(w=>{console.error("Failed to sync node to filesystem:",w)})},500)},[]);if(R.useEffect(()=>(e&&e.type!=="input"&&e.type!=="output"&&f(e),()=>{u.current&&clearTimeout(u.current)}),[e,f]),!e)return x.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[x.jsx(y_,{className:"w-12 h-12 mb-4 opacity-50"}),x.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const h=()=>{e.type!=="input"&&e.type!=="output"?s(!0):i(e.id)},d=()=>{u2(e,l).catch(v=>{console.error("Failed to delete node from filesystem:",v)}),i(e.id),s(!1)},g=()=>{s(!1)},p=v=>{t(e.id,{label:v})},b=v=>{t(e.id,{description:v})};return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"p-2 rounded-lg bg-surface",children:P9(e.type)}),x.jsxs("div",{children:[x.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),x.jsx("p",{className:"text-xs text-gray-500",children:Y9(e.type)})]})]}),x.jsx("button",{onClick:h,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:x.jsx(wo,{className:"w-4 h-4"})})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),x.jsx("input",{type:"text",value:e.data.label,onChange:v=>p(v.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"})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="agent"?"Prompt":"Description"}),x.jsx("textarea",{value:e.data.description||"",onChange:v=>b(v.target.value),rows:4,placeholder:e.type==="agent"?"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"&&x.jsx(X9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="agent"&&x.jsx(G9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="skill"&&x.jsx(Z9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="hook"&&x.jsx(Q9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="output"&&x.jsx(K9,{onUpdate:v=>t(e.id,v)})]}),o&&x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:x.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 border border-zinc-700 shadow-xl",children:[x.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[x.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:x.jsx(wo,{className:"w-5 h-5 text-red-400"})}),x.jsx("h3",{className:"text-lg font-semibold text-white",children:"노드 삭제 확인"})]}),x.jsxs("p",{className:"text-zinc-300 mb-4",children:[x.jsx("span",{className:"font-medium text-white",children:e.data.label})," 노드를 삭제하시겠습니까?",x.jsx("br",{}),x.jsx("span",{className:"text-red-400 text-sm",children:"이 작업은 파일을 삭제하며 되돌릴 수 없습니다."})]}),x.jsxs("div",{className:"flex gap-3 justify-end",children:[x.jsx("button",{onClick:g,className:"px-4 py-2 rounded-md bg-zinc-700 text-zinc-300 hover:bg-zinc-600 transition-colors",children:"취소"}),x.jsx("button",{onClick:d,className:"px-4 py-2 rounded-md bg-red-600 text-white hover:bg-red-500 transition-colors",children:"삭제"})]})]})})]})}function X9({data:e,onUpdate:t}){return x.jsxs(x.Fragment,{children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),x.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(i=>x.jsx("button",{onClick:()=>t({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))})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),x.jsx("textarea",{value:e.value||"",onChange:i=>t({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 G9({data:e,onUpdate:t}){return x.jsxs(x.Fragment,{children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),x.jsx("div",{className:"space-y-2",children:$9.map(i=>x.jsxs("button",{onClick:()=>t({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:[x.jsx(Ho,{className:"w-5 h-5 text-purple-400"}),x.jsxs("div",{className:"text-left",children:[x.jsx("div",{className:"font-medium text-white",children:i.name}),x.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),x.jsx("div",{className:"grid grid-cols-2 gap-2",children:q9.map(i=>x.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[x.jsx("input",{type:"checkbox",checked:e.tools?.includes(i)??!1,onChange:l=>{const o=l.target.checked?[...e.tools||[],i]:(e.tools||[]).filter(s=>s!==i);t({tools:o})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),x.jsx("span",{className:"text-sm text-gray-300",children:i})]},i))})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),x.jsx("textarea",{value:e.systemPrompt||"",onChange:i=>t({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 Z9({data:e,onUpdate:t}){const[i,l]=R.useState([]),[o,s]=R.useState(!1),[u,f]=R.useState(null),[h,d]=R.useState(""),[g,p]=R.useState(!1),[b,v]=R.useState(null);R.useEffect(()=>{e.skillType==="generated"&&e.skillPath&&(s(!0),fetch(`/api/skill/files?path=${encodeURIComponent(e.skillPath)}`).then(E=>E.json()).then(E=>{l(E.files||[]),E.files?.length>0&&f(E.files[0].name)}).catch(E=>{console.error("Failed to load skill files:",E)}).finally(()=>s(!1)))},[e.skillPath,e.skillType]);const w=async()=>{if(e.skillPath){p(!0),v(null);try{const E=h.trim()?h.trim().split(/\s+/):[],N=await(await fetch("/api/skill/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillPath:e.skillPath,args:E})})).json();v(N)}catch(E){v({success:!1,error:E instanceof Error?E.message:"Unknown error"})}finally{p(!1)}}};return e.skillType==="generated"&&e.skillPath?x.jsxs(x.Fragment,{children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Path"}),x.jsx("div",{className:"px-3 py-2 bg-surface border border-border rounded-lg text-gray-400 text-sm font-mono break-all",children:e.skillPath})]}),x.jsxs("div",{children:[x.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[x.jsx(LC,{className:"w-4 h-4 inline mr-1"}),"Files Preview"]}),o?x.jsxs("div",{className:"flex items-center justify-center py-8 text-gray-500",children:[x.jsx(Ku,{className:"w-5 h-5 animate-spin mr-2"}),"파일 로딩 중..."]}):i.length===0?x.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"파일을 찾을 수 없습니다"}):x.jsx("div",{className:"space-y-2",children:i.map(E=>x.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[x.jsxs("button",{onClick:()=>f(u===E.name?null:E.name),className:"w-full flex items-center justify-between px-3 py-2 bg-surface-hover hover:bg-border transition-colors",children:[x.jsx("span",{className:"text-sm text-white font-medium",children:E.name}),u===E.name?x.jsx(Wb,{className:"w-4 h-4 text-gray-400"}):x.jsx(bC,{className:"w-4 h-4 text-gray-400"})]}),u===E.name&&x.jsx("pre",{className:"p-3 bg-[#0d1117] text-xs text-gray-300 overflow-x-auto max-h-64 overflow-y-auto font-mono",children:E.content})]},E.name))})]}),x.jsxs("div",{children:[x.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[x.jsx(vo,{className:"w-4 h-4 inline mr-1"}),"Test Skill"]}),x.jsxs("div",{className:"space-y-3",children:[x.jsx("div",{children:x.jsx("input",{type:"text",value:h,onChange:E=>d(E.target.value),placeholder:"Arguments (optional, space-separated)",className:"w-full px-3 py-2 bg-surface border border-border rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-accent"})}),x.jsx("button",{onClick:w,disabled:g,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg font-medium transition-colors ${g?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-cyan-600 hover:bg-cyan-700 text-white"}`,children:g?x.jsxs(x.Fragment,{children:[x.jsx(Ku,{className:"w-4 h-4 animate-spin"}),"실행 중..."]}):x.jsxs(x.Fragment,{children:[x.jsx(vo,{className:"w-4 h-4"}),"테스트 실행"]})}),b&&x.jsxs("div",{className:`p-3 rounded-lg border ${b.success?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.success?x.jsx(yc,{className:"w-4 h-4 text-green-400"}):x.jsx(Rp,{className:"w-4 h-4 text-red-400"}),x.jsxs("span",{className:`text-sm font-medium ${b.success?"text-green-400":"text-red-400"}`,children:[b.success?"성공":"실패",b.exitCode!==void 0&&` (exit code: ${b.exitCode})`]})]}),b.stdout&&x.jsxs("div",{className:"mb-2",children:[x.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output:"}),x.jsx("pre",{className:"p-2 bg-black/30 rounded text-xs text-gray-300 overflow-x-auto max-h-32 overflow-y-auto font-mono whitespace-pre-wrap",children:b.stdout})]}),b.stderr&&x.jsxs("div",{children:[x.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Error:"}),x.jsx("pre",{className:"p-2 bg-black/30 rounded text-xs text-red-400 overflow-x-auto max-h-32 overflow-y-auto font-mono whitespace-pre-wrap",children:b.stderr})]}),b.error&&x.jsx("div",{className:"text-sm text-red-400",children:b.error})]})]})]})]}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),x.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(E=>x.jsx("button",{onClick:()=>t({skillType:E}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===E?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:E.charAt(0).toUpperCase()+E.slice(1)},E))})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),x.jsx("div",{className:"space-y-2",children:V9.map(E=>x.jsxs("button",{onClick:()=>t({skillId:E.id,description:E.description}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===E.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[x.jsx(Uo,{className:"w-5 h-5 text-cyan-400"}),x.jsxs("div",{children:[x.jsx("div",{className:"font-medium text-white",children:E.name}),x.jsx("div",{className:"text-xs text-gray-500",children:E.description})]})]},E.id))})]})]})}function Q9({data:e,onUpdate:t}){const i=["PreToolUse","PostToolUse","Notification","Stop"];return x.jsxs(x.Fragment,{children:[x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Event"}),x.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map(l=>x.jsx("button",{onClick:()=>t({hookEvent:l}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.hookEvent===l?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:l},l))})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),x.jsx("input",{type:"text",value:e.hookMatcher||"",onChange:l=>t({hookMatcher:l.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"}),x.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),x.jsx("input",{type:"text",value:e.hookCommand||"",onChange:l=>t({hookCommand:l.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"}),x.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Shell command to execute"})]})]})}function K9({onUpdate:e}){const t=[{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 x.jsxs("div",{children:[x.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),x.jsx("div",{className:"space-y-2",children:t.map(i=>x.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:[x.jsx(gc,{className:"w-5 h-5 text-emerald-400"}),x.jsxs("div",{children:[x.jsx("div",{className:"font-medium text-white",children:i.name}),x.jsx("div",{className:"text-xs text-gray-500",children:i.description})]})]},i.id))})]})}const J9=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function W9(){const{activeTab:e,setActiveTab:t}=Oc(),i=Kn(Pw);return x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:J9.map(l=>x.jsx("button",{onClick:()=>t(l.id),className:qt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===l.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:l.label},l.id))}),x.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&x.jsx(H9,{}),e==="console"&&x.jsx(I9,{}),e==="step"&&x.jsx(F9,{node:i}),e==="theme"&&x.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function eB(e){let t;const{apiMode:i,apiKey:l,proxyUrl:o}=Op.getState(),s={"Content-Type":"application/json","X-API-Mode":i};i==="direct"&&l?s["X-API-Key"]=l:i==="proxy"&&o&&(s["X-Proxy-URL"]=o);try{t=await fetch("/api/generate/workflow",{method:"POST",headers:s,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!t.ok){let h=`서버 오류 (${t.status})`;try{h=(await t.json()).message||h}catch{}throw new Error(h)}let u;try{u=await t.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:nB(u),workflowName:u.workflowName}}function tB(e,t){if(e.length===0)return e;const i=300,l=180,o=100,s=100,u=new Map,f=new Map;e.forEach(_=>{u.set(_.id,[]),f.set(_.id,[])}),t.forEach(_=>{const k=u.get(_.target)||[];k.push(_.source),u.set(_.target,k);const T=f.get(_.source)||[];T.push(_.target),f.set(_.source,T)});const h=e.filter(_=>(u.get(_.id)||[]).length===0),d=new Map,g=[];for(h.forEach(_=>{d.set(_.id,0),g.push({id:_.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 _=g.shift();(f.get(_.id)||[]).forEach(T=>{const B=d.get(T),A=_.depth+1;(B===void 0||A>B)&&(d.set(T,A),g.push({id:T,depth:A}))})}const p=new Map,b=new Set,v=[...e].sort((_,k)=>{const T=d.get(_.id)??0;return(d.get(k.id)??0)-T});function w(_){if(p.has(_))return p.get(_);const k=f.get(_)||[];if(k.length===0)return p.set(_,1),1;let T=0;k.forEach(A=>{T+=w(A)});const B=Math.max(1,T);return p.set(_,B),B}v.forEach(_=>{w(_.id)});const E=new Map;function C(_,k,T,B){if(b.has(_))return;b.add(_);const A=p.get(_)||1,L=B-T,X=T+L/2,Z=o+k*i;E.set(_,{x:Z,y:X});const U=f.get(_)||[];if(U.length>0){let I=T;U.forEach(P=>{const H=(p.get(P)||1)/A*L;C(P,k+1,I,I+H),I+=H})}}let N=s;return h.forEach(_=>{const T=(p.get(_.id)||1)*l;b.clear(),C(_.id,0,N,N+T),N+=T}),e.forEach(_=>{E.has(_.id)||(E.set(_.id,{x:o,y:N}),N+=l)}),e.map(_=>{const k=E.get(_.id)||_.position;return{..._,position:k}})}function nB(e){const t=[],i=new Map,l={x:0,y:0};e.nodes.forEach((u,f)=>{const h=Ql();i.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":t.push({id:h,type:"input",position:{...l},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description,value:u.config.defaultValue||"",defaultValue:u.config.defaultValue||""}});break;case"agent":t.push({id:h,type:"agent",position:{...l},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":t.push({id:h,type:"skill",position:{...l},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"hook":t.push({id:h,type:"hook",position:{...l},data:{...d,hookEvent:u.config.hookEvent||"PreToolUse",hookMatcher:u.config.hookMatcher,hookCommand:u.config.hookCommand}});break;case"output":t.push({id:h,type:"output",position:{...l},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=t.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:tB(t,o),edges:o}}function iB(e){const t=e.toLowerCase();if(t.includes("스킬")||t.includes("skill"))return!0;const i=[/만들어\s*(줘|주세요|줘요)/,/작성해\s*(줘|주세요|줘요)/,/생성해\s*(줘|주세요|줘요)/];for(const l of i)if(l.test(e))return!0;return!1}function rB(){const[e,t]=R.useState(""),[i,l]=R.useState(!1),[o,s]=R.useState(null),[u,f]=R.useState(null),[h,d]=R.useState("workflow"),{loadWorkflow:g,addNode:p,setSelectedNode:b,nodes:v}=Kn(),{openConsolePanel:w,openStepPanel:E}=Oc(),{addLog:C,clearLogs:N}=ea(),{apiMode:_,apiKey:k,proxyUrl:T}=Op(),B=R.useCallback(U=>{console.log("[PromptBar] Skill progress:",U.step,U.message);const I=U.step==="error"?"error":U.step==="completed"?"success":"info";C(I,U.message,void 0,U.detail)},[C]),A=R.useCallback(U=>{l(!1),f(`스킬 "${U.skill.skillName}"이 ${U.savedPath}에 저장되었습니다!`),t(""),setTimeout(()=>f(null),5e3);const I=Ql(),P=v.length,ee={id:I,type:"skill",position:{x:100+P%3*300,y:100+Math.floor(P/3)*200},data:{label:U.skill.skillName,description:U.skill.description,status:"idle",skillType:"generated",skillId:U.skill.skillId,skillPath:U.savedPath}};p(ee),b(I),E()},[v,p,b,E]),L=R.useCallback(U=>{l(!1),s(U.error)},[]);R.useEffect(()=>(Ct.on("skill:progress",B),Ct.on("skill:completed",A),Ct.on("skill:error",L),()=>{Ct.off("skill:progress",B),Ct.off("skill:completed",A),Ct.off("skill:error",L)}),[B,A,L]);const X=async()=>{if(!e.trim()||i)return;l(!0),s(null),f(null);const U=iB(e);d(U?"skill":"workflow");try{if(U)N(),w(),Ct.isConnected()||C("warning","⚠️ 서버 연결 대기 중...",void 0,"잠시 후 자동으로 연결됩니다"),Ct.generateSkill({prompt:e,apiMode:_,apiKey:_==="direct"?k:void 0,proxyUrl:_==="proxy"?T:void 0});else{const{workflow:I,workflowName:P}=await eB(e);g({nodes:I.nodes,edges:I.edges,name:P}),t(""),l(!1)}}catch(I){console.error("Generation failed:",I);const P=I instanceof Error?I.message:"생성에 실패했습니다.";s(P),l(!1)}},Z=U=>{U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),X())};return x.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[x.jsx(Ho,{className:"w-5 h-5 text-accent flex-shrink-0"}),x.jsx("input",{type:"text",value:e,onChange:U=>t(U.target.value),onKeyDown:Z,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}),x.jsx("button",{onClick:X,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?x.jsx(Ku,{className:"w-5 h-5 animate-spin"}):x.jsx(h_,{className:"w-5 h-5"})}),x.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:o?x.jsx("span",{className:"text-red-400",children:o}):u?x.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[x.jsx(yc,{className:"w-3 h-3"}),u]}):i?x.jsxs("span",{className:"text-accent",children:["AI가 ",h==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):x.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function lB(){const{isCollapsed:e,width:t}=Oc(),{isRunning:i,logs:l}=ea(),{mergeExistingConfig:o}=Kn(),[s,u]=R.useState(!1),f=R.useRef(!1);return R.useEffect(()=>{f.current||(f.current=!0,l2().then(h=>{h.length>0&&(console.log(`Loaded ${h.length} nodes from .claude/`),o(h))}).catch(h=>{console.error("Failed to load initial config:",h)}))},[o]),R.useEffect(()=>{i&&u(!0)},[i]),x.jsx(Iw,{children:x.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[x.jsx(Qz,{}),x.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[x.jsxs("div",{className:"flex-1 flex flex-col",children:[x.jsx(eR,{}),x.jsxs("div",{className:"flex-1 relative",children:[x.jsx(mR,{}),x.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:x.jsx(rB,{})})]})]}),!e&&x.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${t}px`},children:x.jsx(W9,{})})]}),x.jsxs("button",{onClick:()=>u(!s),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${s?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${s?"opacity-0 pointer-events-none":"opacity-100"}`,children:[x.jsx(bc,{className:"w-4 h-4"}),x.jsx("span",{className:"text-sm font-medium",children:"Console"}),l.length>0&&!s&&x.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:l.length}),i&&x.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),x.jsx(U9,{isOpen:s,onClose:()=>u(!1)})]})})}function aB(){return x.jsx(QN,{children:x.jsxs(CN,{children:[x.jsx($h,{path:"/",element:x.jsx(H_,{})}),x.jsx($h,{path:"/project/:projectName",element:x.jsx(lB,{})})]})})}AE.createRoot(document.getElementById("root")).render(x.jsx(R.StrictMode,{children:x.jsx(aB,{})}));