morpheus-cli 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/manager.js +3 -0
- package/dist/config/schemas.js +7 -2
- package/dist/http/routers/skills.js +164 -0
- package/dist/runtime/oracle.js +8 -2
- package/dist/runtime/tasks/context.js +16 -0
- package/dist/runtime/tools/apoc-tool.js +28 -1
- package/dist/runtime/tools/morpheus-tools.js +3 -0
- package/dist/runtime/tools/neo-tool.js +32 -0
- package/dist/runtime/tools/trinity-tool.js +27 -0
- package/dist/types/config.js +3 -0
- package/dist/ui/assets/index-CsMDzmtQ.js +117 -0
- package/dist/ui/assets/index-Dz_qYlIb.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/sw.js +1 -1
- package/package.json +4 -1
- package/dist/ui/assets/index-CiT3ltw7.css +0 -1
- package/dist/ui/assets/index-DfDByABF.js +0 -111
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function Yp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bh={exports:{}},tl={};var h0;function PC(){if(h0)return tl;h0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,u){var l=null;if(u!==void 0&&(l=""+u),s.key!==void 0&&(l=""+s.key),"key"in s){u={};for(var f in s)f!=="key"&&(u[f]=s[f])}else u=s;return s=u.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:u}}return tl.Fragment=t,tl.jsx=n,tl.jsxs=n,tl}var m0;function UC(){return m0||(m0=1,Bh.exports=PC()),Bh.exports}var d=UC(),Zh={exports:{}},Oe={};var p0;function VC(){if(p0)return Oe;p0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(C){return C===null||typeof C!="object"?null:(C=v&&C[v]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,A={};function E(C,I,w){this.props=C,this.context=I,this.refs=A,this.updater=w||S}E.prototype.isReactComponent={},E.prototype.setState=function(C,I){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,I,"setState")},E.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function O(){}O.prototype=E.prototype;function N(C,I,w){this.props=C,this.context=I,this.refs=A,this.updater=w||S}var L=N.prototype=new O;L.constructor=N,j(L,E.prototype),L.isPureReactComponent=!0;var D=Array.isArray;function R(){}var q={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function X(C,I,w){var Y=w.ref;return{$$typeof:e,type:C,key:I,ref:Y!==void 0?Y:null,props:w}}function fe(C,I){return X(C.type,I,C.props)}function se(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function le(C){var I={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(w){return I[w]})}var ee=/\/+/g;function oe(C,I){return typeof C=="object"&&C!==null&&C.key!=null?le(""+C.key):I.toString(36)}function ae(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(R,R):(C.status="pending",C.then(function(I){C.status==="pending"&&(C.status="fulfilled",C.value=I)},function(I){C.status==="pending"&&(C.status="rejected",C.reason=I)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function P(C,I,w,Y,de){var he=typeof C;(he==="undefined"||he==="boolean")&&(C=null);var pe=!1;if(C===null)pe=!0;else switch(he){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(C.$$typeof){case e:case t:pe=!0;break;case g:return pe=C._init,P(pe(C._payload),I,w,Y,de)}}if(pe)return de=de(C),pe=Y===""?"."+oe(C,0):Y,D(de)?(w="",pe!=null&&(w=pe.replace(ee,"$&/")+"/"),P(de,I,w,"",function(pt){return pt})):de!=null&&(se(de)&&(de=fe(de,w+(de.key==null||C&&C.key===de.key?"":(""+de.key).replace(ee,"$&/")+"/")+pe)),I.push(de)),1;pe=0;var Pe=Y===""?".":Y+":";if(D(C))for(var Ae=0;Ae<C.length;Ae++)Y=C[Ae],he=Pe+oe(Y,Ae),pe+=P(Y,I,w,he,de);else if(Ae=b(C),typeof Ae=="function")for(C=Ae.call(C),Ae=0;!(Y=C.next()).done;)Y=Y.value,he=Pe+oe(Y,Ae++),pe+=P(Y,I,w,he,de);else if(he==="object"){if(typeof C.then=="function")return P(ae(C),I,w,Y,de);throw I=String(C),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return pe}function J(C,I,w){if(C==null)return C;var Y=[],de=0;return P(C,Y,"","",function(he){return I.call(w,he,de++)}),Y}function Z(C){if(C._status===-1){var I=C._result;I=I(),I.then(function(w){(C._status===0||C._status===-1)&&(C._status=1,C._result=w)},function(w){(C._status===0||C._status===-1)&&(C._status=2,C._result=w)}),C._status===-1&&(C._status=0,C._result=I)}if(C._status===1)return C._result.default;throw C._result}var me=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},T={map:J,forEach:function(C,I,w){J(C,function(){I.apply(this,arguments)},w)},count:function(C){var I=0;return J(C,function(){I++}),I},toArray:function(C){return J(C,function(I){return I})||[]},only:function(C){if(!se(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Oe.Activity=y,Oe.Children=T,Oe.Component=E,Oe.Fragment=n,Oe.Profiler=s,Oe.PureComponent=N,Oe.StrictMode=a,Oe.Suspense=h,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(C){return q.H.useMemoCache(C)}},Oe.cache=function(C){return function(){return C.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(C,I,w){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var Y=j({},C.props),de=C.key;if(I!=null)for(he in I.key!==void 0&&(de=""+I.key),I)!B.call(I,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&I.ref===void 0||(Y[he]=I[he]);var he=arguments.length-2;if(he===1)Y.children=w;else if(1<he){for(var pe=Array(he),Pe=0;Pe<he;Pe++)pe[Pe]=arguments[Pe+2];Y.children=pe}return X(C.type,de,Y)},Oe.createContext=function(C){return C={$$typeof:l,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},Oe.createElement=function(C,I,w){var Y,de={},he=null;if(I!=null)for(Y in I.key!==void 0&&(he=""+I.key),I)B.call(I,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(de[Y]=I[Y]);var pe=arguments.length-2;if(pe===1)de.children=w;else if(1<pe){for(var Pe=Array(pe),Ae=0;Ae<pe;Ae++)Pe[Ae]=arguments[Ae+2];de.children=Pe}if(C&&C.defaultProps)for(Y in pe=C.defaultProps,pe)de[Y]===void 0&&(de[Y]=pe[Y]);return X(C,he,de)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(C){return{$$typeof:f,render:C}},Oe.isValidElement=se,Oe.lazy=function(C){return{$$typeof:g,_payload:{_status:-1,_result:C},_init:Z}},Oe.memo=function(C,I){return{$$typeof:m,type:C,compare:I===void 0?null:I}},Oe.startTransition=function(C){var I=q.T,w={};q.T=w;try{var Y=C(),de=q.S;de!==null&&de(w,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(R,me)}catch(he){me(he)}finally{I!==null&&w.types!==null&&(I.types=w.types),q.T=I}},Oe.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Oe.use=function(C){return q.H.use(C)},Oe.useActionState=function(C,I,w){return q.H.useActionState(C,I,w)},Oe.useCallback=function(C,I){return q.H.useCallback(C,I)},Oe.useContext=function(C){return q.H.useContext(C)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(C,I){return q.H.useDeferredValue(C,I)},Oe.useEffect=function(C,I){return q.H.useEffect(C,I)},Oe.useEffectEvent=function(C){return q.H.useEffectEvent(C)},Oe.useId=function(){return q.H.useId()},Oe.useImperativeHandle=function(C,I,w){return q.H.useImperativeHandle(C,I,w)},Oe.useInsertionEffect=function(C,I){return q.H.useInsertionEffect(C,I)},Oe.useLayoutEffect=function(C,I){return q.H.useLayoutEffect(C,I)},Oe.useMemo=function(C,I){return q.H.useMemo(C,I)},Oe.useOptimistic=function(C,I){return q.H.useOptimistic(C,I)},Oe.useReducer=function(C,I,w){return q.H.useReducer(C,I,w)},Oe.useRef=function(C){return q.H.useRef(C)},Oe.useState=function(C){return q.H.useState(C)},Oe.useSyncExternalStore=function(C,I,w){return q.H.useSyncExternalStore(C,I,w)},Oe.useTransition=function(){return q.H.useTransition()},Oe.version="19.2.4",Oe}var g0;function ud(){return g0||(g0=1,Zh.exports=VC()),Zh.exports}var z=ud();const Kp=Yp(z);var Ih={exports:{}},nl={},Hh={exports:{}},Fh={};var x0;function BC(){return x0||(x0=1,(function(e){function t(P,J){var Z=P.length;P.push(J);e:for(;0<Z;){var me=Z-1>>>1,T=P[me];if(0<s(T,J))P[me]=J,P[Z]=T,Z=me;else break e}}function n(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var J=P[0],Z=P.pop();if(Z!==J){P[0]=Z;e:for(var me=0,T=P.length,C=T>>>1;me<C;){var I=2*(me+1)-1,w=P[I],Y=I+1,de=P[Y];if(0>s(w,Z))Y<T&&0>s(de,w)?(P[me]=de,P[Y]=Z,me=Y):(P[me]=w,P[I]=Z,me=I);else if(Y<T&&0>s(de,Z))P[me]=de,P[Y]=Z,me=Y;else break e}}return J}function s(P,J){var Z=P.sortIndex-J.sortIndex;return Z!==0?Z:P.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,f=l.now();e.unstable_now=function(){return l.now()-f}}var h=[],m=[],g=1,y=null,v=3,b=!1,S=!1,j=!1,A=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(P){for(var J=n(m);J!==null;){if(J.callback===null)a(m);else if(J.startTime<=P)a(m),J.sortIndex=J.expirationTime,t(h,J);else break;J=n(m)}}function D(P){if(j=!1,L(P),!S)if(n(h)!==null)S=!0,R||(R=!0,le());else{var J=n(m);J!==null&&ae(D,J.startTime-P)}}var R=!1,q=-1,B=5,X=-1;function fe(){return A?!0:!(e.unstable_now()-X<B)}function se(){if(A=!1,R){var P=e.unstable_now();X=P;var J=!0;try{e:{S=!1,j&&(j=!1,O(q),q=-1),b=!0;var Z=v;try{t:{for(L(P),y=n(h);y!==null&&!(y.expirationTime>P&&fe());){var me=y.callback;if(typeof me=="function"){y.callback=null,v=y.priorityLevel;var T=me(y.expirationTime<=P);if(P=e.unstable_now(),typeof T=="function"){y.callback=T,L(P),J=!0;break t}y===n(h)&&a(h),L(P)}else a(h);y=n(h)}if(y!==null)J=!0;else{var C=n(m);C!==null&&ae(D,C.startTime-P),J=!1}}break e}finally{y=null,v=Z,b=!1}J=void 0}}finally{J?le():R=!1}}}var le;if(typeof N=="function")le=function(){N(se)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,oe=ee.port2;ee.port1.onmessage=se,le=function(){oe.postMessage(null)}}else le=function(){E(se,0)};function ae(P,J){q=E(function(){P(e.unstable_now())},J)}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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var J=3;break;default:J=v}var Z=v;v=J;try{return P()}finally{v=Z}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(P,J){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var Z=v;v=P;try{return J()}finally{v=Z}},e.unstable_scheduleCallback=function(P,J,Z){var me=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?me+Z:me):Z=me,P){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=Z+T,P={id:g++,callback:J,priorityLevel:P,startTime:Z,expirationTime:T,sortIndex:-1},Z>me?(P.sortIndex=Z,t(m,P),n(h)===null&&P===n(m)&&(j?(O(q),q=-1):j=!0,ae(D,Z-me))):(P.sortIndex=T,t(h,P),S||b||(S=!0,R||(R=!0,le()))),P},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(P){var J=v;return function(){var Z=v;v=J;try{return P.apply(this,arguments)}finally{v=Z}}}})(Fh)),Fh}var y0;function ZC(){return y0||(y0=1,Hh.exports=BC()),Hh.exports}var qh={exports:{}},cn={};var b0;function IC(){if(b0)return cn;b0=1;var e=ud();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function u(h,m,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:""+y,children:h,containerInfo:m,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,cn.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return u(h,m,null,g)},cn.flushSync=function(h){var m=l.T,g=a.p;try{if(l.T=null,a.p=2,h)return h()}finally{l.T=m,a.p=g,a.d.f()}},cn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},cn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},cn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},cn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=f(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},cn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},cn.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=f(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},cn.requestFormReset=function(h){a.d.r(h)},cn.unstable_batchedUpdates=function(h,m){return h(m)},cn.useFormState=function(h,m,g){return l.H.useFormState(h,m,g)},cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},cn.version="19.2.4",cn}var v0;function HC(){if(v0)return qh.exports;v0=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(),qh.exports=IC(),qh.exports}var k0;function FC(){if(k0)return nl;k0=1;var e=ZC(),t=ud(),n=HC();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,o=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(o=i.return),r=i.return;while(r)}return i.tag===3?o:null}function l(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(u(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(a(188));return i!==r?null:r}for(var o=r,c=i;;){var p=o.return;if(p===null)break;var x=p.alternate;if(x===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===o)return h(p),r;if(x===c)return h(p),i;x=x.sibling}throw Error(a(188))}if(o.return!==c.return)o=p,c=x;else{for(var k=!1,_=p.child;_;){if(_===o){k=!0,o=p,c=x;break}if(_===c){k=!0,c=p,o=x;break}_=_.sibling}if(!k){for(_=x.child;_;){if(_===o){k=!0,o=x,c=p;break}if(_===c){k=!0,c=x,o=p;break}_=_.sibling}if(!k)throw Error(a(189))}}if(o.alternate!==c)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),se=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=se&&r[se]||r["@@iterator"],typeof r=="function"?r:null)}var ee=Symbol.for("react.client.reference");function oe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ee?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case E:return"Profiler";case A:return"StrictMode";case D:return"Suspense";case R:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case O:return(r._context.displayName||"Context")+".Consumer";case L:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case q:return i=r.displayName||null,i!==null?i:oe(r.type)||"Memo";case B:i=r._payload,r=r._init;try{return oe(r(i))}catch{}}return null}var ae=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},me=[],T=-1;function C(r){return{current:r}}function I(r){0>T||(r.current=me[T],me[T]=null,T--)}function w(r,i){T++,me[T]=r.current,r.current=i}var Y=C(null),de=C(null),he=C(null),pe=C(null);function Pe(r,i){switch(w(he,i),w(de,r),w(Y,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?$v(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=$v(i),r=Lv(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}I(Y),w(Y,r)}function Ae(){I(Y),I(de),I(he)}function pt(r){r.memoizedState!==null&&w(pe,r);var i=Y.current,o=Lv(i,r.type);i!==o&&(w(de,r),w(Y,o))}function Rt(r){de.current===r&&(I(Y),I(de)),pe.current===r&&(I(pe),Jo._currentValue=Z)}var V,Ne;function Ge(r){if(V===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);V=i&&i[1]||"",Ne=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+V+r+Ne}var Lt=!1;function Me(r,i){if(!r||Lt)return"";Lt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(K){var G=K}Reflect.construct(r,[],re)}else{try{re.call()}catch(K){G=K}r.call(re.prototype)}}else{try{throw Error()}catch(K){G=K}(re=r())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(K){if(K&&G&&typeof K.stack=="string")return[K.stack,G.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),k=x[0],_=x[1];if(k&&_){var M=k.split(`
|
|
4
|
-
`),F=_.split(`
|
|
5
|
-
`);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===F.length)for(c=M.length-1,p=F.length-1;1<=c&&0<=p&&M[c]!==F[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==F[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==F[p]){var Q=`
|
|
6
|
-
`+M[c].replace(" at new "," at ");return r.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",r.displayName)),Q}while(1<=c&&0<=p);break}}}finally{Lt=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?Ge(o):""}function Xe(r,i){switch(r.tag){case 26:case 27:case 5:return Ge(r.type);case 16:return Ge("Lazy");case 13:return r.child!==i&&i!==null?Ge("Suspense Fallback"):Ge("Suspense");case 19:return Ge("SuspenseList");case 0:case 15:return Me(r.type,!1);case 11:return Me(r.type.render,!1);case 1:return Me(r.type,!0);case 31:return Ge("Activity");default:return""}}function st(r){try{var i="",o=null;do i+=Xe(r,o),o=r,r=r.return;while(r);return i}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var tt=Object.prototype.hasOwnProperty,Qt=e.unstable_scheduleCallback,Gn=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Gt=e.unstable_requestPaint,gt=e.unstable_now,$i=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Ce=e.unstable_LowPriority,He=e.unstable_IdlePriority,pn=e.log,$n=e.unstable_setDisableYieldValue,gn=null,Yt=null;function Sn(r){if(typeof pn=="function"&&$n(r),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(gn,r)}catch{}}var ct=Math.clz32?Math.clz32:z2,ua=Math.log,hr=Math.LN2;function z2(r){return r>>>=0,r===0?32:31-(ua(r)/hr|0)|0}var Jl=256,Ql=262144,Wl=4194304;function ti(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function eu(r,i,o){var c=r.pendingLanes;if(c===0)return 0;var p=0,x=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var _=c&134217727;return _!==0?(c=_&~x,c!==0?p=ti(c):(k&=_,k!==0?p=ti(k):o||(o=_&~r,o!==0&&(p=ti(o))))):(_=c&~x,_!==0?p=ti(_):k!==0?p=ti(k):o||(o=c&~r,o!==0&&(p=ti(o)))),p===0?0:i!==0&&i!==p&&(i&x)===0&&(x=p&-p,o=i&-i,x>=o||x===32&&(o&4194048)!==0)?i:p}function uo(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function _2(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xx(){var r=Wl;return Wl<<=1,(Wl&62914560)===0&&(Wl=4194304),r}function Cd(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function co(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function j2(r,i,o,c,p,x){var k=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var _=r.entanglements,M=r.expirationTimes,F=r.hiddenUpdates;for(o=k&~o;0<o;){var Q=31-ct(o),re=1<<Q;_[Q]=0,M[Q]=-1;var G=F[Q];if(G!==null)for(F[Q]=null,Q=0;Q<G.length;Q++){var K=G[Q];K!==null&&(K.lane&=-536870913)}o&=~re}c!==0&&yx(r,c,0),x!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=x&~(k&~i))}function yx(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ct(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|o&261930}function bx(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var c=31-ct(o),p=1<<c;p&i|r[c]&i&&(r[c]|=i),o&=~p}}function vx(r,i){var o=i&-i;return o=(o&42)!==0?1:Ed(o),(o&(r.suspendedLanes|i))!==0?0:o}function Ed(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Td(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function kx(){var r=J.p;return r!==0?r:(r=window.event,r===void 0?32:s0(r.type))}function wx(r,i){var o=J.p;try{return J.p=r,i()}finally{J.p=o}}var ca=Math.random().toString(36).slice(2),nn="__reactFiber$"+ca,zn="__reactProps$"+ca,Li="__reactContainer$"+ca,Ad="__reactEvents$"+ca,N2="__reactListeners$"+ca,C2="__reactHandles$"+ca,Sx="__reactResources$"+ca,fo="__reactMarker$"+ca;function Od(r){delete r[nn],delete r[zn],delete r[Ad],delete r[N2],delete r[C2]}function Pi(r){var i=r[nn];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Li]||o[nn]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Hv(r);r!==null;){if(o=r[nn])return o;r=Hv(r)}return i}r=o,o=r.parentNode}return null}function Ui(r){if(r=r[nn]||r[Li]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ho(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Vi(r){var i=r[Sx];return i||(i=r[Sx]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Wt(r){r[fo]=!0}var zx=new Set,_x={};function ni(r,i){Bi(r,i),Bi(r+"Capture",i)}function Bi(r,i){for(_x[r]=i,r=0;r<i.length;r++)zx.add(i[r])}var E2=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]*$"),jx={},Nx={};function T2(r){return tt.call(Nx,r)?!0:tt.call(jx,r)?!1:E2.test(r)?Nx[r]=!0:(jx[r]=!0,!1)}function tu(r,i,o){if(T2(i))if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+o)}}function nu(r,i,o){if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+o)}}function Pr(r,i,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(i,o,""+c)}}function Yn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Cx(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function A2(r,i,o){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,x=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(k){o=""+k,x.call(this,k)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(k){o=""+k},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Rd(r){if(!r._valueTracker){var i=Cx(r)?"checked":"value";r._valueTracker=A2(r,i,""+r[i])}}function Ex(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),c="";return r&&(c=Cx(r)?r.checked?"true":"false":r.value),r=c,r!==o?(i.setValue(r),!0):!1}function ru(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var O2=/[\n"\\]/g;function Kn(r){return r.replace(O2,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Md(r,i,o,c,p,x,k,_){r.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.type=k:r.removeAttribute("type"),i!=null?k==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Yn(i)):r.value!==""+Yn(i)&&(r.value=""+Yn(i)):k!=="submit"&&k!=="reset"||r.removeAttribute("value"),i!=null?Dd(r,k,Yn(i)):o!=null?Dd(r,k,Yn(o)):c!=null&&r.removeAttribute("value"),p==null&&x!=null&&(r.defaultChecked=!!x),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+Yn(_):r.removeAttribute("name")}function Tx(r,i,o,c,p,x,k,_){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(r.type=x),i!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Rd(r);return}o=o!=null?""+Yn(o):"",i=i!=null?""+Yn(i):o,_||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=_?r.checked:!!c,r.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(r.name=k),Rd(r)}function Dd(r,i,o){i==="number"&&ru(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Zi(r,i,o,c){if(r=r.options,i){i={};for(var p=0;p<o.length;p++)i["$"+o[p]]=!0;for(o=0;o<r.length;o++)p=i.hasOwnProperty("$"+r[o].value),r[o].selected!==p&&(r[o].selected=p),p&&c&&(r[o].defaultSelected=!0)}else{for(o=""+Yn(o),i=null,p=0;p<r.length;p++){if(r[p].value===o){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ax(r,i,o){if(i!=null&&(i=""+Yn(i),i!==r.value&&(r.value=i),o==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=o!=null?""+Yn(o):""}function Ox(r,i,o,c){if(i==null){if(c!=null){if(o!=null)throw Error(a(92));if(ae(c)){if(1<c.length)throw Error(a(93));c=c[0]}o=c}o==null&&(o=""),i=o}o=Yn(i),r.defaultValue=o,c=r.textContent,c===o&&c!==""&&c!==null&&(r.value=c),Rd(r)}function Ii(r,i){if(i){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=i;return}}r.textContent=i}var R2=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 Rx(r,i,o){var c=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,o):typeof o!="number"||o===0||R2.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Mx(r,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&o[p]!==c&&Rx(r,p,c)}else for(var x in i)i.hasOwnProperty(x)&&Rx(r,x,i[x])}function $d(r){if(r.indexOf("-")===-1)return!1;switch(r){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 M2=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"]]),D2=/^[\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 au(r){return D2.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ur(){}var Ld=null;function Pd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Hi=null,Fi=null;function Dx(r){var i=Ui(r);if(i&&(r=i.stateNode)){var o=r[zn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Md(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=r;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Kn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var c=o[i];if(c!==r&&c.form===r.form){var p=c[zn]||null;if(!p)throw Error(a(90));Md(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<o.length;i++)c=o[i],c.form===r.form&&Ex(c)}break e;case"textarea":Ax(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Zi(r,!!o.multiple,i,!1)}}}var Ud=!1;function $x(r,i,o){if(Ud)return r(i,o);Ud=!0;try{var c=r(i);return c}finally{if(Ud=!1,(Hi!==null||Fi!==null)&&(Fu(),Hi&&(i=Hi,r=Fi,Fi=Hi=null,Dx(i),r)))for(i=0;i<r.length;i++)Dx(r[i])}}function mo(r,i){var o=r.stateNode;if(o===null)return null;var c=o[zn]||null;if(c===null)return null;o=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vd=!1;if(Vr)try{var po={};Object.defineProperty(po,"passive",{get:function(){Vd=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{Vd=!1}var da=null,Bd=null,iu=null;function Lx(){if(iu)return iu;var r,i=Bd,o=i.length,c,p="value"in da?da.value:da.textContent,x=p.length;for(r=0;r<o&&i[r]===p[r];r++);var k=o-r;for(c=1;c<=k&&i[o-c]===p[x-c];c++);return iu=p.slice(r,1<c?1-c:void 0)}function su(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function ou(){return!0}function Px(){return!1}function _n(r){function i(o,c,p,x,k){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(o=r[_],this[_]=o?o(x):x[_]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ou:Px,this.isPropagationStopped=Px,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ou)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ou)},persist:function(){},isPersistent:ou}),i}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lu=_n(ri),go=y({},ri,{view:0,detail:0}),$2=_n(go),Zd,Id,xo,uu=y({},go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==xo&&(xo&&r.type==="mousemove"?(Zd=r.screenX-xo.screenX,Id=r.screenY-xo.screenY):Id=Zd=0,xo=r),Zd)},movementY:function(r){return"movementY"in r?r.movementY:Id}}),Ux=_n(uu),L2=y({},uu,{dataTransfer:0}),P2=_n(L2),U2=y({},go,{relatedTarget:0}),Hd=_n(U2),V2=y({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),B2=_n(V2),Z2=y({},ri,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),I2=_n(Z2),H2=y({},ri,{data:0}),Vx=_n(H2),F2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q2={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"},G2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y2(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=G2[r])?!!i[r]:!1}function Fd(){return Y2}var K2=y({},go,{key:function(r){if(r.key){var i=F2[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=su(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?q2[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fd,charCode:function(r){return r.type==="keypress"?su(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?su(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),X2=_n(K2),J2=y({},uu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bx=_n(J2),Q2=y({},go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fd}),W2=_n(Q2),eN=y({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),tN=_n(eN),nN=y({},uu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),rN=_n(nN),aN=y({},ri,{newState:0,oldState:0}),iN=_n(aN),sN=[9,13,27,32],qd=Vr&&"CompositionEvent"in window,yo=null;Vr&&"documentMode"in document&&(yo=document.documentMode);var oN=Vr&&"TextEvent"in window&&!yo,Zx=Vr&&(!qd||yo&&8<yo&&11>=yo),Ix=" ",Hx=!1;function Fx(r,i){switch(r){case"keyup":return sN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qi=!1;function lN(r,i){switch(r){case"compositionend":return qx(i);case"keypress":return i.which!==32?null:(Hx=!0,Ix);case"textInput":return r=i.data,r===Ix&&Hx?null:r;default:return null}}function uN(r,i){if(qi)return r==="compositionend"||!qd&&Fx(r,i)?(r=Lx(),iu=Bd=da=null,qi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Zx&&i.locale!=="ko"?null:i.data;default:return null}}var cN={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 Gx(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!cN[r.type]:i==="textarea"}function Yx(r,i,o,c){Hi?Fi?Fi.push(c):Fi=[c]:Hi=c,i=Qu(i,"onChange"),0<i.length&&(o=new lu("onChange","change",null,o,c),r.push({event:o,listeners:i}))}var bo=null,vo=null;function dN(r){Tv(r,0)}function cu(r){var i=ho(r);if(Ex(i))return r}function Kx(r,i){if(r==="change")return i}var Xx=!1;if(Vr){var Gd;if(Vr){var Yd="oninput"in document;if(!Yd){var Jx=document.createElement("div");Jx.setAttribute("oninput","return;"),Yd=typeof Jx.oninput=="function"}Gd=Yd}else Gd=!1;Xx=Gd&&(!document.documentMode||9<document.documentMode)}function Qx(){bo&&(bo.detachEvent("onpropertychange",Wx),vo=bo=null)}function Wx(r){if(r.propertyName==="value"&&cu(vo)){var i=[];Yx(i,vo,r,Pd(r)),$x(dN,i)}}function fN(r,i,o){r==="focusin"?(Qx(),bo=i,vo=o,bo.attachEvent("onpropertychange",Wx)):r==="focusout"&&Qx()}function hN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return cu(vo)}function mN(r,i){if(r==="click")return cu(i)}function pN(r,i){if(r==="input"||r==="change")return cu(i)}function gN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Ln=typeof Object.is=="function"?Object.is:gN;function ko(r,i){if(Ln(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var o=Object.keys(r),c=Object.keys(i);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!tt.call(i,p)||!Ln(r[p],i[p]))return!1}return!0}function ey(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ty(r,i){var o=ey(r);r=0;for(var c;o;){if(o.nodeType===3){if(c=r+o.textContent.length,r<=i&&c>=i)return{node:o,offset:i-r};r=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ey(o)}}function ny(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?ny(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function ry(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=ru(r.document);i instanceof r.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)r=i.contentWindow;else break;i=ru(r.document)}return i}function Kd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var xN=Vr&&"documentMode"in document&&11>=document.documentMode,Gi=null,Xd=null,wo=null,Jd=!1;function ay(r,i,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Jd||Gi==null||Gi!==ru(c)||(c=Gi,"selectionStart"in c&&Kd(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}),wo&&ko(wo,c)||(wo=c,c=Qu(Xd,"onSelect"),0<c.length&&(i=new lu("onSelect","select",null,i,o),r.push({event:i,listeners:c}),i.target=Gi)))}function ai(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var Yi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},Qd={},iy={};Vr&&(iy=document.createElement("div").style,"AnimationEvent"in window||(delete Yi.animationend.animation,delete Yi.animationiteration.animation,delete Yi.animationstart.animation),"TransitionEvent"in window||delete Yi.transitionend.transition);function ii(r){if(Qd[r])return Qd[r];if(!Yi[r])return r;var i=Yi[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in iy)return Qd[r]=i[o];return r}var sy=ii("animationend"),oy=ii("animationiteration"),ly=ii("animationstart"),yN=ii("transitionrun"),bN=ii("transitionstart"),vN=ii("transitioncancel"),uy=ii("transitionend"),cy=new Map,Wd="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(" ");Wd.push("scrollEnd");function mr(r,i){cy.set(r,i),ni(i,[r])}var du=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Xn=[],Ki=0,ef=0;function fu(){for(var r=Ki,i=ef=Ki=0;i<r;){var o=Xn[i];Xn[i++]=null;var c=Xn[i];Xn[i++]=null;var p=Xn[i];Xn[i++]=null;var x=Xn[i];if(Xn[i++]=null,c!==null&&p!==null){var k=c.pending;k===null?p.next=p:(p.next=k.next,k.next=p),c.pending=p}x!==0&&dy(o,p,x)}}function hu(r,i,o,c){Xn[Ki++]=r,Xn[Ki++]=i,Xn[Ki++]=o,Xn[Ki++]=c,ef|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function tf(r,i,o,c){return hu(r,i,o,c),mu(r)}function si(r,i){return hu(r,null,null,i),mu(r)}function dy(r,i,o){r.lanes|=o;var c=r.alternate;c!==null&&(c.lanes|=o);for(var p=!1,x=r.return;x!==null;)x.childLanes|=o,c=x.alternate,c!==null&&(c.childLanes|=o),x.tag===22&&(r=x.stateNode,r===null||r._visibility&1||(p=!0)),r=x,x=x.return;return r.tag===3?(x=r.stateNode,p&&i!==null&&(p=31-ct(o),r=x.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=o|536870912),x):null}function mu(r){if(50<Ho)throw Ho=0,dh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Xi={};function kN(r,i,o,c){this.tag=r,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(r,i,o,c){return new kN(r,i,o,c)}function nf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Br(r,i){var o=r.alternate;return o===null?(o=Pn(r.tag,i,r.key,r.mode),o.elementType=r.elementType,o.type=r.type,o.stateNode=r.stateNode,o.alternate=r,r.alternate=o):(o.pendingProps=i,o.type=r.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=r.flags&65011712,o.childLanes=r.childLanes,o.lanes=r.lanes,o.child=r.child,o.memoizedProps=r.memoizedProps,o.memoizedState=r.memoizedState,o.updateQueue=r.updateQueue,i=r.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=r.sibling,o.index=r.index,o.ref=r.ref,o.refCleanup=r.refCleanup,o}function fy(r,i){r.flags&=65011714;var o=r.alternate;return o===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function pu(r,i,o,c,p,x){var k=0;if(c=r,typeof r=="function")nf(r)&&(k=1);else if(typeof r=="string")k=jC(r,o,Y.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=Pn(31,o,i,p),r.elementType=X,r.lanes=x,r;case j:return oi(o.children,p,x,i);case A:k=8,p|=24;break;case E:return r=Pn(12,o,i,p|2),r.elementType=E,r.lanes=x,r;case D:return r=Pn(13,o,i,p),r.elementType=D,r.lanes=x,r;case R:return r=Pn(19,o,i,p),r.elementType=R,r.lanes=x,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:k=10;break e;case O:k=9;break e;case L:k=11;break e;case q:k=14;break e;case B:k=16,c=null;break e}k=29,o=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Pn(k,o,i,p),i.elementType=r,i.type=c,i.lanes=x,i}function oi(r,i,o,c){return r=Pn(7,r,c,i),r.lanes=o,r}function rf(r,i,o){return r=Pn(6,r,null,i),r.lanes=o,r}function hy(r){var i=Pn(18,null,null,0);return i.stateNode=r,i}function af(r,i,o){return i=Pn(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var my=new WeakMap;function Jn(r,i){if(typeof r=="object"&&r!==null){var o=my.get(r);return o!==void 0?o:(i={value:r,source:i,stack:st(i)},my.set(r,i),i)}return{value:r,source:i,stack:st(i)}}var Ji=[],Qi=0,gu=null,So=0,Qn=[],Wn=0,fa=null,zr=1,_r="";function Zr(r,i){Ji[Qi++]=So,Ji[Qi++]=gu,gu=r,So=i}function py(r,i,o){Qn[Wn++]=zr,Qn[Wn++]=_r,Qn[Wn++]=fa,fa=r;var c=zr;r=_r;var p=32-ct(c)-1;c&=~(1<<p),o+=1;var x=32-ct(i)+p;if(30<x){var k=p-p%5;x=(c&(1<<k)-1).toString(32),c>>=k,p-=k,zr=1<<32-ct(i)+p|o<<p|c,_r=x+r}else zr=1<<x|o<<p|c,_r=r}function sf(r){r.return!==null&&(Zr(r,1),py(r,1,0))}function of(r){for(;r===gu;)gu=Ji[--Qi],Ji[Qi]=null,So=Ji[--Qi],Ji[Qi]=null;for(;r===fa;)fa=Qn[--Wn],Qn[Wn]=null,_r=Qn[--Wn],Qn[Wn]=null,zr=Qn[--Wn],Qn[Wn]=null}function gy(r,i){Qn[Wn++]=zr,Qn[Wn++]=_r,Qn[Wn++]=fa,zr=i.id,_r=i.overflow,fa=r}var rn=null,xt=null,Ie=!1,ha=null,er=!1,lf=Error(a(519));function ma(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zo(Jn(i,r)),lf}function xy(r){var i=r.stateNode,o=r.type,c=r.memoizedProps;switch(i[nn]=r,i[zn]=c,o){case"dialog":Ve("cancel",i),Ve("close",i);break;case"iframe":case"object":case"embed":Ve("load",i);break;case"video":case"audio":for(o=0;o<qo.length;o++)Ve(qo[o],i);break;case"source":Ve("error",i);break;case"img":case"image":case"link":Ve("error",i),Ve("load",i);break;case"details":Ve("toggle",i);break;case"input":Ve("invalid",i),Tx(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ve("invalid",i);break;case"textarea":Ve("invalid",i),Ox(i,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||c.suppressHydrationWarning===!0||Mv(i.textContent,o)?(c.popover!=null&&(Ve("beforetoggle",i),Ve("toggle",i)),c.onScroll!=null&&Ve("scroll",i),c.onScrollEnd!=null&&Ve("scrollend",i),c.onClick!=null&&(i.onclick=Ur),i=!0):i=!1,i||ma(r,!0)}function yy(r){for(rn=r.return;rn;)switch(rn.tag){case 5:case 31:case 13:er=!1;return;case 27:case 3:er=!0;return;default:rn=rn.return}}function Wi(r){if(r!==rn)return!1;if(!Ie)return yy(r),Ie=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||jh(r.type,r.memoizedProps)),o=!o),o&&xt&&ma(r),yy(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));xt=Iv(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));xt=Iv(r)}else i===27?(i=xt,Ca(r.type)?(r=Ah,Ah=null,xt=r):xt=i):xt=rn?nr(r.stateNode.nextSibling):null;return!0}function li(){xt=rn=null,Ie=!1}function uf(){var r=ha;return r!==null&&(En===null?En=r:En.push.apply(En,r),ha=null),r}function zo(r){ha===null?ha=[r]:ha.push(r)}var cf=C(null),ui=null,Ir=null;function pa(r,i,o){w(cf,i._currentValue),i._currentValue=o}function Hr(r){r._currentValue=cf.current,I(cf)}function df(r,i,o){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===o)break;r=r.return}}function ff(r,i,o,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var x=p.dependencies;if(x!==null){var k=p.child;x=x.firstContext;e:for(;x!==null;){var _=x;x=p;for(var M=0;M<i.length;M++)if(_.context===i[M]){x.lanes|=o,_=x.alternate,_!==null&&(_.lanes|=o),df(x.return,o,r),c||(k=null);break e}x=_.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(a(341));k.lanes|=o,x=k.alternate,x!==null&&(x.lanes|=o),df(k,o,r),k=null}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===r){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function es(r,i,o,c){r=null;for(var p=i,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(a(387));if(k=k.memoizedProps,k!==null){var _=p.type;Ln(p.pendingProps.value,k.value)||(r!==null?r.push(_):r=[_])}}else if(p===pe.current){if(k=p.alternate,k===null)throw Error(a(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&ff(i,r,o,c),i.flags|=262144}function xu(r){for(r=r.firstContext;r!==null;){if(!Ln(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ci(r){ui=r,Ir=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function an(r){return by(ui,r)}function yu(r,i){return ui===null&&ci(r),by(r,i)}function by(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Ir===null){if(r===null)throw Error(a(308));Ir=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Ir=Ir.next=i;return o}var wN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(o,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(o){return o()})}},SN=e.unstable_scheduleCallback,zN=e.unstable_NormalPriority,Pt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hf(){return{controller:new wN,data:new Map,refCount:0}}function _o(r){r.refCount--,r.refCount===0&&SN(zN,function(){r.controller.abort()})}var jo=null,mf=0,ts=0,ns=null;function _N(r,i){if(jo===null){var o=jo=[];mf=0,ts=xh(),ns={status:"pending",value:void 0,then:function(c){o.push(c)}}}return mf++,i.then(vy,vy),i}function vy(){if(--mf===0&&jo!==null){ns!==null&&(ns.status="fulfilled");var r=jo;jo=null,ts=0,ns=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function jN(r,i){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<o.length;p++)(0,o[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var ky=P.S;P.S=function(r,i){av=gt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&_N(r,i),ky!==null&&ky(r,i)};var di=C(null);function pf(){var r=di.current;return r!==null?r:dt.pooledCache}function bu(r,i){i===null?w(di,di.current):w(di,i.pool)}function wy(){var r=pf();return r===null?null:{parent:Pt._currentValue,pool:r}}var rs=Error(a(460)),gf=Error(a(474)),vu=Error(a(542)),ku={then:function(){}};function Sy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function zy(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(Ur,Ur),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,jy(r),r;default:if(typeof i.status=="string")i.then(Ur,Ur);else{if(r=dt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,jy(r),r}throw hi=i,rs}}function fi(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(hi=o,rs):o}}var hi=null;function _y(){if(hi===null)throw Error(a(459));var r=hi;return hi=null,r}function jy(r){if(r===rs||r===vu)throw Error(a(483))}var as=null,No=0;function wu(r){var i=No;return No+=1,as===null&&(as=[]),zy(as,r,i)}function Co(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Su(r,i){throw i.$$typeof===v?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Ny(r){function i(U,$){if(r){var H=U.deletions;H===null?(U.deletions=[$],U.flags|=16):H.push($)}}function o(U,$){if(!r)return null;for(;$!==null;)i(U,$),$=$.sibling;return null}function c(U){for(var $=new Map;U!==null;)U.key!==null?$.set(U.key,U):$.set(U.index,U),U=U.sibling;return $}function p(U,$){return U=Br(U,$),U.index=0,U.sibling=null,U}function x(U,$,H){return U.index=H,r?(H=U.alternate,H!==null?(H=H.index,H<$?(U.flags|=67108866,$):H):(U.flags|=67108866,$)):(U.flags|=1048576,$)}function k(U){return r&&U.alternate===null&&(U.flags|=67108866),U}function _(U,$,H,ne){return $===null||$.tag!==6?($=rf(H,U.mode,ne),$.return=U,$):($=p($,H),$.return=U,$)}function M(U,$,H,ne){var _e=H.type;return _e===j?Q(U,$,H.props.children,ne,H.key):$!==null&&($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&fi(_e)===$.type)?($=p($,H.props),Co($,H),$.return=U,$):($=pu(H.type,H.key,H.props,null,U.mode,ne),Co($,H),$.return=U,$)}function F(U,$,H,ne){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=af(H,U.mode,ne),$.return=U,$):($=p($,H.children||[]),$.return=U,$)}function Q(U,$,H,ne,_e){return $===null||$.tag!==7?($=oi(H,U.mode,ne,_e),$.return=U,$):($=p($,H),$.return=U,$)}function re(U,$,H){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=rf(""+$,U.mode,H),$.return=U,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return H=pu($.type,$.key,$.props,null,U.mode,H),Co(H,$),H.return=U,H;case S:return $=af($,U.mode,H),$.return=U,$;case B:return $=fi($),re(U,$,H)}if(ae($)||le($))return $=oi($,U.mode,H,null),$.return=U,$;if(typeof $.then=="function")return re(U,wu($),H);if($.$$typeof===N)return re(U,yu(U,$),H);Su(U,$)}return null}function G(U,$,H,ne){var _e=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return _e!==null?null:_(U,$,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===_e?M(U,$,H,ne):null;case S:return H.key===_e?F(U,$,H,ne):null;case B:return H=fi(H),G(U,$,H,ne)}if(ae(H)||le(H))return _e!==null?null:Q(U,$,H,ne,null);if(typeof H.then=="function")return G(U,$,wu(H),ne);if(H.$$typeof===N)return G(U,$,yu(U,H),ne);Su(U,H)}return null}function K(U,$,H,ne,_e){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return U=U.get(H)||null,_($,U,""+ne,_e);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return U=U.get(ne.key===null?H:ne.key)||null,M($,U,ne,_e);case S:return U=U.get(ne.key===null?H:ne.key)||null,F($,U,ne,_e);case B:return ne=fi(ne),K(U,$,H,ne,_e)}if(ae(ne)||le(ne))return U=U.get(H)||null,Q($,U,ne,_e,null);if(typeof ne.then=="function")return K(U,$,H,wu(ne),_e);if(ne.$$typeof===N)return K(U,$,H,yu($,ne),_e);Su($,ne)}return null}function ge(U,$,H,ne){for(var _e=null,Ye=null,Se=$,De=$=0,Ze=null;Se!==null&&De<H.length;De++){Se.index>De?(Ze=Se,Se=null):Ze=Se.sibling;var Ke=G(U,Se,H[De],ne);if(Ke===null){Se===null&&(Se=Ze);break}r&&Se&&Ke.alternate===null&&i(U,Se),$=x(Ke,$,De),Ye===null?_e=Ke:Ye.sibling=Ke,Ye=Ke,Se=Ze}if(De===H.length)return o(U,Se),Ie&&Zr(U,De),_e;if(Se===null){for(;De<H.length;De++)Se=re(U,H[De],ne),Se!==null&&($=x(Se,$,De),Ye===null?_e=Se:Ye.sibling=Se,Ye=Se);return Ie&&Zr(U,De),_e}for(Se=c(Se);De<H.length;De++)Ze=K(Se,U,De,H[De],ne),Ze!==null&&(r&&Ze.alternate!==null&&Se.delete(Ze.key===null?De:Ze.key),$=x(Ze,$,De),Ye===null?_e=Ze:Ye.sibling=Ze,Ye=Ze);return r&&Se.forEach(function(Ra){return i(U,Ra)}),Ie&&Zr(U,De),_e}function je(U,$,H,ne){if(H==null)throw Error(a(151));for(var _e=null,Ye=null,Se=$,De=$=0,Ze=null,Ke=H.next();Se!==null&&!Ke.done;De++,Ke=H.next()){Se.index>De?(Ze=Se,Se=null):Ze=Se.sibling;var Ra=G(U,Se,Ke.value,ne);if(Ra===null){Se===null&&(Se=Ze);break}r&&Se&&Ra.alternate===null&&i(U,Se),$=x(Ra,$,De),Ye===null?_e=Ra:Ye.sibling=Ra,Ye=Ra,Se=Ze}if(Ke.done)return o(U,Se),Ie&&Zr(U,De),_e;if(Se===null){for(;!Ke.done;De++,Ke=H.next())Ke=re(U,Ke.value,ne),Ke!==null&&($=x(Ke,$,De),Ye===null?_e=Ke:Ye.sibling=Ke,Ye=Ke);return Ie&&Zr(U,De),_e}for(Se=c(Se);!Ke.done;De++,Ke=H.next())Ke=K(Se,U,De,Ke.value,ne),Ke!==null&&(r&&Ke.alternate!==null&&Se.delete(Ke.key===null?De:Ke.key),$=x(Ke,$,De),Ye===null?_e=Ke:Ye.sibling=Ke,Ye=Ke);return r&&Se.forEach(function(LC){return i(U,LC)}),Ie&&Zr(U,De),_e}function ut(U,$,H,ne){if(typeof H=="object"&&H!==null&&H.type===j&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var _e=H.key;$!==null;){if($.key===_e){if(_e=H.type,_e===j){if($.tag===7){o(U,$.sibling),ne=p($,H.props.children),ne.return=U,U=ne;break e}}else if($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&fi(_e)===$.type){o(U,$.sibling),ne=p($,H.props),Co(ne,H),ne.return=U,U=ne;break e}o(U,$);break}else i(U,$);$=$.sibling}H.type===j?(ne=oi(H.props.children,U.mode,ne,H.key),ne.return=U,U=ne):(ne=pu(H.type,H.key,H.props,null,U.mode,ne),Co(ne,H),ne.return=U,U=ne)}return k(U);case S:e:{for(_e=H.key;$!==null;){if($.key===_e)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){o(U,$.sibling),ne=p($,H.children||[]),ne.return=U,U=ne;break e}else{o(U,$);break}else i(U,$);$=$.sibling}ne=af(H,U.mode,ne),ne.return=U,U=ne}return k(U);case B:return H=fi(H),ut(U,$,H,ne)}if(ae(H))return ge(U,$,H,ne);if(le(H)){if(_e=le(H),typeof _e!="function")throw Error(a(150));return H=_e.call(H),je(U,$,H,ne)}if(typeof H.then=="function")return ut(U,$,wu(H),ne);if(H.$$typeof===N)return ut(U,$,yu(U,H),ne);Su(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,$!==null&&$.tag===6?(o(U,$.sibling),ne=p($,H),ne.return=U,U=ne):(o(U,$),ne=rf(H,U.mode,ne),ne.return=U,U=ne),k(U)):o(U,$)}return function(U,$,H,ne){try{No=0;var _e=ut(U,$,H,ne);return as=null,_e}catch(Se){if(Se===rs||Se===vu)throw Se;var Ye=Pn(29,Se,null,U.mode);return Ye.lanes=ne,Ye.return=U,Ye}}}var mi=Ny(!0),Cy=Ny(!1),ga=!1;function xf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yf(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function xa(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ya(r,i,o){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(Je&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=mu(r),dy(r,null,o),i}return hu(r,c,i,o),mu(r)}function Eo(r,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,bx(r,o)}}function bf(r,i){var o=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var k={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?p=x=k:x=x.next=k,o=o.next}while(o!==null);x===null?p=x=i:x=x.next=i}else p=x=i;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=i:r.next=i,o.lastBaseUpdate=i}var vf=!1;function To(){if(vf){var r=ns;if(r!==null)throw r}}function Ao(r,i,o,c){vf=!1;var p=r.updateQueue;ga=!1;var x=p.firstBaseUpdate,k=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var M=_,F=M.next;M.next=null,k===null?x=F:k.next=F,k=M;var Q=r.alternate;Q!==null&&(Q=Q.updateQueue,_=Q.lastBaseUpdate,_!==k&&(_===null?Q.firstBaseUpdate=F:_.next=F,Q.lastBaseUpdate=M))}if(x!==null){var re=p.baseState;k=0,Q=F=M=null,_=x;do{var G=_.lane&-536870913,K=G!==_.lane;if(K?(Be&G)===G:(c&G)===G){G!==0&&G===ts&&(vf=!0),Q!==null&&(Q=Q.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ge=r,je=_;G=i;var ut=o;switch(je.tag){case 1:if(ge=je.payload,typeof ge=="function"){re=ge.call(ut,re,G);break e}re=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=je.payload,G=typeof ge=="function"?ge.call(ut,re,G):ge,G==null)break e;re=y({},re,G);break e;case 2:ga=!0}}G=_.callback,G!==null&&(r.flags|=64,K&&(r.flags|=8192),K=p.callbacks,K===null?p.callbacks=[G]:K.push(G))}else K={lane:G,tag:_.tag,payload:_.payload,callback:_.callback,next:null},Q===null?(F=Q=K,M=re):Q=Q.next=K,k|=G;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;K=_,_=K.next,K.next=null,p.lastBaseUpdate=K,p.shared.pending=null}}while(!0);Q===null&&(M=re),p.baseState=M,p.firstBaseUpdate=F,p.lastBaseUpdate=Q,x===null&&(p.shared.lanes=0),Sa|=k,r.lanes=k,r.memoizedState=re}}function Ey(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Ty(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)Ey(o[r],i)}var is=C(null),zu=C(0);function Ay(r,i){r=Wr,w(zu,r),w(is,i),Wr=r|i.baseLanes}function kf(){w(zu,Wr),w(is,is.current)}function wf(){Wr=zu.current,I(is),I(zu)}var Un=C(null),tr=null;function ba(r){var i=r.alternate;w(Dt,Dt.current&1),w(Un,r),tr===null&&(i===null||is.current!==null||i.memoizedState!==null)&&(tr=r)}function Sf(r){w(Dt,Dt.current),w(Un,r),tr===null&&(tr=r)}function Oy(r){r.tag===22?(w(Dt,Dt.current),w(Un,r),tr===null&&(tr=r)):va()}function va(){w(Dt,Dt.current),w(Un,Un.current)}function Vn(r){I(Un),tr===r&&(tr=null),I(Dt)}var Dt=C(0);function _u(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Eh(o)||Th(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Fr=0,Re=null,ot=null,Ut=null,ju=!1,ss=!1,pi=!1,Nu=0,Oo=0,os=null,NN=0;function Tt(){throw Error(a(321))}function zf(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!Ln(r[o],i[o]))return!1;return!0}function _f(r,i,o,c,p,x){return Fr=x,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=r===null||r.memoizedState===null?pb:Vf,pi=!1,x=o(c,p),pi=!1,ss&&(x=My(i,o,c,p)),Ry(r),x}function Ry(r){P.H=Do;var i=ot!==null&&ot.next!==null;if(Fr=0,Ut=ot=Re=null,ju=!1,Oo=0,os=null,i)throw Error(a(300));r===null||Vt||(r=r.dependencies,r!==null&&xu(r)&&(Vt=!0))}function My(r,i,o,c){Re=r;var p=0;do{if(ss&&(os=null),Oo=0,ss=!1,25<=p)throw Error(a(301));if(p+=1,Ut=ot=null,r.updateQueue!=null){var x=r.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}P.H=gb,x=i(o,c)}while(ss);return x}function CN(){var r=P.H,i=r.useState()[0];return i=typeof i.then=="function"?Ro(i):i,r=r.useState()[0],(ot!==null?ot.memoizedState:null)!==r&&(Re.flags|=1024),i}function jf(){var r=Nu!==0;return Nu=0,r}function Nf(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function Cf(r){if(ju){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ju=!1}Fr=0,Ut=ot=Re=null,ss=!1,Oo=Nu=0,os=null}function xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Re.memoizedState=Ut=r:Ut=Ut.next=r,Ut}function $t(){if(ot===null){var r=Re.alternate;r=r!==null?r.memoizedState:null}else r=ot.next;var i=Ut===null?Re.memoizedState:Ut.next;if(i!==null)Ut=i,ot=r;else{if(r===null)throw Re.alternate===null?Error(a(467)):Error(a(310));ot=r,r={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?Re.memoizedState=Ut=r:Ut=Ut.next=r}return Ut}function Cu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(r){var i=Oo;return Oo+=1,os===null&&(os=[]),r=zy(os,r,i),i=Re,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,P.H=i===null||i.memoizedState===null?pb:Vf),r}function Eu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ro(r);if(r.$$typeof===N)return an(r)}throw Error(a(438,String(r)))}function Ef(r){var i=null,o=Re.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var c=Re.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Cu(),Re.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(r),c=0;c<r;c++)o[c]=fe;return i.index++,o}function qr(r,i){return typeof i=="function"?i(r):i}function Tu(r){var i=$t();return Tf(i,ot,r)}function Tf(r,i,o){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=o;var p=r.baseQueue,x=c.pending;if(x!==null){if(p!==null){var k=p.next;p.next=x.next,x.next=k}i.baseQueue=p=x,c.pending=null}if(x=r.baseState,p===null)r.memoizedState=x;else{i=p.next;var _=k=null,M=null,F=i,Q=!1;do{var re=F.lane&-536870913;if(re!==F.lane?(Be&re)===re:(Fr&re)===re){var G=F.revertLane;if(G===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===ts&&(Q=!0);else if((Fr&G)===G){F=F.next,G===ts&&(Q=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},M===null?(_=M=re,k=x):M=M.next=re,Re.lanes|=G,Sa|=G;re=F.action,pi&&o(x,re),x=F.hasEagerState?F.eagerState:o(x,re)}else G={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},M===null?(_=M=G,k=x):M=M.next=G,Re.lanes|=re,Sa|=re;F=F.next}while(F!==null&&F!==i);if(M===null?k=x:M.next=_,!Ln(x,r.memoizedState)&&(Vt=!0,Q&&(o=ns,o!==null)))throw o;r.memoizedState=x,r.baseState=k,r.baseQueue=M,c.lastRenderedState=x}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function Af(r){var i=$t(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=r;var c=o.dispatch,p=o.pending,x=i.memoizedState;if(p!==null){o.pending=null;var k=p=p.next;do x=r(x,k.action),k=k.next;while(k!==p);Ln(x,i.memoizedState)||(Vt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,c]}function Dy(r,i,o){var c=Re,p=$t(),x=Ie;if(x){if(o===void 0)throw Error(a(407));o=o()}else o=i();var k=!Ln((ot||p).memoizedState,o);if(k&&(p.memoizedState=o,Vt=!0),p=p.queue,Mf(Py.bind(null,c,p,r),[r]),p.getSnapshot!==i||k||Ut!==null&&Ut.memoizedState.tag&1){if(c.flags|=2048,ls(9,{destroy:void 0},Ly.bind(null,c,p,o,i),null),dt===null)throw Error(a(349));x||(Fr&127)!==0||$y(c,i,o)}return o}function $y(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=Cu(),Re.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function Ly(r,i,o,c){i.value=o,i.getSnapshot=c,Uy(i)&&Vy(r)}function Py(r,i,o){return o(function(){Uy(i)&&Vy(r)})}function Uy(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!Ln(r,o)}catch{return!0}}function Vy(r){var i=si(r,2);i!==null&&Tn(i,r,2)}function Of(r){var i=xn();if(typeof r=="function"){var o=r;if(r=o(),pi){Sn(!0);try{o()}finally{Sn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:r},i}function By(r,i,o,c){return r.baseState=o,Tf(r,ot,typeof c=="function"?c:qr)}function EN(r,i,o,c,p){if(Ru(r))throw Error(a(485));if(r=i.action,r!==null){var x={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};P.T!==null?o(!0):x.isTransition=!1,c(x),o=i.pending,o===null?(x.next=i.pending=x,Zy(i,x)):(x.next=o.next,i.pending=o.next=x)}}function Zy(r,i){var o=i.action,c=i.payload,p=r.state;if(i.isTransition){var x=P.T,k={};P.T=k;try{var _=o(p,c),M=P.S;M!==null&&M(k,_),Iy(r,i,_)}catch(F){Rf(r,i,F)}finally{x!==null&&k.types!==null&&(x.types=k.types),P.T=x}}else try{x=o(p,c),Iy(r,i,x)}catch(F){Rf(r,i,F)}}function Iy(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Hy(r,i,c)},function(c){return Rf(r,i,c)}):Hy(r,i,o)}function Hy(r,i,o){i.status="fulfilled",i.value=o,Fy(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,Zy(r,o)))}function Rf(r,i,o){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=o,Fy(i),i=i.next;while(i!==c)}r.action=null}function Fy(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function qy(r,i){return i}function Gy(r,i){if(Ie){var o=dt.formState;if(o!==null){e:{var c=Re;if(Ie){if(xt){t:{for(var p=xt,x=er;p.nodeType!==8;){if(!x){p=null;break t}if(p=nr(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){xt=nr(p.nextSibling),c=p.data==="F!";break e}}ma(c)}c=!1}c&&(i=o[0])}}return o=xn(),o.memoizedState=o.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qy,lastRenderedState:i},o.queue=c,o=fb.bind(null,Re,c),c.dispatch=o,c=Of(!1),x=Uf.bind(null,Re,!1,c.queue),c=xn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,o=EN.bind(null,Re,p,x,o),p.dispatch=o,c.memoizedState=r,[i,o,!1]}function Yy(r){var i=$t();return Ky(i,ot,r)}function Ky(r,i,o){if(i=Tf(r,i,qy)[0],r=Tu(qr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Ro(i)}catch(k){throw k===rs?vu:k}else c=i;i=$t();var p=i.queue,x=p.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,ls(9,{destroy:void 0},TN.bind(null,p,o),null)),[c,x,r]}function TN(r,i){r.action=i}function Xy(r){var i=$t(),o=ot;if(o!==null)return Ky(i,o,r);$t(),i=i.memoizedState,o=$t();var c=o.queue.dispatch;return o.memoizedState=r,[i,c,!1]}function ls(r,i,o,c){return r={tag:r,create:o,deps:c,inst:i,next:null},i=Re.updateQueue,i===null&&(i=Cu(),Re.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=r.next=r:(c=o.next,o.next=r,r.next=c,i.lastEffect=r),r}function Jy(){return $t().memoizedState}function Au(r,i,o,c){var p=xn();Re.flags|=r,p.memoizedState=ls(1|i,{destroy:void 0},o,c===void 0?null:c)}function Ou(r,i,o,c){var p=$t();c=c===void 0?null:c;var x=p.memoizedState.inst;ot!==null&&c!==null&&zf(c,ot.memoizedState.deps)?p.memoizedState=ls(i,x,o,c):(Re.flags|=r,p.memoizedState=ls(1|i,x,o,c))}function Qy(r,i){Au(8390656,8,r,i)}function Mf(r,i){Ou(2048,8,r,i)}function AN(r){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=Cu(),Re.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function Wy(r){var i=$t().memoizedState;return AN({ref:i,nextImpl:r}),function(){if((Je&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function eb(r,i){return Ou(4,2,r,i)}function tb(r,i){return Ou(4,4,r,i)}function nb(r,i){if(typeof i=="function"){r=r();var o=i(r);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function rb(r,i,o){o=o!=null?o.concat([r]):null,Ou(4,4,nb.bind(null,i,r),o)}function Df(){}function ab(r,i){var o=$t();i=i===void 0?null:i;var c=o.memoizedState;return i!==null&&zf(i,c[1])?c[0]:(o.memoizedState=[r,i],r)}function ib(r,i){var o=$t();i=i===void 0?null:i;var c=o.memoizedState;if(i!==null&&zf(i,c[1]))return c[0];if(c=r(),pi){Sn(!0);try{r()}finally{Sn(!1)}}return o.memoizedState=[c,i],c}function $f(r,i,o){return o===void 0||(Fr&1073741824)!==0&&(Be&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=sv(),Re.lanes|=r,Sa|=r,o)}function sb(r,i,o,c){return Ln(o,i)?o:is.current!==null?(r=$f(r,o,c),Ln(r,i)||(Vt=!0),r):(Fr&42)===0||(Fr&1073741824)!==0&&(Be&261930)===0?(Vt=!0,r.memoizedState=o):(r=sv(),Re.lanes|=r,Sa|=r,i)}function ob(r,i,o,c,p){var x=J.p;J.p=x!==0&&8>x?x:8;var k=P.T,_={};P.T=_,Uf(r,!1,i,o);try{var M=p(),F=P.S;if(F!==null&&F(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var Q=jN(M,c);Mo(r,i,Q,In(r))}else Mo(r,i,c,In(r))}catch(re){Mo(r,i,{then:function(){},status:"rejected",reason:re},In())}finally{J.p=x,k!==null&&_.types!==null&&(k.types=_.types),P.T=k}}function ON(){}function Lf(r,i,o,c){if(r.tag!==5)throw Error(a(476));var p=lb(r).queue;ob(r,p,i,Z,o===null?ON:function(){return ub(r),o(c)})}function lb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:Z},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:o},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function ub(r){var i=lb(r);i.next===null&&(i=r.alternate.memoizedState),Mo(r,i.next.queue,{},In())}function Pf(){return an(Jo)}function cb(){return $t().memoizedState}function db(){return $t().memoizedState}function RN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=In();r=xa(o);var c=ya(i,r,o);c!==null&&(Tn(c,i,o),Eo(c,i,o)),i={cache:hf()},r.payload=i;return}i=i.return}}function MN(r,i,o){var c=In();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ru(r)?hb(i,o):(o=tf(r,i,o,c),o!==null&&(Tn(o,r,c),mb(o,i,c)))}function fb(r,i,o){var c=In();Mo(r,i,o,c)}function Mo(r,i,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ru(r))hb(i,p);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var k=i.lastRenderedState,_=x(k,o);if(p.hasEagerState=!0,p.eagerState=_,Ln(_,k))return hu(r,i,p,0),dt===null&&fu(),!1}catch{}if(o=tf(r,i,p,c),o!==null)return Tn(o,r,c),mb(o,i,c),!0}return!1}function Uf(r,i,o,c){if(c={lane:2,revertLane:xh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ru(r)){if(i)throw Error(a(479))}else i=tf(r,o,c,2),i!==null&&Tn(i,r,2)}function Ru(r){var i=r.alternate;return r===Re||i!==null&&i===Re}function hb(r,i){ss=ju=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function mb(r,i,o){if((o&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,o|=c,i.lanes=o,bx(r,o)}}var Do={readContext:an,use:Eu,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};Do.useEffectEvent=Tt;var pb={readContext:an,use:Eu,useCallback:function(r,i){return xn().memoizedState=[r,i===void 0?null:i],r},useContext:an,useEffect:Qy,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,Au(4194308,4,nb.bind(null,i,r),o)},useLayoutEffect:function(r,i){return Au(4194308,4,r,i)},useInsertionEffect:function(r,i){Au(4,2,r,i)},useMemo:function(r,i){var o=xn();i=i===void 0?null:i;var c=r();if(pi){Sn(!0);try{r()}finally{Sn(!1)}}return o.memoizedState=[c,i],c},useReducer:function(r,i,o){var c=xn();if(o!==void 0){var p=o(i);if(pi){Sn(!0);try{o(i)}finally{Sn(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=MN.bind(null,Re,r),[c.memoizedState,r]},useRef:function(r){var i=xn();return r={current:r},i.memoizedState=r},useState:function(r){r=Of(r);var i=r.queue,o=fb.bind(null,Re,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:Df,useDeferredValue:function(r,i){var o=xn();return $f(o,r,i)},useTransition:function(){var r=Of(!1);return r=ob.bind(null,Re,r.queue,!0,!1),xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var c=Re,p=xn();if(Ie){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),dt===null)throw Error(a(349));(Be&127)!==0||$y(c,i,o)}p.memoizedState=o;var x={value:o,getSnapshot:i};return p.queue=x,Qy(Py.bind(null,c,x,r),[r]),c.flags|=2048,ls(9,{destroy:void 0},Ly.bind(null,c,x,o,i),null),o},useId:function(){var r=xn(),i=dt.identifierPrefix;if(Ie){var o=_r,c=zr;o=(c&~(1<<32-ct(c)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Nu++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=NN++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Pf,useFormState:Gy,useActionState:Gy,useOptimistic:function(r){var i=xn();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=Uf.bind(null,Re,!0,o),o.dispatch=i,[r,i]},useMemoCache:Ef,useCacheRefresh:function(){return xn().memoizedState=RN.bind(null,Re)},useEffectEvent:function(r){var i=xn(),o={impl:r};return i.memoizedState=o,function(){if((Je&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Vf={readContext:an,use:Eu,useCallback:ab,useContext:an,useEffect:Mf,useImperativeHandle:rb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ib,useReducer:Tu,useRef:Jy,useState:function(){return Tu(qr)},useDebugValue:Df,useDeferredValue:function(r,i){var o=$t();return sb(o,ot.memoizedState,r,i)},useTransition:function(){var r=Tu(qr)[0],i=$t().memoizedState;return[typeof r=="boolean"?r:Ro(r),i]},useSyncExternalStore:Dy,useId:cb,useHostTransitionStatus:Pf,useFormState:Yy,useActionState:Yy,useOptimistic:function(r,i){var o=$t();return By(o,ot,r,i)},useMemoCache:Ef,useCacheRefresh:db};Vf.useEffectEvent=Wy;var gb={readContext:an,use:Eu,useCallback:ab,useContext:an,useEffect:Mf,useImperativeHandle:rb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ib,useReducer:Af,useRef:Jy,useState:function(){return Af(qr)},useDebugValue:Df,useDeferredValue:function(r,i){var o=$t();return ot===null?$f(o,r,i):sb(o,ot.memoizedState,r,i)},useTransition:function(){var r=Af(qr)[0],i=$t().memoizedState;return[typeof r=="boolean"?r:Ro(r),i]},useSyncExternalStore:Dy,useId:cb,useHostTransitionStatus:Pf,useFormState:Xy,useActionState:Xy,useOptimistic:function(r,i){var o=$t();return ot!==null?By(o,ot,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:db};gb.useEffectEvent=Wy;function Bf(r,i,o,c){i=r.memoizedState,o=o(c,i),o=o==null?i:y({},i,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var Zf={enqueueSetState:function(r,i,o){r=r._reactInternals;var c=In(),p=xa(c);p.payload=i,o!=null&&(p.callback=o),i=ya(r,p,c),i!==null&&(Tn(i,r,c),Eo(i,r,c))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var c=In(),p=xa(c);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=ya(r,p,c),i!==null&&(Tn(i,r,c),Eo(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=In(),c=xa(o);c.tag=2,i!=null&&(c.callback=i),i=ya(r,c,o),i!==null&&(Tn(i,r,o),Eo(i,r,o))}};function xb(r,i,o,c,p,x,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,x,k):i.prototype&&i.prototype.isPureReactComponent?!ko(o,c)||!ko(p,x):!0}function yb(r,i,o,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,c),i.state!==r&&Zf.enqueueReplaceState(i,i.state,null)}function gi(r,i){var o=i;if("ref"in i){o={};for(var c in i)c!=="ref"&&(o[c]=i[c])}if(r=r.defaultProps){o===i&&(o=y({},o));for(var p in r)o[p]===void 0&&(o[p]=r[p])}return o}function bb(r){du(r)}function vb(r){console.error(r)}function kb(r){du(r)}function Mu(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function wb(r,i,o){try{var c=r.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function If(r,i,o){return o=xa(o),o.tag=3,o.payload={element:null},o.callback=function(){Mu(r,i)},o}function Sb(r){return r=xa(r),r.tag=3,r}function zb(r,i,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var x=c.value;r.payload=function(){return p(x)},r.callback=function(){wb(i,o,c)}}var k=o.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(r.callback=function(){wb(i,o,c),typeof p!="function"&&(za===null?za=new Set([this]):za.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function DN(r,i,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=o.alternate,i!==null&&es(i,o,p,!0),o=Un.current,o!==null){switch(o.tag){case 31:case 13:return tr===null?qu():o.alternate===null&&At===0&&(At=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===ku?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([c]):i.add(c),mh(r,c,p)),!1;case 22:return o.flags|=65536,c===ku?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([c]):o.add(c)),mh(r,c,p)),!1}throw Error(a(435,o.tag))}return mh(r,c,p),qu(),!1}if(Ie)return i=Un.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==lf&&(r=Error(a(422),{cause:c}),zo(Jn(r,o)))):(c!==lf&&(i=Error(a(423),{cause:c}),zo(Jn(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=Jn(c,o),p=If(r.stateNode,c,p),bf(r,p),At!==4&&(At=2)),!1;var x=Error(a(520),{cause:c});if(x=Jn(x,o),Io===null?Io=[x]:Io.push(x),At!==4&&(At=2),i===null)return!0;c=Jn(c,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=p&-p,o.lanes|=r,r=If(o.stateNode,c,r),bf(o,r),!1;case 1:if(i=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(za===null||!za.has(x))))return o.flags|=65536,p&=-p,o.lanes|=p,p=Sb(p),zb(p,r,o,c),bf(o,p),!1}o=o.return}while(o!==null);return!1}var Hf=Error(a(461)),Vt=!1;function sn(r,i,o,c){i.child=r===null?Cy(i,null,o,c):mi(i,r.child,o,c)}function _b(r,i,o,c,p){o=o.render;var x=i.ref;if("ref"in c){var k={};for(var _ in c)_!=="ref"&&(k[_]=c[_])}else k=c;return ci(i),c=_f(r,i,o,k,x,p),_=jf(),r!==null&&!Vt?(Nf(r,i,p),Gr(r,i,p)):(Ie&&_&&sf(i),i.flags|=1,sn(r,i,c,p),i.child)}function jb(r,i,o,c,p){if(r===null){var x=o.type;return typeof x=="function"&&!nf(x)&&x.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=x,Nb(r,i,x,c,p)):(r=pu(o.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(x=r.child,!Qf(r,p)){var k=x.memoizedProps;if(o=o.compare,o=o!==null?o:ko,o(k,c)&&r.ref===i.ref)return Gr(r,i,p)}return i.flags|=1,r=Br(x,c),r.ref=i.ref,r.return=i,i.child=r}function Nb(r,i,o,c,p){if(r!==null){var x=r.memoizedProps;if(ko(x,c)&&r.ref===i.ref)if(Vt=!1,i.pendingProps=c=x,Qf(r,p))(r.flags&131072)!==0&&(Vt=!0);else return i.lanes=r.lanes,Gr(r,i,p)}return Ff(r,i,o,c,p)}function Cb(r,i,o,c){var p=c.children,x=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|o:o,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~x}else c=0,i.child=null;return Eb(r,i,x,o,c)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&bu(i,x!==null?x.cachePool:null),x!==null?Ay(i,x):kf(),Oy(i);else return c=i.lanes=536870912,Eb(r,i,x!==null?x.baseLanes|o:o,o,c)}else x!==null?(bu(i,x.cachePool),Ay(i,x),va(),i.memoizedState=null):(r!==null&&bu(i,null),kf(),va());return sn(r,i,p,o),i.child}function $o(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Eb(r,i,o,c,p){var x=pf();return x=x===null?null:{parent:Pt._currentValue,pool:x},i.memoizedState={baseLanes:o,cachePool:x},r!==null&&bu(i,null),kf(),Oy(i),r!==null&&es(r,i,c,!0),i.childLanes=p,null}function Du(r,i){return i=Lu({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Tb(r,i,o){return mi(i,r.child,null,o),r=Du(i,i.pendingProps),r.flags|=2,Vn(i),i.memoizedState=null,r}function $N(r,i,o){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ie){if(c.mode==="hidden")return r=Du(i,c),i.lanes=536870912,$o(null,r);if(Sf(i),(r=xt)?(r=Zv(r,er),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:fa!==null?{id:zr,overflow:_r}:null,retryLane:536870912,hydrationErrors:null},o=hy(r),o.return=i,i.child=o,rn=i,xt=null)):r=null,r===null)throw ma(i);return i.lanes=536870912,null}return Du(i,c)}var x=r.memoizedState;if(x!==null){var k=x.dehydrated;if(Sf(i),p)if(i.flags&256)i.flags&=-257,i=Tb(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Vt||es(r,i,o,!1),p=(o&r.childLanes)!==0,Vt||p){if(c=dt,c!==null&&(k=vx(c,o),k!==0&&k!==x.retryLane))throw x.retryLane=k,si(r,k),Tn(c,r,k),Hf;qu(),i=Tb(r,i,o)}else r=x.treeContext,xt=nr(k.nextSibling),rn=i,Ie=!0,ha=null,er=!1,r!==null&&gy(i,r),i=Du(i,c),i.flags|=4096;return i}return r=Br(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function $u(r,i){var o=i.ref;if(o===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(r===null||r.ref!==o)&&(i.flags|=4194816)}}function Ff(r,i,o,c,p){return ci(i),o=_f(r,i,o,c,void 0,p),c=jf(),r!==null&&!Vt?(Nf(r,i,p),Gr(r,i,p)):(Ie&&c&&sf(i),i.flags|=1,sn(r,i,o,p),i.child)}function Ab(r,i,o,c,p,x){return ci(i),i.updateQueue=null,o=My(i,c,o,p),Ry(r),c=jf(),r!==null&&!Vt?(Nf(r,i,x),Gr(r,i,x)):(Ie&&c&&sf(i),i.flags|=1,sn(r,i,o,x),i.child)}function Ob(r,i,o,c,p){if(ci(i),i.stateNode===null){var x=Xi,k=o.contextType;typeof k=="object"&&k!==null&&(x=an(k)),x=new o(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Zf,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},xf(i),k=o.contextType,x.context=typeof k=="object"&&k!==null?an(k):Xi,x.state=i.memoizedState,k=o.getDerivedStateFromProps,typeof k=="function"&&(Bf(i,o,k,c),x.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&Zf.enqueueReplaceState(x,x.state,null),Ao(i,c,x,p),To(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){x=i.stateNode;var _=i.memoizedProps,M=gi(o,_);x.props=M;var F=x.context,Q=o.contextType;k=Xi,typeof Q=="object"&&Q!==null&&(k=an(Q));var re=o.getDerivedStateFromProps;Q=typeof re=="function"||typeof x.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,Q||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(_||F!==k)&&yb(i,x,c,k),ga=!1;var G=i.memoizedState;x.state=G,Ao(i,c,x,p),To(),F=i.memoizedState,_||G!==F||ga?(typeof re=="function"&&(Bf(i,o,re,c),F=i.memoizedState),(M=ga||xb(i,o,M,c,G,F,k))?(Q||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=F),x.props=c,x.state=F,x.context=k,c=M):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,yf(r,i),k=i.memoizedProps,Q=gi(o,k),x.props=Q,re=i.pendingProps,G=x.context,F=o.contextType,M=Xi,typeof F=="object"&&F!==null&&(M=an(F)),_=o.getDerivedStateFromProps,(F=typeof _=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==re||G!==M)&&yb(i,x,c,M),ga=!1,G=i.memoizedState,x.state=G,Ao(i,c,x,p),To();var K=i.memoizedState;k!==re||G!==K||ga||r!==null&&r.dependencies!==null&&xu(r.dependencies)?(typeof _=="function"&&(Bf(i,o,_,c),K=i.memoizedState),(Q=ga||xb(i,o,Q,c,G,K,M)||r!==null&&r.dependencies!==null&&xu(r.dependencies))?(F||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,K,M),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,K,M)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=K),x.props=c,x.state=K,x.context=M,c=Q):(typeof x.componentDidUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===r.memoizedProps&&G===r.memoizedState||(i.flags|=1024),c=!1)}return x=c,$u(r,i),c=(i.flags&128)!==0,x||c?(x=i.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,r!==null&&c?(i.child=mi(i,r.child,null,p),i.child=mi(i,null,o,p)):sn(r,i,o,p),i.memoizedState=x.state,r=i.child):r=Gr(r,i,p),r}function Rb(r,i,o,c){return li(),i.flags|=256,sn(r,i,o,c),i.child}var qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gf(r){return{baseLanes:r,cachePool:wy()}}function Yf(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Zn),r}function Mb(r,i,o){var c=i.pendingProps,p=!1,x=(i.flags&128)!==0,k;if((k=x)||(k=r!==null&&r.memoizedState===null?!1:(Dt.current&2)!==0),k&&(p=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ie){if(p?ba(i):va(),(r=xt)?(r=Zv(r,er),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:fa!==null?{id:zr,overflow:_r}:null,retryLane:536870912,hydrationErrors:null},o=hy(r),o.return=i,i.child=o,rn=i,xt=null)):r=null,r===null)throw ma(i);return Th(r)?i.lanes=32:i.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(va(),p=i.mode,_=Lu({mode:"hidden",children:_},p),c=oi(c,p,o,null),_.return=i,c.return=i,_.sibling=c,i.child=_,c=i.child,c.memoizedState=Gf(o),c.childLanes=Yf(r,k,o),i.memoizedState=qf,$o(null,c)):(ba(i),Kf(i,_))}var M=r.memoizedState;if(M!==null&&(_=M.dehydrated,_!==null)){if(x)i.flags&256?(ba(i),i.flags&=-257,i=Xf(r,i,o)):i.memoizedState!==null?(va(),i.child=r.child,i.flags|=128,i=null):(va(),_=c.fallback,p=i.mode,c=Lu({mode:"visible",children:c.children},p),_=oi(_,p,o,null),_.flags|=2,c.return=i,_.return=i,c.sibling=_,i.child=c,mi(i,r.child,null,o),c=i.child,c.memoizedState=Gf(o),c.childLanes=Yf(r,k,o),i.memoizedState=qf,i=$o(null,c));else if(ba(i),Th(_)){if(k=_.nextSibling&&_.nextSibling.dataset,k)var F=k.dgst;k=F,c=Error(a(419)),c.stack="",c.digest=k,zo({value:c,source:null,stack:null}),i=Xf(r,i,o)}else if(Vt||es(r,i,o,!1),k=(o&r.childLanes)!==0,Vt||k){if(k=dt,k!==null&&(c=vx(k,o),c!==0&&c!==M.retryLane))throw M.retryLane=c,si(r,c),Tn(k,r,c),Hf;Eh(_)||qu(),i=Xf(r,i,o)}else Eh(_)?(i.flags|=192,i.child=r.child,i=null):(r=M.treeContext,xt=nr(_.nextSibling),rn=i,Ie=!0,ha=null,er=!1,r!==null&&gy(i,r),i=Kf(i,c.children),i.flags|=4096);return i}return p?(va(),_=c.fallback,p=i.mode,M=r.child,F=M.sibling,c=Br(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,F!==null?_=Br(F,_):(_=oi(_,p,o,null),_.flags|=2),_.return=i,c.return=i,c.sibling=_,i.child=c,$o(null,c),c=i.child,_=r.child.memoizedState,_===null?_=Gf(o):(p=_.cachePool,p!==null?(M=Pt._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=wy(),_={baseLanes:_.baseLanes|o,cachePool:p}),c.memoizedState=_,c.childLanes=Yf(r,k,o),i.memoizedState=qf,$o(r.child,c)):(ba(i),o=r.child,r=o.sibling,o=Br(o,{mode:"visible",children:c.children}),o.return=i,o.sibling=null,r!==null&&(k=i.deletions,k===null?(i.deletions=[r],i.flags|=16):k.push(r)),i.child=o,i.memoizedState=null,o)}function Kf(r,i){return i=Lu({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Lu(r,i){return r=Pn(22,r,null,i),r.lanes=0,r}function Xf(r,i,o){return mi(i,r.child,null,o),r=Kf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Db(r,i,o){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),df(r.return,i,o)}function Jf(r,i,o,c,p,x){var k=r.memoizedState;k===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:x}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=o,k.tailMode=p,k.treeForkCount=x)}function $b(r,i,o){var c=i.pendingProps,p=c.revealOrder,x=c.tail;c=c.children;var k=Dt.current,_=(k&2)!==0;if(_?(k=k&1|2,i.flags|=128):k&=1,w(Dt,k),sn(r,i,c,o),c=Ie?So:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Db(r,o,i);else if(r.tag===19)Db(r,o,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(o=i.child,p=null;o!==null;)r=o.alternate,r!==null&&_u(r)===null&&(p=o),o=o.sibling;o=p,o===null?(p=i.child,i.child=null):(p=o.sibling,o.sibling=null),Jf(i,!1,p,o,x,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&_u(r)===null){i.child=p;break}r=p.sibling,p.sibling=o,o=p,p=r}Jf(i,!0,o,null,x,c);break;case"together":Jf(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Gr(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),Sa|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(es(r,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,o=Br(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=Br(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function Qf(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&xu(r)))}function LN(r,i,o){switch(i.tag){case 3:Pe(i,i.stateNode.containerInfo),pa(i,Pt,r.memoizedState.cache),li();break;case 27:case 5:pt(i);break;case 4:Pe(i,i.stateNode.containerInfo);break;case 10:pa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Sf(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(ba(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Mb(r,i,o):(ba(i),r=Gr(r,i,o),r!==null?r.sibling:null);ba(i);break;case 19:var p=(r.flags&128)!==0;if(c=(o&i.childLanes)!==0,c||(es(r,i,o,!1),c=(o&i.childLanes)!==0),p){if(c)return $b(r,i,o);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),w(Dt,Dt.current),c)break;return null;case 22:return i.lanes=0,Cb(r,i,o,i.pendingProps);case 24:pa(i,Pt,r.memoizedState.cache)}return Gr(r,i,o)}function Lb(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Vt=!0;else{if(!Qf(r,o)&&(i.flags&128)===0)return Vt=!1,LN(r,i,o);Vt=(r.flags&131072)!==0}else Vt=!1,Ie&&(i.flags&1048576)!==0&&py(i,So,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=fi(i.elementType),i.type=r,typeof r=="function")nf(r)?(c=gi(r,c),i.tag=1,i=Ob(null,i,r,c,o)):(i.tag=0,i=Ff(null,i,r,c,o));else{if(r!=null){var p=r.$$typeof;if(p===L){i.tag=11,i=_b(null,i,r,c,o);break e}else if(p===q){i.tag=14,i=jb(null,i,r,c,o);break e}}throw i=oe(r)||r,Error(a(306,i,""))}}return i;case 0:return Ff(r,i,i.type,i.pendingProps,o);case 1:return c=i.type,p=gi(c,i.pendingProps),Ob(r,i,c,p,o);case 3:e:{if(Pe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;p=x.element,yf(r,i),Ao(i,c,null,o);var k=i.memoizedState;if(c=k.cache,pa(i,Pt,c),c!==x.cache&&ff(i,[Pt],o,!0),To(),c=k.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=Rb(r,i,c,o);break e}else if(c!==p){p=Jn(Error(a(424)),i),zo(p),i=Rb(r,i,c,o);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,xt=nr(r.firstChild),rn=i,Ie=!0,ha=null,er=!0,o=Cy(i,null,c,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(li(),c===p){i=Gr(r,i,o);break e}sn(r,i,c,o)}i=i.child}return i;case 26:return $u(r,i),r===null?(o=Yv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Ie||(o=i.type,r=i.pendingProps,c=Wu(he.current).createElement(o),c[nn]=i,c[zn]=r,on(c,o,r),Wt(c),i.stateNode=c):i.memoizedState=Yv(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return pt(i),r===null&&Ie&&(c=i.stateNode=Fv(i.type,i.pendingProps,he.current),rn=i,er=!0,p=xt,Ca(i.type)?(Ah=p,xt=nr(c.firstChild)):xt=p),sn(r,i,i.pendingProps.children,o),$u(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ie&&((p=c=xt)&&(c=hC(c,i.type,i.pendingProps,er),c!==null?(i.stateNode=c,rn=i,xt=nr(c.firstChild),er=!1,p=!0):p=!1),p||ma(i)),pt(i),p=i.type,x=i.pendingProps,k=r!==null?r.memoizedProps:null,c=x.children,jh(p,x)?c=null:k!==null&&jh(p,k)&&(i.flags|=32),i.memoizedState!==null&&(p=_f(r,i,CN,null,null,o),Jo._currentValue=p),$u(r,i),sn(r,i,c,o),i.child;case 6:return r===null&&Ie&&((r=o=xt)&&(o=mC(o,i.pendingProps,er),o!==null?(i.stateNode=o,rn=i,xt=null,r=!0):r=!1),r||ma(i)),null;case 13:return Mb(r,i,o);case 4:return Pe(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=mi(i,null,c,o):sn(r,i,c,o),i.child;case 11:return _b(r,i,i.type,i.pendingProps,o);case 7:return sn(r,i,i.pendingProps,o),i.child;case 8:return sn(r,i,i.pendingProps.children,o),i.child;case 12:return sn(r,i,i.pendingProps.children,o),i.child;case 10:return c=i.pendingProps,pa(i,i.type,c.value),sn(r,i,c.children,o),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,ci(i),p=an(p),c=c(p),i.flags|=1,sn(r,i,c,o),i.child;case 14:return jb(r,i,i.type,i.pendingProps,o);case 15:return Nb(r,i,i.type,i.pendingProps,o);case 19:return $b(r,i,o);case 31:return $N(r,i,o);case 22:return Cb(r,i,o,i.pendingProps);case 24:return ci(i),c=an(Pt),r===null?(p=pf(),p===null&&(p=dt,x=hf(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),i.memoizedState={parent:c,cache:p},xf(i),pa(i,Pt,p)):((r.lanes&o)!==0&&(yf(r,i),Ao(i,null,null,o),To()),p=r.memoizedState,x=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),pa(i,Pt,c)):(c=x.cache,pa(i,Pt,c),c!==p.cache&&ff(i,[Pt],o,!0))),sn(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Yr(r){r.flags|=4}function Wf(r,i,o,c,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(cv())r.flags|=8192;else throw hi=ku,gf}else r.flags&=-16777217}function Pb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Wv(i))if(cv())r.flags|=8192;else throw hi=ku,gf}function Pu(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?xx():536870912,r.lanes|=i,fs|=i)}function Lo(r,i){if(!Ie)switch(r.tailMode){case"hidden":i=r.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?r.tail=null:o.sibling=null;break;case"collapsed":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function yt(r){var i=r.alternate!==null&&r.alternate.child===r.child,o=0,c=0;if(i)for(var p=r.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=o,i}function PN(r,i,o){var c=i.pendingProps;switch(of(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(i),null;case 1:return yt(i),null;case 3:return o=i.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Hr(Pt),Ae(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(Wi(i)?Yr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,uf())),yt(i),null;case 26:var p=i.type,x=i.memoizedState;return r===null?(Yr(i),x!==null?(yt(i),Pb(i,x)):(yt(i),Wf(i,p,null,c,o))):x?x!==r.memoizedState?(Yr(i),yt(i),Pb(i,x)):(yt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&Yr(i),yt(i),Wf(i,p,r,c,o)),null;case 27:if(Rt(i),o=he.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Yr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return yt(i),null}r=Y.current,Wi(i)?xy(i):(r=Fv(p,c,o),i.stateNode=r,Yr(i))}return yt(i),null;case 5:if(Rt(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&Yr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return yt(i),null}if(x=Y.current,Wi(i))xy(i);else{var k=Wu(he.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?k.createElement(p,{is:c.is}):k.createElement(p)}}x[nn]=i,x[zn]=c;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===i)break e;for(;k.sibling===null;){if(k.return===null||k.return===i)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}i.stateNode=x;e:switch(on(x,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Yr(i)}}return yt(i),Wf(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&Yr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=he.current,Wi(i)){if(r=i.stateNode,o=i.memoizedProps,c=null,p=rn,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[nn]=i,r=!!(r.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Mv(r.nodeValue,o)),r||ma(i,!0)}else r=Wu(r).createTextNode(c),r[nn]=i,i.stateNode=r}return yt(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(c=Wi(i),o!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[nn]=i}else li(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),r=!1}else o=uf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(Vn(i),i):(Vn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return yt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Wi(i),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[nn]=i}else li(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),p=!1}else p=uf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Vn(i),i):(Vn(i),null)}return Vn(i),(i.flags&128)!==0?(i.lanes=o,i):(o=c!==null,r=r!==null&&r.memoizedState!==null,o&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048)),o!==r&&o&&(i.child.flags|=8192),Pu(i,i.updateQueue),yt(i),null);case 4:return Ae(),r===null&&kh(i.stateNode.containerInfo),yt(i),null;case 10:return Hr(i.type),yt(i),null;case 19:if(I(Dt),c=i.memoizedState,c===null)return yt(i),null;if(p=(i.flags&128)!==0,x=c.rendering,x===null)if(p)Lo(c,!1);else{if(At!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(x=_u(r),x!==null){for(i.flags|=128,Lo(c,!1),r=x.updateQueue,i.updateQueue=r,Pu(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)fy(o,r),o=o.sibling;return w(Dt,Dt.current&1|2),Ie&&Zr(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&>()>Iu&&(i.flags|=128,p=!0,Lo(c,!1),i.lanes=4194304)}else{if(!p)if(r=_u(x),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Pu(i,r),Lo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Ie)return yt(i),null}else 2*gt()-c.renderingStartTime>Iu&&o!==536870912&&(i.flags|=128,p=!0,Lo(c,!1),i.lanes=4194304);c.isBackwards?(x.sibling=i.child,i.child=x):(r=c.last,r!==null?r.sibling=x:i.child=x,c.last=x)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=gt(),r.sibling=null,o=Dt.current,w(Dt,p?o&1|2:o&1),Ie&&Zr(i,c.treeForkCount),r):(yt(i),null);case 22:case 23:return Vn(i),wf(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(o&536870912)!==0&&(i.flags&128)===0&&(yt(i),i.subtreeFlags&6&&(i.flags|=8192)):yt(i),o=i.updateQueue,o!==null&&Pu(i,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048),r!==null&&I(di),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Hr(Pt),yt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function UN(r,i){switch(of(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Hr(Pt),Ae(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Rt(i),null;case 31:if(i.memoizedState!==null){if(Vn(i),i.alternate===null)throw Error(a(340));li()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Vn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));li()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return I(Dt),null;case 4:return Ae(),null;case 10:return Hr(i.type),null;case 22:case 23:return Vn(i),wf(),r!==null&&I(di),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Hr(Pt),null;case 25:return null;default:return null}}function Ub(r,i){switch(of(i),i.tag){case 3:Hr(Pt),Ae();break;case 26:case 27:case 5:Rt(i);break;case 4:Ae();break;case 31:i.memoizedState!==null&&Vn(i);break;case 13:Vn(i);break;case 19:I(Dt);break;case 10:Hr(i.type);break;case 22:case 23:Vn(i),wf(),r!==null&&I(di);break;case 24:Hr(Pt)}}function Po(r,i){try{var o=i.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&r)===r){c=void 0;var x=o.create,k=o.inst;c=x(),k.destroy=c}o=o.next}while(o!==p)}}catch(_){at(i,i.return,_)}}function ka(r,i,o){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var x=p.next;c=x;do{if((c.tag&r)===r){var k=c.inst,_=k.destroy;if(_!==void 0){k.destroy=void 0,p=i;var M=o,F=_;try{F()}catch(Q){at(p,M,Q)}}}c=c.next}while(c!==x)}}catch(Q){at(i,i.return,Q)}}function Vb(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{Ty(i,o)}catch(c){at(r,r.return,c)}}}function Bb(r,i,o){o.props=gi(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(c){at(r,i,c)}}function Uo(r,i){try{var o=r.ref;if(o!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof o=="function"?r.refCleanup=o(c):o.current=c}}catch(p){at(r,i,p)}}function jr(r,i){var o=r.ref,c=r.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){at(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){at(r,i,p)}else o.current=null}function Zb(r){var i=r.type,o=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){at(r,r.return,p)}}function eh(r,i,o){try{var c=r.stateNode;oC(c,r.type,o,i),c[zn]=i}catch(p){at(r,r.return,p)}}function Ib(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ca(r.type)||r.tag===4}function th(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Ib(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ca(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function nh(r,i,o){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(r),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Ur));else if(c!==4&&(c===27&&Ca(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(nh(r,i,o),r=r.sibling;r!==null;)nh(r,i,o),r=r.sibling}function Uu(r,i,o){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?o.insertBefore(r,i):o.appendChild(r);else if(c!==4&&(c===27&&Ca(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Uu(r,i,o),r=r.sibling;r!==null;)Uu(r,i,o),r=r.sibling}function Hb(r){var i=r.stateNode,o=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);on(i,c,o),i[nn]=r,i[zn]=o}catch(x){at(r,r.return,x)}}var Kr=!1,Bt=!1,rh=!1,Fb=typeof WeakSet=="function"?WeakSet:Set,en=null;function VN(r,i){if(r=r.containerInfo,zh=sc,r=ry(r),Kd(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var k=0,_=-1,M=-1,F=0,Q=0,re=r,G=null;t:for(;;){for(var K;re!==o||p!==0&&re.nodeType!==3||(_=k+p),re!==x||c!==0&&re.nodeType!==3||(M=k+c),re.nodeType===3&&(k+=re.nodeValue.length),(K=re.firstChild)!==null;)G=re,re=K;for(;;){if(re===r)break t;if(G===o&&++F===p&&(_=k),G===x&&++Q===c&&(M=k),(K=re.nextSibling)!==null)break;re=G,G=re.parentNode}re=K}o=_===-1||M===-1?null:{start:_,end:M}}else o=null}o=o||{start:0,end:0}}else o=null;for(_h={focusedElem:r,selectionRange:o},sc=!1,en=i;en!==null;)if(i=en,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,en=r;else for(;en!==null;){switch(i=en,x=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(o=0;o<r.length;o++)p=r[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&x!==null){r=void 0,o=i,p=x.memoizedProps,x=x.memoizedState,c=o.stateNode;try{var ge=gi(o.type,p);r=c.getSnapshotBeforeUpdate(ge,x),c.__reactInternalSnapshotBeforeUpdate=r}catch(je){at(o,o.return,je)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)Ch(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ch(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,en=r;break}en=i.return}}function qb(r,i,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Jr(r,o),c&4&&Po(5,o);break;case 1:if(Jr(r,o),c&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(k){at(o,o.return,k)}else{var p=gi(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(k){at(o,o.return,k)}}c&64&&Vb(o),c&512&&Uo(o,o.return);break;case 3:if(Jr(r,o),c&64&&(r=o.updateQueue,r!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{Ty(r,i)}catch(k){at(o,o.return,k)}}break;case 27:i===null&&c&4&&Hb(o);case 26:case 5:Jr(r,o),i===null&&c&4&&Zb(o),c&512&&Uo(o,o.return);break;case 12:Jr(r,o);break;case 31:Jr(r,o),c&4&&Kb(r,o);break;case 13:Jr(r,o),c&4&&Xb(r,o),c&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=KN.bind(null,o),pC(r,o))));break;case 22:if(c=o.memoizedState!==null||Kr,!c){i=i!==null&&i.memoizedState!==null||Bt,p=Kr;var x=Bt;Kr=c,(Bt=i)&&!x?Qr(r,o,(o.subtreeFlags&8772)!==0):Jr(r,o),Kr=p,Bt=x}break;case 30:break;default:Jr(r,o)}}function Gb(r){var i=r.alternate;i!==null&&(r.alternate=null,Gb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Od(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var vt=null,jn=!1;function Xr(r,i,o){for(o=o.child;o!==null;)Yb(r,i,o),o=o.sibling}function Yb(r,i,o){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(gn,o)}catch{}switch(o.tag){case 26:Bt||jr(o,i),Xr(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Bt||jr(o,i);var c=vt,p=jn;Ca(o.type)&&(vt=o.stateNode,jn=!1),Xr(r,i,o),Yo(o.stateNode),vt=c,jn=p;break;case 5:Bt||jr(o,i);case 6:if(c=vt,p=jn,vt=null,Xr(r,i,o),vt=c,jn=p,vt!==null)if(jn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(o.stateNode)}catch(x){at(o,i,x)}else try{vt.removeChild(o.stateNode)}catch(x){at(o,i,x)}break;case 18:vt!==null&&(jn?(r=vt,Vv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),vs(r)):Vv(vt,o.stateNode));break;case 4:c=vt,p=jn,vt=o.stateNode.containerInfo,jn=!0,Xr(r,i,o),vt=c,jn=p;break;case 0:case 11:case 14:case 15:ka(2,o,i),Bt||ka(4,o,i),Xr(r,i,o);break;case 1:Bt||(jr(o,i),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Bb(o,i,c)),Xr(r,i,o);break;case 21:Xr(r,i,o);break;case 22:Bt=(c=Bt)||o.memoizedState!==null,Xr(r,i,o),Bt=c;break;default:Xr(r,i,o)}}function Kb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{vs(r)}catch(o){at(i,i.return,o)}}}function Xb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{vs(r)}catch(o){at(i,i.return,o)}}function BN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Fb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Fb),i;default:throw Error(a(435,r.tag))}}function Vu(r,i){var o=BN(r);i.forEach(function(c){if(!o.has(c)){o.add(c);var p=XN.bind(null,r,c);c.then(p,p)}})}function Nn(r,i){var o=i.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],x=r,k=i,_=k;e:for(;_!==null;){switch(_.tag){case 27:if(Ca(_.type)){vt=_.stateNode,jn=!1;break e}break;case 5:vt=_.stateNode,jn=!1;break e;case 3:case 4:vt=_.stateNode.containerInfo,jn=!0;break e}_=_.return}if(vt===null)throw Error(a(160));Yb(x,k,p),vt=null,jn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Jb(i,r),i=i.sibling}var pr=null;function Jb(r,i){var o=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Nn(i,r),Cn(r),c&4&&(ka(3,r,r.return),Po(3,r),ka(5,r,r.return));break;case 1:Nn(i,r),Cn(r),c&512&&(Bt||o===null||jr(o,o.return)),c&64&&Kr&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=pr;if(Nn(i,r),Cn(r),c&512&&(Bt||o===null||jr(o,o.return)),c&4){var x=o!==null?o.memoizedState:null;if(c=r.memoizedState,o===null)if(c===null)if(r.stateNode===null){e:{c=r.type,o=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":x=p.getElementsByTagName("title")[0],(!x||x[fo]||x[nn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(c),p.head.insertBefore(x,p.querySelector("head > title"))),on(x,c,o),x[nn]=r,Wt(x),c=x;break e;case"link":var k=Jv("link","href",p).get(c+(o.href||""));if(k){for(var _=0;_<k.length;_++)if(x=k[_],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(_,1);break t}}x=p.createElement(c),on(x,c,o),p.head.appendChild(x);break;case"meta":if(k=Jv("meta","content",p).get(c+(o.content||""))){for(_=0;_<k.length;_++)if(x=k[_],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(_,1);break t}}x=p.createElement(c),on(x,c,o),p.head.appendChild(x);break;default:throw Error(a(468,c))}x[nn]=r,Wt(x),c=x}r.stateNode=c}else Qv(p,r.type,r.stateNode);else r.stateNode=Xv(p,c,r.memoizedProps);else x!==c?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,c===null?Qv(p,r.type,r.stateNode):Xv(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&eh(r,r.memoizedProps,o.memoizedProps)}break;case 27:Nn(i,r),Cn(r),c&512&&(Bt||o===null||jr(o,o.return)),o!==null&&c&4&&eh(r,r.memoizedProps,o.memoizedProps);break;case 5:if(Nn(i,r),Cn(r),c&512&&(Bt||o===null||jr(o,o.return)),r.flags&32){p=r.stateNode;try{Ii(p,"")}catch(ge){at(r,r.return,ge)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,eh(r,p,o!==null?o.memoizedProps:p)),c&1024&&(rh=!0);break;case 6:if(Nn(i,r),Cn(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,o=r.stateNode;try{o.nodeValue=c}catch(ge){at(r,r.return,ge)}}break;case 3:if(nc=null,p=pr,pr=ec(i.containerInfo),Nn(i,r),pr=p,Cn(r),c&4&&o!==null&&o.memoizedState.isDehydrated)try{vs(i.containerInfo)}catch(ge){at(r,r.return,ge)}rh&&(rh=!1,Qb(r));break;case 4:c=pr,pr=ec(r.stateNode.containerInfo),Nn(i,r),Cn(r),pr=c;break;case 12:Nn(i,r),Cn(r);break;case 31:Nn(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Vu(r,c)));break;case 13:Nn(i,r),Cn(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Zu=gt()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Vu(r,c)));break;case 22:p=r.memoizedState!==null;var M=o!==null&&o.memoizedState!==null,F=Kr,Q=Bt;if(Kr=F||p,Bt=Q||M,Nn(i,r),Bt=Q,Kr=F,Cn(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||M||Kr||Bt||xi(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){M=o=i;try{if(x=M.stateNode,p)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{_=M.stateNode;var re=M.memoizedProps.style,G=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ge){at(M,M.return,ge)}}}else if(i.tag===6){if(o===null){M=i;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(ge){at(M,M.return,ge)}}}else if(i.tag===18){if(o===null){M=i;try{var K=M.stateNode;p?Bv(K,!0):Bv(M.stateNode,!1)}catch(ge){at(M,M.return,ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=r.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,Vu(r,o))));break;case 19:Nn(i,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Vu(r,c)));break;case 30:break;case 21:break;default:Nn(i,r),Cn(r)}}function Cn(r){var i=r.flags;if(i&2){try{for(var o,c=r.return;c!==null;){if(Ib(c)){o=c;break}c=c.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,x=th(r);Uu(r,x,p);break;case 5:var k=o.stateNode;o.flags&32&&(Ii(k,""),o.flags&=-33);var _=th(r);Uu(r,_,k);break;case 3:case 4:var M=o.stateNode.containerInfo,F=th(r);nh(r,F,M);break;default:throw Error(a(161))}}catch(Q){at(r,r.return,Q)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Qb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Qb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Jr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)qb(r,i.alternate,i),i=i.sibling}function xi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:ka(4,i,i.return),xi(i);break;case 1:jr(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&Bb(i,i.return,o),xi(i);break;case 27:Yo(i.stateNode);case 26:case 5:jr(i,i.return),xi(i);break;case 22:i.memoizedState===null&&xi(i);break;case 30:xi(i);break;default:xi(i)}r=r.sibling}}function Qr(r,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,x=i,k=x.flags;switch(x.tag){case 0:case 11:case 15:Qr(p,x,o),Po(4,x);break;case 1:if(Qr(p,x,o),c=x,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(F){at(c,c.return,F)}if(c=x,p=c.updateQueue,p!==null){var _=c.stateNode;try{var M=p.shared.hiddenCallbacks;if(M!==null)for(p.shared.hiddenCallbacks=null,p=0;p<M.length;p++)Ey(M[p],_)}catch(F){at(c,c.return,F)}}o&&k&64&&Vb(x),Uo(x,x.return);break;case 27:Hb(x);case 26:case 5:Qr(p,x,o),o&&c===null&&k&4&&Zb(x),Uo(x,x.return);break;case 12:Qr(p,x,o);break;case 31:Qr(p,x,o),o&&k&4&&Kb(p,x);break;case 13:Qr(p,x,o),o&&k&4&&Xb(p,x);break;case 22:x.memoizedState===null&&Qr(p,x,o),Uo(x,x.return);break;case 30:break;default:Qr(p,x,o)}i=i.sibling}}function ah(r,i){var o=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==o&&(r!=null&&r.refCount++,o!=null&&_o(o))}function ih(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&_o(r))}function gr(r,i,o,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Wb(r,i,o,c),i=i.sibling}function Wb(r,i,o,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:gr(r,i,o,c),p&2048&&Po(9,i);break;case 1:gr(r,i,o,c);break;case 3:gr(r,i,o,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&_o(r)));break;case 12:if(p&2048){gr(r,i,o,c),r=i.stateNode;try{var x=i.memoizedProps,k=x.id,_=x.onPostCommit;typeof _=="function"&&_(k,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(M){at(i,i.return,M)}}else gr(r,i,o,c);break;case 31:gr(r,i,o,c);break;case 13:gr(r,i,o,c);break;case 23:break;case 22:x=i.stateNode,k=i.alternate,i.memoizedState!==null?x._visibility&2?gr(r,i,o,c):Vo(r,i):x._visibility&2?gr(r,i,o,c):(x._visibility|=2,us(r,i,o,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&ah(k,i);break;case 24:gr(r,i,o,c),p&2048&&ih(i.alternate,i);break;default:gr(r,i,o,c)}}function us(r,i,o,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=r,k=i,_=o,M=c,F=k.flags;switch(k.tag){case 0:case 11:case 15:us(x,k,_,M,p),Po(8,k);break;case 23:break;case 22:var Q=k.stateNode;k.memoizedState!==null?Q._visibility&2?us(x,k,_,M,p):Vo(x,k):(Q._visibility|=2,us(x,k,_,M,p)),p&&F&2048&&ah(k.alternate,k);break;case 24:us(x,k,_,M,p),p&&F&2048&&ih(k.alternate,k);break;default:us(x,k,_,M,p)}i=i.sibling}}function Vo(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=r,c=i,p=c.flags;switch(c.tag){case 22:Vo(o,c),p&2048&&ah(c.alternate,c);break;case 24:Vo(o,c),p&2048&&ih(c.alternate,c);break;default:Vo(o,c)}i=i.sibling}}var Bo=8192;function cs(r,i,o){if(r.subtreeFlags&Bo)for(r=r.child;r!==null;)ev(r,i,o),r=r.sibling}function ev(r,i,o){switch(r.tag){case 26:cs(r,i,o),r.flags&Bo&&r.memoizedState!==null&&NC(o,pr,r.memoizedState,r.memoizedProps);break;case 5:cs(r,i,o);break;case 3:case 4:var c=pr;pr=ec(r.stateNode.containerInfo),cs(r,i,o),pr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Bo,Bo=16777216,cs(r,i,o),Bo=c):cs(r,i,o));break;default:cs(r,i,o)}}function tv(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Zo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];en=c,rv(c,r)}tv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)nv(r),r=r.sibling}function nv(r){switch(r.tag){case 0:case 11:case 15:Zo(r),r.flags&2048&&ka(9,r,r.return);break;case 3:Zo(r);break;case 12:Zo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Bu(r)):Zo(r);break;default:Zo(r)}}function Bu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];en=c,rv(c,r)}tv(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:ka(8,i,i.return),Bu(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,Bu(i));break;default:Bu(i)}r=r.sibling}}function rv(r,i){for(;en!==null;){var o=en;switch(o.tag){case 0:case 11:case 15:ka(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:_o(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,en=c;else e:for(o=r;en!==null;){c=en;var p=c.sibling,x=c.return;if(Gb(c),c===o){en=null;break e}if(p!==null){p.return=x,en=p;break e}en=x}}}var ZN={getCacheForType:function(r){var i=an(Pt),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return an(Pt).controller.signal}},IN=typeof WeakMap=="function"?WeakMap:Map,Je=0,dt=null,Ue=null,Be=0,rt=0,Bn=null,wa=!1,ds=!1,sh=!1,Wr=0,At=0,Sa=0,yi=0,oh=0,Zn=0,fs=0,Io=null,En=null,lh=!1,Zu=0,av=0,Iu=1/0,Hu=null,za=null,Kt=0,_a=null,hs=null,ea=0,uh=0,ch=null,iv=null,Ho=0,dh=null;function In(){return(Je&2)!==0&&Be!==0?Be&-Be:P.T!==null?xh():kx()}function sv(){if(Zn===0)if((Be&536870912)===0||Ie){var r=Ql;Ql<<=1,(Ql&3932160)===0&&(Ql=262144),Zn=r}else Zn=536870912;return r=Un.current,r!==null&&(r.flags|=32),Zn}function Tn(r,i,o){(r===dt&&(rt===2||rt===9)||r.cancelPendingCommit!==null)&&(ms(r,0),ja(r,Be,Zn,!1)),co(r,o),((Je&2)===0||r!==dt)&&(r===dt&&((Je&2)===0&&(yi|=o),At===4&&ja(r,Be,Zn,!1)),Nr(r))}function ov(r,i,o){if((Je&6)!==0)throw Error(a(327));var c=!o&&(i&127)===0&&(i&r.expiredLanes)===0||uo(r,i),p=c?qN(r,i):hh(r,i,!0),x=c;do{if(p===0){ds&&!c&&ja(r,i,0,!1);break}else{if(o=r.current.alternate,x&&!HN(o)){p=hh(r,i,!1),x=!1;continue}if(p===2){if(x=i,r.errorRecoveryDisabledLanes&x)var k=0;else k=r.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var _=r;p=Io;var M=_.current.memoizedState.isDehydrated;if(M&&(ms(_,k).flags|=256),k=hh(_,k,!1),k!==2){if(sh&&!M){_.errorRecoveryDisabledLanes|=x,yi|=x,p=4;break e}x=En,En=p,x!==null&&(En===null?En=x:En.push.apply(En,x))}p=k}if(x=!1,p!==2)continue}}if(p===1){ms(r,0),ja(r,i,0,!0);break}e:{switch(c=r,x=p,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ja(c,i,Zn,!wa);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Zu+300-gt(),10<p)){if(ja(c,i,Zn,!wa),eu(c,0,!0)!==0)break e;ea=i,c.timeoutHandle=Pv(lv.bind(null,c,o,En,Hu,lh,i,Zn,yi,fs,wa,x,"Throttled",-0,0),p);break e}lv(c,o,En,Hu,lh,i,Zn,yi,fs,wa,x,null,-0,0)}}break}while(!0);Nr(r)}function lv(r,i,o,c,p,x,k,_,M,F,Q,re,G,K){if(r.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ur},ev(i,x,re);var ge=(x&62914560)===x?Zu-gt():(x&4194048)===x?av-gt():0;if(ge=CC(re,ge),ge!==null){ea=x,r.cancelPendingCommit=ge(gv.bind(null,r,i,x,o,c,p,k,_,M,Q,re,null,G,K)),ja(r,x,k,!F);return}}gv(r,i,x,o,c,p,k,_,M)}function HN(r){for(var i=r;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],x=p.getSnapshot;p=p.value;try{if(!Ln(x(),p))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ja(r,i,o,c){i&=~oh,i&=~yi,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var x=31-ct(p),k=1<<x;c[x]=-1,p&=~k}o!==0&&yx(r,o,i)}function Fu(){return(Je&6)===0?(Fo(0),!1):!0}function fh(){if(Ue!==null){if(rt===0)var r=Ue.return;else r=Ue,Ir=ui=null,Cf(r),as=null,No=0,r=Ue;for(;r!==null;)Ub(r.alternate,r),r=r.return;Ue=null}}function ms(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,cC(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),ea=0,fh(),dt=r,Ue=o=Br(r.current,null),Be=i,rt=0,Bn=null,wa=!1,ds=uo(r,i),sh=!1,fs=Zn=oh=yi=Sa=At=0,En=Io=null,lh=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-ct(c),x=1<<p;i|=r[p],c&=~x}return Wr=i,fu(),o}function uv(r,i){Re=null,P.H=Do,i===rs||i===vu?(i=_y(),rt=3):i===gf?(i=_y(),rt=4):rt=i===Hf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Bn=i,Ue===null&&(At=1,Mu(r,Jn(i,r.current)))}function cv(){var r=Un.current;return r===null?!0:(Be&4194048)===Be?tr===null:(Be&62914560)===Be||(Be&536870912)!==0?r===tr:!1}function dv(){var r=P.H;return P.H=Do,r===null?Do:r}function fv(){var r=P.A;return P.A=ZN,r}function qu(){At=4,wa||(Be&4194048)!==Be&&Un.current!==null||(ds=!0),(Sa&134217727)===0&&(yi&134217727)===0||dt===null||ja(dt,Be,Zn,!1)}function hh(r,i,o){var c=Je;Je|=2;var p=dv(),x=fv();(dt!==r||Be!==i)&&(Hu=null,ms(r,i)),i=!1;var k=At;e:do try{if(rt!==0&&Ue!==null){var _=Ue,M=Bn;switch(rt){case 8:fh(),k=6;break e;case 3:case 2:case 9:case 6:Un.current===null&&(i=!0);var F=rt;if(rt=0,Bn=null,ps(r,_,M,F),o&&ds){k=0;break e}break;default:F=rt,rt=0,Bn=null,ps(r,_,M,F)}}FN(),k=At;break}catch(Q){uv(r,Q)}while(!0);return i&&r.shellSuspendCounter++,Ir=ui=null,Je=c,P.H=p,P.A=x,Ue===null&&(dt=null,Be=0,fu()),k}function FN(){for(;Ue!==null;)hv(Ue)}function qN(r,i){var o=Je;Je|=2;var c=dv(),p=fv();dt!==r||Be!==i?(Hu=null,Iu=gt()+500,ms(r,i)):ds=uo(r,i);e:do try{if(rt!==0&&Ue!==null){i=Ue;var x=Bn;t:switch(rt){case 1:rt=0,Bn=null,ps(r,i,x,1);break;case 2:case 9:if(Sy(x)){rt=0,Bn=null,mv(i);break}i=function(){rt!==2&&rt!==9||dt!==r||(rt=7),Nr(r)},x.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:Sy(x)?(rt=0,Bn=null,mv(i)):(rt=0,Bn=null,ps(r,i,x,7));break;case 5:var k=null;switch(Ue.tag){case 26:k=Ue.memoizedState;case 5:case 27:var _=Ue;if(k?Wv(k):_.stateNode.complete){rt=0,Bn=null;var M=_.sibling;if(M!==null)Ue=M;else{var F=_.return;F!==null?(Ue=F,Gu(F)):Ue=null}break t}}rt=0,Bn=null,ps(r,i,x,5);break;case 6:rt=0,Bn=null,ps(r,i,x,6);break;case 8:fh(),At=6;break e;default:throw Error(a(462))}}GN();break}catch(Q){uv(r,Q)}while(!0);return Ir=ui=null,P.H=c,P.A=p,Je=o,Ue!==null?0:(dt=null,Be=0,fu(),At)}function GN(){for(;Ue!==null&&!Mt();)hv(Ue)}function hv(r){var i=Lb(r.alternate,r,Wr);r.memoizedProps=r.pendingProps,i===null?Gu(r):Ue=i}function mv(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=Ab(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Ab(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:Cf(i);default:Ub(o,i),i=Ue=fy(i,Wr),i=Lb(o,i,Wr)}r.memoizedProps=r.pendingProps,i===null?Gu(r):Ue=i}function ps(r,i,o,c){Ir=ui=null,Cf(i),as=null,No=0;var p=i.return;try{if(DN(r,p,i,o,Be)){At=1,Mu(r,Jn(o,r.current)),Ue=null;return}}catch(x){if(p!==null)throw Ue=p,x;At=1,Mu(r,Jn(o,r.current)),Ue=null;return}i.flags&32768?(Ie||c===1?r=!0:ds||(Be&536870912)!==0?r=!1:(wa=r=!0,(c===2||c===9||c===3||c===6)&&(c=Un.current,c!==null&&c.tag===13&&(c.flags|=16384))),pv(i,r)):Gu(i)}function Gu(r){var i=r;do{if((i.flags&32768)!==0){pv(i,wa);return}r=i.return;var o=PN(i.alternate,i,Wr);if(o!==null){Ue=o;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=r}while(i!==null);At===0&&(At=5)}function pv(r,i){do{var o=UN(r.alternate,r);if(o!==null){o.flags&=32767,Ue=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Ue=r;return}Ue=r=o}while(r!==null);At=6,Ue=null}function gv(r,i,o,c,p,x,k,_,M){r.cancelPendingCommit=null;do Yu();while(Kt!==0);if((Je&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=ef,j2(r,o,x,k,_,M),r===dt&&(Ue=dt=null,Be=0),hs=i,_a=r,ea=o,uh=x,ch=p,iv=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,JN(we,function(){return kv(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=J.p,J.p=2,k=Je,Je|=4;try{VN(r,i,o)}finally{Je=k,J.p=p,P.T=c}}Kt=1,xv(),yv(),bv()}}function xv(){if(Kt===1){Kt=0;var r=_a,i=hs,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=P.T,P.T=null;var c=J.p;J.p=2;var p=Je;Je|=4;try{Jb(i,r);var x=_h,k=ry(r.containerInfo),_=x.focusedElem,M=x.selectionRange;if(k!==_&&_&&_.ownerDocument&&ny(_.ownerDocument.documentElement,_)){if(M!==null&&Kd(_)){var F=M.start,Q=M.end;if(Q===void 0&&(Q=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(Q,_.value.length);else{var re=_.ownerDocument||document,G=re&&re.defaultView||window;if(G.getSelection){var K=G.getSelection(),ge=_.textContent.length,je=Math.min(M.start,ge),ut=M.end===void 0?je:Math.min(M.end,ge);!K.extend&&je>ut&&(k=ut,ut=je,je=k);var U=ty(_,je),$=ty(_,ut);if(U&&$&&(K.rangeCount!==1||K.anchorNode!==U.node||K.anchorOffset!==U.offset||K.focusNode!==$.node||K.focusOffset!==$.offset)){var H=re.createRange();H.setStart(U.node,U.offset),K.removeAllRanges(),je>ut?(K.addRange(H),K.extend($.node,$.offset)):(H.setEnd($.node,$.offset),K.addRange(H))}}}}for(re=[],K=_;K=K.parentNode;)K.nodeType===1&&re.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var ne=re[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}sc=!!zh,_h=zh=null}finally{Je=p,J.p=c,P.T=o}}r.current=i,Kt=2}}function yv(){if(Kt===2){Kt=0;var r=_a,i=hs,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=P.T,P.T=null;var c=J.p;J.p=2;var p=Je;Je|=4;try{qb(r,i.alternate,i)}finally{Je=p,J.p=c,P.T=o}}Kt=3}}function bv(){if(Kt===4||Kt===3){Kt=0,Gt();var r=_a,i=hs,o=ea,c=iv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,hs=_a=null,vv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(za=null),Td(o),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(gn,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=P.T,p=J.p,J.p=2,P.T=null;try{for(var x=r.onRecoverableError,k=0;k<c.length;k++){var _=c[k];x(_.value,{componentStack:_.stack})}}finally{P.T=i,J.p=p}}(ea&3)!==0&&Yu(),Nr(r),p=r.pendingLanes,(o&261930)!==0&&(p&42)!==0?r===dh?Ho++:(Ho=0,dh=r):Ho=0,Fo(0)}}function vv(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,_o(i)))}function Yu(){return xv(),yv(),bv(),kv()}function kv(){if(Kt!==5)return!1;var r=_a,i=uh;uh=0;var o=Td(ea),c=P.T,p=J.p;try{J.p=32>o?32:o,P.T=null,o=ch,ch=null;var x=_a,k=ea;if(Kt=0,hs=_a=null,ea=0,(Je&6)!==0)throw Error(a(331));var _=Je;if(Je|=4,nv(x.current),Wb(x,x.current,k,o),Je=_,Fo(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(gn,x)}catch{}return!0}finally{J.p=p,P.T=c,vv(r,i)}}function wv(r,i,o){i=Jn(o,i),i=If(r.stateNode,i,2),r=ya(r,i,2),r!==null&&(co(r,2),Nr(r))}function at(r,i,o){if(r.tag===3)wv(r,r,o);else for(;i!==null;){if(i.tag===3){wv(i,r,o);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(za===null||!za.has(c))){r=Jn(o,r),o=Sb(2),c=ya(i,o,2),c!==null&&(zb(o,c,i,r),co(c,2),Nr(c));break}}i=i.return}}function mh(r,i,o){var c=r.pingCache;if(c===null){c=r.pingCache=new IN;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(o)||(sh=!0,p.add(o),r=YN.bind(null,r,i,o),i.then(r,r))}function YN(r,i,o){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,dt===r&&(Be&o)===o&&(At===4||At===3&&(Be&62914560)===Be&&300>gt()-Zu?(Je&2)===0&&ms(r,0):oh|=o,fs===Be&&(fs=0)),Nr(r)}function Sv(r,i){i===0&&(i=xx()),r=si(r,i),r!==null&&(co(r,i),Nr(r))}function KN(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),Sv(r,o)}function XN(r,i){var o=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),Sv(r,o)}function JN(r,i){return Qt(r,i)}var Ku=null,gs=null,ph=!1,Xu=!1,gh=!1,Na=0;function Nr(r){r!==gs&&r.next===null&&(gs===null?Ku=gs=r:gs=gs.next=r),Xu=!0,ph||(ph=!0,WN())}function Fo(r,i){if(!gh&&Xu){gh=!0;do for(var o=!1,c=Ku;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var x=0;else{var k=c.suspendedLanes,_=c.pingedLanes;x=(1<<31-ct(42|r)+1)-1,x&=p&~(k&~_),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,Nv(c,x))}else x=Be,x=eu(c,c===dt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||uo(c,x)||(o=!0,Nv(c,x));c=c.next}while(o);gh=!1}}function QN(){zv()}function zv(){Xu=ph=!1;var r=0;Na!==0&&uC()&&(r=Na);for(var i=gt(),o=null,c=Ku;c!==null;){var p=c.next,x=_v(c,i);x===0?(c.next=null,o===null?Ku=p:o.next=p,p===null&&(gs=o)):(o=c,(r!==0||(x&3)!==0)&&(Xu=!0)),c=p}Kt!==0&&Kt!==5||Fo(r),Na!==0&&(Na=0)}function _v(r,i){for(var o=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,x=r.pendingLanes&-62914561;0<x;){var k=31-ct(x),_=1<<k,M=p[k];M===-1?((_&o)===0||(_&c)!==0)&&(p[k]=_2(_,i)):M<=i&&(r.expiredLanes|=_),x&=~_}if(i=dt,o=Be,o=eu(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,o===0||r===i&&(rt===2||rt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Gn(c),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||uo(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(c!==null&&Gn(c),Td(o)){case 2:case 8:o=ce;break;case 32:o=we;break;case 268435456:o=He;break;default:o=we}return c=jv.bind(null,r),o=Qt(o,c),r.callbackPriority=i,r.callbackNode=o,i}return c!==null&&c!==null&&Gn(c),r.callbackPriority=2,r.callbackNode=null,2}function jv(r,i){if(Kt!==0&&Kt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(Yu()&&r.callbackNode!==o)return null;var c=Be;return c=eu(r,r===dt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(ov(r,c,i),_v(r,gt()),r.callbackNode!=null&&r.callbackNode===o?jv.bind(null,r):null)}function Nv(r,i){if(Yu())return null;ov(r,i,!0)}function WN(){dC(function(){(Je&6)!==0?Qt(W,QN):zv()})}function xh(){if(Na===0){var r=ts;r===0&&(r=Jl,Jl<<=1,(Jl&261888)===0&&(Jl=256)),Na=r}return Na}function Cv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:au(""+r)}function Ev(r,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,r.id&&o.setAttribute("form",r.id),i.parentNode.insertBefore(o,i),r=new FormData(r),o.parentNode.removeChild(o),r}function eC(r,i,o,c,p){if(i==="submit"&&o&&o.stateNode===p){var x=Cv((p[zn]||null).action),k=c.submitter;k&&(i=(i=k[zn]||null)?Cv(i.formAction):k.getAttribute("formAction"),i!==null&&(x=i,k=null));var _=new lu("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Na!==0){var M=k?Ev(p,k):new FormData(p);Lf(o,{pending:!0,data:M,method:p.method,action:x},null,M)}}else typeof x=="function"&&(_.preventDefault(),M=k?Ev(p,k):new FormData(p),Lf(o,{pending:!0,data:M,method:p.method,action:x},x,M))},currentTarget:p}]})}}for(var yh=0;yh<Wd.length;yh++){var bh=Wd[yh],tC=bh.toLowerCase(),nC=bh[0].toUpperCase()+bh.slice(1);mr(tC,"on"+nC)}mr(sy,"onAnimationEnd"),mr(oy,"onAnimationIteration"),mr(ly,"onAnimationStart"),mr("dblclick","onDoubleClick"),mr("focusin","onFocus"),mr("focusout","onBlur"),mr(yN,"onTransitionRun"),mr(bN,"onTransitionStart"),mr(vN,"onTransitionCancel"),mr(uy,"onTransitionEnd"),Bi("onMouseEnter",["mouseout","mouseover"]),Bi("onMouseLeave",["mouseout","mouseover"]),Bi("onPointerEnter",["pointerout","pointerover"]),Bi("onPointerLeave",["pointerout","pointerover"]),ni("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ni("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ni("onBeforeInput",["compositionend","keypress","textInput","paste"]),ni("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="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(" "),rC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function Tv(r,i){i=(i&4)!==0;for(var o=0;o<r.length;o++){var c=r[o],p=c.event;c=c.listeners;e:{var x=void 0;if(i)for(var k=c.length-1;0<=k;k--){var _=c[k],M=_.instance,F=_.currentTarget;if(_=_.listener,M!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=F;try{x(p)}catch(Q){du(Q)}p.currentTarget=null,x=M}else for(k=0;k<c.length;k++){if(_=c[k],M=_.instance,F=_.currentTarget,_=_.listener,M!==x&&p.isPropagationStopped())break e;x=_,p.currentTarget=F;try{x(p)}catch(Q){du(Q)}p.currentTarget=null,x=M}}}}function Ve(r,i){var o=i[Ad];o===void 0&&(o=i[Ad]=new Set);var c=r+"__bubble";o.has(c)||(Av(i,r,2,!1),o.add(c))}function vh(r,i,o){var c=0;i&&(c|=4),Av(o,r,c,i)}var Ju="_reactListening"+Math.random().toString(36).slice(2);function kh(r){if(!r[Ju]){r[Ju]=!0,zx.forEach(function(o){o!=="selectionchange"&&(rC.has(o)||vh(o,!1,r),vh(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Ju]||(i[Ju]=!0,vh("selectionchange",!1,i))}}function Av(r,i,o,c){switch(s0(i)){case 2:var p=AC;break;case 8:p=OC;break;default:p=$h}o=p.bind(null,i,o,r),p=void 0,!Vd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(i,o,{capture:!0,passive:p}):r.addEventListener(i,o,!0):p!==void 0?r.addEventListener(i,o,{passive:p}):r.addEventListener(i,o,!1)}function wh(r,i,o,c,p){var x=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var _=c.stateNode.containerInfo;if(_===p)break;if(k===4)for(k=c.return;k!==null;){var M=k.tag;if((M===3||M===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;_!==null;){if(k=Pi(_),k===null)return;if(M=k.tag,M===5||M===6||M===26||M===27){c=x=k;continue e}_=_.parentNode}}c=c.return}$x(function(){var F=x,Q=Pd(o),re=[];e:{var G=cy.get(r);if(G!==void 0){var K=lu,ge=r;switch(r){case"keypress":if(su(o)===0)break e;case"keydown":case"keyup":K=X2;break;case"focusin":ge="focus",K=Hd;break;case"focusout":ge="blur",K=Hd;break;case"beforeblur":case"afterblur":K=Hd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=Ux;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=P2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=W2;break;case sy:case oy:case ly:K=B2;break;case uy:K=tN;break;case"scroll":case"scrollend":K=$2;break;case"wheel":K=rN;break;case"copy":case"cut":case"paste":K=I2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Bx;break;case"toggle":case"beforetoggle":K=iN}var je=(i&4)!==0,ut=!je&&(r==="scroll"||r==="scrollend"),U=je?G!==null?G+"Capture":null:G;je=[];for(var $=F,H;$!==null;){var ne=$;if(H=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||H===null||U===null||(ne=mo($,U),ne!=null&&je.push(Go($,ne,H))),ut)break;$=$.return}0<je.length&&(G=new K(G,ge,null,o,Q),re.push({event:G,listeners:je}))}}if((i&7)===0){e:{if(G=r==="mouseover"||r==="pointerover",K=r==="mouseout"||r==="pointerout",G&&o!==Ld&&(ge=o.relatedTarget||o.fromElement)&&(Pi(ge)||ge[Li]))break e;if((K||G)&&(G=Q.window===Q?Q:(G=Q.ownerDocument)?G.defaultView||G.parentWindow:window,K?(ge=o.relatedTarget||o.toElement,K=F,ge=ge?Pi(ge):null,ge!==null&&(ut=u(ge),je=ge.tag,ge!==ut||je!==5&&je!==27&&je!==6)&&(ge=null)):(K=null,ge=F),K!==ge)){if(je=Ux,ne="onMouseLeave",U="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(je=Bx,ne="onPointerLeave",U="onPointerEnter",$="pointer"),ut=K==null?G:ho(K),H=ge==null?G:ho(ge),G=new je(ne,$+"leave",K,o,Q),G.target=ut,G.relatedTarget=H,ne=null,Pi(Q)===F&&(je=new je(U,$+"enter",ge,o,Q),je.target=H,je.relatedTarget=ut,ne=je),ut=ne,K&&ge)t:{for(je=aC,U=K,$=ge,H=0,ne=U;ne;ne=je(ne))H++;ne=0;for(var _e=$;_e;_e=je(_e))ne++;for(;0<H-ne;)U=je(U),H--;for(;0<ne-H;)$=je($),ne--;for(;H--;){if(U===$||$!==null&&U===$.alternate){je=U;break t}U=je(U),$=je($)}je=null}else je=null;K!==null&&Ov(re,G,K,je,!1),ge!==null&&ut!==null&&Ov(re,ut,ge,je,!0)}}e:{if(G=F?ho(F):window,K=G.nodeName&&G.nodeName.toLowerCase(),K==="select"||K==="input"&&G.type==="file")var Ye=Kx;else if(Gx(G))if(Xx)Ye=pN;else{Ye=hN;var Se=fN}else K=G.nodeName,!K||K.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&$d(F.elementType)&&(Ye=Kx):Ye=mN;if(Ye&&(Ye=Ye(r,F))){Yx(re,Ye,o,Q);break e}Se&&Se(r,G,F),r==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&Dd(G,"number",G.value)}switch(Se=F?ho(F):window,r){case"focusin":(Gx(Se)||Se.contentEditable==="true")&&(Gi=Se,Xd=F,wo=null);break;case"focusout":wo=Xd=Gi=null;break;case"mousedown":Jd=!0;break;case"contextmenu":case"mouseup":case"dragend":Jd=!1,ay(re,o,Q);break;case"selectionchange":if(xN)break;case"keydown":case"keyup":ay(re,o,Q)}var De;if(qd)e:{switch(r){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else qi?Fx(r,o)&&(Ze="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Ze="onCompositionStart");Ze&&(Zx&&o.locale!=="ko"&&(qi||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&qi&&(De=Lx()):(da=Q,Bd="value"in da?da.value:da.textContent,qi=!0)),Se=Qu(F,Ze),0<Se.length&&(Ze=new Vx(Ze,r,null,o,Q),re.push({event:Ze,listeners:Se}),De?Ze.data=De:(De=qx(o),De!==null&&(Ze.data=De)))),(De=oN?lN(r,o):uN(r,o))&&(Ze=Qu(F,"onBeforeInput"),0<Ze.length&&(Se=new Vx("onBeforeInput","beforeinput",null,o,Q),re.push({event:Se,listeners:Ze}),Se.data=De)),eC(re,r,F,o,Q)}Tv(re,i)})}function Go(r,i,o){return{instance:r,listener:i,currentTarget:o}}function Qu(r,i){for(var o=i+"Capture",c=[];r!==null;){var p=r,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=mo(r,o),p!=null&&c.unshift(Go(r,p,x)),p=mo(r,i),p!=null&&c.push(Go(r,p,x))),r.tag===3)return c;r=r.return}return[]}function aC(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Ov(r,i,o,c,p){for(var x=i._reactName,k=[];o!==null&&o!==c;){var _=o,M=_.alternate,F=_.stateNode;if(_=_.tag,M!==null&&M===c)break;_!==5&&_!==26&&_!==27||F===null||(M=F,p?(F=mo(o,x),F!=null&&k.unshift(Go(o,F,M))):p||(F=mo(o,x),F!=null&&k.push(Go(o,F,M)))),o=o.return}k.length!==0&&r.push({event:i,listeners:k})}var iC=/\r\n?/g,sC=/\u0000|\uFFFD/g;function Rv(r){return(typeof r=="string"?r:""+r).replace(iC,`
|
|
9
|
-
`).replace(sC,"")}function Mv(r,i){return i=Rv(i),Rv(r)===i}function lt(r,i,o,c,p,x){switch(o){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Ii(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Ii(r,""+c);break;case"className":nu(r,"class",c);break;case"tabIndex":nu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":nu(r,o,c);break;case"style":Mx(r,c,x);break;case"data":if(i!=="object"){nu(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||o!=="href")){r.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=au(""+c),r.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(o==="formAction"?(i!=="input"&<(r,i,"name",p.name,p,null),lt(r,i,"formEncType",p.formEncType,p,null),lt(r,i,"formMethod",p.formMethod,p,null),lt(r,i,"formTarget",p.formTarget,p,null)):(lt(r,i,"encType",p.encType,p,null),lt(r,i,"method",p.method,p,null),lt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(o);break}c=au(""+c),r.setAttribute(o,c);break;case"onClick":c!=null&&(r.onclick=Ur);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.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"){r.removeAttribute("xlink:href");break}o=au(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);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"?r.setAttribute(o,""+c):r.removeAttribute(o);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"?r.setAttribute(o,""):r.removeAttribute(o);break;case"capture":case"download":c===!0?r.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(o,c):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(o,c):r.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(o):r.setAttribute(o,c);break;case"popover":Ve("beforetoggle",r),Ve("toggle",r),tu(r,"popover",c);break;case"xlinkActuate":Pr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Pr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Pr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Pr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Pr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Pr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Pr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Pr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Pr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":tu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=M2.get(o)||o,tu(r,o,c))}}function Sh(r,i,o,c,p,x){switch(o){case"style":Mx(r,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"children":typeof c=="string"?Ii(r,c):(typeof c=="number"||typeof c=="bigint")&&Ii(r,""+c);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Ur);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_x.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),i=o.slice(2,p?o.length-7:void 0),x=r[zn]||null,x=x!=null?x[o]:null,typeof x=="function"&&r.removeEventListener(i,x,p),typeof c=="function")){typeof x!="function"&&x!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(i,c,p);break e}o in r?r[o]=c:c===!0?r.setAttribute(o,""):tu(r,o,c)}}}function on(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",r),Ve("load",r);var c=!1,p=!1,x;for(x in o)if(o.hasOwnProperty(x)){var k=o[x];if(k!=null)switch(x){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(r,i,x,k,o,null)}}p&<(r,i,"srcSet",o.srcSet,o,null),c&<(r,i,"src",o.src,o,null);return;case"input":Ve("invalid",r);var _=x=k=p=null,M=null,F=null;for(c in o)if(o.hasOwnProperty(c)){var Q=o[c];if(Q!=null)switch(c){case"name":p=Q;break;case"type":k=Q;break;case"checked":M=Q;break;case"defaultChecked":F=Q;break;case"value":x=Q;break;case"defaultValue":_=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:lt(r,i,c,Q,o,null)}}Tx(r,x,_,M,F,k,p,!1);return;case"select":Ve("invalid",r),c=k=x=null;for(p in o)if(o.hasOwnProperty(p)&&(_=o[p],_!=null))switch(p){case"value":x=_;break;case"defaultValue":k=_;break;case"multiple":c=_;default:lt(r,i,p,_,o,null)}i=x,o=k,r.multiple=!!c,i!=null?Zi(r,!!c,i,!1):o!=null&&Zi(r,!!c,o,!0);return;case"textarea":Ve("invalid",r),x=p=c=null;for(k in o)if(o.hasOwnProperty(k)&&(_=o[k],_!=null))switch(k){case"value":c=_;break;case"defaultValue":p=_;break;case"children":x=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:lt(r,i,k,_,o,null)}Ox(r,c,p,x);return;case"option":for(M in o)o.hasOwnProperty(M)&&(c=o[M],c!=null)&&(M==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":lt(r,i,M,c,o,null));return;case"dialog":Ve("beforetoggle",r),Ve("toggle",r),Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":Ve("load",r);break;case"video":case"audio":for(c=0;c<qo.length;c++)Ve(qo[c],r);break;case"image":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"embed":case"source":case"link":Ve("error",r),Ve("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in o)if(o.hasOwnProperty(F)&&(c=o[F],c!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(r,i,F,c,o,null)}return;default:if($d(i)){for(Q in o)o.hasOwnProperty(Q)&&(c=o[Q],c!==void 0&&Sh(r,i,Q,c,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(c=o[_],c!=null&<(r,i,_,c,o,null))}function oC(r,i,o,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,k=null,_=null,M=null,F=null,Q=null;for(K in o){var re=o[K];if(o.hasOwnProperty(K)&&re!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":M=re;default:c.hasOwnProperty(K)||lt(r,i,K,null,c,re)}}for(var G in c){var K=c[G];if(re=o[G],c.hasOwnProperty(G)&&(K!=null||re!=null))switch(G){case"type":x=K;break;case"name":p=K;break;case"checked":F=K;break;case"defaultChecked":Q=K;break;case"value":k=K;break;case"defaultValue":_=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:K!==re&<(r,i,G,K,c,re)}}Md(r,k,_,M,F,Q,x,p);return;case"select":K=k=_=G=null;for(x in o)if(M=o[x],o.hasOwnProperty(x)&&M!=null)switch(x){case"value":break;case"multiple":K=M;default:c.hasOwnProperty(x)||lt(r,i,x,null,c,M)}for(p in c)if(x=c[p],M=o[p],c.hasOwnProperty(p)&&(x!=null||M!=null))switch(p){case"value":G=x;break;case"defaultValue":_=x;break;case"multiple":k=x;default:x!==M&<(r,i,p,x,c,M)}i=_,o=k,c=K,G!=null?Zi(r,!!o,G,!1):!!c!=!!o&&(i!=null?Zi(r,!!o,i,!0):Zi(r,!!o,o?[]:"",!1));return;case"textarea":K=G=null;for(_ in o)if(p=o[_],o.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:lt(r,i,_,null,c,p)}for(k in c)if(p=c[k],x=o[k],c.hasOwnProperty(k)&&(p!=null||x!=null))switch(k){case"value":G=p;break;case"defaultValue":K=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==x&<(r,i,k,p,c,x)}Ax(r,G,K);return;case"option":for(var ge in o)G=o[ge],o.hasOwnProperty(ge)&&G!=null&&!c.hasOwnProperty(ge)&&(ge==="selected"?r.selected=!1:lt(r,i,ge,null,c,G));for(M in c)G=c[M],K=o[M],c.hasOwnProperty(M)&&G!==K&&(G!=null||K!=null)&&(M==="selected"?r.selected=G&&typeof G!="function"&&typeof G!="symbol":lt(r,i,M,G,c,K));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 je in o)G=o[je],o.hasOwnProperty(je)&&G!=null&&!c.hasOwnProperty(je)&<(r,i,je,null,c,G);for(F in c)if(G=c[F],K=o[F],c.hasOwnProperty(F)&&G!==K&&(G!=null||K!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(a(137,i));break;default:lt(r,i,F,G,c,K)}return;default:if($d(i)){for(var ut in o)G=o[ut],o.hasOwnProperty(ut)&&G!==void 0&&!c.hasOwnProperty(ut)&&Sh(r,i,ut,void 0,c,G);for(Q in c)G=c[Q],K=o[Q],!c.hasOwnProperty(Q)||G===K||G===void 0&&K===void 0||Sh(r,i,Q,G,c,K);return}}for(var U in o)G=o[U],o.hasOwnProperty(U)&&G!=null&&!c.hasOwnProperty(U)&<(r,i,U,null,c,G);for(re in c)G=c[re],K=o[re],!c.hasOwnProperty(re)||G===K||G==null&&K==null||lt(r,i,re,G,c,K)}function Dv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lC(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],x=p.transferSize,k=p.initiatorType,_=p.duration;if(x&&_&&Dv(k)){for(k=0,_=p.responseEnd,c+=1;c<o.length;c++){var M=o[c],F=M.startTime;if(F>_)break;var Q=M.transferSize,re=M.initiatorType;Q&&Dv(re)&&(M=M.responseEnd,k+=Q*(M<_?1:(_-F)/(M-F)))}if(--c,i+=8*(x+k)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var zh=null,_h=null;function Wu(r){return r.nodeType===9?r:r.ownerDocument}function $v(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lv(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function jh(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Nh=null;function uC(){var r=window.event;return r&&r.type==="popstate"?r===Nh?!1:(Nh=r,!0):(Nh=null,!1)}var Pv=typeof setTimeout=="function"?setTimeout:void 0,cC=typeof clearTimeout=="function"?clearTimeout:void 0,Uv=typeof Promise=="function"?Promise:void 0,dC=typeof queueMicrotask=="function"?queueMicrotask:typeof Uv<"u"?function(r){return Uv.resolve(null).then(r).catch(fC)}:Pv;function fC(r){setTimeout(function(){throw r})}function Ca(r){return r==="head"}function Vv(r,i){var o=i,c=0;do{var p=o.nextSibling;if(r.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){r.removeChild(p),vs(i);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")Yo(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,Yo(o);for(var x=o.firstChild;x;){var k=x.nextSibling,_=x.nodeName;x[fo]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=k}}else o==="body"&&Yo(r.ownerDocument.body);o=p}while(o);vs(i)}function Bv(r,i){var o=r;r=0;do{var c=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(r===0)break;r--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||r++;o=c}while(o)}function Ch(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Ch(o),Od(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function hC(r,i,o,c){for(;r.nodeType===1;){var p=o;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[fo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(x=r.getAttribute("rel"),x==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(x!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(x=r.getAttribute("src"),(x!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===x)return r}else return r;if(r=nr(r.nextSibling),r===null)break}return null}function mC(r,i,o){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=nr(r.nextSibling),r===null))return null;return r}function Zv(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=nr(r.nextSibling),r===null))return null;return r}function Eh(r){return r.data==="$?"||r.data==="$~"}function Th(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function pC(r,i){var o=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||o.readyState!=="loading")i();else{var c=function(){i(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function nr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Ah=null;function Iv(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="/$"||o==="/&"){if(i===0)return nr(r.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}r=r.nextSibling}return null}function Hv(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return r;i--}else o!=="/$"&&o!=="/&"||i++}r=r.previousSibling}return null}function Fv(r,i,o){switch(i=Wu(o),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Yo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Od(r)}var rr=new Map,qv=new Set;function ec(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ta=J.d;J.d={f:gC,r:xC,D:yC,C:bC,L:vC,m:kC,X:SC,S:wC,M:zC};function gC(){var r=ta.f(),i=Fu();return r||i}function xC(r){var i=Ui(r);i!==null&&i.tag===5&&i.type==="form"?ub(i):ta.r(r)}var xs=typeof document>"u"?null:document;function Gv(r,i,o){var c=xs;if(c&&typeof i=="string"&&i){var p=Kn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),qv.has(p)||(qv.add(p),r={rel:r,crossOrigin:o,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),on(i,"link",r),Wt(i),c.head.appendChild(i)))}}function yC(r){ta.D(r),Gv("dns-prefetch",r,null)}function bC(r,i){ta.C(r,i),Gv("preconnect",r,i)}function vC(r,i,o){ta.L(r,i,o);var c=xs;if(c&&r&&i){var p='link[rel="preload"][as="'+Kn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Kn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Kn(o.imageSizes)+'"]')):p+='[href="'+Kn(r)+'"]';var x=p;switch(i){case"style":x=ys(r);break;case"script":x=bs(r)}rr.has(x)||(r=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),rr.set(x,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Ko(x))||i==="script"&&c.querySelector(Xo(x))||(i=c.createElement("link"),on(i,"link",r),Wt(i),c.head.appendChild(i)))}}function kC(r,i){ta.m(r,i);var o=xs;if(o&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Kn(c)+'"][href="'+Kn(r)+'"]',x=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=bs(r)}if(!rr.has(x)&&(r=y({rel:"modulepreload",href:r},i),rr.set(x,r),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Xo(x)))return}c=o.createElement("link"),on(c,"link",r),Wt(c),o.head.appendChild(c)}}}function wC(r,i,o){ta.S(r,i,o);var c=xs;if(c&&r){var p=Vi(c).hoistableStyles,x=ys(r);i=i||"default";var k=p.get(x);if(!k){var _={loading:0,preload:null};if(k=c.querySelector(Ko(x)))_.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},o),(o=rr.get(x))&&Oh(r,o);var M=k=c.createElement("link");Wt(M),on(M,"link",r),M._p=new Promise(function(F,Q){M.onload=F,M.onerror=Q}),M.addEventListener("load",function(){_.loading|=1}),M.addEventListener("error",function(){_.loading|=2}),_.loading|=4,tc(k,i,c)}k={type:"stylesheet",instance:k,count:1,state:_},p.set(x,k)}}}function SC(r,i){ta.X(r,i);var o=xs;if(o&&r){var c=Vi(o).hoistableScripts,p=bs(r),x=c.get(p);x||(x=o.querySelector(Xo(p)),x||(r=y({src:r,async:!0},i),(i=rr.get(p))&&Rh(r,i),x=o.createElement("script"),Wt(x),on(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function zC(r,i){ta.M(r,i);var o=xs;if(o&&r){var c=Vi(o).hoistableScripts,p=bs(r),x=c.get(p);x||(x=o.querySelector(Xo(p)),x||(r=y({src:r,async:!0,type:"module"},i),(i=rr.get(p))&&Rh(r,i),x=o.createElement("script"),Wt(x),on(x,"link",r),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(p,x))}}function Yv(r,i,o,c){var p=(p=he.current)?ec(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=ys(o.href),o=Vi(p).hoistableStyles,c=o.get(i),c||(c={type:"style",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=ys(o.href);var x=Vi(p).hoistableStyles,k=x.get(r);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(r,k),(x=p.querySelector(Ko(r)))&&!x._p&&(k.instance=x,k.state.loading=5),rr.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},rr.set(r,o),x||_C(p,r,o,k.state))),i&&c===null)throw Error(a(528,""));return k}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=bs(o),o=Vi(p).hoistableScripts,c=o.get(i),c||(c={type:"script",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ys(r){return'href="'+Kn(r)+'"'}function Ko(r){return'link[rel="stylesheet"]['+r+"]"}function Kv(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function _C(r,i,o,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),on(i,"link",o),Wt(i),r.head.appendChild(i))}function bs(r){return'[src="'+Kn(r)+'"]'}function Xo(r){return"script[async]"+r}function Xv(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+Kn(o.href)+'"]');if(c)return i.instance=c,Wt(c),c;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Wt(c),on(c,"style",p),tc(c,o.precedence,r),i.instance=c;case"stylesheet":p=ys(o.href);var x=r.querySelector(Ko(p));if(x)return i.state.loading|=4,i.instance=x,Wt(x),x;c=Kv(o),(p=rr.get(p))&&Oh(c,p),x=(r.ownerDocument||r).createElement("link"),Wt(x);var k=x;return k._p=new Promise(function(_,M){k.onload=_,k.onerror=M}),on(x,"link",c),i.state.loading|=4,tc(x,o.precedence,r),i.instance=x;case"script":return x=bs(o.src),(p=r.querySelector(Xo(x)))?(i.instance=p,Wt(p),p):(c=o,(p=rr.get(x))&&(c=y({},o),Rh(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Wt(p),on(p,"link",c),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,tc(c,o.precedence,r));return i.instance}function tc(r,i,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,x=p,k=0;k<c.length;k++){var _=c[k];if(_.dataset.precedence===i)x=_;else if(x!==p)break}x?x.parentNode.insertBefore(r,x.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(r,i.firstChild))}function Oh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Rh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var nc=null;function Jv(r,i,o){if(nc===null){var c=new Map,p=nc=new Map;p.set(o,c)}else p=nc,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(r))return c;for(c.set(r,null),o=o.getElementsByTagName(r),p=0;p<o.length;p++){var x=o[p];if(!(x[fo]||x[nn]||r==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(i)||"";k=r+k;var _=c.get(k);_?_.push(x):c.set(k,[x])}}return c}function Qv(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function jC(r,i,o){if(o===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Wv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function NC(r,i,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=ys(c.href),x=i.querySelector(Ko(p));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=rc.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=x,Wt(x);return}x=i.ownerDocument||i,c=Kv(c),(p=rr.get(p))&&Oh(c,p),x=x.createElement("link"),Wt(x);var k=x;k._p=new Promise(function(_,M){k.onload=_,k.onerror=M}),on(x,"link",c),o.instance=x}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=rc.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var Mh=0;function CC(r,i){return r.stylesheets&&r.count===0&&ic(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var c=setTimeout(function(){if(r.stylesheets&&ic(r,r.stylesheets),r.unsuspend){var x=r.unsuspend;r.unsuspend=null,x()}},6e4+i);0<r.imgBytes&&Mh===0&&(Mh=62500*lC());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ic(r,r.stylesheets),r.unsuspend)){var x=r.unsuspend;r.unsuspend=null,x()}},(r.imgBytes>Mh?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ic(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ac=null;function ic(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ac=new Map,i.forEach(EC,r),ac=null,rc.call(r))}function EC(r,i){if(!(i.state.loading&4)){var o=ac.get(r);if(o)var c=o.get(null);else{o=new Map,ac.set(r,o);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var k=p[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(o.set(k.dataset.precedence,k),c=k)}c&&o.set(null,c)}p=i.instance,k=p.getAttribute("data-precedence"),x=o.get(k)||c,x===c&&o.set(null,p),o.set(k,p),this.count++,c=rc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),x?x.parentNode.insertBefore(p,x.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Jo={$$typeof:N,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function TC(r,i,o,c,p,x,k,_,M){this.tag=1,this.containerInfo=r,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=Cd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cd(0),this.hiddenUpdates=Cd(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function e0(r,i,o,c,p,x,k,_,M,F,Q,re){return r=new TC(r,i,o,k,M,F,Q,re,_),i=1,x===!0&&(i|=24),x=Pn(3,null,null,i),r.current=x,x.stateNode=r,i=hf(),i.refCount++,r.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:o,cache:i},xf(x),r}function t0(r){return r?(r=Xi,r):Xi}function n0(r,i,o,c,p,x){p=t0(p),c.context===null?c.context=p:c.pendingContext=p,c=xa(i),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=ya(r,c,i),o!==null&&(Tn(o,r,i),Eo(o,r,i))}function r0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function Dh(r,i){r0(r,i),(r=r.alternate)&&r0(r,i)}function a0(r){if(r.tag===13||r.tag===31){var i=si(r,67108864);i!==null&&Tn(i,r,67108864),Dh(r,67108864)}}function i0(r){if(r.tag===13||r.tag===31){var i=In();i=Ed(i);var o=si(r,i);o!==null&&Tn(o,r,i),Dh(r,i)}}var sc=!0;function AC(r,i,o,c){var p=P.T;P.T=null;var x=J.p;try{J.p=2,$h(r,i,o,c)}finally{J.p=x,P.T=p}}function OC(r,i,o,c){var p=P.T;P.T=null;var x=J.p;try{J.p=8,$h(r,i,o,c)}finally{J.p=x,P.T=p}}function $h(r,i,o,c){if(sc){var p=Lh(c);if(p===null)wh(r,i,c,oc,o),o0(r,c);else if(MC(p,r,i,o,c))c.stopPropagation();else if(o0(r,c),i&4&&-1<RC.indexOf(r)){for(;p!==null;){var x=Ui(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=ti(x.pendingLanes);if(k!==0){var _=x;for(_.pendingLanes|=2,_.entangledLanes|=2;k;){var M=1<<31-ct(k);_.entanglements[1]|=M,k&=~M}Nr(x),(Je&6)===0&&(Iu=gt()+500,Fo(0))}}break;case 31:case 13:_=si(x,2),_!==null&&Tn(_,x,2),Fu(),Dh(x,2)}if(x=Lh(c),x===null&&wh(r,i,c,oc,o),x===p)break;p=x}p!==null&&c.stopPropagation()}else wh(r,i,c,null,o)}}function Lh(r){return r=Pd(r),Ph(r)}var oc=null;function Ph(r){if(oc=null,r=Pi(r),r!==null){var i=u(r);if(i===null)r=null;else{var o=i.tag;if(o===13){if(r=l(i),r!==null)return r;r=null}else if(o===31){if(r=f(i),r!==null)return r;r=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return oc=r,null}function s0(r){switch(r){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($i()){case W:return 2;case ce:return 8;case we:case Ce:return 32;case He:return 268435456;default:return 32}default:return 32}}var Uh=!1,Ea=null,Ta=null,Aa=null,Qo=new Map,Wo=new Map,Oa=[],RC="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 o0(r,i){switch(r){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":Qo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wo.delete(i.pointerId)}}function el(r,i,o,c,p,x){return r===null||r.nativeEvent!==x?(r={blockedOn:i,domEventName:o,eventSystemFlags:c,nativeEvent:x,targetContainers:[p]},i!==null&&(i=Ui(i),i!==null&&a0(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function MC(r,i,o,c,p){switch(i){case"focusin":return Ea=el(Ea,r,i,o,c,p),!0;case"dragenter":return Ta=el(Ta,r,i,o,c,p),!0;case"mouseover":return Aa=el(Aa,r,i,o,c,p),!0;case"pointerover":var x=p.pointerId;return Qo.set(x,el(Qo.get(x)||null,r,i,o,c,p)),!0;case"gotpointercapture":return x=p.pointerId,Wo.set(x,el(Wo.get(x)||null,r,i,o,c,p)),!0}return!1}function l0(r){var i=Pi(r.target);if(i!==null){var o=u(i);if(o!==null){if(i=o.tag,i===13){if(i=l(o),i!==null){r.blockedOn=i,wx(r.priority,function(){i0(o)});return}}else if(i===31){if(i=f(o),i!==null){r.blockedOn=i,wx(r.priority,function(){i0(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){r.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}r.blockedOn=null}function lc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=Lh(r.nativeEvent);if(o===null){o=r.nativeEvent;var c=new o.constructor(o.type,o);Ld=c,o.target.dispatchEvent(c),Ld=null}else return i=Ui(o),i!==null&&a0(i),r.blockedOn=o,!1;i.shift()}return!0}function u0(r,i,o){lc(r)&&o.delete(i)}function DC(){Uh=!1,Ea!==null&&lc(Ea)&&(Ea=null),Ta!==null&&lc(Ta)&&(Ta=null),Aa!==null&&lc(Aa)&&(Aa=null),Qo.forEach(u0),Wo.forEach(u0)}function uc(r,i){r.blockedOn===i&&(r.blockedOn=null,Uh||(Uh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,DC)))}var cc=null;function c0(r){cc!==r&&(cc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){cc===r&&(cc=null);for(var i=0;i<r.length;i+=3){var o=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Ph(c||o)===null)continue;break}var x=Ui(o);x!==null&&(r.splice(i,3),i-=3,Lf(x,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function vs(r){function i(M){return uc(M,r)}Ea!==null&&uc(Ea,r),Ta!==null&&uc(Ta,r),Aa!==null&&uc(Aa,r),Qo.forEach(i),Wo.forEach(i);for(var o=0;o<Oa.length;o++){var c=Oa[o];c.blockedOn===r&&(c.blockedOn=null)}for(;0<Oa.length&&(o=Oa[0],o.blockedOn===null);)l0(o),o.blockedOn===null&&Oa.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],x=o[c+1],k=p[zn]||null;if(typeof x=="function")k||c0(o);else if(k){var _=null;if(x&&x.hasAttribute("formAction")){if(p=x,k=x[zn]||null)_=k.formAction;else if(Ph(p)!==null)continue}else _=k.action;typeof _=="function"?o[c+1]=_:(o.splice(c,3),c-=3),c0(o)}}}function d0(){function r(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Vh(r){this._internalRoot=r}dc.prototype.render=Vh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,c=In();n0(o,c,r,i,null,null)},dc.prototype.unmount=Vh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;n0(r.current,2,null,r,null,null),Fu(),i[Li]=null}};function dc(r){this._internalRoot=r}dc.prototype.unstable_scheduleHydration=function(r){if(r){var i=kx();r={blockedOn:null,target:r,priority:i};for(var o=0;o<Oa.length&&i!==0&&i<Oa[o].priority;o++);Oa.splice(o,0,r),o===0&&l0(r)}};var f0=t.version;if(f0!=="19.2.4")throw Error(a(527,f0,"19.2.4"));J.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var $C={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{gn=fc.inject($C),Yt=fc}catch{}}return nl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var o=!1,c="",p=bb,x=vb,k=kb;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=e0(r,1,!1,null,null,o,c,null,p,x,k,d0),r[Li]=i.current,kh(r),new Vh(i)},nl.hydrateRoot=function(r,i,o){if(!s(r))throw Error(a(299));var c=!1,p="",x=bb,k=vb,_=kb,M=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(x=o.onUncaughtError),o.onCaughtError!==void 0&&(k=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(M=o.formState)),i=e0(r,1,!0,i,o??null,c,p,M,x,k,_,d0),i.context=t0(null),o=i.current,c=In(),c=Ed(c),p=xa(c),p.callback=null,ya(o,p,c),o=c,i.current.lanes=o,co(i,o),Nr(i),r[Li]=i.current,kh(r),new dc(i)},nl.version="19.2.4",nl}var w0;function qC(){if(w0)return Ih.exports;w0=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(),Ih.exports=FC(),Ih.exports}var GC=qC();var S0="popstate";function YC(e={}){function t(a,s){let{pathname:u,search:l,hash:f}=a.location;return Fm("",{pathname:u,search:l,hash:f},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:jl(s)}return XC(t,n,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function br(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function KC(){return Math.random().toString(36).substring(2,10)}function z0(e,t){return{usr:e.state,key:e.key,idx:t}}function Fm(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xs(t):t,state:n,key:t&&t.key||a||KC()}}function jl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Xs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function XC(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:u=!1}=a,l=s.history,f="POP",h=null,m=g();m==null&&(m=0,l.replaceState({...l.state,idx:m},""));function g(){return(l.state||{idx:null}).idx}function y(){f="POP";let A=g(),E=A==null?null:A-m;m=A,h&&h({action:f,location:j.location,delta:E})}function v(A,E){f="PUSH";let O=Fm(j.location,A,E);m=g()+1;let N=z0(O,m),L=j.createHref(O);try{l.pushState(N,"",L)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(L)}u&&h&&h({action:f,location:j.location,delta:1})}function b(A,E){f="REPLACE";let O=Fm(j.location,A,E);m=g();let N=z0(O,m),L=j.createHref(O);l.replaceState(N,"",L),u&&h&&h({action:f,location:j.location,delta:0})}function S(A){return JC(A)}let j={get action(){return f},get location(){return e(s,l)},listen(A){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(S0,y),h=A,()=>{s.removeEventListener(S0,y),h=null}},createHref(A){return t(s,A)},createURL:S,encodeLocation(A){let E=S(A);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:b,go(A){return l.go(A)}};return j}function JC(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),wt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:jl(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function eS(e,t,n="/"){return QC(e,t,n,!1)}function QC(e,t,n,a){let s=typeof t=="string"?Xs(t):t,u=oa(s.pathname||"/",n);if(u==null)return null;let l=tS(e);WC(l);let f=null;for(let h=0;f==null&&h<l.length;++h){let m=cE(u);f=lE(l[h],m,a)}return f}function tS(e,t=[],n=[],a="",s=!1){let u=(l,f,h=s,m)=>{let g={relativePath:m===void 0?l.path||"":m,caseSensitive:l.caseSensitive===!0,childrenIndex:f,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;wt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let y=ia([a,g.relativePath]),v=n.concat(g);l.children&&l.children.length>0&&(wt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),tS(l.children,t,v,y,h)),!(l.path==null&&!l.index)&&t.push({path:y,score:sE(y,l.index),routesMeta:v})};return e.forEach((l,f)=>{if(l.path===""||!l.path?.includes("?"))u(l,f);else for(let h of nS(l.path))u(l,f,!0,h)}),t}function nS(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),u=n.replace(/\?$/,"");if(a.length===0)return s?[u,""]:[u];let l=nS(a.join("/")),f=[];return f.push(...l.map(h=>h===""?u:[u,h].join("/"))),s&&f.push(...l),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function WC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:oE(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var eE=/^:[\w-]+$/,tE=3,nE=2,rE=1,aE=10,iE=-2,_0=e=>e==="*";function sE(e,t){let n=e.split("/"),a=n.length;return n.some(_0)&&(a+=iE),t&&(a+=nE),n.filter(s=>!_0(s)).reduce((s,u)=>s+(eE.test(u)?tE:u===""?rE:aE),a)}function oE(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function lE(e,t,n=!1){let{routesMeta:a}=e,s={},u="/",l=[];for(let f=0;f<a.length;++f){let h=a[f],m=f===a.length-1,g=u==="/"?t:t.slice(u.length)||"/",y=Ic({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),v=h.route;if(!y&&m&&n&&!a[a.length-1].route.index&&(y=Ic({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!y)return null;Object.assign(s,y.params),l.push({params:s,pathname:ia([u,y.pathname]),pathnameBase:mE(ia([u,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(u=ia([u,y.pathnameBase]))}return l}function Ic(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=uE(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let u=s[0],l=u.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:a.reduce((m,{paramName:g,isOptional:y},v)=>{if(g==="*"){let S=f[v]||"";l=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const b=f[v];return y&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:l,pattern:e}}function uE(e,t=!1,n=!0){br(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 a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,f,h)=>(a.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function cE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return br(!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 oa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var dE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function fE(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Xs(e):e,u;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?u=j0(n.substring(1),"/"):u=j0(n,t)):u=t,{pathname:u,search:pE(a),hash:gE(s)}}function j0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Gh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function hE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Xp(e){let t=hE(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Jp(e,t,n,a=!1){let s;typeof e=="string"?s=Xs(e):(s={...e},wt(!s.pathname||!s.pathname.includes("?"),Gh("?","pathname","search",s)),wt(!s.pathname||!s.pathname.includes("#"),Gh("#","pathname","hash",s)),wt(!s.search||!s.search.includes("#"),Gh("#","search","hash",s)));let u=e===""||s.pathname==="",l=u?"/":s.pathname,f;if(l==null)f=n;else{let y=t.length-1;if(!a&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),y-=1;s.pathname=v.join("/")}f=y>=0?t[y]:"/"}let h=fE(s,f),m=l&&l!=="/"&&l.endsWith("/"),g=(u||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var ia=e=>e.join("/").replace(/\/\/+/g,"/"),mE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xE=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function yE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function bE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var rS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aS(e,t){let n=e;if(typeof n!="string"||!dE.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(rS)try{let u=new URL(window.location.href),l=n.startsWith("//")?new URL(u.protocol+n):new URL(n),f=oa(l.pathname,t);l.origin===u.origin&&f!=null?n=f+l.search+l.hash:s=!0}catch{br(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var iS=["POST","PUT","PATCH","DELETE"];new Set(iS);var vE=["GET",...iS];new Set(vE);var Js=z.createContext(null);Js.displayName="DataRouter";var cd=z.createContext(null);cd.displayName="DataRouterState";var kE=z.createContext(!1),sS=z.createContext({isTransitioning:!1});sS.displayName="ViewTransition";var wE=z.createContext(new Map);wE.displayName="Fetchers";var SE=z.createContext(null);SE.displayName="Await";var qn=z.createContext(null);qn.displayName="Navigation";var Bl=z.createContext(null);Bl.displayName="Location";var $r=z.createContext({outlet:null,matches:[],isDataRoute:!1});$r.displayName="Route";var Qp=z.createContext(null);Qp.displayName="RouteError";var oS="REACT_ROUTER_ERROR",zE="REDIRECT",_E="ROUTE_ERROR_RESPONSE";function jE(e){if(e.startsWith(`${oS}:${zE}:{`))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 NE(e){if(e.startsWith(`${oS}:${_E}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new xE(t.status,t.statusText,t.data)}catch{}}function CE(e,{relative:t}={}){wt(Qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=z.useContext(qn),{hash:s,pathname:u,search:l}=Zl(e,{relative:t}),f=u;return n!=="/"&&(f=u==="/"?n:ia([n,u])),a.createHref({pathname:f,search:l,hash:s})}function Qs(){return z.useContext(Bl)!=null}function Sr(){return wt(Qs(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Bl).location}var lS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uS(e){z.useContext(qn).static||z.useLayoutEffect(e)}function Wp(){let{isDataRoute:e}=z.useContext($r);return e?BE():EE()}function EE(){wt(Qs(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(Js),{basename:t,navigator:n}=z.useContext(qn),{matches:a}=z.useContext($r),{pathname:s}=Sr(),u=JSON.stringify(Xp(a)),l=z.useRef(!1);return uS(()=>{l.current=!0}),z.useCallback((h,m={})=>{if(br(l.current,lS),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=Jp(h,JSON.parse(u),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ia([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,u,s,e])}z.createContext(null);function Zl(e,{relative:t}={}){let{matches:n}=z.useContext($r),{pathname:a}=Sr(),s=JSON.stringify(Xp(n));return z.useMemo(()=>Jp(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function TE(e,t){return cS(e,t)}function cS(e,t,n,a,s){wt(Qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=z.useContext(qn),{matches:l}=z.useContext($r),f=l[l.length-1],h=f?f.params:{},m=f?f.pathname:"/",g=f?f.pathnameBase:"/",y=f&&f.route;{let O=y&&y.path||"";fS(m,!y||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${O}">) 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="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let v=Sr(),b;if(t){let O=typeof t=="string"?Xs(t):t;wt(g==="/"||O.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 "${O.pathname}" was given in the \`location\` prop.`),b=O}else b=v;let S=b.pathname||"/",j=S;if(g!=="/"){let O=g.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(O.length).join("/")}let A=eS(e,{pathname:j});br(y||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),br(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 E=DE(A&&A.map(O=>Object.assign({},O,{params:Object.assign({},h,O.params),pathname:ia([g,u.encodeLocation?u.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?g:ia([g,u.encodeLocation?u.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),l,n,a,s);return t&&E?z.createElement(Bl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}function AE(){let e=VE(),t=yE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:u},"ErrorBoundary")," or"," ",z.createElement("code",{style:u},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},t),n?z.createElement("pre",{style:s},n):null,l)}var OE=z.createElement(AE,null),dS=class extends z.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 n=NE(e.digest);n&&(e=n)}let t=e!==void 0?z.createElement($r.Provider,{value:this.props.routeContext},z.createElement(Qp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(RE,{error:e},t):t}};dS.contextType=kE;var Yh=new WeakMap;function RE({children:e,error:t}){let{basename:n}=z.useContext(qn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=jE(t.digest);if(a){let s=Yh.get(t);if(s)throw s;let u=aS(a.location,n);if(rS&&!Yh.get(t))if(u.isExternal||a.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:a.replace}));throw Yh.set(t,l),l}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function ME({routeContext:e,match:t,children:n}){let a=z.useContext(Js);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),z.createElement($r.Provider,{value:e},n)}function DE(e,t=[],n=null,a=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let u=e,l=n?.errors;if(l!=null){let g=u.findIndex(y=>y.route.id&&l?.[y.route.id]!==void 0);wt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),u=u.slice(0,Math.min(u.length,g+1))}let f=!1,h=-1;if(n)for(let g=0;g<u.length;g++){let y=u[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(h=g),y.route.id){let{loaderData:v,errors:b}=n,S=y.route.loader&&!v.hasOwnProperty(y.route.id)&&(!b||b[y.route.id]===void 0);if(y.route.lazy||S){f=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let m=n&&a?(g,y)=>{a(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:bE(n.matches),errorInfo:y})}:void 0;return u.reduceRight((g,y,v)=>{let b,S=!1,j=null,A=null;n&&(b=l&&y.route.id?l[y.route.id]:void 0,j=y.route.errorElement||OE,f&&(h<0&&v===0?(fS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,A=null):h===v&&(S=!0,A=y.route.hydrateFallbackElement||null)));let E=t.concat(u.slice(0,v+1)),O=()=>{let N;return b?N=j:S?N=A:y.route.Component?N=z.createElement(y.route.Component,null):y.route.element?N=y.route.element:N=g,z.createElement(ME,{match:y,routeContext:{outlet:g,matches:E,isDataRoute:n!=null},children:N})};return n&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?z.createElement(dS,{location:n.location,revalidation:n.revalidation,component:j,error:b,children:O(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:m}):O()},null)}function eg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $E(e){let t=z.useContext(Js);return wt(t,eg(e)),t}function LE(e){let t=z.useContext(cd);return wt(t,eg(e)),t}function PE(e){let t=z.useContext($r);return wt(t,eg(e)),t}function tg(e){let t=PE(e),n=t.matches[t.matches.length-1];return wt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function UE(){return tg("useRouteId")}function VE(){let e=z.useContext(Qp),t=LE("useRouteError"),n=tg("useRouteError");return e!==void 0?e:t.errors?.[n]}function BE(){let{router:e}=$E("useNavigate"),t=tg("useNavigate"),n=z.useRef(!1);return uS(()=>{n.current=!0}),z.useCallback(async(s,u={})=>{br(n.current,lS),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...u}))},[e,t])}var N0={};function fS(e,t,n){!t&&!N0[e]&&(N0[e]=!0,br(!1,n))}z.memo(ZE);function ZE({routes:e,future:t,state:n,onError:a}){return cS(e,void 0,n,a,t)}function hS({to:e,replace:t,state:n,relative:a}){wt(Qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=z.useContext(qn);br(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=z.useContext($r),{pathname:l}=Sr(),f=Wp(),h=Jp(e,Xp(u),l,a==="path"),m=JSON.stringify(h);return z.useEffect(()=>{f(JSON.parse(m),{replace:t,state:n,relative:a})},[f,m,a,t,n]),null}function tn(e){wt(!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 IE({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:u=!1,unstable_useTransitions:l}){wt(!Qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=z.useMemo(()=>({basename:f,navigator:s,static:u,unstable_useTransitions:l,future:{}}),[f,s,u,l]);typeof n=="string"&&(n=Xs(n));let{pathname:m="/",search:g="",hash:y="",state:v=null,key:b="default"}=n,S=z.useMemo(()=>{let j=oa(m,f);return j==null?null:{location:{pathname:j,search:g,hash:y,state:v,key:b},navigationType:a}},[f,m,g,y,v,b,a]);return br(S!=null,`<Router basename="${f}"> is not able to match the URL "${m}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:z.createElement(qn.Provider,{value:h},z.createElement(Bl.Provider,{children:t,value:S}))}function C0({children:e,location:t}){return TE(qm(e),t)}function qm(e,t=[]){let n=[];return z.Children.forEach(e,(a,s)=>{if(!z.isValidElement(a))return;let u=[...t,s];if(a.type===z.Fragment){n.push.apply(n,qm(a.props.children,u));return}wt(a.type===tn,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),wt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(l.children=qm(a.props.children,u)),n.push(l)}),n}var Mc="get",Dc="application/x-www-form-urlencoded";function dd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function HE(e){return dd(e)&&e.tagName.toLowerCase()==="button"}function FE(e){return dd(e)&&e.tagName.toLowerCase()==="form"}function qE(e){return dd(e)&&e.tagName.toLowerCase()==="input"}function GE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YE(e,t){return e.button===0&&(!t||t==="_self")&&!GE(e)}var hc=null;function KE(){if(hc===null)try{new FormData(document.createElement("form"),0),hc=!1}catch{hc=!0}return hc}var XE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kh(e){return e!=null&&!XE.has(e)?(br(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dc}"`),null):e}function JE(e,t){let n,a,s,u,l;if(FE(e)){let f=e.getAttribute("action");a=f?oa(f,t):null,n=e.getAttribute("method")||Mc,s=Kh(e.getAttribute("enctype"))||Dc,u=new FormData(e)}else if(HE(e)||qE(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(a=h?oa(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Mc,s=Kh(e.getAttribute("formenctype"))||Kh(f.getAttribute("enctype"))||Dc,u=new FormData(f,e),!KE()){let{name:m,type:g,value:y}=e;if(g==="image"){let v=m?`${m}.`:"";u.append(`${v}x`,"0"),u.append(`${v}y`,"0")}else m&&u.append(m,y)}}else{if(dd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Mc,a=null,s=Dc,l=e}return u&&s==="text/plain"&&(l=u,u=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:u,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ng(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function QE(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&oa(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function WE(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function eT(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 tT(e,t,n){let a=await Promise.all(e.map(async s=>{let u=t.routes[s.route.id];if(u){let l=await WE(u,n);return l.links?l.links():[]}return[]}));return iT(a.flat(1).filter(eT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function E0(e,t,n,a,s,u){let l=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,f=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return u==="assets"?t.filter((h,m)=>l(h,m)||f(h,m)):u==="data"?t.filter((h,m)=>{let g=a.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,m)||f(h,m))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function nT(e,t,{includeHydrateFallback:n}={}){return rT(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let u=[s.module];return s.clientActionModule&&(u=u.concat(s.clientActionModule)),s.clientLoaderModule&&(u=u.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(u=u.concat(s.hydrateFallbackModule)),s.imports&&(u=u.concat(s.imports)),u}).flat(1))}function rT(e){return[...new Set(e)]}function aT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function iT(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let u=JSON.stringify(aT(s));return n.has(u)||(n.add(u),a.push({key:u,link:s})),a},[])}function mS(){let e=z.useContext(Js);return ng(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function sT(){let e=z.useContext(cd);return ng(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var rg=z.createContext(void 0);rg.displayName="FrameworkContext";function pS(){let e=z.useContext(rg);return ng(e,"You must render this element inside a <HydratedRouter> element"),e}function oT(e,t){let n=z.useContext(rg),[a,s]=z.useState(!1),[u,l]=z.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:y}=t,v=z.useRef(null);z.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let j=E=>{E.forEach(O=>{l(O.isIntersecting)})},A=new IntersectionObserver(j,{threshold:.5});return v.current&&A.observe(v.current),()=>{A.disconnect()}}},[e]),z.useEffect(()=>{if(a){let j=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(j)}}},[a]);let b=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[u,v,{}]:[u,v,{onFocus:rl(f,b),onBlur:rl(h,S),onMouseEnter:rl(m,b),onMouseLeave:rl(g,S),onTouchStart:rl(y,b)}]:[!1,v,{}]}function rl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function lT({page:e,...t}){let{router:n}=mS(),a=z.useMemo(()=>eS(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?z.createElement(cT,{page:e,matches:a,...t}):null}function uT(e){let{manifest:t,routeModules:n}=pS(),[a,s]=z.useState([]);return z.useEffect(()=>{let u=!1;return tT(e,t,n).then(l=>{u||s(l)}),()=>{u=!0}},[e,t,n]),a}function cT({page:e,matches:t,...n}){let a=Sr(),{future:s,manifest:u,routeModules:l}=pS(),{basename:f}=mS(),{loaderData:h,matches:m}=sT(),g=z.useMemo(()=>E0(e,t,m,u,a,"data"),[e,t,m,u,a]),y=z.useMemo(()=>E0(e,t,m,u,a,"assets"),[e,t,m,u,a]),v=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,A=!1;if(t.forEach(O=>{let N=u.routes[O.route.id];!N||!N.hasLoader||(!g.some(L=>L.route.id===O.route.id)&&O.route.id in h&&l[O.route.id]?.shouldRevalidate||N.hasClientLoader?A=!0:j.add(O.route.id))}),j.size===0)return[];let E=QE(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return A&&j.size>0&&E.searchParams.set("_routes",t.filter(O=>j.has(O.route.id)).map(O=>O.route.id).join(",")),[E.pathname+E.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,a,u,g,t,e,l]),b=z.useMemo(()=>nT(y,u),[y,u]),S=uT(y);return z.createElement(z.Fragment,null,v.map(j=>z.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),b.map(j=>z.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),S.map(({key:j,link:A})=>z.createElement("link",{key:j,nonce:n.nonce,...A,crossOrigin:A.crossOrigin??n.crossOrigin})))}function dT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var fT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fT&&(window.__reactRouterVersion="7.13.0")}catch{}function hT({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=z.useRef();s.current==null&&(s.current=YC({window:a,v5Compat:!0}));let u=s.current,[l,f]=z.useState({action:u.action,location:u.location}),h=z.useCallback(m=>{n===!1?f(m):z.startTransition(()=>f(m))},[n]);return z.useLayoutEffect(()=>u.listen(h),[u,h]),z.createElement(IE,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:u,unstable_useTransitions:n})}var gS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Va=z.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:u,replace:l,state:f,target:h,to:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},S){let{basename:j,unstable_useTransitions:A}=z.useContext(qn),E=typeof m=="string"&&gS.test(m),O=aS(m,j);m=O.to;let N=CE(m,{relative:s}),[L,D,R]=oT(a,b),q=xT(m,{replace:l,state:f,target:h,preventScrollReset:g,relative:s,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:A});function B(fe){t&&t(fe),fe.defaultPrevented||q(fe)}let X=z.createElement("a",{...b,...R,href:O.absoluteURL||N,onClick:O.isExternal||u?t:B,ref:dT(S,D),target:h,"data-discover":!E&&n==="render"?"true":void 0});return L&&!E?z.createElement(z.Fragment,null,X,z.createElement(lT,{page:N})):X});Va.displayName="Link";var mT=z.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:u,to:l,viewTransition:f,children:h,...m},g){let y=Zl(l,{relative:m.relative}),v=Sr(),b=z.useContext(cd),{navigator:S,basename:j}=z.useContext(qn),A=b!=null&&wT(y)&&f===!0,E=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,O=v.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(O=O.toLowerCase(),N=N?N.toLowerCase():null,E=E.toLowerCase()),N&&j&&(N=oa(N,j)||N);const L=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=O===E||!s&&O.startsWith(E)&&O.charAt(L)==="/",R=N!=null&&(N===E||!s&&N.startsWith(E)&&N.charAt(E.length)==="/"),q={isActive:D,isPending:R,isTransitioning:A},B=D?t:void 0,X;typeof a=="function"?X=a(q):X=[a,D?"active":null,R?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(q):u;return z.createElement(Va,{...m,"aria-current":B,className:X,ref:g,style:fe,to:l,viewTransition:f},typeof h=="function"?h(q):h)});mT.displayName="NavLink";var pT=z.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:u,method:l=Mc,action:f,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:j}=z.useContext(qn),A=vT(),E=kT(f,{relative:m}),O=l.toLowerCase()==="get"?"get":"post",N=typeof f=="string"&&gS.test(f),L=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,q=R?.getAttribute("formmethod")||l,B=()=>A(R||D.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:s,state:u,relative:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v});j&&n!==!1?z.startTransition(()=>B()):B()};return z.createElement("form",{ref:S,method:O,action:E,onSubmit:a?h:L,...b,"data-discover":!N&&e==="render"?"true":void 0})});pT.displayName="Form";function gT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xS(e){let t=z.useContext(Js);return wt(t,gT(e)),t}function xT(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=Wp(),g=Sr(),y=Zl(e,{relative:u});return z.useCallback(v=>{if(YE(v,t)){v.preventDefault();let b=n!==void 0?n:jl(g)===jl(y),S=()=>m(e,{replace:b,state:a,preventScrollReset:s,relative:u,viewTransition:l,unstable_defaultShouldRevalidate:f});h?z.startTransition(()=>S()):S()}},[g,m,y,n,a,t,e,s,u,l,f,h])}var yT=0,bT=()=>`__${String(++yT)}__`;function vT(){let{router:e}=xS("useSubmit"),{basename:t}=z.useContext(qn),n=UE(),a=e.fetch,s=e.navigate;return z.useCallback(async(u,l={})=>{let{action:f,method:h,encType:m,formData:g,body:y}=JE(u,t);if(l.navigate===!1){let v=l.fetcherKey||bT();await a(v,n,l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:y,formMethod:l.method||h,formEncType:l.encType||m,flushSync:l.flushSync})}else await s(l.action||f,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:y,formMethod:l.method||h,formEncType:l.encType||m,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[a,s,t,n])}function kT(e,{relative:t}={}){let{basename:n}=z.useContext(qn),a=z.useContext($r);wt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),u={...Zl(e||".",{relative:t})},l=Sr();if(e==null){u.search=l.search;let f=new URLSearchParams(u.search),h=f.getAll("index");if(h.some(g=>g==="")){f.delete("index"),h.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:ia([n,u.pathname])),jl(u)}function wT(e,{relative:t}={}){let n=z.useContext(sS);wt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=xS("useViewTransitionState"),s=Zl(e,{relative:t});if(!n.isTransitioning)return!1;let u=oa(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=oa(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Ic(s.pathname,l)!=null||Ic(s.pathname,u)!=null}const yS=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const ST=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const zT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const T0=e=>{const t=zT(e);return t.charAt(0).toUpperCase()+t.slice(1)};var _T={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 jT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const NT=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:u,iconNode:l,...f},h)=>z.createElement("svg",{ref:h,..._T,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:yS("lucide",s),...!u&&!jT(f)&&{"aria-hidden":"true"},...f},[...l.map(([m,g])=>z.createElement(m,g)),...Array.isArray(u)?u:[u]]));const ke=(e,t)=>{const n=z.forwardRef(({className:a,...s},u)=>z.createElement(NT,{ref:u,iconNode:t,className:yS(`lucide-${ST(T0(e))}`,`lucide-${e}`,a),...s}));return n.displayName=T0(e),n};const CT=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Cs=ke("activity",CT);const ET=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],TT=ke("archive",ET);const AT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],bS=ke("arrow-down",AT);const OT=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],RT=ke("arrow-left",OT);const MT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],vS=ke("arrow-up",MT);const DT=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$T=ke("ban",DT);const LT=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Nl=ke("bell",LT);const PT=[["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"}]],A0=ke("bot",PT);const UT=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],VT=ke("box",UT);const BT=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ZT=ke("brain",BT);const IT=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],kS=ke("calendar",IT);const HT=[["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"}]],Gm=ke("chart-column",HT);const FT=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],qT=ke("check-check",FT);const GT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ym=ke("check",GT);const YT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],KT=ke("chevron-down",YT);const XT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],JT=ke("chevron-right",XT);const QT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],WT=ke("chevron-up",QT);const eA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wS=ke("circle-check",eA);const tA=[["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"}]],Km=ke("circle-x",tA);const nA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ia=ke("clock",nA);const rA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],aA=ke("copy",rA);const iA=[["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"}]],SS=ke("cpu",iA);const sA=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$s=ke("database",sA);const oA=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Hc=ke("dollar-sign",oA);const lA=[["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"}]],Il=ke("eye",lA);const uA=[["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"}]],cA=ke("file-text",uA);const dA=[["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"}]],fA=ke("folder-open",dA);const hA=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],mA=ke("funnel",hA);const pA=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],gA=ke("hash",pA);const xA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],yA=ke("history",xA);const bA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vA=ke("info",bA);const kA=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],O0=ke("layout-dashboard",kA);const wA=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Xm=ke("list-checks",wA);const SA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zA=ke("loader-circle",SA);const _A=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],R0=ke("log-out",_A);const jA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],NA=ke("menu",jA);const CA=[["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"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],M0=ke("message-square-plus",CA);const EA=[["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"}]],Cl=ke("message-square",EA);const TA=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],zS=ke("moon",TA);const AA=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],OA=ke("pause",AA);const RA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],MA=ke("pen",RA);const DA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ag=ke("pencil",DA);const $A=[["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"}]],LA=ke("play",$A);const PA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fd=ke("plus",PA);const UA=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],D0=ke("puzzle",UA);const VA=[["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"}]],yl=ke("refresh-cw",VA);const BA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],$0=ke("rotate-ccw",BA);const ZA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],IA=ke("search",ZA);const HA=[["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"}]],FA=ke("send",HA);const qA=[["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"}]],L0=ke("settings",qA);const GA=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],P0=ke("shield-check",GA);const YA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],_S=ke("sun",YA);const KA=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],ig=ke("tag",KA);const XA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Jm=ke("terminal",XA);const JA=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],jS=ke("toggle-left",JA);const QA=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],NS=ke("toggle-right",QA);const WA=[["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"}]],Ti=ke("trash-2",WA);const e4=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],t4=ke("trending-up",e4);const n4=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],sg=ke("user",n4);const r4=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],El=ke("wand-sparkles",r4);const a4=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Qm=ke("webhook",a4);const i4=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],s4=ke("wifi-off",i4);const o4=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Xh=ke("wifi",o4);const l4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],og=ke("x",l4);var Jh={exports:{}},Qh={};var U0;function u4(){if(U0)return Qh;U0=1;var e=ud();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function f(y,v){var b=v(),S=a({inst:{value:b,getSnapshot:v}}),j=S[0].inst,A=S[1];return u(function(){j.value=b,j.getSnapshot=v,h(j)&&A({inst:j})},[y,b,v]),s(function(){return h(j)&&A({inst:j}),y(function(){h(j)&&A({inst:j})})},[y]),l(b),b}function h(y){var v=y.getSnapshot;y=y.value;try{var b=v();return!n(y,b)}catch{return!0}}function m(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Qh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Qh}var V0;function c4(){return V0||(V0=1,Jh.exports=u4()),Jh.exports}var B0=c4();const CS=0,ES=1,TS=2,Z0=3;var I0=Object.prototype.hasOwnProperty;function Wm(e,t){var n,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((a=e.length)===t.length)for(;a--&&Wm(e[a],t[a]););return a===-1}if(!n||typeof e=="object"){a=0;for(n in e)if(I0.call(e,n)&&++a&&!I0.call(t,n)||!(n in t)||!Wm(e[n],t[n]))return!1;return Object.keys(t).length===a}}return e!==e&&t!==t}const ra=new WeakMap,aa=()=>{},fn=aa(),ep=Object,Fe=e=>e===fn,Tr=e=>typeof e=="function",Ha=(e,t)=>({...e,...t}),AS=e=>Tr(e.then),Wh={},mc={},lg="undefined",Hl=typeof window!=lg,tp=typeof document!=lg,d4=Hl&&"Deno"in window,f4=()=>Hl&&typeof window.requestAnimationFrame!=lg,OS=(e,t)=>{const n=ra.get(e);return[()=>!Fe(t)&&e.get(t)||Wh,a=>{if(!Fe(t)){const s=e.get(t);t in mc||(mc[t]=s),n[5](t,Ha(s,a),s||Wh)}},n[6],()=>!Fe(t)&&t in mc?mc[t]:!Fe(t)&&e.get(t)||Wh]};let np=!0;const h4=()=>np,[rp,ap]=Hl&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[aa,aa],m4=()=>{const e=tp&&document.visibilityState;return Fe(e)||e!=="hidden"},p4=e=>(tp&&document.addEventListener("visibilitychange",e),rp("focus",e),()=>{tp&&document.removeEventListener("visibilitychange",e),ap("focus",e)}),g4=e=>{const t=()=>{np=!0,e()},n=()=>{np=!1};return rp("online",t),rp("offline",n),()=>{ap("online",t),ap("offline",n)}},x4={isOnline:h4,isVisible:m4},y4={initFocus:p4,initReconnect:g4},H0=!Kp.useId,Ls=!Hl||d4,b4=e=>f4()?window.requestAnimationFrame(e):setTimeout(e,1),em=Ls?z.useEffect:z.useLayoutEffect,tm=typeof navigator<"u"&&navigator.connection,F0=!Ls&&tm&&(["slow-2g","2g"].includes(tm.effectiveType)||tm.saveData),pc=new WeakMap,v4=e=>ep.prototype.toString.call(e),nm=(e,t)=>e===`[object ${t}]`;let k4=0;const ip=e=>{const t=typeof e,n=v4(e),a=nm(n,"Date"),s=nm(n,"RegExp"),u=nm(n,"Object");let l,f;if(ep(e)===e&&!a&&!s){if(l=pc.get(e),l)return l;if(l=++k4+"~",pc.set(e,l),Array.isArray(e)){for(l="@",f=0;f<e.length;f++)l+=ip(e[f])+",";pc.set(e,l)}if(u){l="#";const h=ep.keys(e).sort();for(;!Fe(f=h.pop());)Fe(e[f])||(l+=f+":"+ip(e[f])+",");pc.set(e,l)}}else l=a?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return l},ug=e=>{if(Tr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ip(e):"",[e,t]};let w4=0;const sp=()=>++w4;async function RS(...e){const[t,n,a,s]=e,u=Ha({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let l=u.populateCache;const f=u.rollbackOnError;let h=u.optimisticData;const m=v=>typeof f=="function"?f(v):f!==!1,g=u.throwOnError;if(Tr(n)){const v=n,b=[],S=t.keys();for(const j of S)!/^\$(inf|sub)\$/.test(j)&&v(t.get(j)._k)&&b.push(j);return Promise.all(b.map(y))}return y(n);async function y(v){const[b]=ug(v);if(!b)return;const[S,j]=OS(t,b),[A,E,O,N]=ra.get(t),L=()=>{const oe=A[b];return(Tr(u.revalidate)?u.revalidate(S().data,v):u.revalidate!==!1)&&(delete O[b],delete N[b],oe&&oe[0])?oe[0](TS).then(()=>S().data):S().data};if(e.length<3)return L();let D=a,R,q=!1;const B=sp();E[b]=[B,0];const X=!Fe(h),fe=S(),se=fe.data,le=fe._c,ee=Fe(le)?se:le;if(X&&(h=Tr(h)?h(ee,se):h,j({data:h,_c:ee})),Tr(D))try{D=D(ee)}catch(oe){R=oe,q=!0}if(D&&AS(D))if(D=await D.catch(oe=>{R=oe,q=!0}),B!==E[b][0]){if(q)throw R;return D}else q&&X&&m(R)&&(l=!0,j({data:ee,_c:fn}));if(l&&!q)if(Tr(l)){const oe=l(D,ee);j({data:oe,error:fn,_c:fn})}else j({data:D,error:fn,_c:fn});if(E[b][1]=sp(),Promise.resolve(L()).then(()=>{j({_c:fn})}),q){if(g)throw R;return}return D}}const q0=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},S4=(e,t)=>{if(!ra.has(e)){const n=Ha(y4,t),a=Object.create(null),s=RS.bind(fn,e);let u=aa;const l=Object.create(null),f=(g,y)=>{const v=l[g]||[];return l[g]=v,v.push(y),()=>v.splice(v.indexOf(y),1)},h=(g,y,v)=>{e.set(g,y);const b=l[g];if(b)for(const S of b)S(y,v)},m=()=>{if(!ra.has(e)&&(ra.set(e,[a,Object.create(null),Object.create(null),Object.create(null),s,h,f]),!Ls)){const g=n.initFocus(setTimeout.bind(fn,q0.bind(fn,a,CS))),y=n.initReconnect(setTimeout.bind(fn,q0.bind(fn,a,ES)));u=()=>{g&&g(),y&&y(),ra.delete(e)}}};return m(),[e,s,m,u]}return[e,ra.get(e)[4]]},z4=(e,t,n,a,s)=>{const u=n.errorRetryCount,l=s.retryCount,f=~~((Math.random()+.5)*(1<<(l<8?l:8)))*n.errorRetryInterval;!Fe(u)&&l>u||setTimeout(a,f,s)},_4=Wm,[MS,On]=S4(new Map),j4=Ha({onLoadingSlow:aa,onSuccess:aa,onError:aa,onErrorRetry:z4,onDiscarded:aa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:F0?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:F0?5e3:3e3,compare:_4,isPaused:()=>!1,cache:MS,mutate:On,fallback:{}},x4),N4=(e,t)=>{const n=Ha(e,t);if(t){const{use:a,fallback:s}=e,{use:u,fallback:l}=t;a&&u&&(n.use=a.concat(u)),s&&l&&(n.fallback=Ha(s,l))}return n},C4=z.createContext({}),E4="$inf$",DS=Hl&&window.__SWR_DEVTOOLS_USE__,T4=DS?window.__SWR_DEVTOOLS_USE__:[],A4=()=>{DS&&(window.__SWR_DEVTOOLS_REACT__=Kp)},O4=e=>Tr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],R4=()=>{const e=z.useContext(C4);return z.useMemo(()=>Ha(j4,e),[e])},M4=e=>(t,n,a)=>e(t,n&&((...u)=>{const[l]=ug(t),[,,,f]=ra.get(MS);if(l.startsWith(E4))return n(...u);const h=f[l];return Fe(h)?n(...u):(delete f[l],h)}),a),D4=T4.concat(M4),$4=e=>function(...n){const a=R4(),[s,u,l]=O4(n),f=N4(a,l);let h=e;const{use:m}=f,g=(m||[]).concat(D4);for(let y=g.length;y--;)h=g[y](h);return h(s,u||f.fetcher||null,f)},L4=(e,t,n)=>{const a=t[e]||(t[e]=[]);return a.push(n),()=>{const s=a.indexOf(n);s>=0&&(a[s]=a[a.length-1],a.pop())}};A4();const rm=Kp.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),am={dedupe:!0},G0=Promise.resolve(fn),P4=(e,t,n)=>{const{cache:a,compare:s,suspense:u,fallbackData:l,revalidateOnMount:f,revalidateIfStale:h,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:v,strictServerPrefetchWarning:b}=n,[S,j,A,E]=ra.get(a),[O,N]=ug(e),L=z.useRef(!1),D=z.useRef(!1),R=z.useRef(O),q=z.useRef(t),B=z.useRef(n),X=()=>B.current,fe=()=>X().isVisible()&&X().isOnline(),[se,le,ee,oe]=OS(a,O),ae=z.useRef({}).current,P=Fe(l)?Fe(n.fallback)?fn:n.fallback[O]:l,J=(Me,Xe)=>{for(const st in ae){const tt=st;if(tt==="data"){if(!s(Me[tt],Xe[tt])&&(!Fe(Me[tt])||!s(he,Xe[tt])))return!1}else if(Xe[tt]!==Me[tt])return!1}return!0},Z=z.useMemo(()=>{const Me=!O||!t?!1:Fe(f)?X().isPaused()||u?!1:h!==!1:f,Xe=Gt=>{const gt=Ha(Gt);return delete gt._k,Me?{isValidating:!0,isLoading:!0,...gt}:gt},st=se(),tt=oe(),Qt=Xe(st),Gn=st===tt?Qt:Xe(tt);let Mt=Qt;return[()=>{const Gt=Xe(se());return J(Gt,Mt)?(Mt.data=Gt.data,Mt.isLoading=Gt.isLoading,Mt.isValidating=Gt.isValidating,Mt.error=Gt.error,Mt):(Mt=Gt,Gt)},()=>Gn]},[a,O]),me=B0.useSyncExternalStore(z.useCallback(Me=>ee(O,(Xe,st)=>{J(st,Xe)||Me()}),[a,O]),Z[0],Z[1]),T=!L.current,C=S[O]&&S[O].length>0,I=me.data,w=Fe(I)?P&&AS(P)?rm(P):P:I,Y=me.error,de=z.useRef(w),he=v?Fe(I)?Fe(de.current)?w:de.current:I:w,pe=O&&Fe(w),Pe=!Ls&&B0.useSyncExternalStore(()=>aa,()=>!1,()=>!0);b&&Pe&&!u&&pe&&console.warn(`Missing pre-initiated data for serialized key "${O}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ae=C&&!Fe(Y)?!1:T&&!Fe(f)?f:X().isPaused()?!1:u?Fe(w)?!1:h:Fe(w)||h,pt=!!(O&&t&&T&&Ae),Rt=Fe(me.isValidating)?pt:me.isValidating,V=Fe(me.isLoading)?pt:me.isLoading,Ne=z.useCallback(async Me=>{const Xe=q.current;if(!O||!Xe||D.current||X().isPaused())return!1;let st,tt,Qt=!0;const Gn=Me||{},Mt=!A[O]||!Gn.dedupe,Gt=()=>H0?!D.current&&O===R.current&&L.current:O===R.current,gt={isValidating:!1,isLoading:!1},$i=()=>{le(gt)},W=()=>{const we=A[O];we&&we[1]===tt&&delete A[O]},ce={isValidating:!0};Fe(se().data)&&(ce.isLoading=!0);try{if(Mt&&(le(ce),n.loadingTimeout&&Fe(se().data)&&setTimeout(()=>{Qt&&Gt()&&X().onLoadingSlow(O,n)},n.loadingTimeout),A[O]=[Xe(N),sp()]),[st,tt]=A[O],st=await st,Mt&&setTimeout(W,n.dedupingInterval),!A[O]||A[O][1]!==tt)return Mt&&Gt()&&X().onDiscarded(O),!1;gt.error=fn;const we=j[O];if(!Fe(we)&&(tt<=we[0]||tt<=we[1]||we[1]===0))return $i(),Mt&&Gt()&&X().onDiscarded(O),!1;const Ce=se().data;gt.data=s(Ce,st)?Ce:st,Mt&&Gt()&&X().onSuccess(st,O,n)}catch(we){W();const Ce=X(),{shouldRetryOnError:He}=Ce;Ce.isPaused()||(gt.error=we,Mt&&Gt()&&(Ce.onError(we,O,Ce),(He===!0||Tr(He)&&He(we))&&(!X().revalidateOnFocus||!X().revalidateOnReconnect||fe())&&Ce.onErrorRetry(we,O,Ce,pn=>{const $n=S[O];$n&&$n[0]&&$n[0](Z0,pn)},{retryCount:(Gn.retryCount||0)+1,dedupe:!0})))}return Qt=!1,$i(),!0},[O,a]),Ge=z.useCallback((...Me)=>RS(a,R.current,...Me),[]);if(em(()=>{q.current=t,B.current=n,Fe(I)||(de.current=I)}),em(()=>{if(!O)return;const Me=Ne.bind(fn,am);let Xe=0;X().revalidateOnFocus&&(Xe=Date.now()+X().focusThrottleInterval);const tt=L4(O,S,(Qt,Gn={})=>{if(Qt==CS){const Mt=Date.now();X().revalidateOnFocus&&Mt>Xe&&fe()&&(Xe=Mt+X().focusThrottleInterval,Me())}else if(Qt==ES)X().revalidateOnReconnect&&fe()&&Me();else{if(Qt==TS)return Ne();if(Qt==Z0)return Ne(Gn)}});return D.current=!1,R.current=O,L.current=!0,le({_k:N}),Ae&&(A[O]||(Fe(w)||Ls?Me():b4(Me))),()=>{D.current=!0,tt()}},[O]),em(()=>{let Me;function Xe(){const tt=Tr(m)?m(se().data):m;tt&&Me!==-1&&(Me=setTimeout(st,tt))}function st(){!se().error&&(g||X().isVisible())&&(y||X().isOnline())?Ne(am).then(Xe):Xe()}return Xe(),()=>{Me&&(clearTimeout(Me),Me=-1)}},[m,g,y,O]),z.useDebugValue(he),u){if(!H0&&Ls&&pe)throw new Error("Fallback data is required when using Suspense in SSR.");pe&&(q.current=t,B.current=n,D.current=!1);const Me=E[O],Xe=!Fe(Me)&&pe?Ge(Me):G0;if(rm(Xe),!Fe(Y)&&pe)throw Y;const st=pe?Ne(am):G0;!Fe(he)&&pe&&(st.status="fulfilled",st.value=!0),rm(st)}return{mutate:Ge,get data(){return ae.data=!0,he},get error(){return ae.error=!0,Y},get isValidating(){return ae.isValidating=!0,Rt},get isLoading(){return ae.isLoading=!0,V}}},kt=$4(P4),U4="x-architect-pass",al="/api";class Ba{static instance;constructor(){}static getInstance(){return Ba.instance||(Ba.instance=new Ba),Ba.instance}getHeaders(t={}){const n=localStorage.getItem("morpheus.auth.token"),a={...t};return n&&(a[U4]=n),a}async handleResponse(t){if(t.status===401)throw localStorage.removeItem("morpheus.auth.token"),window.location.pathname.endsWith("/login")||(window.location.href="/login"),new Error("Unauthorized");if(!t.ok){const n=await t.json().catch(()=>({error:"Unknown error"})),a=new Error(n.error||`HTTP error! status: ${t.status}`);throw a.details=n.details,a}return t.json()}async get(t){const n=await fetch(`${al}${t}`,{headers:this.getHeaders()});return this.handleResponse(n)}async post(t,n){const a=await fetch(`${al}${t}`,{method:"POST",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async put(t,n){const a=await fetch(`${al}${t}`,{method:"PUT",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async patch(t,n){const a=await fetch(`${al}${t}`,{method:"PATCH",headers:this.getHeaders({"Content-Type":"application/json"}),body:JSON.stringify(n)});return this.handleResponse(a)}async delete(t){const n=await fetch(`${al}${t}`,{method:"DELETE",headers:this.getHeaders()});return this.handleResponse(n)}}const xe=Ba.getInstance(),Tl="/api",cg=e=>{const t=e.startsWith(Tl)?e.substring(Tl.length):e;return xe.get(t)};function $S(){return kt(`${Tl}/status`,cg,{refreshInterval:5e3})}function V4(){return kt(`${Tl}/logs`,cg)}function B4(e){return kt(e?`${Tl}/logs/${e}?limit=1000`:null,cg,{refreshInterval:2e3})}function LS(e){const t=Math.floor(e/60);if(t>59){const n=Math.floor(t/60),a=t%60;return`${n}h ${a}m`}return`${t}m`}function Z4(){const{data:e}=$S();return d.jsxs("footer",{className:"h-8 bg-azure-bg dark:bg-zinc-950 border-t border-azure-border dark:border-matrix-primary flex items-center px-4 text-xs justify-between select-none z-10 shrink-0",children:[d.jsxs("div",{className:"flex gap-4",children:[d.jsxs("span",{className:e?"text-azure-primary dark:text-matrix-highlight":"text-red-500",children:["● ",e?.status.toUpperCase()||"OFFLINE"]}),d.jsxs("span",{children:["PID: ",e?.pid||"-"]}),d.jsxs("span",{children:["UPTIME: ",e?LS(e.uptimeSeconds):"-"]})]}),d.jsxs("div",{className:"flex gap-4 opacity-70",children:[d.jsxs("span",{children:["v",e?.projectVersion||"0.0.0"]}),d.jsx("span",{children:e?.agentName||"Morpheus"})]})]})}const dg=z.createContext({});function fg(e){const t=z.useRef(null);return t.current===null&&(t.current=e()),t.current}const PS=typeof window<"u",US=PS?z.useLayoutEffect:z.useEffect,hd=z.createContext(null);function hg(e,t){e.indexOf(t)===-1&&e.push(t)}function mg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Mr=(e,t,n)=>n>t?t:n<e?e:n;let pg=()=>{};const la={},VS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function BS(e){return typeof e=="object"&&e!==null}const ZS=e=>/^0[^.\s]+$/u.test(e);function gg(e){let t;return()=>(t===void 0&&(t=e()),t)}const cr=e=>e,I4=(e,t)=>n=>t(e(n)),Fl=(...e)=>e.reduce(I4),Al=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class xg{constructor(){this.subscriptions=[]}add(t){return hg(this.subscriptions,t),()=>mg(this.subscriptions,t)}notify(t,n,a){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,a);else for(let u=0;u<s;u++){const l=this.subscriptions[u];l&&l(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const sa=e=>e*1e3,ur=e=>e/1e3;function IS(e,t){return t?e*(1e3/t):0}const HS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,H4=1e-7,F4=12;function q4(e,t,n,a,s){let u,l,f=0;do l=t+(n-t)/2,u=HS(l,a,s)-e,u>0?n=l:t=l;while(Math.abs(u)>H4&&++f<F4);return l}function ql(e,t,n,a){if(e===t&&n===a)return cr;const s=u=>q4(u,0,1,e,n);return u=>u===0||u===1?u:HS(s(u),t,a)}const FS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qS=e=>t=>1-e(1-t),GS=ql(.33,1.53,.69,.99),yg=qS(GS),YS=FS(yg),KS=e=>(e*=2)<1?.5*yg(e):.5*(2-Math.pow(2,-10*(e-1))),bg=e=>1-Math.sin(Math.acos(e)),XS=qS(bg),JS=FS(bg),G4=ql(.42,0,1,1),Y4=ql(0,0,.58,1),QS=ql(.42,0,.58,1),K4=e=>Array.isArray(e)&&typeof e[0]!="number",WS=e=>Array.isArray(e)&&typeof e[0]=="number",X4={linear:cr,easeIn:G4,easeInOut:QS,easeOut:Y4,circIn:bg,circInOut:JS,circOut:XS,backIn:yg,backInOut:YS,backOut:GS,anticipate:KS},J4=e=>typeof e=="string",Y0=e=>{if(WS(e)){pg(e.length===4);const[t,n,a,s]=e;return ql(t,n,a,s)}else if(J4(e))return X4[e];return e},gc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Q4(e,t){let n=new Set,a=new Set,s=!1,u=!1;const l=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function h(g){l.has(g)&&(m.schedule(g),e()),g(f)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&s?n:a;return y&&l.add(g),S.has(g)||S.add(g),g},cancel:g=>{a.delete(g),l.delete(g)},process:g=>{if(f=g,s){u=!0;return}s=!0,[n,a]=[a,n],n.forEach(h),n.clear(),s=!1,u&&(u=!1,m.process(g))}};return m}const W4=40;function ez(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,l=gc.reduce((N,L)=>(N[L]=Q4(u),N),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:g,update:y,preRender:v,render:b,postRender:S}=l,j=()=>{const N=la.useManualTiming?s.timestamp:performance.now();n=!1,la.useManualTiming||(s.delta=a?1e3/60:Math.max(Math.min(N-s.timestamp,W4),1)),s.timestamp=N,s.isProcessing=!0,f.process(s),h.process(s),m.process(s),g.process(s),y.process(s),v.process(s),b.process(s),S.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(j))},A=()=>{n=!0,a=!0,s.isProcessing||e(j)};return{schedule:gc.reduce((N,L)=>{const D=l[L];return N[L]=(R,q=!1,B=!1)=>(n||A(),D.schedule(R,q,B)),N},{}),cancel:N=>{for(let L=0;L<gc.length;L++)l[gc[L]].cancel(N)},state:s,steps:l}}const{schedule:bt,cancel:Fa,state:ln,steps:im}=ez(typeof requestAnimationFrame<"u"?requestAnimationFrame:cr,!0);let $c;function eO(){$c=void 0}const kn={now:()=>($c===void 0&&kn.set(ln.isProcessing||la.useManualTiming?ln.timestamp:performance.now()),$c),set:e=>{$c=e,queueMicrotask(eO)}},tz=e=>t=>typeof t=="string"&&t.startsWith(e),nz=tz("--"),tO=tz("var(--"),vg=e=>tO(e)?nO.test(e.split("/*")[0].trim()):!1,nO=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function K0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ws={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ol={...Ws,transform:e=>Mr(0,1,e)},xc={...Ws,default:1},bl=e=>Math.round(e*1e5)/1e5,kg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rO(e){return e==null}const aO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wg=(e,t)=>n=>!!(typeof n=="string"&&aO.test(n)&&n.startsWith(e)||t&&!rO(n)&&Object.prototype.hasOwnProperty.call(n,t)),rz=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,u,l,f]=a.match(kg);return{[e]:parseFloat(s),[t]:parseFloat(u),[n]:parseFloat(l),alpha:f!==void 0?parseFloat(f):1}},iO=e=>Mr(0,255,e),sm={...Ws,transform:e=>Math.round(iO(e))},ji={test:wg("rgb","red"),parse:rz("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+sm.transform(e)+", "+sm.transform(t)+", "+sm.transform(n)+", "+bl(Ol.transform(a))+")"};function sO(e){let t="",n="",a="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,a+=a,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:s?parseInt(s,16)/255:1}}const op={test:wg("#"),parse:sO,transform:ji.transform},Gl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),La=Gl("deg"),Or=Gl("%"),ve=Gl("px"),oO=Gl("vh"),lO=Gl("vw"),X0={...Or,parse:e=>Or.parse(e)/100,transform:e=>Or.transform(e*100)},Es={test:wg("hsl","hue"),parse:rz("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+Or.transform(bl(t))+", "+Or.transform(bl(n))+", "+bl(Ol.transform(a))+")"},It={test:e=>ji.test(e)||op.test(e)||Es.test(e),parse:e=>ji.test(e)?ji.parse(e):Es.test(e)?Es.parse(e):op.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ji.transform(e):Es.transform(e),getAnimatableNone:e=>{const t=It.parse(e);return t.alpha=0,It.transform(t)}},uO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cO(e){return isNaN(e)&&typeof e=="string"&&(e.match(kg)?.length||0)+(e.match(uO)?.length||0)>0}const az="number",iz="color",dO="var",fO="var(",J0="${}",hO=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Rl(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let u=0;const f=t.replace(hO,h=>(It.test(h)?(a.color.push(u),s.push(iz),n.push(It.parse(h))):h.startsWith(fO)?(a.var.push(u),s.push(dO),n.push(h)):(a.number.push(u),s.push(az),n.push(parseFloat(h))),++u,J0)).split(J0);return{values:n,split:f,indexes:a,types:s}}function sz(e){return Rl(e).values}function oz(e){const{split:t,types:n}=Rl(e),a=t.length;return s=>{let u="";for(let l=0;l<a;l++)if(u+=t[l],s[l]!==void 0){const f=n[l];f===az?u+=bl(s[l]):f===iz?u+=It.transform(s[l]):u+=s[l]}return u}}const mO=e=>typeof e=="number"?0:It.test(e)?It.getAnimatableNone(e):e;function pO(e){const t=sz(e);return oz(e)(t.map(mO))}const qa={test:cO,parse:sz,createTransformer:oz,getAnimatableNone:pO};function om(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gO({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,u=0,l=0;if(!t)s=u=l=n;else{const f=n<.5?n*(1+t):n+t-n*t,h=2*n-f;s=om(h,f,e+1/3),u=om(h,f,e),l=om(h,f,e-1/3)}return{red:Math.round(s*255),green:Math.round(u*255),blue:Math.round(l*255),alpha:a}}function Fc(e,t){return n=>n>0?t:e}const _t=(e,t,n)=>e+(t-e)*n,lm=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},xO=[op,ji,Es],yO=e=>xO.find(t=>t.test(e));function Q0(e){const t=yO(e);if(!t)return!1;let n=t.parse(e);return t===Es&&(n=gO(n)),n}const W0=(e,t)=>{const n=Q0(e),a=Q0(t);if(!n||!a)return Fc(e,t);const s={...n};return u=>(s.red=lm(n.red,a.red,u),s.green=lm(n.green,a.green,u),s.blue=lm(n.blue,a.blue,u),s.alpha=_t(n.alpha,a.alpha,u),ji.transform(s))},lp=new Set(["none","hidden"]);function bO(e,t){return lp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function vO(e,t){return n=>_t(e,t,n)}function Sg(e){return typeof e=="number"?vO:typeof e=="string"?vg(e)?Fc:It.test(e)?W0:SO:Array.isArray(e)?lz:typeof e=="object"?It.test(e)?W0:kO:Fc}function lz(e,t){const n=[...e],a=n.length,s=e.map((u,l)=>Sg(u)(u,t[l]));return u=>{for(let l=0;l<a;l++)n[l]=s[l](u);return n}}function kO(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=Sg(e[s])(e[s],t[s]));return s=>{for(const u in a)n[u]=a[u](s);return n}}function wO(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const u=t.types[s],l=e.indexes[u][a[u]],f=e.values[l]??0;n[s]=f,a[u]++}return n}const SO=(e,t)=>{const n=qa.createTransformer(t),a=Rl(e),s=Rl(t);return a.indexes.var.length===s.indexes.var.length&&a.indexes.color.length===s.indexes.color.length&&a.indexes.number.length>=s.indexes.number.length?lp.has(e)&&!s.values.length||lp.has(t)&&!a.values.length?bO(e,t):Fl(lz(wO(a,s),s.values),n):Fc(e,t)};function uz(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?_t(e,t,n):Sg(e)(e,t)}const zO=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>bt.update(t,n),stop:()=>Fa(t),now:()=>ln.isProcessing?ln.timestamp:kn.now()}},cz=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let u=0;u<s;u++)a+=Math.round(e(u/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},qc=2e4;function zg(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<qc;)t+=n,a=e.next(t);return t>=qc?1/0:t}function _O(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(zg(a),qc);return{type:"keyframes",ease:u=>a.next(s*u).value/t,duration:ur(s)}}const jO=5;function dz(e,t,n){const a=Math.max(t-jO,0);return IS(n-e(a),t-a)}const Ot={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},um=.001;function NO({duration:e=Ot.duration,bounce:t=Ot.bounce,velocity:n=Ot.velocity,mass:a=Ot.mass}){let s,u,l=1-t;l=Mr(Ot.minDamping,Ot.maxDamping,l),e=Mr(Ot.minDuration,Ot.maxDuration,ur(e)),l<1?(s=m=>{const g=m*l,y=g*e,v=g-n,b=up(m,l),S=Math.exp(-y);return um-v/b*S},u=m=>{const y=m*l*e,v=y*n+n,b=Math.pow(l,2)*Math.pow(m,2)*e,S=Math.exp(-y),j=up(Math.pow(m,2),l);return(-s(m)+um>0?-1:1)*((v-b)*S)/j}):(s=m=>{const g=Math.exp(-m*e),y=(m-n)*e+1;return-um+g*y},u=m=>{const g=Math.exp(-m*e),y=(n-m)*(e*e);return g*y});const f=5/e,h=EO(s,u,f);if(e=sa(e),isNaN(h))return{stiffness:Ot.stiffness,damping:Ot.damping,duration:e};{const m=Math.pow(h,2)*a;return{stiffness:m,damping:l*2*Math.sqrt(a*m),duration:e}}}const CO=12;function EO(e,t,n){let a=n;for(let s=1;s<CO;s++)a=a-e(a)/t(a);return a}function up(e,t){return e*Math.sqrt(1-t*t)}const TO=["duration","bounce"],AO=["stiffness","damping","mass"];function e1(e,t){return t.some(n=>e[n]!==void 0)}function OO(e){let t={velocity:Ot.velocity,stiffness:Ot.stiffness,damping:Ot.damping,mass:Ot.mass,isResolvedFromDuration:!1,...e};if(!e1(e,AO)&&e1(e,TO))if(e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,u=2*Mr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ot.mass,stiffness:s,damping:u}}else{const n=NO(e);t={...t,...n,mass:Ot.mass},t.isResolvedFromDuration=!0}return t}function Gc(e=Ot.visualDuration,t=Ot.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:s}=n;const u=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],f={done:!1,value:u},{stiffness:h,damping:m,mass:g,duration:y,velocity:v,isResolvedFromDuration:b}=OO({...n,velocity:-ur(n.velocity||0)}),S=v||0,j=m/(2*Math.sqrt(h*g)),A=l-u,E=ur(Math.sqrt(h/g)),O=Math.abs(A)<5;a||(a=O?Ot.restSpeed.granular:Ot.restSpeed.default),s||(s=O?Ot.restDelta.granular:Ot.restDelta.default);let N;if(j<1){const D=up(E,j);N=R=>{const q=Math.exp(-j*E*R);return l-q*((S+j*E*A)/D*Math.sin(D*R)+A*Math.cos(D*R))}}else if(j===1)N=D=>l-Math.exp(-E*D)*(A+(S+E*A)*D);else{const D=E*Math.sqrt(j*j-1);N=R=>{const q=Math.exp(-j*E*R),B=Math.min(D*R,300);return l-q*((S+j*E*A)*Math.sinh(B)+D*A*Math.cosh(B))/D}}const L={calculatedDuration:b&&y||null,next:D=>{const R=N(D);if(b)f.done=D>=y;else{let q=D===0?S:0;j<1&&(q=D===0?sa(S):dz(N,D,R));const B=Math.abs(q)<=a,X=Math.abs(l-R)<=s;f.done=B&&X}return f.value=f.done?l:R,f},toString:()=>{const D=Math.min(zg(L),qc),R=cz(q=>L.next(D*q).value,D,30);return D+"ms "+R},toTransition:()=>{}};return L}Gc.applyToOptions=e=>{const t=_O(e,100,Gc);return e.ease=t.ease,e.duration=sa(t.duration),e.type="keyframes",e};function cp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:u=500,modifyTarget:l,min:f,max:h,restDelta:m=.5,restSpeed:g}){const y=e[0],v={done:!1,value:y},b=B=>f!==void 0&&B<f||h!==void 0&&B>h,S=B=>f===void 0?h:h===void 0||Math.abs(f-B)<Math.abs(h-B)?f:h;let j=n*t;const A=y+j,E=l===void 0?A:l(A);E!==A&&(j=E-y);const O=B=>-j*Math.exp(-B/a),N=B=>E+O(B),L=B=>{const X=O(B),fe=N(B);v.done=Math.abs(X)<=m,v.value=v.done?E:fe};let D,R;const q=B=>{b(v.value)&&(D=B,R=Gc({keyframes:[v.value,S(v.value)],velocity:dz(N,B,v.value),damping:s,stiffness:u,restDelta:m,restSpeed:g}))};return q(0),{calculatedDuration:null,next:B=>{let X=!1;return!R&&D===void 0&&(X=!0,L(B),q(B)),D!==void 0&&B>=D?R.next(B-D):(!X&&L(B),v)}}}function RO(e,t,n){const a=[],s=n||la.mix||uz,u=e.length-1;for(let l=0;l<u;l++){let f=s(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||cr:t;f=Fl(h,f)}a.push(f)}return a}function MO(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const u=e.length;if(pg(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=RO(t,a,s),h=f.length,m=g=>{if(l&&g<e[0])return t[0];let y=0;if(h>1)for(;y<e.length-2&&!(g<e[y+1]);y++);const v=Al(e[y],e[y+1],g);return f[y](v)};return n?g=>m(Mr(e[0],e[u-1],g)):m}function DO(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=Al(0,t,a);e.push(_t(n,1,s))}}function $O(e){const t=[0];return DO(t,e.length-1),t}function LO(e,t){return e.map(n=>n*t)}function PO(e,t){return e.map(()=>t||QS).splice(0,e.length-1)}function vl({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=K4(a)?a.map(Y0):Y0(a),u={done:!1,value:t[0]},l=LO(n&&n.length===t.length?n:$O(t),e),f=MO(l,t,{ease:Array.isArray(s)?s:PO(t,s)});return{calculatedDuration:e,next:h=>(u.value=f(h),u.done=h>=e,u)}}const UO=e=>e!==null;function _g(e,{repeat:t,repeatType:n="loop"},a,s=1){const u=e.filter(UO),f=s<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!f||a===void 0?u[f]:a}const VO={decay:cp,inertia:cp,tween:vl,keyframes:vl,spring:Gc};function fz(e){typeof e.type=="string"&&(e.type=VO[e.type])}class jg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const BO=e=>e/100;class Ng extends jg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==kn.now()&&this.tick(kn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;fz(t);const{type:n=vl,repeat:a=0,repeatDelay:s=0,repeatType:u,velocity:l=0}=t;let{keyframes:f}=t;const h=n||vl;h!==vl&&typeof f[0]!="number"&&(this.mixKeyframes=Fl(BO,uz(f[0],f[1])),f=[0,100]);const m=h({...t,keyframes:f});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...f].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=zg(m));const{calculatedDuration:g}=m;this.calculatedDuration=g,this.resolvedDuration=g+s,this.totalDuration=this.resolvedDuration*(a+1)-s,this.generator=m}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:s,mixKeyframes:u,mirroredGenerator:l,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:m=0,keyframes:g,repeat:y,repeatType:v,repeatDelay:b,type:S,onUpdate:j,finalKeyframe:A}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const E=this.currentTime-m*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let N=this.currentTime,L=a;if(y){const B=Math.min(this.currentTime,s)/f;let X=Math.floor(B),fe=B%1;!fe&&B>=1&&(fe=1),fe===1&&X--,X=Math.min(X,y+1),X%2&&(v==="reverse"?(fe=1-fe,b&&(fe-=b/f)):v==="mirror"&&(L=l)),N=Mr(0,1,fe)*f}const D=O?{done:!1,value:g[0]}:L.next(N);u&&(D.value=u(D.value));let{done:R}=D;!O&&h!==null&&(R=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return q&&S!==cp&&(D.value=_g(g,this.options,A,this.speed)),j&&j(D.value),q&&this.finish(),D}then(t,n){return this.finished.then(t,n)}get duration(){return ur(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ur(t)}get time(){return ur(this.currentTime)}set time(t){t=sa(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(kn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ur(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=zO,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(kn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function ZO(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ni=e=>e*180/Math.PI,dp=e=>{const t=Ni(Math.atan2(e[1],e[0]));return fp(t)},IO={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dp,rotateZ:dp,skewX:e=>Ni(Math.atan(e[1])),skewY:e=>Ni(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fp=e=>(e=e%360,e<0&&(e+=360),e),t1=dp,n1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),r1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),HO={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:n1,scaleY:r1,scale:e=>(n1(e)+r1(e))/2,rotateX:e=>fp(Ni(Math.atan2(e[6],e[5]))),rotateY:e=>fp(Ni(Math.atan2(-e[2],e[0]))),rotateZ:t1,rotate:t1,skewX:e=>Ni(Math.atan(e[4])),skewY:e=>Ni(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hp(e){return e.includes("scale")?1:0}function mp(e,t){if(!e||e==="none")return hp(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=HO,s=n;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=IO,s=f}if(!s)return hp(t);const u=a[t],l=s[1].split(",").map(qO);return typeof u=="function"?u(l):l[u]}const FO=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return mp(n,t)};function qO(e){return parseFloat(e.trim())}const eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],to=new Set(eo),a1=e=>e===Ws||e===ve,GO=new Set(["x","y","z"]),YO=eo.filter(e=>!GO.has(e));function KO(e){const t=[];return YO.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Za={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>mp(t,"x"),y:(e,{transform:t})=>mp(t,"y")};Za.translateX=Za.x;Za.translateY=Za.y;const Ci=new Set;let pp=!1,gp=!1,xp=!1;function hz(){if(gp){const e=Array.from(Ci).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=KO(a);s.length&&(n.set(a,s),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const s=n.get(a);s&&s.forEach(([u,l])=>{a.getValue(u)?.set(l)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}gp=!1,pp=!1,Ci.forEach(e=>e.complete(xp)),Ci.clear()}function mz(){Ci.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gp=!0)})}function XO(){xp=!0,mz(),hz(),xp=!1}class Cg{constructor(t,n,a,s,u,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=s,this.element=u,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Ci.add(this),pp||(pp=!0,bt.read(mz),bt.resolveKeyframes(hz))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const u=s?.get(),l=t[t.length-1];if(u!==void 0)t[0]=u;else if(a&&n){const f=a.readValue(n,l);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=l),s&&u===void 0&&s.set(t[0])}ZO(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ci.delete(this)}cancel(){this.state==="scheduled"&&(Ci.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const JO=e=>e.startsWith("--");function QO(e,t,n){JO(t)?e.style.setProperty(t,n):e.style[t]=n}const WO=gg(()=>window.ScrollTimeline!==void 0),e3={};function t3(e,t){const n=gg(e);return()=>e3[t]??n()}const pz=t3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ml=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,i1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ml([0,.65,.55,1]),circOut:ml([.55,0,1,.45]),backIn:ml([.31,.01,.66,-.59]),backOut:ml([.33,1.53,.69,.99])};function gz(e,t){if(e)return typeof e=="function"?pz()?cz(e,t):"ease-out":WS(e)?ml(e):Array.isArray(e)?e.map(n=>gz(n,t)||i1.easeOut):i1[e]}function n3(e,t,n,{delay:a=0,duration:s=300,repeat:u=0,repeatType:l="loop",ease:f="easeOut",times:h}={},m=void 0){const g={[t]:n};h&&(g.offset=h);const y=gz(f,s);Array.isArray(y)&&(g.easing=y);const v={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:l==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(g,v)}function xz(e){return typeof e=="function"&&"applyToOptions"in e}function r3({type:e,...t}){return xz(e)&&pz()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class a3 extends jg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:u,allowFlatten:l=!1,finalKeyframe:f,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=l,this.options=t,pg(typeof t.type!="string");const m=r3(t);this.animation=n3(n,a,s,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=_g(s,this.options,f,this.speed);this.updateMotionValue?this.updateMotionValue(g):QO(n,a,g),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ur(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ur(t)}get time(){return ur(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=sa(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&WO()?(this.animation.timeline=t,cr):n(this)}}const yz={anticipate:KS,backInOut:YS,circInOut:JS};function i3(e){return e in yz}function s3(e){typeof e.ease=="string"&&i3(e.ease)&&(e.ease=yz[e.ease])}const cm=10;class o3 extends a3{constructor(t){s3(t),fz(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:u,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const f=new Ng({...l,autoplay:!1}),h=Math.max(cm,kn.now()-this.startTime),m=Mr(0,cm,h-cm);n.setWithVelocity(f.sample(Math.max(0,h-m)).value,f.sample(h).value,m),f.stop()}}const s1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qa.test(e)||e==="0")&&!e.startsWith("url("));function l3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function u3(e,t,n,a){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],l=s1(s,t),f=s1(u,t);return!l||!f?!1:l3(e)||(n==="spring"||xz(n))&&a}function yp(e){e.duration=0,e.type="keyframes"}const c3=new Set(["opacity","clipPath","filter","transform"]),d3=gg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function f3(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:u,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=t.owner.getProps();return d3()&&n&&c3.has(n)&&(n!=="transform"||!m)&&!h&&!a&&s!=="mirror"&&u!==0&&l!=="inertia"}const h3=40;class m3 extends jg{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:u=0,repeatType:l="loop",keyframes:f,name:h,motionValue:m,element:g,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=kn.now();const v={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:u,repeatType:l,name:h,motionValue:m,element:g,...y},b=g?.KeyframeResolver||Cg;this.keyframeResolver=new b(f,(S,j,A)=>this.onKeyframesResolved(S,j,v,!A),h,m,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:u,type:l,velocity:f,delay:h,isHandoff:m,onUpdate:g}=a;this.resolvedAt=kn.now(),u3(t,u,l,f)||((la.instantAnimations||!h)&&g?.(_g(t,a,n)),t[0]=t[t.length-1],yp(a),a.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},b=!m&&f3(v),S=v.motionValue?.owner?.current,j=b?new o3({...v,element:S}):new Ng(v);j.finished.then(()=>{this.notifyFinished()}).catch(cr),this.pendingTimeline&&(this.stopTimeline=j.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=j}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),XO()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function bz(e,t,n,a=0,s=1){const u=Array.from(e).sort((m,g)=>m.sortNodePosition(g)).indexOf(t),l=e.size,f=(l-1)*a;return typeof n=="function"?n(u,l):s===1?u*a:f-u*a}const p3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function g3(e){const t=p3.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function vz(e,t,n=1){const[a,s]=g3(e);if(!a)return;const u=window.getComputedStyle(t).getPropertyValue(a);if(u){const l=u.trim();return VS(l)?parseFloat(l):l}return vg(s)?vz(s,t,n+1):s}const x3={type:"spring",stiffness:500,damping:25,restSpeed:10},y3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b3={type:"keyframes",duration:.8},v3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k3=(e,{keyframes:t})=>t.length>2?b3:to.has(e)?e.startsWith("scale")?y3(t[1]):x3:v3,w3=e=>e!==null;function S3(e,{repeat:t,repeatType:n="loop"},a){const s=e.filter(w3),u=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[u]}function Eg(e,t){return e?.[t]??e?.default??e}function z3({when:e,delay:t,delayChildren:n,staggerChildren:a,staggerDirection:s,repeat:u,repeatType:l,repeatDelay:f,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const Tg=(e,t,n,a={},s,u)=>l=>{const f=Eg(a,e)||{},h=f.delay||a.delay||0;let{elapsed:m=0}=a;m=m-sa(h);const g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-m,onUpdate:v=>{t.set(v),f.onUpdate&&f.onUpdate(v)},onComplete:()=>{l(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:u?void 0:s};z3(f)||Object.assign(g,k3(e,g)),g.duration&&(g.duration=sa(g.duration)),g.repeatDelay&&(g.repeatDelay=sa(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(yp(g),g.delay===0&&(y=!0)),(la.instantAnimations||la.skipAnimations)&&(y=!0,yp(g),g.delay=0),g.allowFlatten=!f.type&&!f.ease,y&&!u&&t.get()!==void 0){const v=S3(g.keyframes,f);if(v!==void 0){bt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return f.isSync?new Ng(g):new m3(g)};function o1(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Ag(e,t,n,a){if(typeof t=="function"){const[s,u]=o1(a);t=t(n!==void 0?n:e.custom,s,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,u]=o1(a);t=t(n!==void 0?n:e.custom,s,u)}return t}function Ps(e,t,n){const a=e.getProps();return Ag(a,t,n!==void 0?n:a.custom,e)}const kz=new Set(["width","height","top","left","right","bottom",...eo]),l1=30,_3=e=>!isNaN(parseFloat(e));class j3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=kn.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=kn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=_3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new xg);const a=this.events[t].add(n);return t==="change"?()=>{a(),bt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=kn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>l1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,l1);return IS(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Hs(e,t){return new j3(e,t)}const bp=e=>Array.isArray(e);function N3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hs(n))}function C3(e){return bp(e)?e[e.length-1]||0:e}function E3(e,t){const n=Ps(e,t);let{transitionEnd:a={},transition:s={},...u}=n||{};u={...u,...a};for(const l in u){const f=C3(u[l]);N3(e,l,f)}}const hn=e=>!!(e&&e.getVelocity);function T3(e){return!!(hn(e)&&e.add)}function vp(e,t){const n=e.getValue("willChange");if(T3(n))return n.add(t);if(!n&&la.WillChange){const a=new la.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Og(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const A3="framerAppearId",wz="data-"+Og(A3);function Sz(e){return e.props[wz]}function O3({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function zz(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:l,...f}=t;const h=u?.reduceMotion;a&&(u=a);const m=[],g=s&&e.animationState&&e.animationState.getState()[s];for(const y in f){const v=e.getValue(y,e.latestValues[y]??null),b=f[y];if(b===void 0||g&&O3(g,y))continue;const S={delay:n,...Eg(u||{},y)},j=v.get();if(j!==void 0&&!v.isAnimating&&!Array.isArray(b)&&b===j&&!S.velocity)continue;let A=!1;if(window.MotionHandoffAnimation){const N=Sz(e);if(N){const L=window.MotionHandoffAnimation(N,y,bt);L!==null&&(S.startTime=L,A=!0)}}vp(e,y);const E=h??e.shouldReduceMotion;v.start(Tg(y,v,b,E&&kz.has(y)?{type:!1}:S,e,A));const O=v.animation;O&&m.push(O)}return l&&Promise.all(m).then(()=>{bt.update(()=>{l&&E3(e,l)})}),m}function kp(e,t,n={}){const a=Ps(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const u=a?()=>Promise.all(zz(e,a,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:g,staggerDirection:y}=s;return R3(e,t,h,m,g,y,n)}:()=>Promise.resolve(),{when:f}=s;if(f){const[h,m]=f==="beforeChildren"?[u,l]:[l,u];return h().then(()=>m())}else return Promise.all([u(),l(n.delay)])}function R3(e,t,n=0,a=0,s=0,u=1,l){const f=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),f.push(kp(h,t,{...l,delay:n+(typeof a=="function"?0:a)+bz(e.variantChildren,h,a,s,u)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(f)}function M3(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(u=>kp(e,u,n));a=Promise.all(s)}else if(typeof t=="string")a=kp(e,t,n);else{const s=typeof t=="function"?Ps(e,t,n.custom):t;a=Promise.all(zz(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const D3={test:e=>e==="auto",parse:e=>e},_z=e=>t=>t.test(e),jz=[Ws,ve,Or,La,lO,oO,D3],u1=e=>jz.find(_z(e));function $3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ZS(e):!0}const L3=new Set(["brightness","contrast","saturate","opacity"]);function P3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(kg)||[];if(!a)return e;const s=n.replace(a,"");let u=L3.has(t)?1:0;return a!==n&&(u*=100),t+"("+u+s+")"}const U3=/\b([a-z-]*)\(.*?\)/gu,wp={...qa,getAnimatableNone:e=>{const t=e.match(U3);return t?t.map(P3).join(" "):e}},c1={...Ws,transform:Math.round},V3={rotate:La,rotateX:La,rotateY:La,rotateZ:La,scale:xc,scaleX:xc,scaleY:xc,scaleZ:xc,skew:La,skewX:La,skewY:La,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:Ol,originX:X0,originY:X0,originZ:ve},Rg={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,inset:ve,insetBlock:ve,insetBlockStart:ve,insetBlockEnd:ve,insetInline:ve,insetInlineStart:ve,insetInlineEnd:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,paddingBlock:ve,paddingBlockStart:ve,paddingBlockEnd:ve,paddingInline:ve,paddingInlineStart:ve,paddingInlineEnd:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,marginBlock:ve,marginBlockStart:ve,marginBlockEnd:ve,marginInline:ve,marginInlineStart:ve,marginInlineEnd:ve,fontSize:ve,backgroundPositionX:ve,backgroundPositionY:ve,...V3,zIndex:c1,fillOpacity:Ol,strokeOpacity:Ol,numOctaves:c1},B3={...Rg,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:wp,WebkitFilter:wp},Nz=e=>B3[e];function Cz(e,t){let n=Nz(e);return n!==wp&&(n=qa),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Z3=new Set(["auto","none","0"]);function I3(e,t,n){let a=0,s;for(;a<e.length&&!s;){const u=e[a];typeof u=="string"&&!Z3.has(u)&&Rl(u).values.length&&(s=e[a]),a++}if(s&&n)for(const u of t)e[u]=Cz(n,s)}class H3 extends Cg{constructor(t,n,a,s,u){super(t,n,a,s,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let g=0;g<t.length;g++){let y=t[g];if(typeof y=="string"&&(y=y.trim(),vg(y))){const v=vz(y,n.current);v!==void 0&&(t[g]=v),g===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!kz.has(a)||t.length!==2)return;const[s,u]=t,l=u1(s),f=u1(u),h=K0(s),m=K0(u);if(h!==m&&Za[a]){this.needsMeasurement=!0;return}if(l!==f)if(a1(l)&&a1(f))for(let g=0;g<t.length;g++){const y=t[g];typeof y=="string"&&(t[g]=parseFloat(y))}else Za[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||$3(t[s]))&&a.push(s);a.length&&I3(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Za[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(a,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const u=a.length-1,l=a[u];a[u]=Za[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([f,h])=>{t.getValue(f).set(h)}),this.resolveNoneKeyframes()}}function F3(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const s=n?.[e]??a.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(a=>a!=null)}const Ez=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Sp(e){return BS(e)&&"offsetHeight"in e}const{schedule:Mg}=ez(queueMicrotask,!1),yr={x:!1,y:!1};function Tz(){return yr.x||yr.y}function q3(e){return e==="x"||e==="y"?yr[e]?null:(yr[e]=!0,()=>{yr[e]=!1}):yr.x||yr.y?null:(yr.x=yr.y=!0,()=>{yr.x=yr.y=!1})}function Az(e,t){const n=F3(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function d1(e){return!(e.pointerType==="touch"||Tz())}function G3(e,t,n={}){const[a,s,u]=Az(e,n),l=f=>{if(!d1(f))return;const{target:h}=f,m=t(h,f);if(typeof m!="function"||!h)return;const g=y=>{d1(y)&&(m(y),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,s)};return a.forEach(f=>{f.addEventListener("pointerenter",l,s)}),u}const Oz=(e,t)=>t?e===t?!0:Oz(e,t.parentElement):!1,Dg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Y3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rz(e){return Y3.has(e.tagName)||e.isContentEditable===!0}const Lc=new WeakSet;function f1(e){return t=>{t.key==="Enter"&&e(t)}}function dm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const K3=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=f1(()=>{if(Lc.has(n))return;dm(n,"down");const s=f1(()=>{dm(n,"up")}),u=()=>dm(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function h1(e){return Dg(e)&&!Tz()}function X3(e,t,n={}){const[a,s,u]=Az(e,n),l=f=>{const h=f.currentTarget;if(!h1(f))return;Lc.add(h);const m=t(h,f),g=(b,S)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),Lc.has(h)&&Lc.delete(h),h1(b)&&typeof m=="function"&&m(b,{success:S})},y=b=>{g(b,h===window||h===document||n.useGlobalTarget||Oz(h,b.target))},v=b=>{g(b,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",v,s)};return a.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",l,s),Sp(f)&&(f.addEventListener("focus",m=>K3(m,s)),!Rz(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function Mz(e){return BS(e)&&"ownerSVGElement"in e}function J3(e){return Mz(e)&&e.tagName==="svg"}const Q3=[...jz,It,qa],W3=e=>Q3.find(_z(e)),m1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ts=()=>({x:m1(),y:m1()}),p1=()=>({min:0,max:0}),Jt=()=>({x:p1(),y:p1()}),zp={current:null},Dz={current:!1},eR=typeof window<"u";function tR(){if(Dz.current=!0,!!eR)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zp.current=e.matches;e.addEventListener("change",t),t()}else zp.current=!1}const nR=new WeakMap;function md(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ml(e){return typeof e=="string"||Array.isArray(e)}const $g=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Lg=["initial",...$g];function pd(e){return md(e.animate)||Lg.some(t=>Ml(e[t]))}function $z(e){return!!(pd(e)||e.variants)}function rR(e,t,n){for(const a in t){const s=t[a],u=n[a];if(hn(s))e.addValue(a,s);else if(hn(u))e.addValue(a,Hs(s,{owner:e}));else if(u!==s)if(e.hasValue(a)){const l=e.getValue(a);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(a);e.addValue(a,Hs(l!==void 0?l:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const g1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Yc={};function Lz(e){Yc=e}function aR(){return Yc}class iR{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,blockInitialAnimation:u,visualState:l},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Cg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=kn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,bt.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=l;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=f,this.blockInitialAnimation=!!u,this.isControllingVariants=pd(n),this.isVariantNode=$z(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in y){const b=y[v];h[v]!==void 0&&hn(b)&&b.set(h[v])}}mount(t){this.current=t,nR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Dz.current||tR(),this.shouldReduceMotion=zp.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Fa(this.notifyUpdate),Fa(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const a=to.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&bt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),u&&u(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Yc){const n=Yc[t];if(!n)continue;const{isEnabled:a,Feature:s}=n;if(!this.features[t]&&s&&a(this.props)&&(this.features[t]=new s(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Jt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<g1.length;a++){const s=g1[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const u="on"+s,l=t[u];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=rR(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=Hs(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(VS(a)||ZS(a))?a=parseFloat(a):!W3(a)&&qa.test(n)&&(a=Cz(t,n)),this.setBaseTarget(t,hn(a)?a.get():a)),hn(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const u=Ag(this.props,n,this.presenceContext?.custom);u&&(a=u[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!hn(s)?s:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new xg),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Mg.render(this.render)}}class Pz extends iR{constructor(){super(...arguments),this.KeyframeResolver=H3}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;hn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ka{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Uz({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function sR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function oR(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function fm(e){return e===void 0||e===1}function _p({scale:e,scaleX:t,scaleY:n}){return!fm(e)||!fm(t)||!fm(n)}function zi(e){return _p(e)||Vz(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vz(e){return x1(e.x)||x1(e.y)}function x1(e){return e&&e!=="0%"}function Kc(e,t,n){const a=e-n,s=t*a;return n+s}function y1(e,t,n,a,s){return s!==void 0&&(e=Kc(e,s,a)),Kc(e,n,a)+t}function jp(e,t=0,n=1,a,s){e.min=y1(e.min,t,n,a,s),e.max=y1(e.max,t,n,a,s)}function Bz(e,{x:t,y:n}){jp(e.x,t.translate,t.scale,t.originPoint),jp(e.y,n.translate,n.scale,n.originPoint)}const b1=.999999999999,v1=1.0000000000001;function lR(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let u,l;for(let f=0;f<s;f++){u=n[f],l=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Os(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Bz(e,l)),a&&zi(u.latestValues)&&Os(e,u.latestValues))}t.x<v1&&t.x>b1&&(t.x=1),t.y<v1&&t.y>b1&&(t.y=1)}function As(e,t){e.min=e.min+t,e.max=e.max+t}function k1(e,t,n,a,s=.5){const u=_t(e.min,e.max,s);jp(e,t,n,u,a)}function Os(e,t){k1(e.x,t.x,t.scaleX,t.scale,t.originX),k1(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zz(e,t){return Uz(oR(e.getBoundingClientRect(),t))}function uR(e,t,n){const a=Zz(e,n),{scroll:s}=t;return s&&(As(a.x,s.offset.x),As(a.y,s.offset.y)),a}const cR={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dR=eo.length;function fR(e,t,n){let a="",s=!0;for(let u=0;u<dR;u++){const l=eo[u],f=e[l];if(f===void 0)continue;let h=!0;if(typeof f=="number")h=f===(l.startsWith("scale")?1:0);else{const m=parseFloat(f);h=l.startsWith("scale")?m===1:m===0}if(!h||n){const m=Ez(f,Rg[l]);if(!h){s=!1;const g=cR[l]||l;a+=`${g}(${m}) `}n&&(t[l]=m)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function Pg(e,t,n){const{style:a,vars:s,transformOrigin:u}=e;let l=!1,f=!1;for(const h in t){const m=t[h];if(to.has(h)){l=!0;continue}else if(nz(h)){s[h]=m;continue}else{const g=Ez(m,Rg[h]);h.startsWith("origin")?(f=!0,u[h]=g):a[h]=g}}if(t.transform||(l||n?a.transform=fR(t,e.transform,n):a.transform&&(a.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:g=0}=u;a.transformOrigin=`${h} ${m} ${g}`}}function Iz(e,{style:t,vars:n},a,s){const u=e.style;let l;for(l in t)u[l]=t[l];s?.applyProjectionStyles(u,a);for(l in n)u.setProperty(l,n[l])}function w1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const il={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ve.test(e))e=parseFloat(e);else return e;const n=w1(e,t.target.x),a=w1(e,t.target.y);return`${n}% ${a}%`}},hR={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=qa.parse(e);if(s.length>5)return a;const u=qa.createTransformer(e),l=typeof s[0]!="number"?1:0,f=n.x.scale*t.x,h=n.y.scale*t.y;s[0+l]/=f,s[1+l]/=h;const m=_t(f,h,.5);return typeof s[2+l]=="number"&&(s[2+l]/=m),typeof s[3+l]=="number"&&(s[3+l]/=m),u(s)}},Np={borderRadius:{...il,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:il,borderTopRightRadius:il,borderBottomLeftRadius:il,borderBottomRightRadius:il,boxShadow:hR};function Hz(e,{layout:t,layoutId:n}){return to.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Np[e]||e==="opacity")}function Ug(e,t,n){const a=e.style,s=t?.style,u={};if(!a)return u;for(const l in a)(hn(a[l])||s&&hn(s[l])||Hz(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(u[l]=a[l]);return u}function mR(e){return window.getComputedStyle(e)}class pR extends Pz{constructor(){super(...arguments),this.type="html",this.renderInstance=Iz}readValueFromInstance(t,n){if(to.has(n))return this.projection?.isProjecting?hp(n):FO(t,n);{const a=mR(t),s=(nz(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zz(t,n)}build(t,n,a){Pg(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Ug(t,n,a)}}const gR={offset:"stroke-dashoffset",array:"stroke-dasharray"},xR={offset:"strokeDashoffset",array:"strokeDasharray"};function yR(e,t,n=1,a=0,s=!0){e.pathLength=1;const u=s?gR:xR;e[u.offset]=`${-a}`,e[u.array]=`${t} ${n}`}const bR=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Fz(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:u=1,pathOffset:l=0,...f},h,m,g){if(Pg(e,f,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:v}=e;y.transform&&(v.transform=y.transform,delete y.transform),(v.transform||y.transformOrigin)&&(v.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const b of bR)y[b]!==void 0&&(v[b]=y[b],delete y[b]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),s!==void 0&&yR(y,s,u,l,!1)}const qz=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Gz=e=>typeof e=="string"&&e.toLowerCase()==="svg";function vR(e,t,n,a){Iz(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(qz.has(s)?s:Og(s),t.attrs[s])}function Yz(e,t,n){const a=Ug(e,t,n);for(const s in e)if(hn(e[s])||hn(t[s])){const u=eo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[u]=e[s]}return a}class kR extends Pz{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(to.has(n)){const a=Nz(n);return a&&a.default||0}return n=qz.has(n)?n:Og(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Yz(t,n,a)}build(t,n,a){Fz(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){vR(t,n,a,s)}mount(t){this.isSVGTag=Gz(t.tagName),super.mount(t)}}const wR=Lg.length;function Kz(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Kz(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<wR;n++){const a=Lg[n],s=e.props[a];(Ml(s)||s===!1)&&(t[a]=s)}return t}function Xz(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const SR=[...$g].reverse(),zR=$g.length;function _R(e){return t=>Promise.all(t.map(({animation:n,options:a})=>M3(e,n,a)))}function jR(e){let t=_R(e),n=S1(),a=!0;const s=h=>(m,g)=>{const y=Ps(e,g,h==="exit"?e.presenceContext?.custom:void 0);if(y){const{transition:v,transitionEnd:b,...S}=y;m={...m,...S,...b}}return m};function u(h){t=h(e)}function l(h){const{props:m}=e,g=Kz(e.parent)||{},y=[],v=new Set;let b={},S=1/0;for(let A=0;A<zR;A++){const E=SR[A],O=n[E],N=m[E]!==void 0?m[E]:g[E],L=Ml(N),D=E===h?O.isActive:null;D===!1&&(S=A);let R=N===g[E]&&N!==m[E]&&L;if(R&&a&&e.manuallyAnimateOnMount&&(R=!1),O.protectedKeys={...b},!O.isActive&&D===null||!N&&!O.prevProp||md(N)||typeof N=="boolean")continue;const q=NR(O.prevProp,N);let B=q||E===h&&O.isActive&&!R&&L||A>S&&L,X=!1;const fe=Array.isArray(N)?N:[N];let se=fe.reduce(s(E),{});D===!1&&(se={});const{prevResolvedValues:le={}}=O,ee={...le,...se},oe=J=>{B=!0,v.has(J)&&(X=!0,v.delete(J)),O.needsAnimating[J]=!0;const Z=e.getValue(J);Z&&(Z.liveStyle=!1)};for(const J in ee){const Z=se[J],me=le[J];if(b.hasOwnProperty(J))continue;let T=!1;bp(Z)&&bp(me)?T=!Xz(Z,me):T=Z!==me,T?Z!=null?oe(J):v.add(J):Z!==void 0&&v.has(J)?oe(J):O.protectedKeys[J]=!0}O.prevProp=N,O.prevResolvedValues=se,O.isActive&&(b={...b,...se}),a&&e.blockInitialAnimation&&(B=!1);const ae=R&&q;B&&(!ae||X)&&y.push(...fe.map(J=>{const Z={type:E};if(typeof J=="string"&&a&&!ae&&e.manuallyAnimateOnMount&&e.parent){const{parent:me}=e,T=Ps(me,J);if(me.enteringChildren&&T){const{delayChildren:C}=T.transition||{};Z.delay=bz(me.enteringChildren,e,C)}}return{animation:J,options:Z}}))}if(v.size){const A={};if(typeof m.initial!="boolean"){const E=Ps(e,Array.isArray(m.initial)?m.initial[0]:m.initial);E&&E.transition&&(A.transition=E.transition)}v.forEach(E=>{const O=e.getBaseTarget(E),N=e.getValue(E);N&&(N.liveStyle=!0),A[E]=O??null}),y.push({animation:A})}let j=!!y.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(j=!1),a=!1,j?t(y):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();e.variantChildren?.forEach(y=>y.animationState?.setActive(h,m)),n[h].isActive=m;const g=l(h);for(const y in n)n[y].protectedKeys={};return g}return{animateChanges:l,setActive:f,setAnimateFunction:u,getState:()=>n,reset:()=>{n=S1()}}}function NR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Xz(t,e):!1}function bi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function S1(){return{animate:bi(!0),whileInView:bi(),whileHover:bi(),whileTap:bi(),whileDrag:bi(),whileFocus:bi(),exit:bi()}}function z1(e,t){e.min=t.min,e.max=t.max}function xr(e,t){z1(e.x,t.x),z1(e.y,t.y)}function _1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Jz=1e-4,CR=1-Jz,ER=1+Jz,Qz=.01,TR=0-Qz,AR=0+Qz;function wn(e){return e.max-e.min}function OR(e,t,n){return Math.abs(e-t)<=n}function j1(e,t,n,a=.5){e.origin=a,e.originPoint=_t(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),e.translate=_t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CR&&e.scale<=ER||isNaN(e.scale))&&(e.scale=1),(e.translate>=TR&&e.translate<=AR||isNaN(e.translate))&&(e.translate=0)}function kl(e,t,n,a){j1(e.x,t.x,n.x,a?a.originX:void 0),j1(e.y,t.y,n.y,a?a.originY:void 0)}function N1(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function RR(e,t,n){N1(e.x,t.x,n.x),N1(e.y,t.y,n.y)}function C1(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function Xc(e,t,n){C1(e.x,t.x,n.x),C1(e.y,t.y,n.y)}function E1(e,t,n,a,s){return e-=t,e=Kc(e,1/n,a),s!==void 0&&(e=Kc(e,1/s,a)),e}function MR(e,t=0,n=1,a=.5,s,u=e,l=e){if(Or.test(t)&&(t=parseFloat(t),t=_t(l.min,l.max,t/100)-l.min),typeof t!="number")return;let f=_t(u.min,u.max,a);e===u&&(f-=t),e.min=E1(e.min,t,n,f,s),e.max=E1(e.max,t,n,f,s)}function T1(e,t,[n,a,s],u,l){MR(e,t[n],t[a],t[s],t.scale,u,l)}const DR=["x","scaleX","originX"],$R=["y","scaleY","originY"];function A1(e,t,n,a){T1(e.x,t,DR,n?n.x:void 0,a?a.x:void 0),T1(e.y,t,$R,n?n.y:void 0,a?a.y:void 0)}function O1(e){return e.translate===0&&e.scale===1}function Wz(e){return O1(e.x)&&O1(e.y)}function R1(e,t){return e.min===t.min&&e.max===t.max}function LR(e,t){return R1(e.x,t.x)&&R1(e.y,t.y)}function M1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function e_(e,t){return M1(e.x,t.x)&&M1(e.y,t.y)}function D1(e){return wn(e.x)/wn(e.y)}function $1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function sr(e){return[e("x"),e("y")]}function PR(e,t,n){let a="";const s=e.x.translate/t.x,u=e.y.translate/t.y,l=n?.z||0;if((s||u||l)&&(a=`translate3d(${s}px, ${u}px, ${l}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:y,rotateY:v,skewX:b,skewY:S}=n;m&&(a=`perspective(${m}px) ${a}`),g&&(a+=`rotate(${g}deg) `),y&&(a+=`rotateX(${y}deg) `),v&&(a+=`rotateY(${v}deg) `),b&&(a+=`skewX(${b}deg) `),S&&(a+=`skewY(${S}deg) `)}const f=e.x.scale*t.x,h=e.y.scale*t.y;return(f!==1||h!==1)&&(a+=`scale(${f}, ${h})`),a||"none"}const t_=["TopLeft","TopRight","BottomLeft","BottomRight"],UR=t_.length,L1=e=>typeof e=="string"?parseFloat(e):e,P1=e=>typeof e=="number"||ve.test(e);function VR(e,t,n,a,s,u){s?(e.opacity=_t(0,n.opacity??1,BR(a)),e.opacityExit=_t(t.opacity??1,0,ZR(a))):u&&(e.opacity=_t(t.opacity??1,n.opacity??1,a));for(let l=0;l<UR;l++){const f=`border${t_[l]}Radius`;let h=U1(t,f),m=U1(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||P1(h)===P1(m)?(e[f]=Math.max(_t(L1(h),L1(m),a),0),(Or.test(m)||Or.test(h))&&(e[f]+="%")):e[f]=m}(t.rotate||n.rotate)&&(e.rotate=_t(t.rotate||0,n.rotate||0,a))}function U1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const BR=n_(0,.5,XS),ZR=n_(.5,.95,cr);function n_(e,t,n){return a=>a<e?0:a>t?1:n(Al(e,t,a))}function IR(e,t,n){const a=hn(e)?e:Hs(e);return a.start(Tg("",a,t,n)),a.animation}function Dl(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const HR=(e,t)=>e.depth-t.depth;class FR{constructor(){this.children=[],this.isDirty=!1}add(t){hg(this.children,t),this.isDirty=!0}remove(t){mg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(HR),this.isDirty=!1,this.children.forEach(t)}}function qR(e,t){const n=kn.now(),a=({timestamp:s})=>{const u=s-n;u>=t&&(Fa(a),e(u-t))};return bt.setup(a,!0),()=>Fa(a)}function Pc(e){return hn(e)?e.get():e}class GR{constructor(){this.members=[]}add(t){hg(this.members,t),t.scheduleRender()}remove(t){if(mg(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let a;for(let s=n;s>=0;s--){const u=this.members[s];if(u.isPresent!==!1){a=u;break}}return a?(this.promote(a),!0):!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender();const s=a.options.layoutDependency,u=t.options.layoutDependency;s!==void 0&&u!==void 0&&s===u||(t.resumeFrom=a,n&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:f}=t.options;f===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:a}=t;n.onExitComplete&&n.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Uc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},hm=["","X","Y","Z"],YR=1e3;let KR=0;function mm(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function r_(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Sz(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",bt,!(s||u))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&r_(a)}function a_({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(l={},f=t?.()){this.id=KR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(QR),this.nodes.forEach(nM),this.nodes.forEach(rM),this.nodes.forEach(WR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new FR)}addEventListener(l,f){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new xg),this.eventHandlers.get(l).add(f)}notifyListeners(l,...f){const h=this.eventHandlers.get(l);h&&h.notify(...f)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Mz(l)&&!J3(l),this.instance=l;const{layoutId:f,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||f)&&(this.isLayoutDirty=!0),e){let g,y=0;const v=()=>this.root.updateBlockedByResize=!1;bt.read(()=>{y=window.innerWidth}),e(l,()=>{const b=window.innerWidth;b!==y&&(y=b,this.root.updateBlockedByResize=!0,g&&g(),g=qR(v,250),Uc.hasAnimatedSinceResize&&(Uc.hasAnimatedSinceResize=!1,this.nodes.forEach(Z1)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||h)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:v,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||m.getDefaultTransition()||lM,{onLayoutAnimationStart:j,onLayoutAnimationComplete:A}=m.getProps(),E=!this.targetLayout||!e_(this.targetLayout,b),O=!y&&v;if(this.options.layoutRoot||this.resumeFrom||O||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...Eg(S,"layout"),onPlay:j,onComplete:A};(m.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(g,O)}else y||Z1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Fa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aM),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&r_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:f,layout:h}=this.options;if(f===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(V1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(B1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(tM),this.nodes.forEach(XR),this.nodes.forEach(JR)):this.nodes.forEach(B1),this.clearAllSnapshots();const f=kn.now();ln.delta=Mr(0,1e3/60,f-ln.timestamp),ln.timestamp=f,ln.isProcessing=!0,im.update.process(ln),im.preRender.process(ln),im.render.process(ln),ln.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eM),this.sharedNodes.forEach(iM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,bt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){bt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!wn(this.snapshot.measuredBox.x)&&!wn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Jt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(f=!1),f&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!Wz(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;l&&this.instance&&(f||zi(this.latestValues)||g)&&(s(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return l&&(h=this.removeTransform(h)),uM(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Jt();const f=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(cM))){const{scroll:m}=this.root;m&&(As(f.x,m.offset.x),As(f.y,m.offset.y))}return f}removeElementScroll(l){const f=Jt();if(xr(f,l),this.scroll?.wasRoot)return f;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:g,options:y}=m;m!==this.root&&g&&y.layoutScroll&&(g.wasRoot&&xr(f,l),As(f.x,g.offset.x),As(f.y,g.offset.y))}return f}applyTransform(l,f=!1){const h=Jt();xr(h,l);for(let m=0;m<this.path.length;m++){const g=this.path[m];!f&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Os(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),zi(g.latestValues)&&Os(h,g.latestValues)}return zi(this.latestValues)&&Os(h,this.latestValues),h}removeTransform(l){const f=Jt();xr(f,l);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!zi(m.latestValues))continue;_p(m.latestValues)&&m.updateSnapshot();const g=Jt(),y=m.measurePageBox();xr(g,y),A1(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return zi(this.latestValues)&&A1(f,this.latestValues),f}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ln.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;if(!(l||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:y}=this.options;if(!this.layout||!(g||y))return;this.resolvedRelativeTargetAt=ln.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Jt(),this.targetWithTransforms=Jt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),RR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xr(this.target,this.layout.layoutBox),Bz(this.target,this.targetDelta)):xr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||_p(this.parent.latestValues)||Vz(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,f,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jt(),this.relativeTargetOrigin=Jt(),Xc(this.relativeTargetOrigin,f,h),xr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),f=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===ln.timestamp&&(h=!1),h)return;const{layout:m,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||g))return;xr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,v=this.treeScale.y;lR(this.layoutCorrected,this.treeScale,this.path,f),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Jt());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_1(this.prevProjectionDelta.x,this.projectionDelta.x),_1(this.prevProjectionDelta.y,this.projectionDelta.y)),kl(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==v||!$1(this.projectionDelta.x,this.prevProjectionDelta.x)||!$1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ts(),this.projectionDelta=Ts(),this.projectionDeltaWithTransform=Ts()}setAnimationOrigin(l,f=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},y=Ts();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const v=Jt(),b=h?h.source:void 0,S=this.layout?this.layout.source:void 0,j=b!==S,A=this.getStack(),E=!A||A.members.length<=1,O=!!(j&&!E&&this.options.crossfade===!0&&!this.path.some(oM));this.animationProgress=0;let N;this.mixTargetDelta=L=>{const D=L/1e3;I1(y.x,l.x,D),I1(y.y,l.y,D),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xc(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sM(this.relativeTarget,this.relativeTargetOrigin,v,D),N&&LR(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=Jt()),xr(N,this.relativeTarget)),j&&(this.animationValues=g,VR(g,m,this.latestValues,D,O,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Fa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=bt.update(()=>{Uc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hs(0)),this.currentAnimation=IR(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),l.onUpdate&&l.onUpdate(f)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:f,target:h,layout:m,latestValues:g}=l;if(!(!f||!h||!m)){if(this!==l&&this.layout&&m&&i_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||Jt();const y=wn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+y;const v=wn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+v}xr(f,h),Os(f,g),kl(this.projectionDeltaWithTransform,this.layoutCorrected,f,g)}}registerSharedNode(l,f){this.sharedNodes.has(l)||this.sharedNodes.set(l,new GR),this.sharedNodes.get(l).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let f=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&mm("z",l,m,this.animationValues);for(let g=0;g<hm.length;g++)mm(`rotate${hm[g]}`,l,m,this.animationValues),mm(`skew${hm[g]}`,l,m,this.animationValues);l.render();for(const g in m)l.setStaticValue(g,m[g]),this.animationValues&&(this.animationValues[g]=m[g]);l.scheduleRender()}applyProjectionStyles(l,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Pc(f?.pointerEvents)||"",l.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Pc(f?.pointerEvents)||""),this.hasProjected&&!zi(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const g=m.animationValues||m.latestValues;this.applyTransformsToTarget();let y=PR(this.projectionDeltaWithTransform,this.treeScale,g);h&&(y=h(g,y)),l.transform=y;const{x:v,y:b}=this.projectionDelta;l.transformOrigin=`${v.origin*100}% ${b.origin*100}% 0`,m.animationValues?l.opacity=m===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:l.opacity=m===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const S in Np){if(g[S]===void 0)continue;const{correct:j,applyTo:A,isCSSVariable:E}=Np[S],O=y==="none"?g[S]:j(g[S],m);if(A){const N=A.length;for(let L=0;L<N;L++)l[A[L]]=O}else E?this.options.visualElement.renderState.vars[S]=O:l[S]=O}this.options.layoutId&&(l.pointerEvents=m===this?Pc(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(V1),this.root.sharedNodes.clear()}}}function XR(e){e.updateLayout()}function JR(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:s}=e.options,u=t.source!==e.layout.source;s==="size"?sr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],v=wn(y);y.min=n[g].min,y.max=y.min+v}):i_(s,t.layoutBox,n)&&sr(g=>{const y=u?t.measuredBox[g]:t.layoutBox[g],v=wn(n[g]);y.max=y.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+v)});const l=Ts();kl(l,n,t.layoutBox);const f=Ts();u?kl(f,e.applyTransform(a,!0),t.measuredBox):kl(f,n,t.layoutBox);const h=!Wz(l);let m=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:v}=g;if(y&&v){const b=Jt();Xc(b,t.layoutBox,y.layoutBox);const S=Jt();Xc(S,n,v.layoutBox),e_(b,S)||(m=!0),g.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=b,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:f,layoutDelta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function QR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function WR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eM(e){e.clearSnapshot()}function V1(e){e.clearMeasurements()}function B1(e){e.isLayoutDirty=!1}function tM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Z1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nM(e){e.resolveTargetDelta()}function rM(e){e.calcProjection()}function aM(e){e.resetSkewAndRotation()}function iM(e){e.removeLeadSnapshot()}function I1(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function H1(e,t,n,a){e.min=_t(t.min,n.min,a),e.max=_t(t.max,n.max,a)}function sM(e,t,n,a){H1(e.x,t.x,n.x,a),H1(e.y,t.y,n.y,a)}function oM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lM={duration:.45,ease:[.4,0,.1,1]},F1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),q1=F1("applewebkit/")&&!F1("chrome/")?Math.round:cr;function G1(e){e.min=q1(e.min),e.max=q1(e.max)}function uM(e){G1(e.x),G1(e.y)}function i_(e,t,n){return e==="position"||e==="preserve-aspect"&&!OR(D1(t),D1(n),.2)}function cM(e){return e!==e.root&&e.scroll?.wasRoot}const dM=a_({attachResizeListener:(e,t)=>Dl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pm={current:void 0},s_=a_({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pm.current){const e=new dM({});e.mount(window),e.setOptions({layoutScroll:!0}),pm.current=e}return pm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Vg=z.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Y1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fM(...e){return t=>{let n=!1;const a=e.map(s=>{const u=Y1(s,t);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let s=0;s<a.length;s++){const u=a[s];typeof u=="function"?u():Y1(e[s],null)}}}}function hM(...e){return z.useCallback(fM(...e),e)}class mM extends z.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const a=n.offsetParent,s=Sp(a)&&a.offsetWidth||0,u=Sp(a)&&a.offsetHeight||0,l=this.props.sizeRef.current;l.height=n.offsetHeight||0,l.width=n.offsetWidth||0,l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=u-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function pM({children:e,isPresent:t,anchorX:n,anchorY:a,root:s}){const u=z.useId(),l=z.useRef(null),f=z.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=z.useContext(Vg),m=e.props?.ref??e?.ref,g=hM(l,m);return z.useInsertionEffect(()=>{const{width:y,height:v,top:b,left:S,right:j,bottom:A}=f.current;if(t||!l.current||!y||!v)return;const E=n==="left"?`left: ${S}`:`right: ${j}`,O=a==="bottom"?`bottom: ${A}`:`top: ${b}`;l.current.dataset.motionPopId=u;const N=document.createElement("style");h&&(N.nonce=h);const L=s??document.head;return L.appendChild(N),N.sheet&&N.sheet.insertRule(`
|
|
12
|
-
[data-motion-pop-id="${u}"] {
|
|
13
|
-
position: absolute !important;
|
|
14
|
-
width: ${y}px !important;
|
|
15
|
-
height: ${v}px !important;
|
|
16
|
-
${E}px !important;
|
|
17
|
-
${O}px !important;
|
|
18
|
-
}
|
|
19
|
-
`),()=>{L.contains(N)&&L.removeChild(N)}},[t]),d.jsx(mM,{isPresent:t,childRef:l,sizeRef:f,children:z.cloneElement(e,{ref:g})})}const gM=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:u,mode:l,anchorX:f,anchorY:h,root:m})=>{const g=fg(xM),y=z.useId();let v=!0,b=z.useMemo(()=>(v=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:S=>{g.set(S,!0);for(const j of g.values())if(!j)return;a&&a()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[n,g,a]);return u&&v&&(b={...b}),z.useMemo(()=>{g.forEach((S,j)=>g.set(j,!1))},[n]),z.useEffect(()=>{!n&&!g.size&&a&&a()},[n]),l==="popLayout"&&(e=d.jsx(pM,{isPresent:n,anchorX:f,anchorY:h,root:m,children:e})),d.jsx(hd.Provider,{value:b,children:e})};function xM(){return new Map}function o_(e=!0){const t=z.useContext(hd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,u=z.useId();z.useEffect(()=>{if(e)return s(u)},[e]);const l=z.useCallback(()=>e&&a&&a(u),[u,a,e]);return!n&&a?[!1,l]:[!0]}const yc=e=>e.key||"";function K1(e){const t=[];return z.Children.forEach(e,n=>{z.isValidElement(n)&&t.push(n)}),t}const yM=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:u="sync",propagate:l=!1,anchorX:f="left",anchorY:h="top",root:m})=>{const[g,y]=o_(l),v=z.useMemo(()=>K1(e),[e]),b=l&&!g?[]:v.map(yc),S=z.useRef(!0),j=z.useRef(v),A=fg(()=>new Map),E=z.useRef(new Set),[O,N]=z.useState(v),[L,D]=z.useState(v);US(()=>{S.current=!1,j.current=v;for(let B=0;B<L.length;B++){const X=yc(L[B]);b.includes(X)?(A.delete(X),E.current.delete(X)):A.get(X)!==!0&&A.set(X,!1)}},[L,b.length,b.join("-")]);const R=[];if(v!==O){let B=[...v];for(let X=0;X<L.length;X++){const fe=L[X],se=yc(fe);b.includes(se)||(B.splice(X,0,fe),R.push(fe))}return u==="wait"&&R.length&&(B=R),D(K1(B)),N(v),null}const{forceRender:q}=z.useContext(dg);return d.jsx(d.Fragment,{children:L.map(B=>{const X=yc(B),fe=l&&!g?!1:v===L||b.includes(X),se=()=>{if(E.current.has(X))return;if(E.current.add(X),A.has(X))A.set(X,!0);else return;let le=!0;A.forEach(ee=>{ee||(le=!1)}),le&&(q?.(),D(j.current),l&&y?.(),a&&a())};return d.jsx(gM,{isPresent:fe,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:u,root:m,onExitComplete:fe?void 0:se,anchorX:f,anchorY:h,children:B},X)})})},l_=z.createContext({strict:!1}),X1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let J1=!1;function bM(){if(J1)return;const e={};for(const t in X1)e[t]={isEnabled:n=>X1[t].some(a=>!!n[a])};Lz(e),J1=!0}function u_(){return bM(),aR()}function vM(e){const t=u_();for(const n in e)t[n]={...t[n],...e[n]};Lz(t)}const kM=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||kM.has(e)}let c_=e=>!Jc(e);function wM(e){typeof e=="function"&&(c_=t=>t.startsWith("on")?!Jc(t):e(t))}try{wM(require("@emotion/is-prop-valid").default)}catch{}function SM(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||(c_(s)||n===!0&&Jc(s)||!t&&!Jc(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const gd=z.createContext({});function zM(e,t){if(pd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Ml(n)?n:void 0,animate:Ml(a)?a:void 0}}return e.inherit!==!1?t:{}}function _M(e){const{initial:t,animate:n}=zM(e,z.useContext(gd));return z.useMemo(()=>({initial:t,animate:n}),[Q1(t),Q1(n)])}function Q1(e){return Array.isArray(e)?e.join(" "):e}const Bg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function d_(e,t,n){for(const a in t)!hn(t[a])&&!Hz(a,n)&&(e[a]=t[a])}function jM({transformTemplate:e},t){return z.useMemo(()=>{const n=Bg();return Pg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NM(e,t){const n=e.style||{},a={};return d_(a,n,e),Object.assign(a,jM(e,t)),a}function CM(e,t){const n={},a=NM(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const f_=()=>({...Bg(),attrs:{}});function EM(e,t,n,a){const s=z.useMemo(()=>{const u=f_();return Fz(u,t,Gz(a),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};d_(u,e.style,e),s.style={...u,...s.style}}return s}const TM=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Zg(e){return typeof e!="string"||e.includes("-")?!1:!!(TM.indexOf(e)>-1||/[A-Z]/u.test(e))}function AM(e,t,n,{latestValues:a},s,u=!1,l){const h=(l??Zg(e)?EM:CM)(t,a,s,e),m=SM(t,typeof e=="string",u),g=e!==z.Fragment?{...m,...h,ref:n}:{},{children:y}=t,v=z.useMemo(()=>hn(y)?y.get():y,[y]);return z.createElement(e,{...g,children:v})}function OM({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:RM(n,a,s,e),renderState:t()}}function RM(e,t,n,a){const s={},u=a(e,{});for(const v in u)s[v]=Pc(u[v]);let{initial:l,animate:f}=e;const h=pd(e),m=$z(e);t&&m&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),f===void 0&&(f=t.animate));let g=n?n.initial===!1:!1;g=g||l===!1;const y=g?f:l;if(y&&typeof y!="boolean"&&!md(y)){const v=Array.isArray(y)?y:[y];for(let b=0;b<v.length;b++){const S=Ag(e,v[b]);if(S){const{transitionEnd:j,transition:A,...E}=S;for(const O in E){let N=E[O];if(Array.isArray(N)){const L=g?N.length-1:0;N=N[L]}N!==null&&(s[O]=N)}for(const O in j)s[O]=j[O]}}}return s}const h_=e=>(t,n)=>{const a=z.useContext(gd),s=z.useContext(hd),u=()=>OM(e,t,a,s);return n?u():fg(u)},MM=h_({scrapeMotionValuesFromProps:Ug,createRenderState:Bg}),DM=h_({scrapeMotionValuesFromProps:Yz,createRenderState:f_}),$M=Symbol.for("motionComponentSymbol");function LM(e,t,n){const a=z.useRef(n);z.useInsertionEffect(()=>{a.current=n});const s=z.useRef(null);return z.useCallback(u=>{u&&e.onMount?.(u),t&&(u?t.mount(u):t.unmount());const l=a.current;if(typeof l=="function")if(u){const f=l(u);typeof f=="function"&&(s.current=f)}else s.current?(s.current(),s.current=null):l(u);else l&&(l.current=u)},[t])}const m_=z.createContext({});function pl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function PM(e,t,n,a,s,u){const{visualElement:l}=z.useContext(gd),f=z.useContext(l_),h=z.useContext(hd),m=z.useContext(Vg).reducedMotion,g=z.useRef(null),y=z.useRef(!1);a=a||f.renderer,!g.current&&a&&(g.current=a(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,isSVG:u}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,b=z.useContext(m_);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&UM(g.current,n,s,b);const S=z.useRef(!1);z.useInsertionEffect(()=>{v&&S.current&&v.update(n,h)});const j=n[wz],A=z.useRef(!!j&&!window.MotionHandoffIsComplete?.(j)&&window.MotionHasOptimisedAnimation?.(j));return US(()=>{y.current=!0,v&&(S.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),A.current&&v.animationState&&v.animationState.animateChanges())}),z.useEffect(()=>{v&&(!A.current&&v.animationState&&v.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(j)}),A.current=!1),v.enteringChildren=void 0)}),v}function UM(e,t,n,a){const{layoutId:s,layout:u,drag:l,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:p_(e.parent)),e.projection.setOptions({layoutId:s,layout:u,alwaysMeasureLayout:!!l||f&&pl(f),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:m})}function p_(e){if(e)return e.options.allowProjection!==!1?e.projection:p_(e.parent)}function gm(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&vM(a);const u=n?n==="svg":Zg(e),l=u?DM:MM;function f(m,g){let y;const v={...z.useContext(Vg),...m,layoutId:VM(m)},{isStatic:b}=v,S=_M(m),j=l(m,b);if(!b&&PS){BM();const A=ZM(v);y=A.MeasureLayout,S.visualElement=PM(e,j,v,s,A.ProjectionNode,u)}return d.jsxs(gd.Provider,{value:S,children:[y&&S.visualElement?d.jsx(y,{visualElement:S.visualElement,...v}):null,AM(e,m,LM(j,S.visualElement,g),j,b,t,u)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=z.forwardRef(f);return h[$M]=e,h}function VM({layoutId:e}){const t=z.useContext(dg).id;return t&&e!==void 0?t+"-"+e:e}function BM(e,t){z.useContext(l_).strict}function ZM(e){const t=u_(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function IM(e,t){if(typeof Proxy>"u")return gm;const n=new Map,a=(u,l)=>gm(u,l,e,t),s=(u,l)=>a(u,l);return new Proxy(s,{get:(u,l)=>l==="create"?a:(n.has(l)||n.set(l,gm(l,void 0,e,t)),n.get(l))})}const HM=(e,t)=>t.isSVG??Zg(e)?new kR(t):new pR(t,{allowProjection:e!==z.Fragment});class FM extends Ka{constructor(t){super(t),t.animationState||(t.animationState=jR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();md(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let qM=0;class GM extends Ka{constructor(){super(...arguments),this.id=qM++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const YM={animation:{Feature:FM},exit:{Feature:GM}};function Yl(e){return{point:{x:e.pageX,y:e.pageY}}}const KM=e=>t=>Dg(t)&&e(t,Yl(t));function wl(e,t,n,a){return Dl(e,t,KM(n),a)}const g_=({current:e})=>e?e.ownerDocument.defaultView:null,W1=(e,t)=>Math.abs(e-t);function XM(e,t){const n=W1(e.x,t.x),a=W1(e.y,t.y);return Math.sqrt(n**2+a**2)}const ek=new Set(["auto","scroll"]);class x_{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:u=!1,distanceThreshold:l=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=ym(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,j=XM(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!j)return;const{point:A}=b,{timestamp:E}=ln;this.history.push({...A,timestamp:E});const{onStart:O,onMove:N}=this.handlers;S||(O&&O(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,b)},this.handlePointerMove=(b,S)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=xm(S,this.transformPagePoint),bt.update(this.updatePoint,!0)},this.handlePointerUp=(b,S)=>{this.end();const{onEnd:j,onSessionEnd:A,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=ym(b.type==="pointercancel"?this.lastMoveEventInfo:xm(S,this.transformPagePoint),this.history);this.startEvent&&j&&j(b,O),A&&A(b,O)},!Dg(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=s||window;const h=Yl(t),m=xm(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=ln;this.history=[{...g,timestamp:y}];const{onSessionStart:v}=n;v&&v(t,ym(m,this.history)),this.removeListeners=Fl(wl(this.contextWindow,"pointermove",this.handlePointerMove),wl(this.contextWindow,"pointerup",this.handlePointerUp),wl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(ek.has(a.overflowX)||ek.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},u={x:s.x-n.x,y:s.y-n.y};u.x===0&&u.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(t,s),bt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Fa(this.updatePoint)}}function xm(e,t){return t?{point:t(e.point)}:e}function tk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ym({point:e},t){return{point:e,delta:tk(e,y_(t)),offset:tk(e,JM(t)),velocity:QM(t,.1)}}function JM(e){return e[0]}function y_(e){return e[e.length-1]}function QM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=y_(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>sa(t)));)n--;if(!a)return{x:0,y:0};const u=ur(s.timestamp-a.timestamp);if(u===0)return{x:0,y:0};const l={x:(s.x-a.x)/u,y:(s.y-a.y)/u};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function WM(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?_t(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?_t(n,e,a.max):Math.min(e,n)),e}function nk(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function eD(e,{top:t,left:n,bottom:a,right:s}){return{x:nk(e.x,n,s),y:nk(e.y,t,a)}}function rk(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function tD(e,t){return{x:rk(e.x,t.x),y:rk(e.y,t.y)}}function nD(e,t){let n=.5;const a=wn(e),s=wn(t);return s>a?n=Al(t.min,t.max-a,e.min):a>s&&(n=Al(e.min,e.max-s,t.min)),Mr(0,1,n)}function rD(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Cp=.35;function aD(e=Cp){return e===!1?e=0:e===!0&&(e=Cp),{x:ak(e,"left","right"),y:ak(e,"top","bottom")}}function ak(e,t,n){return{min:ik(e,t),max:ik(e,n)}}function ik(e,t){return typeof e=="number"?e:e[t]||0}const iD=new WeakMap;class sD{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Jt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const u=y=>{n?(this.stopAnimation(),this.snapToCursor(Yl(y).point)):this.pauseAnimation()},l=(y,v)=>{this.stopAnimation();const{drag:b,dragPropagation:S,onDragStart:j}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=q3(b),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sr(E=>{let O=this.getAxisMotionValue(E).get()||0;if(Or.test(O)){const{projection:N}=this.visualElement;if(N&&N.layout){const L=N.layout.layoutBox[E];L&&(O=wn(L)*(parseFloat(O)/100))}}this.originPoint[E]=O}),j&&bt.postRender(()=>j(y,v)),vp(this.visualElement,"transform");const{animationState:A}=this.visualElement;A&&A.setActive("whileDrag",!0)},f=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:j,onDrag:A}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=v;if(S&&this.currentDirection===null){this.currentDirection=oD(E),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),A&&A(y,v)},h=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>sr(y=>this.getAnimationState(y)==="paused"&&this.getAxisMotionValue(y).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new x_(t,{onSessionStart:u,onStart:l,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:a,contextWindow:g_(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!s||!a)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:f}=this.getProps();f&&bt.postRender(()=>f(a,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:s}=this.getProps();if(!a||!bc(t,s,this.currentDirection))return;const u=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=WM(l,this.constraints[t],this.elastic[t])),u.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&pl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=eD(a.layoutBox,t):this.constraints=!1,this.elastic=aD(n),s!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&sr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=rD(a.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!pl(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const u=uR(a,s.root,this.visualElement.getTransformPagePoint());let l=tD(s.layout.layoutBox,u);if(n){const f=n(sR(l));this.hasMutatedConstraints=!!f,f&&(l=Uz(f))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:u,dragSnapToOrigin:l,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=sr(g=>{if(!bc(g,n,this.currentDirection))return;let y=h&&h[g]||{};l&&(y={min:0,max:0});const v=s?200:1e6,b=s?40:1e7,S={type:"inertia",velocity:a?t[g]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(f)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return vp(this.visualElement,t),a.start(Tg(t,a,0,n,this.visualElement,!1))}stopAnimation(){sr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){sr(n=>{const{drag:a}=this.getProps();if(!bc(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,u=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:f}=s.layout.layoutBox[n],h=u.get()||0;u.set(t[n]-_t(l,f,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!pl(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};sr(l=>{const f=this.getAxisMotionValue(l);if(f&&this.constraints!==!1){const h=f.get();s[l]=nD({min:h,max:h},this.constraints[l])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),sr(l=>{if(!bc(l,t,null))return;const f=this.getAxisMotionValue(l),{min:h,max:m}=this.constraints[l];f.set(_t(h,m,s[l]))})}addListeners(){if(!this.visualElement.current)return;iD.set(this.visualElement,this);const t=this.visualElement.current,n=wl(t,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps(),y=h.target,v=y!==t&&Rz(y);m&&g&&!v&&this.start(h)}),a=()=>{const{dragConstraints:h}=this.getProps();pl(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,u=s.addEventListener("measure",a);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),bt.read(a);const l=Dl(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(sr(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=h[g].translate,y.set(y.get()+h[g].translate))}),this.visualElement.render())}));return()=>{l(),n(),u(),f&&f()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:u=!1,dragElastic:l=Cp,dragMomentum:f=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:u,dragElastic:l,dragMomentum:f}}}function bc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oD(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class lD extends Ka{constructor(t){super(t),this.removeGroupControls=cr,this.removeListeners=cr,this.controls=new sD(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const sk=e=>(t,n)=>{e&&bt.postRender(()=>e(t,n))};class uD extends Ka{constructor(){super(...arguments),this.removePointerDownListener=cr}onPointerDown(t){this.session=new x_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:g_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:sk(t),onStart:sk(n),onMove:a,onEnd:(u,l)=>{delete this.session,s&&bt.postRender(()=>s(u,l))}}}mount(){this.removePointerDownListener=wl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let bm=!1;class cD extends z.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:u}=t;u&&(n.group&&n.group.add(u),a&&a.register&&s&&a.register(u),bm&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Uc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:u}=this.props,{projection:l}=a;return l&&(l.isPresent=u,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),bm=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==u?l.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?l.promote():l.relegate()||bt.postRender(()=>{const f=l.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Mg.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;bm=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function b_(e){const[t,n]=o_(),a=z.useContext(dg);return d.jsx(cD,{...e,layoutGroup:a,switchLayoutGroup:z.useContext(m_),isPresent:t,safeToRemove:n})}const dD={pan:{Feature:uD},drag:{Feature:lD,ProjectionNode:s_,MeasureLayout:b_}};function ok(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,u=a[s];u&&bt.postRender(()=>u(t,Yl(t)))}class fD extends Ka{mount(){const{current:t}=this.node;t&&(this.unmount=G3(t,(n,a)=>(ok(this.node,a,"Start"),s=>ok(this.node,s,"End"))))}unmount(){}}class hD extends Ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fl(Dl(this.node.current,"focus",()=>this.onFocus()),Dl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lk(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),u=a[s];u&&bt.postRender(()=>u(t,Yl(t)))}class mD extends Ka{mount(){const{current:t}=this.node;t&&(this.unmount=X3(t,(n,a)=>(lk(this.node,a,"Start"),(s,{success:u})=>lk(this.node,s,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ep=new WeakMap,vm=new WeakMap,pD=e=>{const t=Ep.get(e.target);t&&t(e)},gD=e=>{e.forEach(pD)};function xD({root:e,...t}){const n=e||document;vm.has(n)||vm.set(n,{});const a=vm.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(gD,{root:e,...t})),a[s]}function yD(e,t,n){const a=xD(t);return Ep.set(e,n),a.observe(e),()=>{Ep.delete(e),a.unobserve(e)}}const bD={some:0,all:1};class vD extends Ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:s="some",once:u}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:bD[s]},f=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),v=m?g:y;v&&v(h)};return yD(this.node.current,l,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(kD(t,n))&&this.startObserver()}unmount(){}}function kD({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wD={inView:{Feature:vD},tap:{Feature:mD},focus:{Feature:hD},hover:{Feature:fD}},SD={layout:{ProjectionNode:s_,MeasureLayout:b_}},zD={...YM,...wD,...dD,...SD},qe=IM(zD,HM),v_=()=>{const[e,t]=z.useState(!!localStorage.getItem("morpheus.auth.token"));return z.useEffect(()=>{const s=()=>{t(!!localStorage.getItem("morpheus.auth.token"))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]),{isAuthenticated:e,login:s=>{localStorage.setItem("morpheus.auth.token",s),t(!0)},logout:()=>{localStorage.removeItem("morpheus.auth.token"),t(!1),window.location.href="/login"}}};function _D({onMenuClick:e,isDark:t,toggleTheme:n}){return d.jsxs("header",{className:"lg:hidden fixed top-0 left-0 right-0 z-50 bg-azure-surface dark:bg-black border-b border-azure-border dark:border-matrix-primary/30 p-4 flex items-center justify-between",children:[d.jsxs("h1",{className:"text-lg font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight","aria-label":t?"Modo claro":"Modo escuro",children:t?d.jsx(_S,{className:"w-5 h-5"}):d.jsx(zS,{className:"w-5 h-5"})}),d.jsx("button",{onClick:e,className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-secondary","aria-label":"Abrir menu",children:d.jsx(NA,{className:"w-6 h-6"})})]})]})}const Pa={list:()=>xe.get("/webhooks"),get:e=>xe.get(`/webhooks/${e}`),create:e=>xe.post("/webhooks",e),update:(e,t)=>xe.put(`/webhooks/${e}`,t),delete:e=>xe.delete(`/webhooks/${e}`),listNotifications:e=>{const t=new URLSearchParams;e?.webhookId&&t.set("webhookId",e.webhookId),e?.unreadOnly&&t.set("unreadOnly","true");const n=t.toString()?`?${t}`:"";return xe.get(`/webhooks/notifications${n}`)},unreadCount:()=>xe.get("/webhooks/notifications/unread-count"),markRead:e=>xe.post("/webhooks/notifications/read",{ids:e})},vr=({open:e,onOpenChange:t,children:n})=>e?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),d.jsx("div",{className:"relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:n})]}):null,Fs=({className:e,children:t})=>d.jsx("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full max-w-md md:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col ${e}`,children:d.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:t})}),kr=({children:e})=>d.jsx("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left border-b border-azure-border dark:border-matrix-primary p-6",children:e}),wr=({className:e,children:t})=>d.jsx("h3",{className:`text-lg font-semibold leading-none tracking-tight ${e}`,children:t}),jD=({className:e,children:t})=>d.jsx("div",{className:`mt-6 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ${e}`,children:t}),lr=({className:e,variant:t="default",size:n="default",...a})=>{const f=`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300 ${t==="destructive"?"bg-red-500 text-zinc-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-zinc-50 dark:hover:bg-red-900/90":t==="outline"?"border border-azure-border dark:border-matrix-primary bg-transparent hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="secondary"?"bg-azure-surface dark:bg-zinc-800 hover:bg-azure-hover dark:hover:bg-zinc-700/80 text-azure-text-primary dark:text-matrix-secondary":t==="ghost"?"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-primary dark:text-matrix-secondary":t==="link"?"text-azure-primary dark:text-matrix-highlight underline-offset-4 hover:underline":"bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black hover:bg-azure-primary/90 dark:hover:bg-matrix-highlight/90"} ${n==="sm"?"h-9 px-3 rounded-md":n==="lg"?"h-11 px-8 rounded-md":n==="icon"?"h-10 w-10":"h-10 px-4 py-2"} ${e||""}`;return d.jsx("button",{className:f,...a})};function ND({isOpen:e,onClose:t,onConfirm:n}){return d.jsx(vr,{open:e,onOpenChange:t,children:d.jsxs(Fs,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(kr,{children:d.jsx(wr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:"Confirm Restart"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary mb-6",children:"Are you sure you want to restart the Morpheus agent? This will temporarily disconnect all services and channels."}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-end",children:[d.jsx(lr,{variant:"outline",onClick:t,children:"Cancel"}),d.jsx(lr,{variant:"destructive",onClick:()=>{n(),t()},children:"Confirm Restart"})]})]})]})})}const Ns={list:e=>{const t=new URLSearchParams;e?.status&&t.set("status",e.status),e?.agent&&t.set("agent",e.agent),e?.origin_channel&&t.set("origin_channel",e.origin_channel),e?.session_id&&t.set("session_id",e.session_id),e?.limit&&t.set("limit",String(e.limit));const n=t.toString()?`?${t}`:"";return xe.get(`/tasks${n}`)},get:e=>xe.get(`/tasks/${e}`),stats:()=>xe.get("/tasks/stats"),retry:e=>xe.post(`/tasks/${e}/retry`,{}),cancel:e=>xe.post(`/tasks/${e}/cancel`,{})};function CD({children:e}){const t=Sr(),[n,a]=z.useState(()=>{const A=localStorage.getItem("theme");return A?A==="dark":!0}),[s,u]=z.useState(!1),[l,f]=z.useState(!1),{logout:h}=v_(),{data:m}=kt("/webhooks/notifications/unread-count",()=>Pa.unreadCount(),{refreshInterval:1e4}),g=m?.count??0,{data:y}=kt("/tasks/stats",()=>Ns.stats(),{refreshInterval:5e3}),v=(y?.pending??0)+(y?.running??0),b=async()=>{try{await xe.post("/restart",{}),alert("Restart initiated successfully. The agent will restart shortly.")}catch(A){console.error("Failed to restart:",A),alert("Failed to restart the agent. Please try again.")}};z.useEffect(()=>{n?(document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark")):(document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"))},[n]),z.useEffect(()=>{u(!1)},[t.pathname]);const S=[{icon:O0,label:"Dashboard",path:"/"},{icon:Cl,label:"Chat",path:"/chat"},{icon:L0,label:"Zaion",path:"/zaion"},{icon:D0,label:"MCP Servers",path:"/mcp-servers"},{icon:El,label:"Skills",path:"/skills"},{icon:Gm,label:"Usage Stats",path:"/stats"},{icon:Hc,label:"Model Pricing",path:"/model-pricing"},{icon:Cs,label:"Sati Memories",path:"/sati-memories"},{icon:Qm,label:"Webhooks",path:"/webhooks"},{icon:Xm,label:"Tasks",path:"/tasks"},{icon:$s,label:"Trinity DBs",path:"/trinity-databases"},{icon:Ia,label:"Chronos",path:"/chronos"},{icon:Jm,label:"Logs",path:"/logs"}],j=[{icon:O0,label:"Dashboard",path:"/"},{icon:Cl,label:"Chat",path:"/chat"},{icon:L0,label:"Zaion",path:"/zaion"},{icon:D0,label:"MCP Servers",path:"/mcp-servers"},{icon:El,label:"Skills",path:"/skills"},{icon:Gm,label:"Usage Stats",path:"/stats"},{icon:Hc,label:"Model Pricing",path:"/model-pricing"},{icon:Cs,label:"Sati Memories",path:"/sati-memories"},{icon:Qm,label:"Webhooks",path:"/webhooks"},{icon:Xm,label:"Tasks",path:"/tasks"},{icon:$s,label:"Trinity DBs",path:"/trinity-databases"},{icon:Ia,label:"Chronos",path:"/chronos"},{icon:Jm,label:"Logs",path:"/logs"}];return d.jsxs("div",{className:"flex flex-col h-screen bg-azure-bg dark:bg-black text-azure-text-primary dark:text-matrix-secondary font-mono overflow-hidden transition-colors duration-300",children:[d.jsx(_D,{onMenuClick:()=>u(!0),isDark:n,toggleTheme:()=>a(!n)}),d.jsxs("div",{className:"flex flex-1 overflow-hidden pt-16 lg:pt-0",children:[" ",d.jsxs("div",{className:"hidden lg:flex w-64 border-r border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-black flex-col shrink-0 transition-colors duration-300",children:[d.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[d.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.jsx("button",{onClick:()=>a(!n),className:"p-1 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors",children:n?d.jsx(_S,{className:"w-4 h-4"}):d.jsx(zS,{className:"w-4 h-4"})})]}),d.jsxs("nav",{className:"flex-1 p-2 space-y-0.5",children:[S.map(A=>{const E=t.pathname===A.path;return d.jsxs(Va,{to:A.path,className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${E?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[d.jsx(A.icon,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:A.label}),A.path==="/tasks"&&v>0&&d.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:v>99?"99+":v})]},A.path)}),d.jsxs(Va,{to:"/notifications",className:`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,children:[d.jsxs("div",{className:"relative shrink-0",children:[d.jsx(Nl,{className:"w-4 h-4"}),g>0&&d.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),d.jsx("span",{children:"Notifications"}),g>0&&d.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]},"/notifications")]}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[d.jsx($0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Restart"})]})}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-1.5 rounded w-full text-left text-sm hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[d.jsx(R0,{className:"w-4 h-4 shrink-0"}),d.jsx("span",{children:"Logout"})]})})]}),d.jsx(yM,{children:s&&d.jsxs(qe.div,{className:"fixed inset-0 z-50 lg:hidden",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>u(!1),children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),d.jsxs(qe.div,{className:"absolute left-0 top-0 bottom-0 w-64 bg-azure-surface dark:bg-black flex flex-col shadow-xl",initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:25,stiffness:200},onClick:A=>A.stopPropagation(),children:[d.jsxs("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary/30 flex justify-between items-center",children:[d.jsxs("h1",{className:"text-xl font-bold text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Cs,{className:"w-6 h-6"}),"MORPHEUS"]}),d.jsx("button",{onClick:()=>u(!1),className:"p-2 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-muted dark:text-matrix-secondary transition-colors","aria-label":"Fechar menu",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[j.map(A=>{const E=t.pathname===A.path;return d.jsxs(Va,{to:A.path,className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${E?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[d.jsx(A.icon,{className:"w-5 h-5"}),d.jsx("span",{children:A.label}),A.path==="/tasks"&&v>0&&d.jsx("span",{className:"ml-auto bg-yellow-500 text-black text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:v>99?"99+":v})]},A.path)}),d.jsxs(Va,{to:"/notifications",className:`flex items-center gap-3 px-4 py-3 rounded transition-colors ${t.pathname==="/notifications"?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary"}`,onClick:()=>u(!1),children:[d.jsxs("div",{className:"relative",children:[d.jsx(Nl,{className:"w-5 h-5"}),g>0&&d.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[9px] font-bold rounded-full w-3.5 h-3.5 flex items-center justify-center leading-none",children:g>9?"9+":g})]}),d.jsx("span",{children:"Notifications"}),g>0&&d.jsx("span",{className:"ml-auto bg-red-500 text-white text-[10px] font-bold rounded-full px-1.5 py-0.5 leading-none",children:g>99?"99+":g})]})]}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>{f(!0),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-azure-hover dark:hover:bg-matrix-primary/50 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:[d.jsx($0,{className:"w-5 h-5"}),d.jsx("span",{children:"Restart"})]})}),d.jsx("div",{className:"p-2",children:d.jsxs("button",{onClick:()=>{h(),u(!1)},className:"flex items-center gap-3 px-4 py-3 rounded w-full text-left hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 transition-colors",children:[d.jsx(R0,{className:"w-5 h-5"}),d.jsx("span",{children:"Logout"})]})})]})]})}),d.jsxs("main",{className:`flex-1 p-4 md:p-8 relative flex flex-col ${t.pathname==="/chat"?"overflow-hidden":"overflow-auto"}`,children:[d.jsx("div",{className:`w-full mx-auto flex-1 ${t.pathname==="/chat"?"h-full":"max-w-6xl"}`,children:e}),d.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(18,16,16,0)_50%,rgba(0,0,0,0.1)_50%),linear-gradient(90deg,rgba(0,255,0,0.03),rgba(0,255,0,0.01))] bg-[length:100%_2px,3px_100%] opacity-0 dark:opacity-20 transition-opacity duration-300"})]})]}),d.jsx(Z4,{}),d.jsx(ND,{isOpen:l,onClose:()=>f(!1),onConfirm:b})]})}const ED={hidden:{opacity:0,y:20},show:{opacity:1,y:0}},_i=({title:e,value:t,icon:n,subValue:a})=>d.jsxs(qe.div,{variants:ED,className:"border border-azure-border dark:border-matrix-primary bg-azure-surface/50 dark:bg-zinc-950/50 p-6 rounded relative overflow-hidden group hover:border-azure-primary dark:hover:border-matrix-highlight transition-colors",children:[d.jsxs("div",{className:"flex justify-between items-start mb-4",children:[d.jsx("h3",{className:"text-azure-text-secondary dark:text-matrix-secondary text-sm font-bold uppercase",children:e}),d.jsx(n,{className:"w-6 h-6 text-azure-primary dark:text-matrix-primary group-hover:text-azure-primary dark:group-hover:text-matrix-highlight transition-colors"})]}),d.jsx("div",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight mb-1 font-mono tracking-tighter truncate",children:t}),a&&d.jsx("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70 font-mono",children:a})]}),Tp={fetchUsageStats:async()=>xe.get("/stats/usage"),fetchGroupedUsageStats:async()=>xe.get("/stats/usage/grouped")};function TD(){const{data:e}=kt("/api/stats/usage",Tp.fetchUsageStats,{refreshInterval:5e3});return d.jsxs(d.Fragment,{children:[d.jsx(_i,{title:"Total Input",value:e?e.totalInputTokens.toLocaleString():"-",icon:bS,subValue:"Tokens processed"}),d.jsx(_i,{title:"Total Output",value:e?e.totalOutputTokens.toLocaleString():"-",icon:vS,subValue:"Tokens generated"})]})}function AD(){const{data:e}=$S(),t={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},n={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return d.jsxs(qe.div,{className:"space-y-8",variants:t,initial:"hidden",animate:"show",children:[d.jsxs(qe.div,{variants:n,children:[d.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight mb-2",children:"SYSTEM STATUS"}),d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"Overview of the Morpheus agent runtime."})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[d.jsx(_i,{title:"Agent Status",value:e?.status.toUpperCase()||"CONNECTING...",icon:Cs,subValue:e?`PID: ${e.pid}`:""}),d.jsx(_i,{title:"Uptime",value:e?LS(e.uptimeSeconds):"-",icon:Ia,subValue:e?`${e.uptimeSeconds.toFixed(0)} seconds`:""}),d.jsx(_i,{title:"Version",value:e?.projectVersion||"-",icon:SS,subValue:`Node ${e?.nodeVersion||"-"}`}),d.jsx(_i,{title:"Provider",value:e?.llmProvider?.toUpperCase()||"-",icon:ZT,subValue:"LLM Inference Engine"}),d.jsx(_i,{title:"Model",value:e?.llmModel||"-",icon:VT,subValue:"Active Model"}),d.jsx(TD,{})]})]})}const OD=({sessions:e,activeSessionId:t,onSelectSession:n,onCreateSession:a,onArchiveSession:s,onDeleteSession:u,onRenameSession:l,isOpen:f,toggleSidebar:h})=>{const[m,g]=z.useState(null),[y,v]=z.useState(""),b=z.useRef(null);z.useEffect(()=>{m&&b.current&&b.current.focus()},[m]);const S=(O,N)=>{O.stopPropagation(),g(N.id),v(N.title||"Untitled Session")},j=O=>{O?.stopPropagation(),m&&y.trim()&&(l(m,y.trim()),g(null))},A=O=>{O?.stopPropagation(),g(null)},E=O=>{O.key==="Enter"?j():O.key==="Escape"&&A()};return f?d.jsxs("div",{className:"w-80 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col h-full transition-all duration-300",children:[d.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-matrix-primary/30 flex justify-between items-center bg-azure-bg dark:bg-black",children:[d.jsx("h2",{className:"text-lg font-semibold text-gray-800 dark:text-matrix-highlight",children:"Sessions"}),d.jsx("button",{onClick:h,className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",children:d.jsx(Cl,{size:18})})]}),d.jsx("div",{className:"p-4",children:d.jsxs("button",{onClick:a,className:"w-full flex items-center justify-center gap-2 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black py-2 px-4 rounded-lg hover:bg-azure-secondary dark:hover:bg-matrix-secondary transition-colors shadow-sm",children:[d.jsx(M0,{size:18}),d.jsx("span",{children:"New Chat"})]})}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-2 space-y-1 custom-scrollbar",children:[e.map(O=>d.jsxs("div",{onClick:()=>n(O.id),className:`group flex items-center justify-between p-3 rounded-lg cursor-pointer transition-all border ${t===O.id?"bg-azure-hover dark:bg-matrix-primary/20 border-azure-primary dark:border-matrix-highlight":"hover:bg-gray-50 dark:hover:bg-matrix-primary/10 border-transparent"}`,children:[d.jsx("div",{className:"flex flex-col overflow-hidden w-full mr-2",children:m===O.id?d.jsx("div",{className:"flex items-center gap-1 w-full",onClick:N=>N.stopPropagation(),children:d.jsx("input",{ref:b,type:"text",value:y,onChange:N=>v(N.target.value),onKeyDown:E,className:"w-full text-sm px-1 py-0.5 bg-white dark:bg-black border border-azure-primary dark:border-matrix-highlight rounded focus:outline-none dark:text-matrix-highlight"})}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`text-sm font-medium truncate ${t===O.id?"text-azure-primary dark:text-matrix-highlight":"text-gray-700 dark:text-matrix-secondary"}`,children:O.title||"Untitled Session"}),d.jsx("span",{className:"text-xs text-gray-400 dark:text-matrix-secondary/70 mt-0.5",children:new Date(O.started_at).toLocaleString()})]})}),d.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:m===O.id?d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:j,className:"p-1.5 text-green-600 hover:bg-green-50 dark:text-matrix-highlight dark:hover:bg-matrix-primary/20 rounded",title:"Save",children:d.jsx(Ym,{size:14})}),d.jsx("button",{onClick:A,className:"p-1.5 text-red-500 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 rounded",title:"Cancel",children:d.jsx(og,{size:14})})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:N=>S(N,O),className:"p-1.5 text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 dark:text-matrix-secondary/50 dark:hover:text-blue-400 rounded",title:"Rename",children:d.jsx(ag,{size:14})}),d.jsx("button",{onClick:N=>{N.stopPropagation(),s(O.id)},className:"p-1.5 text-gray-400 hover:text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-900/20 dark:text-matrix-secondary/50 dark:hover:text-amber-500 rounded",title:"Archive",children:d.jsx(TT,{size:14})}),d.jsx("button",{onClick:N=>{N.stopPropagation(),u(O.id)},className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 dark:text-matrix-secondary/50 dark:hover:text-red-500 rounded",title:"Delete",children:d.jsx(Ti,{size:14})})]})})]},O.id)),e.length===0&&d.jsx("div",{className:"text-center text-gray-400 dark:text-matrix-secondary/50 mt-10 text-sm",children:"No active sessions."})]})]}):d.jsxs("div",{className:"w-16 bg-white dark:bg-black border-r border-gray-200 dark:border-matrix-primary/30 flex flex-col items-center py-4 space-y-4 transition-colors duration-300",children:[d.jsx("button",{onClick:h,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-matrix-primary/20 text-gray-500 dark:text-matrix-secondary",title:"Expand Sidebar",children:d.jsx(Cl,{})}),d.jsx("div",{className:"border-t border-gray-200 dark:border-matrix-primary/30 w-full my-2"}),d.jsx("button",{onClick:a,className:"p-3 bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black rounded-full hover:bg-azure-secondary dark:hover:bg-matrix-secondary shadow-lg transition-all",title:"New Session",children:d.jsx(M0,{size:20})})]})};function RD(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const MD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$D={};function uk(e,t){return($D.jsx?DD:MD).test(e)}const LD=/[ \t\n\f\r]/g;function PD(e){return typeof e=="object"?e.type==="text"?ck(e.value):!1:ck(e)}function ck(e){return e.replace(LD,"")===""}class Kl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Kl.prototype.normal={};Kl.prototype.property={};Kl.prototype.space=void 0;function k_(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Kl(n,a,t)}function Ap(e){return e.toLowerCase()}class Mn{constructor(t,n){this.attribute=n,this.property=t}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let UD=0;const $e=Ri(),Zt=Ri(),Op=Ri(),ue=Ri(),ht=Ri(),Us=Ri(),Hn=Ri();function Ri(){return 2**++UD}const Rp=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Zt,commaOrSpaceSeparated:Hn,commaSeparated:Us,number:ue,overloadedBoolean:Op,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),km=Object.keys(Rp);class Ig extends Mn{constructor(t,n,a,s){let u=-1;if(super(t,n),dk(this,"space",s),typeof a=="number")for(;++u<km.length;){const l=km[u];dk(this,km[u],(a&Rp[l])===Rp[l])}}}Ig.prototype.defined=!0;function dk(e,t,n){n&&(e[t]=n)}function no(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const u=new Ig(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[Ap(a)]=a,n[Ap(u.attribute)]=a}return new Kl(t,n,e.space)}const w_=no({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:ht,ariaCurrent:null,ariaDescribedBy:ht,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:ht,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:ht,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ht,ariaLevel:ue,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:ht,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:ht,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:Zt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function S_(e,t){return t in e?e[t]:t}function z_(e,t){return S_(e,t.toLowerCase())}const VD=no({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Us,acceptCharset:ht,accessKey:ht,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:ht,autoFocus:$e,autoPlay:$e,blocking:ht,capture:null,charSet:null,checked:$e,cite:null,className:ht,cols:ue,colSpan:null,content:null,contentEditable:Zt,controls:$e,controlsList:ht,coords:ue|Us,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:Op,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:ht,height:ue,hidden:Op,high:ue,href:null,hrefLang:null,htmlFor:ht,httpEquiv:ht,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:ht,itemRef:ht,itemScope:$e,itemType:ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:ue,pattern:null,ping:ht,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:ht,required:$e,reversed:$e,rows:ue,rowSpan:ue,sandbox:ht,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:Zt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ht,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:z_}),BD=no({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:Hn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:ht,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:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:Us,g2:Us,glyphName:Us,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:Hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,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:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:Hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:S_}),__=no({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()}}),j_=no({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:z_}),N_=no({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ZD={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"},ID=/[A-Z]/g,fk=/-[a-z]/g,HD=/^data[-\w.:]+$/i;function FD(e,t){const n=Ap(t);let a=t,s=Mn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HD.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(fk,GD);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!fk.test(u)){let l=u.replace(ID,qD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=Ig}return new s(a,t)}function qD(e){return"-"+e.toLowerCase()}function GD(e){return e.charAt(1).toUpperCase()}const YD=k_([w_,VD,__,j_,N_],"html"),Hg=k_([w_,BD,__,j_,N_],"svg");function KD(e){return e.join(" ").trim()}var ks={},wm,hk;function XD(){if(hk)return wm;hk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
20
|
-
`,m="/",g="*",y="",v="comment",b="declaration";function S(A,E){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];E=E||{};var O=1,N=1;function L(oe){var ae=oe.match(t);ae&&(O+=ae.length);var P=oe.lastIndexOf(h);N=~P?oe.length-P:N+oe.length}function D(){var oe={line:O,column:N};return function(ae){return ae.position=new R(oe),X(),ae}}function R(oe){this.start=oe,this.end={line:O,column:N},this.source=E.source}R.prototype.content=A;function q(oe){var ae=new Error(E.source+":"+O+":"+N+": "+oe);if(ae.reason=oe,ae.filename=E.source,ae.line=O,ae.column=N,ae.source=A,!E.silent)throw ae}function B(oe){var ae=oe.exec(A);if(ae){var P=ae[0];return L(P),A=A.slice(P.length),ae}}function X(){B(n)}function fe(oe){var ae;for(oe=oe||[];ae=se();)ae!==!1&&oe.push(ae);return oe}function se(){var oe=D();if(!(m!=A.charAt(0)||g!=A.charAt(1))){for(var ae=2;y!=A.charAt(ae)&&(g!=A.charAt(ae)||m!=A.charAt(ae+1));)++ae;if(ae+=2,y===A.charAt(ae-1))return q("End of comment missing");var P=A.slice(2,ae-2);return N+=2,L(P),A=A.slice(ae),N+=2,oe({type:v,comment:P})}}function le(){var oe=D(),ae=B(a);if(ae){if(se(),!B(s))return q("property missing ':'");var P=B(u),J=oe({type:b,property:j(ae[0].replace(e,y)),value:P?j(P[0].replace(e,y)):y});return B(l),J}}function ee(){var oe=[];fe(oe);for(var ae;ae=le();)ae!==!1&&(oe.push(ae),fe(oe));return oe}return X(),ee()}function j(A){return A?A.replace(f,y):y}return wm=S,wm}var mk;function JD(){if(mk)return ks;mk=1;var e=ks&&ks.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=n;const t=e(XD());function n(a,s){let u=null;if(!a||typeof a!="string")return u;const l=(0,t.default)(a),f=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;f?s(m,g,h):g&&(u=u||{},u[m]=g)}),u}return ks}var sl={},pk;function QD(){if(pk)return sl;pk=1,Object.defineProperty(sl,"__esModule",{value:!0}),sl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},l=function(m,g){return g.toUpperCase()},f=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(s,f):m=m.replace(a,f),m.replace(t,l))};return sl.camelCase=h,sl}var ol,gk;function WD(){if(gk)return ol;gk=1;var e=ol&&ol.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(JD()),n=QD();function a(s,u){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(f,h){f&&h&&(l[(0,n.camelCase)(f,u)]=h)}),l}return a.default=a,ol=a,ol}var e5=WD();const t5=Yp(e5),C_=E_("end"),Fg=E_("start");function E_(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function n5(e){const t=Fg(e),n=C_(e);if(t&&n)return{start:t,end:n}}function Sl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xk(e.position):"start"in e||"end"in e?xk(e):"line"in e||"column"in e?Mp(e):""}function Mp(e){return yk(e&&e.line)+":"+yk(e&&e.column)}function xk(e){return Mp(e&&e.start)+"-"+Mp(e&&e.end)}function yk(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",u={},l=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?s=t:!u.cause&&t&&(l=!0,s=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?u.ruleId=a:(u.source=a.slice(0,h),u.ruleId=a.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Sl(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=l&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const qg={}.hasOwnProperty,r5=new Map,a5=/[A-Z]/g,i5=new Set(["table","tbody","thead","tfoot","tr"]),s5=new Set(["td","th"]),T_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function o5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=p5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=m5(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hg:YD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=A_(s,e,void 0);return u&&typeof u!="string"?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}function A_(e,t,n){if(t.type==="element")return l5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return u5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return d5(e,t,n);if(t.type==="mdxjsEsm")return c5(e,t);if(t.type==="root")return f5(e,t,n);if(t.type==="text")return h5(e,t)}function l5(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Hg,e.schema=s),e.ancestors.push(t);const u=R_(e,t.tagName,!1),l=g5(e,t);let f=Yg(e,t);return i5.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!PD(h):!0})),O_(e,l,u,t),Gg(l,f),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function u5(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}$l(e,t.position)}function c5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$l(e,t.position)}function d5(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Hg,e.schema=s),e.ancestors.push(t);const u=t.name===null?e.Fragment:R_(e,t.name,!0),l=x5(e,t),f=Yg(e,t);return O_(e,l,u,t),Gg(l,f),e.ancestors.pop(),e.schema=a,e.create(t,u,l,n)}function f5(e,t,n){const a={};return Gg(a,Yg(e,t)),e.create(t,e.Fragment,a,n)}function h5(e,t){return t.value}function O_(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Gg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function m5(e,t,n){return a;function a(s,u,l,f){const m=Array.isArray(l.children)?n:t;return f?m(u,l,f):m(u,l)}}function p5(e,t){return n;function n(a,s,u,l){const f=Array.isArray(u.children),h=Fg(a);return t(s,u,l,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function g5(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&qg.call(t.properties,s)){const u=y5(e,s,t.properties[s]);if(u){const[l,f]=u;e.tableCellAlignToStyle&&l==="align"&&typeof f=="string"&&s5.has(t.tagName)?a=f:n[l]=f}}if(a){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function x5(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const l=u.expression;l.type;const f=l.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else $l(e,t.position);else{const s=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else $l(e,t.position);else u=a.value===null?!0:a.value;n[s]=u}return n}function Yg(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:r5;for(;++a<t.children.length;){const u=t.children[a];let l;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=s.get(h)||0;l=h+"-"+m,s.set(h,m+1)}}const f=A_(e,u,l);f!==void 0&&n.push(f)}return n}function y5(e,t,n){const a=FD(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?RD(n):KD(n)),a.property==="style"){let s=typeof n=="object"?n:b5(e,String(n));return e.stylePropertyNameCase==="css"&&(s=v5(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?ZD[a.property]||a.property:a.attribute,n]}}function b5(e,t){try{return t5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=T_+"#cannot-parse-style-attribute",s}}function R_(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let u=-1,l;for(;++u<s.length;){const f=uk(s[u])?{type:"Identifier",name:s[u]}:{type:"Literal",value:s[u]};l=l?{type:"MemberExpression",object:l,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}a=l}else a=uk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return qg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);$l(e)}function $l(e,t){const n=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=T_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function v5(e){const t={};let n;for(n in e)qg.call(e,n)&&(t[k5(n)]=e[n]);return t}function k5(e){let t=e.replace(a5,w5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function w5(e){return"-"+e.toLowerCase()}const Sm={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"]},S5={};function z5(e,t){const n=S5,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return M_(e,a,s)}function M_(e,t,n){if(_5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bk(e.children,t,n)}return Array.isArray(e)?bk(e,t,n):""}function bk(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=M_(e[s],t,n);return a.join("")}function _5(e){return!!(e&&typeof e=="object")}const vk=document.createElement("i");function Kg(e){const t="&"+e+";";vk.innerHTML=t;const n=vk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Dr(e,t,n,a){const s=e.length;let u=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)l=Array.from(a),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);u<a.length;)l=a.slice(u,u+1e4),l.unshift(t,0),e.splice(...l),u+=1e4,t+=1e4}function or(e,t){return e.length>0?(Dr(e,e.length,0,t),e):t}const kk={}.hasOwnProperty;function j5(e){const t={};let n=-1;for(;++n<e.length;)N5(t,e[n]);return t}function N5(e,t){let n;for(n in t){const s=(kk.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let l;if(u)for(l in u){kk.call(s,l)||(s[l]=[]);const f=u[l];C5(s[l],Array.isArray(f)?f:f?[f]:[])}}}function C5(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Dr(e,0,0,a)}function D_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Vs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ar=Xa(/[A-Za-z]/),Fn=Xa(/[\dA-Za-z]/),E5=Xa(/[#-'*+\--9=?A-Z^-~]/);function Dp(e){return e!==null&&(e<32||e===127)}const $p=Xa(/\d/),T5=Xa(/[\dA-Fa-f]/),A5=Xa(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function Rn(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const O5=Xa(new RegExp("\\p{P}|\\p{S}","u")),R5=Xa(/\s/);function Xa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ro(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const u=e.charCodeAt(n);let l="";if(u===37&&Fn(e.charCodeAt(n+1))&&Fn(e.charCodeAt(n+2)))s=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(l=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(n+1);u<56320&&f>56319&&f<57344?(l=String.fromCharCode(u,f),s=1):l="�"}else l=String.fromCharCode(u);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function mt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let u=0;return l;function l(h){return et(h)?(e.enter(n),f(h)):t(h)}function f(h){return et(h)&&u++<s?(e.consume(h),f):(e.exit(n),t(h))}}const M5={tokenize:D5};function D5(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),mt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(f)}function l(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ee(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),l)}}const $5={tokenize:L5},wk={tokenize:P5};function L5(e){const t=this,n=[];let a=0,s,u,l;return f;function f(N){if(a<n.length){const L=n[a];return t.containerState=L[1],e.attempt(L[0].continuation,h,m)(N)}return m(N)}function h(N){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&O();const L=t.events.length;let D=L,R;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){R=t.events[D][1].end;break}E(a);let q=L;for(;q<t.events.length;)t.events[q][1].end={...R},q++;return Dr(t.events,D+1,0,t.events.slice(L)),t.events.length=q,m(N)}return f(N)}function m(N){if(a===n.length){if(!s)return v(N);if(s.currentConstruct&&s.currentConstruct.concrete)return S(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wk,g,y)(N)}function g(N){return s&&O(),E(a),v(N)}function y(N){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(N)}function v(N){return t.containerState={},e.attempt(wk,b,S)(N)}function b(N){return a++,n.push([t.currentConstruct,t.containerState]),v(N)}function S(N){if(N===null){s&&O(),E(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:u}),j(N)}function j(N){if(N===null){A(e.exit("chunkFlow"),!0),E(0),e.consume(N);return}return Ee(N)?(e.consume(N),A(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(N),j)}function A(N,L){const D=t.sliceStream(N);if(L&&D.push(null),N.previous=u,u&&(u.next=N),u=N,s.defineSkip(N.start),s.write(D),t.parser.lazy[N.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<l&&(!s.events[R][1].end||s.events[R][1].end.offset>l))return;const q=t.events.length;let B=q,X,fe;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(X){fe=t.events[B][1].end;break}X=!0}for(E(a),R=q;R<t.events.length;)t.events[R][1].end={...fe},R++;Dr(t.events,B+1,0,t.events.slice(q)),t.events.length=R}}function E(N){let L=n.length;for(;L-- >N;){const D=n[L];t.containerState=D[1],D[0].exit.call(t,e)}n.length=N}function O(){s.write([null]),u=void 0,s=void 0,t.containerState._closeFlow=void 0}}function P5(e,t,n){return mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sk(e){if(e===null||Rn(e)||R5(e))return 1;if(O5(e))return 2}function Xg(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const u=e[s].resolveAll;u&&!a.includes(u)&&(t=u(t,n),a.push(u))}return t}const Lp={name:"attention",resolveAll:U5,tokenize:V5};function U5(e,t){let n=-1,a,s,u,l,f,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[a][1].end},v={...e[n][1].start};zk(y,-h),zk(v,h),l={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...f.end}},e[a][1].end={...l.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=or(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=or(m,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",u,t]]),m=or(m,Xg(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=or(m,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=or(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Dr(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function V5(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Sk(a);let u;return l;function l(h){return u=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===u)return e.consume(h),f;const m=e.exit("attentionSequence"),g=Sk(h),y=!g||g===2&&s||n.includes(h),v=!s||s===2&&g||n.includes(a);return m._open=!!(u===42?y:y&&(s||!v)),m._close=!!(u===42?v:v&&(g||!y)),t(h)}}function zk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const B5={name:"autolink",tokenize:Z5};function Z5(e,t,n){let a=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(b){return Ar(b)?(e.consume(b),l):b===64?n(b):m(b)}function l(b){return b===43||b===45||b===46||Fn(b)?(a=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||Fn(b))&&a++<32?(e.consume(b),f):(a=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Dp(b)?n(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),g):E5(b)?(e.consume(b),m):n(b)}function g(b){return Fn(b)?y(b):n(b)}function y(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||Fn(b))&&a++<63){const S=b===45?v:y;return e.consume(b),S}return n(b)}}const xd={partial:!0,tokenize:I5};function I5(e,t,n){return a;function a(u){return et(u)?mt(e,s,"linePrefix")(u):s(u)}function s(u){return u===null||Ee(u)?t(u):n(u)}}const $_={continuation:{tokenize:F5},exit:q5,name:"blockQuote",tokenize:H5};function H5(e,t,n){const a=this;return s;function s(l){if(l===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),u}return n(l)}function u(l){return et(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function F5(e,t,n){const a=this;return s;function s(l){return et(l)?mt(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):u(l)}function u(l){return e.attempt($_,t,n)(l)}}function q5(e){e.exit("blockQuote")}const L_={name:"characterEscape",tokenize:G5};function G5(e,t,n){return a;function a(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),s}function s(u){return A5(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const P_={name:"characterReference",tokenize:Y5};function Y5(e,t,n){const a=this;let s=0,u,l;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,l=Fn,g(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,l=T5,g):(e.enter("characterReferenceValue"),u=7,l=$p,g(y))}function g(y){if(y===59&&s){const v=e.exit("characterReferenceValue");return l===Fn&&!Kg(a.sliceSerialize(v))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&s++<u?(e.consume(y),g):n(y)}}const _k={partial:!0,tokenize:X5},jk={concrete:!0,name:"codeFenced",tokenize:K5};function K5(e,t,n){const a=this,s={partial:!0,tokenize:D};let u=0,l=0,f;return h;function h(R){return m(R)}function m(R){const q=a.events[a.events.length-1];return u=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===f?(l++,e.consume(R),g):l<3?n(R):(e.exit("codeFencedFenceSequence"),et(R)?mt(e,y,"whitespace")(R):y(R))}function y(R){return R===null||Ee(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(_k,j,L)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(R)):et(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mt(e,b,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),v)}function b(R){return R===null||Ee(R)?y(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(R)):R===96&&R===f?n(R):(e.consume(R),S)}function j(R){return e.attempt(s,L,A)(R)}function A(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),E}function E(R){return u>0&&et(R)?mt(e,O,"linePrefix",u+1)(R):O(R)}function O(R){return R===null||Ee(R)?e.check(_k,j,L)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||Ee(R)?(e.exit("codeFlowValue"),O(R)):(e.consume(R),N)}function L(R){return e.exit("codeFenced"),t(R)}function D(R,q,B){let X=0;return fe;function fe(ae){return R.enter("lineEnding"),R.consume(ae),R.exit("lineEnding"),se}function se(ae){return R.enter("codeFencedFence"),et(ae)?mt(R,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):le(ae)}function le(ae){return ae===f?(R.enter("codeFencedFenceSequence"),ee(ae)):B(ae)}function ee(ae){return ae===f?(X++,R.consume(ae),ee):X>=l?(R.exit("codeFencedFenceSequence"),et(ae)?mt(R,oe,"whitespace")(ae):oe(ae)):B(ae)}function oe(ae){return ae===null||Ee(ae)?(R.exit("codeFencedFence"),q(ae)):B(ae)}}}function X5(e,t,n){const a=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const zm={name:"codeIndented",tokenize:Q5},J5={partial:!0,tokenize:W5};function Q5(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),mt(e,u,"linePrefix",5)(m)}function u(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(m):n(m)}function l(m){return m===null?h(m):Ee(m)?e.attempt(J5,l,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ee(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function W5(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):Ee(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):mt(e,u,"linePrefix",5)(l)}function u(l){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(l):Ee(l)?s(l):n(l)}}const e$={name:"codeText",previous:n$,resolve:t$,tokenize:r$};function t$(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function n$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function r$(e,t,n){let a=0,s,u;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(u=e.enter("codeTextSequence"),s=0,g(y)):Ee(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Ee(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),m)}function g(y){return y===96?(e.consume(y),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(u.type="codeTextData",m(y))}}class a${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,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&ll(this.left,a),u.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),ll(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ll(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 n=this.left.splice(t,Number.POSITIVE_INFINITY);ll(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ll(this.left,n.reverse())}}}function ll(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function U_(e){const t={};let n=-1,a,s,u,l,f,h,m;const g=new a$(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,i$(g,n)),n=t[n],m=!0);else if(a[1]._container){for(u=n,s=void 0;u--;)if(l=g.get(u),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=u);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},f=g.slice(s,n),f.unshift(a),g.splice(s,n-s+1,f))}}return Dr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function i$(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const u=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const f=l.events,h=[],m={};let g,y,v=-1,b=n,S=0,j=0;const A=[j];for(;b;){for(;e.get(++s)[1]!==b;);u.push(s),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),y&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=n;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(j=v+1,A.push(j),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):A.pop(),v=A.length;v--;){const E=f.slice(A[v],A[v+1]),O=u.pop();h.push([O,O+E.length-1]),e.splice(O,2,E)}for(h.reverse(),v=-1;++v<h.length;)m[S+h[v][0]]=S+h[v][1],S+=h[v][1]-h[v][0]-1;return m}const s$={resolve:l$,tokenize:u$},o$={partial:!0,tokenize:c$};function l$(e){return U_(e),e}function u$(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?u(f):Ee(f)?e.check(o$,l,u)(f):(e.consume(f),s)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function l(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function c$(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),mt(e,u,"linePrefix")}function u(l){if(l===null||Ee(l))return n(l);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function V_(e,t,n,a,s,u,l,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return y;function y(E){return E===60?(e.enter(a),e.enter(s),e.enter(u),e.consume(E),e.exit(u),v):E===null||E===32||E===41||Dp(E)?n(E):(e.enter(a),e.enter(l),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function v(E){return E===62?(e.enter(u),e.consume(E),e.exit(u),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(f),v(E)):E===null||E===60||Ee(E)?n(E):(e.consume(E),E===92?S:b)}function S(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function j(E){return!g&&(E===null||E===41||Rn(E))?(e.exit("chunkString"),e.exit(f),e.exit(l),e.exit(a),t(E)):g<m&&E===40?(e.consume(E),g++,j):E===41?(e.consume(E),g--,j):E===null||E===32||E===40||Dp(E)?n(E):(e.consume(E),E===92?A:j)}function A(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function B_(e,t,n,a,s,u){const l=this;let f=0,h;return m;function m(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(u),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(u),e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):Ee(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||Ee(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!et(b)),b===92?v:y)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,y):y(b)}}function Z_(e,t,n,a,s,u){let l;return f;function f(v){return v===34||v===39||v===40?(e.enter(a),e.enter(s),e.consume(v),e.exit(s),l=v===40?41:v,h):n(v)}function h(v){return v===l?(e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):(e.enter(u),m(v))}function m(v){return v===l?(e.exit(u),h(l)):v===null?n(v):Ee(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),mt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||Ee(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:g)}function y(v){return v===l||v===92?(e.consume(v),g):g(v)}}function zl(e,t){let n;return a;function a(s){return Ee(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):et(s)?mt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const d$={name:"definition",tokenize:h$},f$={partial:!0,tokenize:m$};function h$(e,t,n){const a=this;let s;return u;function u(b){return e.enter("definition"),l(b)}function l(b){return B_.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return s=Vs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return Rn(b)?zl(e,m)(b):m(b)}function m(b){return V_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(f$,y,y)(b)}function y(b){return et(b)?mt(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Ee(b)?(e.exit("definition"),a.parser.defined.push(s),t(b)):n(b)}}function m$(e,t,n){return a;function a(f){return Rn(f)?zl(e,s)(f):n(f)}function s(f){return Z_(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return et(f)?mt(e,l,"whitespace")(f):l(f)}function l(f){return f===null||Ee(f)?t(f):n(f)}}const p$={name:"hardBreakEscape",tokenize:g$};function g$(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),s}function s(u){return Ee(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const x$={name:"headingAtx",resolve:y$,tokenize:b$};function y$(e,t){let n=e.length-2,a=3,s,u;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},u={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Dr(e,a,n-a+1,[["enter",s,t],["enter",u,t],["exit",u,t],["exit",s,t]])),e}function b$(e,t,n){let a=0;return s;function s(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&a++<6?(e.consume(g),l):g===null||Rn(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ee(g)?(e.exit("atxHeading"),t(g)):et(g)?mt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||Rn(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const v$=["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"],Nk=["pre","script","style","textarea"],k$={concrete:!0,name:"htmlFlow",resolveTo:z$,tokenize:_$},w$={partial:!0,tokenize:N$},S$={partial:!0,tokenize:j$};function z$(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 _$(e,t,n){const a=this;let s,u,l,f,h;return m;function m(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),y}function y(w){return w===33?(e.consume(w),v):w===47?(e.consume(w),u=!0,j):w===63?(e.consume(w),s=3,a.interrupt?t:T):Ar(w)?(e.consume(w),l=String.fromCharCode(w),A):n(w)}function v(w){return w===45?(e.consume(w),s=2,b):w===91?(e.consume(w),s=5,f=0,S):Ar(w)?(e.consume(w),s=4,a.interrupt?t:T):n(w)}function b(w){return w===45?(e.consume(w),a.interrupt?t:T):n(w)}function S(w){const Y="CDATA[";return w===Y.charCodeAt(f++)?(e.consume(w),f===Y.length?a.interrupt?t:le:S):n(w)}function j(w){return Ar(w)?(e.consume(w),l=String.fromCharCode(w),A):n(w)}function A(w){if(w===null||w===47||w===62||Rn(w)){const Y=w===47,de=l.toLowerCase();return!Y&&!u&&Nk.includes(de)?(s=1,a.interrupt?t(w):le(w)):v$.includes(l.toLowerCase())?(s=6,Y?(e.consume(w),E):a.interrupt?t(w):le(w)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(w):u?O(w):N(w))}return w===45||Fn(w)?(e.consume(w),l+=String.fromCharCode(w),A):n(w)}function E(w){return w===62?(e.consume(w),a.interrupt?t:le):n(w)}function O(w){return et(w)?(e.consume(w),O):fe(w)}function N(w){return w===47?(e.consume(w),fe):w===58||w===95||Ar(w)?(e.consume(w),L):et(w)?(e.consume(w),N):fe(w)}function L(w){return w===45||w===46||w===58||w===95||Fn(w)?(e.consume(w),L):D(w)}function D(w){return w===61?(e.consume(w),R):et(w)?(e.consume(w),D):N(w)}function R(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),h=w,q):et(w)?(e.consume(w),R):B(w)}function q(w){return w===h?(e.consume(w),h=null,X):w===null||Ee(w)?n(w):(e.consume(w),q)}function B(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Rn(w)?D(w):(e.consume(w),B)}function X(w){return w===47||w===62||et(w)?N(w):n(w)}function fe(w){return w===62?(e.consume(w),se):n(w)}function se(w){return w===null||Ee(w)?le(w):et(w)?(e.consume(w),se):n(w)}function le(w){return w===45&&s===2?(e.consume(w),P):w===60&&s===1?(e.consume(w),J):w===62&&s===4?(e.consume(w),C):w===63&&s===3?(e.consume(w),T):w===93&&s===5?(e.consume(w),me):Ee(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(w$,I,ee)(w)):w===null||Ee(w)?(e.exit("htmlFlowData"),ee(w)):(e.consume(w),le)}function ee(w){return e.check(S$,oe,I)(w)}function oe(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ae}function ae(w){return w===null||Ee(w)?ee(w):(e.enter("htmlFlowData"),le(w))}function P(w){return w===45?(e.consume(w),T):le(w)}function J(w){return w===47?(e.consume(w),l="",Z):le(w)}function Z(w){if(w===62){const Y=l.toLowerCase();return Nk.includes(Y)?(e.consume(w),C):le(w)}return Ar(w)&&l.length<8?(e.consume(w),l+=String.fromCharCode(w),Z):le(w)}function me(w){return w===93?(e.consume(w),T):le(w)}function T(w){return w===62?(e.consume(w),C):w===45&&s===2?(e.consume(w),T):le(w)}function C(w){return w===null||Ee(w)?(e.exit("htmlFlowData"),I(w)):(e.consume(w),C)}function I(w){return e.exit("htmlFlow"),t(w)}}function j$(e,t,n){const a=this;return s;function s(l){return Ee(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),u):n(l)}function u(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function N$(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(xd,t,n)}}const C$={name:"htmlText",tokenize:E$};function E$(e,t,n){const a=this;let s,u,l;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),D):T===63?(e.consume(T),N):Ar(T)?(e.consume(T),B):n(T)}function m(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),u=0,S):Ar(T)?(e.consume(T),O):n(T)}function g(T){return T===45?(e.consume(T),b):n(T)}function y(T){return T===null?n(T):T===45?(e.consume(T),v):Ee(T)?(l=y,J(T)):(e.consume(T),y)}function v(T){return T===45?(e.consume(T),b):y(T)}function b(T){return T===62?P(T):T===45?v(T):y(T)}function S(T){const C="CDATA[";return T===C.charCodeAt(u++)?(e.consume(T),u===C.length?j:S):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),A):Ee(T)?(l=j,J(T)):(e.consume(T),j)}function A(T){return T===93?(e.consume(T),E):j(T)}function E(T){return T===62?P(T):T===93?(e.consume(T),E):j(T)}function O(T){return T===null||T===62?P(T):Ee(T)?(l=O,J(T)):(e.consume(T),O)}function N(T){return T===null?n(T):T===63?(e.consume(T),L):Ee(T)?(l=N,J(T)):(e.consume(T),N)}function L(T){return T===62?P(T):N(T)}function D(T){return Ar(T)?(e.consume(T),R):n(T)}function R(T){return T===45||Fn(T)?(e.consume(T),R):q(T)}function q(T){return Ee(T)?(l=q,J(T)):et(T)?(e.consume(T),q):P(T)}function B(T){return T===45||Fn(T)?(e.consume(T),B):T===47||T===62||Rn(T)?X(T):n(T)}function X(T){return T===47?(e.consume(T),P):T===58||T===95||Ar(T)?(e.consume(T),fe):Ee(T)?(l=X,J(T)):et(T)?(e.consume(T),X):P(T)}function fe(T){return T===45||T===46||T===58||T===95||Fn(T)?(e.consume(T),fe):se(T)}function se(T){return T===61?(e.consume(T),le):Ee(T)?(l=se,J(T)):et(T)?(e.consume(T),se):X(T)}function le(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,ee):Ee(T)?(l=le,J(T)):et(T)?(e.consume(T),le):(e.consume(T),oe)}function ee(T){return T===s?(e.consume(T),s=void 0,ae):T===null?n(T):Ee(T)?(l=ee,J(T)):(e.consume(T),ee)}function oe(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Rn(T)?X(T):(e.consume(T),oe)}function ae(T){return T===47||T===62||Rn(T)?X(T):n(T)}function P(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function J(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),Z}function Z(T){return et(T)?mt(e,me,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):me(T)}function me(T){return e.enter("htmlTextData"),l(T)}}const Jg={name:"labelEnd",resolveAll:R$,resolveTo:M$,tokenize:D$},T$={tokenize:$$},A$={tokenize:L$},O$={tokenize:P$};function R$(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Dr(e,0,e.length,n),e}function M$(e,t){let n=e.length,a=0,s,u,l,f;for(;n--;)if(s=e[n][1],u){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(u=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[u+a+2][1].end},end:{...e[l-2][1].start}};return f=[["enter",h,t],["enter",m,t]],f=or(f,e.slice(u+1,u+a+3)),f=or(f,[["enter",g,t]]),f=or(f,Xg(t.parser.constructs.insideSpan.null,e.slice(u+a+4,l-3),t)),f=or(f,[["exit",g,t],e[l-2],e[l-1],["exit",m,t]]),f=or(f,e.slice(l+1)),f=or(f,[["exit",h,t]]),Dr(e,u,e.length,f),e}function D$(e,t,n){const a=this;let s=a.events.length,u,l;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){u=a.events[s][1];break}return f;function f(v){return u?u._inactive?y(v):(l=a.parser.defined.includes(Vs(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):n(v)}function h(v){return v===40?e.attempt(T$,g,l?g:y)(v):v===91?e.attempt(A$,g,l?m:y)(v):l?g(v):y(v)}function m(v){return e.attempt(O$,g,y)(v)}function g(v){return t(v)}function y(v){return u._balanced=!0,n(v)}}function $$(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),s}function s(y){return Rn(y)?zl(e,u)(y):u(y)}function u(y){return y===41?g(y):V_(e,l,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return Rn(y)?zl(e,h)(y):g(y)}function f(y){return n(y)}function h(y){return y===34||y===39||y===40?Z_(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function m(y){return Rn(y)?zl(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function L$(e,t,n){const a=this;return s;function s(f){return B_.call(a,e,u,l,"reference","referenceMarker","referenceString")(f)}function u(f){return a.parser.defined.includes(Vs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function l(f){return n(f)}}function P$(e,t,n){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),s}function s(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const U$={name:"labelStartImage",resolveAll:Jg.resolveAll,tokenize:V$};function V$(e,t,n){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),l):n(f)}function l(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const B$={name:"labelStartLink",resolveAll:Jg.resolveAll,tokenize:Z$};function Z$(e,t,n){const a=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),u}function u(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const _m={name:"lineEnding",tokenize:I$};function I$(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),mt(e,t,"linePrefix")}}const Vc={name:"thematicBreak",tokenize:H$};function H$(e,t,n){let a=0,s;return u;function u(m){return e.enter("thematicBreak"),l(m)}function l(m){return s=m,f(m)}function f(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Ee(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),et(m)?mt(e,f,"whitespace")(m):f(m))}}const An={continuation:{tokenize:Y$},exit:X$,name:"list",tokenize:G$},F$={partial:!0,tokenize:J$},q$={partial:!0,tokenize:K$};function G$(e,t,n){const a=this,s=a.events[a.events.length-1];let u=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return f;function f(b){const S=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:$p(b)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Vc,n,m)(b):m(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return $p(b)&&++l<10?(e.consume(b),h):(!a.interrupt||l<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(xd,a.interrupt?n:g,e.attempt(F$,v,y))}function g(b){return a.containerState.initialBlankLine=!0,u++,v(b)}function y(b){return et(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Y$(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(xd,s,u);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,mt(e,t,"listItemIndent",a.containerState.size+1)(f)}function u(f){return a.containerState.furtherBlankLines||!et(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(q$,t,l)(f))}function l(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,mt(e,e.attempt(An,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function K$(e,t,n){const a=this;return mt(e,s,"listItemIndent",a.containerState.size+1);function s(u){const l=a.events[a.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===a.containerState.size?t(u):n(u)}}function X$(e){e.exit(this.containerState.type)}function J$(e,t,n){const a=this;return mt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(u){const l=a.events[a.events.length-1];return!et(u)&&l&&l[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const Ck={name:"setextUnderline",resolveTo:Q$,tokenize:W$};function Q$(e,t){let n=e.length,a,s,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",u?(e.splice(s,0,["enter",l,t]),e.splice(u+1,0,["exit",e[a][1],t]),e[a][1].end={...e[u][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function W$(e,t,n){const a=this;let s;return u;function u(m){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),s=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===s?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),et(m)?mt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ee(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const e6={tokenize:t6};function t6(e){const t=this,n=e.attempt(xd,a,e.attempt(this.parser.constructs.flowInitial,s,mt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(s$,s)),"linePrefix")));return n;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const n6={resolveAll:H_()},r6=I_("string"),a6=I_("text");function I_(e){return{resolveAll:H_(e==="text"?i6:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],u=n.attempt(s,l,f);return l;function l(g){return m(g)?u(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),u(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const y=s[g];let v=-1;if(y)for(;++v<y.length;){const b=y[v];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function H_(e){return t;function t(n,a){let s=-1,u;for(;++s<=n.length;)u===void 0?n[s]&&n[s][1].type==="data"&&(u=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==u+2&&(n[u][1].end=n[s-1][1].end,n.splice(u+2,s-u-2),s=u+2),u=void 0);return e?e(n,a):n}}function i6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let u=s.length,l=-1,f=0,h;for(;u--;){const m=s[u];if(typeof m=="string"){for(l=m.length;m.charCodeAt(l-1)===32;)f++,l--;if(l)break;l=-1}else if(m===-2)h=!0,f++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?l:a.start._bufferIndex+l,_index:a.start._index+u,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const s6={42:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:$_},o6={91:d$},l6={[-2]:zm,[-1]:zm,32:zm},u6={35:x$,42:Vc,45:[Ck,Vc],60:k$,61:Ck,95:Vc,96:jk,126:jk},c6={38:P_,92:L_},d6={[-5]:_m,[-4]:_m,[-3]:_m,33:U$,38:P_,42:Lp,60:[B5,C$],91:B$,92:[p$,L_],93:Jg,95:Lp,96:e$},f6={null:[Lp,n6]},h6={null:[42,95]},m6={null:[]},p6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:h6,contentInitial:o6,disable:m6,document:s6,flow:u6,flowInitial:l6,insideSpan:f6,string:c6,text:d6},Symbol.toStringTag,{value:"Module"}));function g6(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},u=[];let l=[],f=[];const h={attempt:q(D),check:q(R),consume:O,enter:N,exit:L,interrupt:q(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:y};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function y(se){return l=or(l,se),A(),l[l.length-1]!==null?[]:(B(t,0),m.events=Xg(u,m.events,m),m.events)}function v(se,le){return y6(b(se),le)}function b(se){return x6(l,se)}function S(){const{_bufferIndex:se,_index:le,line:ee,column:oe,offset:ae}=a;return{_bufferIndex:se,_index:le,line:ee,column:oe,offset:ae}}function j(se){s[se.line]=se.column,fe()}function A(){let se;for(;a._index<l.length;){const le=l[a._index];if(typeof le=="string")for(se=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===se&&a._bufferIndex<le.length;)E(le.charCodeAt(a._bufferIndex));else E(le)}}function E(se){g=g(se)}function O(se){Ee(se)?(a.line++,a.column=1,a.offset+=se===-3?2:1,fe()):se!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=se}function N(se,le){const ee=le||{};return ee.type=se,ee.start=S(),m.events.push(["enter",ee,m]),f.push(ee),ee}function L(se){const le=f.pop();return le.end=S(),m.events.push(["exit",le,m]),le}function D(se,le){B(se,le.from)}function R(se,le){le.restore()}function q(se,le){return ee;function ee(oe,ae,P){let J,Z,me,T;return Array.isArray(oe)?I(oe):"tokenize"in oe?I([oe]):C(oe);function C(he){return pe;function pe(Pe){const Ae=Pe!==null&&he[Pe],pt=Pe!==null&&he.null,Rt=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(pt)?pt:pt?[pt]:[]];return I(Rt)(Pe)}}function I(he){return J=he,Z=0,he.length===0?P:w(he[Z])}function w(he){return pe;function pe(Pe){return T=X(),me=he,he.partial||(m.currentConstruct=he),he.name&&m.parser.constructs.disable.null.includes(he.name)?de():he.tokenize.call(le?Object.assign(Object.create(m),le):m,h,Y,de)(Pe)}}function Y(he){return se(me,T),ae}function de(he){return T.restore(),++Z<J.length?w(J[Z]):P}}}function B(se,le){se.resolveAll&&!u.includes(se)&&u.push(se),se.resolve&&Dr(m.events,le,m.events.length-le,se.resolve(m.events.slice(le),m)),se.resolveTo&&(m.events=se.resolveTo(m.events,m))}function X(){const se=S(),le=m.previous,ee=m.currentConstruct,oe=m.events.length,ae=Array.from(f);return{from:oe,restore:P};function P(){a=se,m.previous=le,m.currentConstruct=ee,m.events.length=oe,f=ae,fe()}}function fe(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function x6(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,u=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(a,u)];else{if(l=e.slice(n,s),a>-1){const f=l[0];typeof f=="string"?l[0]=f.slice(a):l.shift()}u>0&&l.push(e[s].slice(0,u))}return l}function y6(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const u=e[n];let l;if(typeof u=="string")l=u;else switch(u){case-5:{l="\r";break}case-4:{l=`
|
|
21
|
-
`;break}case-3:{l=`\r
|
|
22
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(u)}s=u===-2,a.push(l)}return a.join("")}function b6(e){const a={constructs:j5([p6,...(e||{}).extensions||[]]),content:s(M5),defined:[],document:s($5),flow:s(e6),lazy:{},string:s(r6),text:s(a6)};return a;function s(u){return l;function l(f){return g6(a,u,f)}}}function v6(e){for(;!U_(e););return e}const Ek=/[\0\t\n\r]/g;function k6(){let e=1,t="",n=!0,a;return s;function s(u,l,f){const h=[];let m,g,y,v,b;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(l||void 0).decode(u)),y=0,t="",n&&(u.charCodeAt(0)===65279&&y++,n=void 0);y<u.length;){if(Ek.lastIndex=y,m=Ek.exec(u),v=m&&m.index!==void 0?m.index:u.length,b=u.charCodeAt(v),!m){t=u.slice(y);break}if(b===10&&y===v&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<v&&(h.push(u.slice(y,v)),e+=v-y),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}y=v+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const w6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function S6(e){return e.replace(w6,z6)}function z6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),u=s===120||s===88;return D_(n.slice(u?2:1),u?16:10)}return Kg(n)||e}const F_={}.hasOwnProperty;function _6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),j6(n)(v6(b6(n).document().write(k6()(e,t,!0))))}function j6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(tt),autolinkProtocol:X,autolinkEmail:X,atxHeading:u(Lt),blockQuote:u(pt),characterEscape:X,characterReference:X,codeFenced:u(Rt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:u(Rt,l),codeText:u(V,l),codeTextData:X,data:X,codeFlowValue:X,definition:u(Ne),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:u(Ge),hardBreakEscape:u(Me),hardBreakTrailing:u(Me),htmlFlow:u(Xe,l),htmlFlowData:X,htmlText:u(Xe,l),htmlTextData:X,image:u(st),label:l,link:u(tt),listItem:u(Gn),listItemValue:v,listOrdered:u(Qt,y),listUnordered:u(Qt),paragraph:u(Mt),reference:w,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:u(Lt),strong:u(Gt),thematicBreak:u($i)},exit:{atxHeading:h(),atxHeadingSequence:D,autolink:h(),autolinkEmail:Ae,autolinkProtocol:Pe,blockQuote:h(),characterEscapeValue:fe,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:he,characterReference:pe,codeFenced:h(A),codeFencedFence:j,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:fe,codeIndented:h(E),codeText:h(ae),codeTextData:fe,data:fe,definition:h(),definitionDestinationString:L,definitionLabelString:O,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(le),hardBreakTrailing:h(le),htmlFlow:h(ee),htmlFlowData:fe,htmlText:h(oe),htmlTextData:fe,image:h(J),label:me,labelText:Z,lineEnding:se,link:h(P),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:Y,resourceDestinationString:T,resourceTitleString:C,resource:I,setextHeading:h(B),setextHeadingLineSequence:q,setextHeadingText:R,strong:h(),thematicBreak:h()}};q_(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(W){let ce={type:"root",children:[]};const we={stack:[ce],tokenStack:[],config:t,enter:f,exit:m,buffer:l,resume:g,data:n},Ce=[];let He=-1;for(;++He<W.length;)if(W[He][1].type==="listOrdered"||W[He][1].type==="listUnordered")if(W[He][0]==="enter")Ce.push(He);else{const pn=Ce.pop();He=s(W,pn,He)}for(He=-1;++He<W.length;){const pn=t[W[He][0]];F_.call(pn,W[He][1].type)&&pn[W[He][1].type].call(Object.assign({sliceSerialize:W[He][2].sliceSerialize},we),W[He][1])}if(we.tokenStack.length>0){const pn=we.tokenStack[we.tokenStack.length-1];(pn[1]||Tk).call(we,void 0,pn[0])}for(ce.position={start:Ma(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ma(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)ce=t.transforms[He](ce)||ce;return ce}function s(W,ce,we){let Ce=ce-1,He=-1,pn=!1,$n,gn,Yt,Sn;for(;++Ce<=we;){const ct=W[Ce];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?He++:He--,Sn=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&($n&&!Sn&&!He&&!Yt&&(Yt=Ce),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!He&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||He===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if($n){let ua=Ce;for(gn=void 0;ua--;){const hr=W[ua];if(hr[1].type==="lineEnding"||hr[1].type==="lineEndingBlank"){if(hr[0]==="exit")continue;gn&&(W[gn][1].type="lineEndingBlank",pn=!0),hr[1].type="lineEnding",gn=ua}else if(!(hr[1].type==="linePrefix"||hr[1].type==="blockQuotePrefix"||hr[1].type==="blockQuotePrefixWhitespace"||hr[1].type==="blockQuoteMarker"||hr[1].type==="listItemIndent"))break}Yt&&(!gn||Yt<gn)&&($n._spread=!0),$n.end=Object.assign({},gn?W[gn][1].start:ct[1].end),W.splice(gn||Ce,0,["exit",$n,ct[2]]),Ce++,we++}if(ct[1].type==="listItemPrefix"){const ua={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};$n=ua,W.splice(Ce,0,["enter",ua,ct[2]]),Ce++,we++,Yt=void 0,Sn=!0}}}return W[ce][1]._spread=pn,we}function u(W,ce){return we;function we(Ce){f.call(this,W(Ce),Ce),ce&&ce.call(this,Ce)}}function l(){this.stack.push({type:"fragment",children:[]})}function f(W,ce,we){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([ce,we||void 0]),W.position={start:Ma(ce.start),end:void 0}}function h(W){return ce;function ce(we){W&&W.call(this,we),m.call(this,we)}}function m(W,ce){const we=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==W.type&&(ce?ce.call(this,W,Ce[0]):(Ce[1]||Tk).call(this,W,Ce[0]));else throw new Error("Cannot close `"+W.type+"` ("+Sl({start:W.start,end:W.end})+"): it’s not open");we.position.end=Ma(W.end)}function g(){return z5(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(W){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function b(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=W}function S(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=W}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W.replace(/(\r?\n|\r)$/g,"")}function O(W){const ce=this.resume(),we=this.stack[this.stack.length-1];we.label=ce,we.identifier=Vs(this.sliceSerialize(W)).toLowerCase()}function N(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.title=W}function L(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.url=W}function D(W){const ce=this.stack[this.stack.length-1];if(!ce.depth){const we=this.sliceSerialize(W).length;ce.depth=we}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function q(W){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function X(W){const we=this.stack[this.stack.length-1].children;let Ce=we[we.length-1];(!Ce||Ce.type!=="text")&&(Ce=gt(),Ce.position={start:Ma(W.start),end:void 0},we.push(Ce)),this.stack.push(Ce)}function fe(W){const ce=this.stack.pop();ce.value+=this.sliceSerialize(W),ce.position.end=Ma(W.end)}function se(W){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=ce.children[ce.children.length-1];we.position.end=Ma(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(X.call(this,W),fe.call(this,W))}function le(){this.data.atHardBreak=!0}function ee(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function oe(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function ae(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.value=W}function P(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ce,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function J(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=ce,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function Z(W){const ce=this.sliceSerialize(W),we=this.stack[this.stack.length-2];we.label=S6(ce),we.identifier=Vs(ce).toLowerCase()}function me(){const W=this.stack[this.stack.length-1],ce=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ce=W.children;we.children=Ce}else we.alt=ce}function T(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.url=W}function C(){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.title=W}function I(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function Y(W){const ce=this.resume(),we=this.stack[this.stack.length-1];we.label=ce,we.identifier=Vs(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function de(W){this.data.characterReferenceType=W.type}function he(W){const ce=this.sliceSerialize(W),we=this.data.characterReferenceType;let Ce;we?(Ce=D_(ce,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Kg(ce);const He=this.stack[this.stack.length-1];He.value+=Ce}function pe(W){const ce=this.stack.pop();ce.position.end=Ma(W.end)}function Pe(W){fe.call(this,W);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(W)}function Ae(W){fe.call(this,W);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(W)}function pt(){return{type:"blockquote",children:[]}}function Rt(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ge(){return{type:"emphasis",children:[]}}function Lt(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function st(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function Qt(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Gn(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Mt(){return{type:"paragraph",children:[]}}function Gt(){return{type:"strong",children:[]}}function gt(){return{type:"text",value:""}}function $i(){return{type:"thematicBreak"}}}function Ma(e){return{line:e.line,column:e.column,offset:e.offset}}function q_(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?q_(e,a):N6(e,a)}}function N6(e,t){let n;for(n in t)if(F_.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Tk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Sl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Sl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Sl({start:t.start,end:t.end})+") is still open")}function C6(e){const t=this;t.parser=n;function n(a){return _6(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function E6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function T6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
23
|
-
`}]}function A6(e,t){const n=t.value?t.value+`
|
|
24
|
-
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function O6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function M6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=ro(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let l,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=u+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function D6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function G_(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),u=s[0];u&&u.type==="text"?u.value="["+u.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=a:s.push({type:"text",value:a}),s}function L6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return G_(e,t);const s={src:ro(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,u),e.applyData(t,u)}function P6(e,t){const n={src:ro(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function U6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function V6(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return G_(e,t);const s={href:ro(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const u={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function B6(e,t){const n={href:ro(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Z6(e,t,n){const a=e.all(t),s=n?I6(n):Y_(t),u={},l=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(s||f!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
25
|
-
`}),g.type==="element"&&g.tagName==="p"&&!s?l.push(...g.children):l.push(g)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
26
|
-
`});const m={type:"element",tagName:"li",properties:u,children:l};return e.patch(t,m),e.applyData(t,m)}function I6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=Y_(n[a])}return t}function Y_(e){const t=e.spread;return t??e.children.length>1}function H6(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const l=a[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function F6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function G6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y6(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Fg(t.children[1]),h=C_(t.children[t.children.length-1]);f&&h&&(l.position={start:f,end:h}),s.push(l)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)}function K6(e,t,n){const a=n?n.children:void 0,u=(a?a.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,f=l?l.length:t.children.length;let h=-1;const m=[];for(;++h<f;){const y=t.children[h],v={},b=l?l[h]:void 0;b&&(v.align=b);let S={type:"element",tagName:u,properties:v,children:[]};y&&(S.children=e.all(y),e.patch(y,S),S=e.applyData(y,S)),m.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function X6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ak=9,Ok=32;function J6(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const u=[];for(;a;)u.push(Rk(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return u.push(Rk(t.slice(s),s>0,!1)),u.join("")}function Rk(e,t,n){let a=0,s=e.length;if(t){let u=e.codePointAt(a);for(;u===Ak||u===Ok;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(s-1);for(;u===Ak||u===Ok;)s--,u=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function Q6(e,t){const n={type:"text",value:J6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function W6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const eL={blockquote:E6,break:T6,code:A6,delete:O6,emphasis:R6,footnoteReference:M6,heading:D6,html:$6,imageReference:L6,image:P6,inlineCode:U6,linkReference:V6,link:B6,listItem:Z6,list:H6,paragraph:F6,root:q6,strong:G6,table:Y6,tableCell:X6,tableRow:K6,text:Q6,thematicBreak:W6,toml:vc,yaml:vc,definition:vc,footnoteDefinition:vc};function vc(){}const K_=-1,yd=0,_l=1,Qc=2,Qg=3,Wg=4,ex=5,tx=6,X_=7,J_=8,Mk=typeof self=="object"?self:globalThis,tL=(e,t)=>{const n=(s,u)=>(e.set(u,s),s),a=s=>{if(e.has(s))return e.get(s);const[u,l]=t[s];switch(u){case yd:case K_:return n(l,s);case _l:{const f=n([],s);for(const h of l)f.push(a(h));return f}case Qc:{const f=n({},s);for(const[h,m]of l)f[a(h)]=a(m);return f}case Qg:return n(new Date(l),s);case Wg:{const{source:f,flags:h}=l;return n(new RegExp(f,h),s)}case ex:{const f=n(new Map,s);for(const[h,m]of l)f.set(a(h),a(m));return f}case tx:{const f=n(new Set,s);for(const h of l)f.add(a(h));return f}case X_:{const{name:f,message:h}=l;return n(new Mk[f](h),s)}case J_:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:f}=new Uint8Array(l);return n(new DataView(f),l)}}return n(new Mk[u](l),s)};return a},Dk=e=>tL(new Map,e)(0),ws="",{toString:nL}={},{keys:rL}=Object,ul=e=>{const t=typeof e;if(t!=="object"||!e)return[yd,t];const n=nL.call(e).slice(8,-1);switch(n){case"Array":return[_l,ws];case"Object":return[Qc,ws];case"Date":return[Qg,ws];case"RegExp":return[Wg,ws];case"Map":return[ex,ws];case"Set":return[tx,ws];case"DataView":return[_l,n]}return n.includes("Array")?[_l,n]:n.includes("Error")?[X_,n]:[Qc,n]},kc=([e,t])=>e===yd&&(t==="function"||t==="symbol"),aL=(e,t,n,a)=>{const s=(l,f)=>{const h=a.push(l)-1;return n.set(f,h),h},u=l=>{if(n.has(l))return n.get(l);let[f,h]=ul(l);switch(f){case yd:{let g=l;switch(h){case"bigint":f=J_,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([K_],l)}return s([f,g],l)}case _l:{if(h){let v=l;return h==="DataView"?v=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(l)),s([h,[...v]],l)}const g=[],y=s([f,g],l);for(const v of l)g.push(u(v));return y}case Qc:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return u(l.toJSON());const g=[],y=s([f,g],l);for(const v of rL(l))(e||!kc(ul(l[v])))&&g.push([u(v),u(l[v])]);return y}case Qg:return s([f,l.toISOString()],l);case Wg:{const{source:g,flags:y}=l;return s([f,{source:g,flags:y}],l)}case ex:{const g=[],y=s([f,g],l);for(const[v,b]of l)(e||!(kc(ul(v))||kc(ul(b))))&&g.push([u(v),u(b)]);return y}case tx:{const g=[],y=s([f,g],l);for(const v of l)(e||!kc(ul(v)))&&g.push(u(v));return y}}const{message:m}=l;return s([f,{name:h,message:m}],l)};return u},$k=(e,{json:t,lossy:n}={})=>{const a=[];return aL(!(t||n),!!t,new Map,a)(e),a},Wc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dk($k(e,t)):structuredClone(e):(e,t)=>Dk($k(e,t));function iL(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function sL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function oL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||iL,a=e.options.footnoteBackLabel||sL,s=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),y=String(m.identifier).toUpperCase(),v=ro(y.toLowerCase());let b=0;const S=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++b<=j;){S.length>0&&S.push({type:"text",value:" "});let O=typeof n=="string"?n:n(h,b);typeof O=="string"&&(O={type:"text",value:O}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,b),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const A=g[g.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const O=A.children[A.children.length-1];O&&O.type==="text"?O.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...S)}else g.push(...S);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Wc(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
27
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
28
|
-
`}]}}const Q_=(function(e){if(e==null)return dL;if(typeof e=="function")return bd(e);if(typeof e=="object")return Array.isArray(e)?lL(e):uL(e);if(typeof e=="string")return cL(e);throw new Error("Expected function, string, or object as test")});function lL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Q_(e[n]);return bd(a);function a(...s){let u=-1;for(;++u<t.length;)if(t[u].apply(this,s))return!0;return!1}}function uL(e){const t=e;return bd(n);function n(a){const s=a;let u;for(u in e)if(s[u]!==t[u])return!1;return!0}}function cL(e){return bd(t);function t(n){return n&&n.type===e}}function bd(e){return t;function t(n,a,s){return!!(fL(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function dL(){return!0}function fL(e){return e!==null&&typeof e=="object"&&"type"in e}const W_=[],hL=!0,Lk=!1,mL="skip";function pL(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const u=Q_(s),l=a?-1:1;f(e,void 0,[])();function f(h,m,g){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=W_,S,j,A;if((!t||u(h,m,g[g.length-1]||void 0))&&(b=gL(n(h,g)),b[0]===Lk))return b;if("children"in h&&h.children){const E=h;if(E.children&&b[0]!==mL)for(j=(a?E.children.length:-1)+l,A=g.concat(E);j>-1&&j<E.children.length;){const O=E.children[j];if(S=f(O,j,A)(),S[0]===Lk)return S;j=typeof S[1]=="number"?S[1]:j+l}}return b}}}function gL(e){return Array.isArray(e)?e:typeof e=="number"?[hL,e]:e==null?W_:[e]}function ej(e,t,n,a){let s,u,l;typeof t=="function"&&typeof n!="function"?(u=void 0,l=t,s=n):(u=t,l=n,s=a),pL(e,u,f,s);function f(h,m){const g=m[m.length-1],y=g?g.children.indexOf(h):void 0;return l(h,y,g)}}const Pp={}.hasOwnProperty,xL={};function yL(e,t){const n=t||xL,a=new Map,s=new Map,u=new Map,l={...eL,...n.handlers},f={all:m,applyData:vL,definitionById:a,footnoteById:s,footnoteCounts:u,footnoteOrder:[],handlers:l,one:h,options:n,patch:bL,wrap:wL};return ej(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:s,v=String(g.identifier).toUpperCase();y.has(v)||y.set(v,g)}}),f;function h(g,y){const v=g.type,b=f.handlers[v];if(Pp.call(f.handlers,v)&&b)return b(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in g){const{children:j,...A}=g,E=Wc(A);return E.children=f.all(g),E}return Wc(g)}return(f.options.unknownHandler||kL)(f,g,y)}function m(g){const y=[];if("children"in g){const v=g.children;let b=-1;for(;++b<v.length;){const S=f.one(v[b],g);if(S){if(b&&v[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Pk(S.value)),!Array.isArray(S)&&S.type==="element")){const j=S.children[0];j&&j.type==="text"&&(j.value=Pk(j.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function bL(e,t){e.position&&(t.position=n5(e))}function vL(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,u=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const l="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:l}}n.type==="element"&&u&&Object.assign(n.properties,Wc(u)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function kL(e,t){const n=t.data||{},a="value"in t&&!(Pp.call(n,"hProperties")||Pp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function wL(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
29
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
30
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
31
|
-
`}),n}function Pk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Uk(e,t){const n=yL(e,t),a=n.one(e,void 0),s=oL(n),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&u.children.push({type:"text",value:`
|
|
32
|
-
`},s),u}function SL(e,t){return e&&"run"in e?async function(n,a){const s=Uk(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Uk(n,{file:a,...e||t})}}function Vk(e){if(e)throw e}var jm,Bk;function zL(){if(Bk)return jm;Bk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},l=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return jm=function h(){var m,g,y,v,b,S,j=arguments[0],A=1,E=arguments.length,O=!1;for(typeof j=="boolean"&&(O=j,j=arguments[1]||{},A=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});A<E;++A)if(m=arguments[A],m!=null)for(g in m)y=f(j,g),v=f(m,g),j!==v&&(O&&v&&(u(v)||(b=s(v)))?(b?(b=!1,S=y&&s(y)?y:[]):S=y&&u(y)?y:{},l(j,{name:g,newValue:h(O,S,v)})):typeof v<"u"&&l(j,{name:g,newValue:v}));return j},jm}var _L=zL();const Nm=Yp(_L);function Up(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 jL(){const e=[],t={run:n,use:a};return t;function n(...s){let u=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);f(null,...s);function f(h,...m){const g=e[++u];let y=-1;if(h){l(h);return}for(;++y<s.length;)(m[y]===null||m[y]===void 0)&&(m[y]=s[y]);s=m,g?NL(g,f)(...m):l(null,...m)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function NL(e,t){let n;return a;function a(...l){const f=e.length>l.length;let h;f&&l.push(s);try{h=e.apply(this,l)}catch(m){const g=m;if(f&&n)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,s):h instanceof Error?s(h):u(h))}function s(l,...f){n||(n=!0,t(l,...f))}function u(l){s(null,l)}}const Cr={basename:CL,dirname:EL,extname:TL,join:AL,sep:"/"};function CL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xl(e);let n=0,a=-1,s=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else a<0&&(u=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(u){n=s+1;break}}else l<0&&(u=!0,l=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(a=s):(f=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function EL(e){if(Xl(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TL(e){Xl(e);let t=e.length,n=-1,a=0,s=-1,u=0,l;for(;t--;){const f=e.codePointAt(t);if(f===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),f===46?s<0?s=t:u!==1&&(u=1):s>-1&&(u=-1)}return s<0||n<0||u===0||u===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function AL(...e){let t=-1,n;for(;++t<e.length;)Xl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":OL(n)}function OL(e){Xl(e);const t=e.codePointAt(0)===47;let n=RL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function RL(e,t){let n="",a=0,s=-1,u=0,l=-1,f,h;for(;++l<=e.length;){if(l<e.length)f=e.codePointAt(l);else{if(f===47)break;f=47}if(f===47){if(!(s===l-1||u===1))if(s!==l-1&&u===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),s=l,u=0;continue}}else if(n.length>0){n="",a=0,s=l,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),a=l-s-1;s=l,u=0}else f===46&&u>-1?u++:u=-1}return n}function Xl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ML={cwd:DL};function DL(){return"/"}function Vp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $L(e){if(typeof e=="string")e=new URL(e);else if(!Vp(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 LL(e)}function LL(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Cm=["history","path","basename","stem","extname","dirname"];class tj{constructor(t){let n;t?Vp(t)?n={path:t}:typeof t=="string"||PL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ML.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Cm.length;){const u=Cm[a];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let s;for(s in n)Cm.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Cr.basename(this.path):void 0}set basename(t){Tm(t,"basename"),Em(t,"basename"),this.path=Cr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Cr.dirname(this.path):void 0}set dirname(t){Zk(this.basename,"dirname"),this.path=Cr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Cr.extname(this.path):void 0}set extname(t){if(Em(t,"extname"),Zk(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=Cr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Vp(t)&&(t=$L(t)),Tm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Cr.basename(this.path,this.extname):void 0}set stem(t){Tm(t,"stem"),Em(t,"stem"),this.path=Cr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new mn(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Em(e,t){if(e&&e.includes(Cr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Cr.sep+"`")}function Tm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Zk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UL=(function(e){const a=this.constructor.prototype,s=a[e],u=function(){return s.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),VL={}.hasOwnProperty;class nx extends UL{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=jL()}copy(){const t=new nx;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Nm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rm("data",this.frozen),this.namespace[t]=n,this):VL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rm("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[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=wc(t),a=this.parser||this.Parser;return Am("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Am("process",this.parser||this.Parser),Om("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(u,l){const f=wc(t),h=a.parse(f);a.run(h,f,function(g,y,v){if(g||!y||!v)return m(g);const b=y,S=a.stringify(b,v);IL(S)?v.value=S:v.result=S,m(g,v)});function m(g,y){g||!y?l(g):u?u(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),Am("processSync",this.parser||this.Parser),Om("processSync",this.compiler||this.Compiler),this.process(t,s),Hk("processSync","process",n),a;function s(u,l){n=!0,Vk(u),a=l}}run(t,n,a){Ik(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?u(void 0,a):new Promise(u);function u(l,f){const h=wc(n);s.run(t,h,m);function m(g,y,v){const b=y||t;g?f(g):l?l(b):a(void 0,b,v)}}}runSync(t,n){let a=!1,s;return this.run(t,n,u),Hk("runSync","run",a),s;function u(l,f){Vk(l),s=f,a=!0}}stringify(t,n){this.freeze();const a=wc(n),s=this.compiler||this.Compiler;return Om("stringify",s),Ik(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(Rm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...y]=m;h(g,y)}else l(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function l(m){if(!("plugins"in m)&&!("settings"in m))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(m.plugins),m.settings&&(s.settings=Nm(!0,s.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const y=m[g];u(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let y=-1,v=-1;for(;++y<a.length;)if(a[y][0]===m){v=y;break}if(v===-1)a.push([m,...g]);else if(g.length>0){let[b,...S]=g;const j=a[v][1];Up(j)&&Up(b)&&(b=Nm(!0,j,b)),a[v]=[m,b,...S]}}}}const BL=new nx().freeze();function Am(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Om(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rm(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 Ik(e){if(!Up(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wc(e){return ZL(e)?e:new tj(e)}function ZL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function IL(e){return typeof e=="string"||HL(e)}function HL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Fk=[],qk={allowDangerousHtml:!0},qL=/^(https?|ircs?|mailto|xmpp)$/i,GL=[{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 YL(e){const t=KL(e),n=XL(e);return JL(t.runSync(t.parse(n),n),e)}function KL(e){const t=e.rehypePlugins||Fk,n=e.remarkPlugins||Fk,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qk}:qk;return BL().use(C6).use(n).use(SL,a).use(t)}function XL(e){const t=e.children||"",n=new tj;return typeof t=="string"&&(n.value=t),n}function JL(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,u=t.disallowedElements,l=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||QL;for(const g of GL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+FL+g.id,void 0);return ej(e,m),o5(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return l?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let b;for(b in Sm)if(Object.hasOwn(Sm,b)&&Object.hasOwn(g.properties,b)){const S=g.properties[b],j=Sm[b];(j===null||j.includes(g.tagName))&&(g.properties[b]=h(String(S||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!b&&a&&typeof y=="number"&&(b=!a(g,y,v)),b&&v&&typeof y=="number")return f&&g.children?v.children.splice(y,1,...g.children):v.children.splice(y,1),y}}}function QL(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||qL.test(e.slice(0,t))?e:""}const WL=({messages:e,onSendMessage:t,isLoading:n,activeSessionId:a})=>{const[s,u]=z.useState(""),l=z.useRef(null),f=()=>{l.current?.scrollIntoView({behavior:"smooth"})};z.useEffect(()=>{f()},[e,n]);const h=S=>{S.preventDefault(),!(!s.trim()||n)&&(t(s),u(""))},m=S=>S.session_id?.startsWith("sati-evaluation-")||S.tool_name?.toLowerCase().includes("sati")||S.tool_call_id?.toLowerCase().includes("sati")?!0:Array.isArray(S.tool_calls)?S.tool_calls.some(j=>String(j?.name||"").toLowerCase().includes("sati")):!1,g=S=>m(S)?"SATI Memory":"Tool Call",y=S=>{if(typeof S=="string")try{return JSON.stringify(JSON.parse(S),null,2)}catch{return S}try{return JSON.stringify(S,null,2)}catch{return String(S)}},v=S=>{const j=S.usage_metadata;if(!j||typeof j!="object")return null;const A=j.input_tokens??j.prompt_tokens??j.input??0,E=j.output_tokens??j.completion_tokens??j.output??0,O=Number(A),N=Number(E);if(!Number.isFinite(O)&&!Number.isFinite(N))return null;const L=Number.isFinite(O)?Math.max(0,Math.round(O)):0,D=Number.isFinite(N)?Math.max(0,Math.round(N)):0;return L===0&&D===0?null:{input:L,output:D}},b=S=>S.toLocaleString("pt-BR");return a?d.jsxs("div",{className:"flex-1 flex flex-col h-full bg-gray-50 dark:bg-black relative overflow-hidden transition-colors duration-300",children:[d.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6 min-h-0",children:[e.map((S,j)=>{const A=v(S),E=S.type==="human"?"bg-white/20 border border-white/30 text-white":"bg-gray-100 border border-gray-200 text-gray-600 dark:bg-zinc-900 dark:border-zinc-700 dark:text-gray-300";return d.jsxs("div",{className:`flex gap-4 ${S.type==="human"?"justify-end":"justify-start"}`,children:[S.type!=="human"&&d.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${S.type==="tool"?"bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400":"bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight"}`,children:S.type==="tool"?d.jsx(SS,{size:16}):d.jsx(A0,{size:18})}),d.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-sm ${S.type==="human"?"bg-azure-primary text-white dark:bg-matrix-primary dark:text-matrix-highlight dark:border dark:border-matrix-highlight/20 rounded-br-none":S.type==="tool"?"bg-white dark:bg-black border border-gray-200 dark:border-zinc-800 text-gray-800 dark:text-gray-200 rounded-bl-none":"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 text-gray-800 dark:text-matrix-secondary rounded-bl-none"}`,children:[S.type==="tool"&&d.jsxs("details",{className:"rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[d.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),d.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:y(S.content)})]}),S.type==="ai"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"prose dark:prose-invert max-w-none text-sm leading-relaxed dark:prose-p:text-matrix-secondary dark:prose-headings:text-matrix-highlight dark:prose-strong:text-matrix-highlight dark:prose-code:text-matrix-highlight",children:d.jsx(YL,{children:S.content})}),Array.isArray(S.tool_calls)&&S.tool_calls.length>0&&d.jsxs("details",{className:"mt-3 rounded-lg border border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-900/50 p-3",children:[d.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-200",children:g(S)}),d.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-all text-xs font-mono text-gray-700 dark:text-gray-300 overflow-x-auto",children:y(S.tool_calls)})]})]}),S.type==="human"&&d.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:S.content}),A&&d.jsx("div",{className:"mt-3 flex justify-end",children:d.jsxs("div",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium ${E}`,children:[d.jsx(vS,{size:12}),d.jsx("span",{children:b(A.input)}),d.jsx("span",{className:"opacity-60",children:"/"}),d.jsx("span",{children:b(A.output)}),d.jsx(bS,{size:12})]})})]}),S.type==="human"&&d.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-200 dark:bg-matrix-primary/20 flex items-center justify-center flex-shrink-0 text-gray-500 dark:text-matrix-secondary",children:d.jsx(sg,{size:18})})]},j)}),n&&d.jsxs("div",{className:"flex gap-4 justify-start",children:[d.jsx("div",{className:"w-8 h-8 rounded-full bg-azure-primary/10 text-azure-primary dark:bg-matrix-primary/20 dark:text-matrix-highlight flex items-center justify-center flex-shrink-0",children:d.jsx(A0,{size:18})}),d.jsxs("div",{className:"bg-white dark:bg-black border border-gray-100 dark:border-matrix-primary/30 p-4 rounded-2xl rounded-bl-none shadow-sm flex items-center gap-2",children:[d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"0ms"}}),d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"150ms"}}),d.jsx("div",{className:"w-2 h-2 bg-azure-primary dark:bg-matrix-highlight rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]}),d.jsx("div",{ref:l})]}),d.jsx("div",{className:"p-4 bg-white dark:bg-black border-t border-gray-200 dark:border-matrix-primary/30 shrink-0",children:d.jsxs("form",{onSubmit:h,className:"max-w-4xl mx-auto relative flex items-center gap-2",children:[d.jsx("input",{type:"text",value:s,onChange:S=>u(S.target.value),placeholder:"Type your message...",className:"flex-1 bg-gray-100 dark:bg-black/50 border border-transparent dark:border-matrix-primary/30 rounded-xl px-4 py-3 focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight outline-none transition-all dark:text-matrix-highlight dark:placeholder-matrix-secondary/50",disabled:n}),d.jsx("button",{type:"submit",disabled:!s.trim()||n,className:"p-3 bg-azure-primary text-white dark:bg-matrix-secondary dark:text-black dark:hover:bg-matrix-highlight rounded-xl hover:bg-azure-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors shadow-md",children:d.jsx(FA,{size:20})})]})})]}):d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-gray-50 dark:bg-black text-gray-400 dark:text-matrix-secondary/50 h-full",children:[d.jsx(e9,{size:48,className:"mb-4 opacity-20"}),d.jsx("p",{children:"Select a session to start chatting or create a new one."})]})},e9=({size:e,className:t})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:d.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),Da={getSessions:async()=>xe.get("/sessions"),createSession:async()=>xe.post("/sessions",{}),deleteSession:async e=>xe.delete(`/sessions/${e}`),renameSession:async(e,t)=>xe.patch(`/sessions/${e}/title`,{title:t}),archiveSession:async e=>xe.post(`/sessions/${e}/archive`,{}),getMessages:async e=>xe.get(`/sessions/${e}/messages`),sendMessage:async(e,t)=>xe.post("/chat",{sessionId:e,message:t})};function nj({isOpen:e,onClose:t,onConfirm:n,title:a,description:s,confirmJson:u="Confirm",variant:l="default"}){return d.jsx(vr,{open:e,onOpenChange:t,children:d.jsxs(Fs,{className:"sm:max-w-md bg-azure-surface dark:bg-black border-azure-border dark:border-matrix-primary",children:[d.jsx(kr,{children:d.jsx(wr,{className:"text-azure-primary dark:text-matrix-highlight flex items-center gap-2",children:a})}),d.jsx("div",{className:"py-4",children:d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:s})}),d.jsxs(jD,{className:"flex flex-col sm:flex-row gap-3 sm:justify-end",children:[d.jsx(lr,{variant:"outline",onClick:t,className:"dark:border-matrix-primary dark:text-matrix-secondary dark:hover:bg-matrix-primary/20",children:"Cancel"}),d.jsx(lr,{variant:l,onClick:()=>{n(),t()},className:l==="destructive"?"dark:bg-red-900/50 dark:text-red-200 dark:hover:bg-red-800/60":"dark:bg-matrix-primary dark:text-black dark:hover:bg-matrix-highlight",children:u})]})]})})}const t9=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(null),[s,u]=z.useState([]),[l,f]=z.useState(!1),[h,m]=z.useState(!0),g=z.useRef(!1);z.useEffect(()=>{g.current=l},[l]),z.useEffect(()=>{if(!n)return;const L=setInterval(async()=>{if(!g.current)try{const R=(await Da.getMessages(n)).filter(q=>q.type!=="system");u(q=>{if(R.length!==q.length)return R;const B=R.at(-1)?.created_at??0,X=q.at(-1)?.created_at??0;return B>X?R:q})}catch{}},3e3);return()=>clearInterval(L)},[n]);const[y,v]=z.useState({isOpen:!1,title:"",description:"",onConfirm:()=>{}}),b=async()=>{try{const L=await Da.getSessions();t(L)}catch(L){console.error("Failed to load sessions:",L)}};z.useEffect(()=>{b()},[]),z.useEffect(()=>{n?S(n):u([])},[n]);const S=async L=>{try{const D=await Da.getMessages(L);u(D.filter(R=>R.type!=="system"))}catch(D){console.error("Failed to load messages:",D)}},j=async()=>{try{const L=await Da.createSession();await b(),a(L.id)}catch(L){console.error("Failed to create session:",L)}},A=async L=>{if(!n)return;const D={type:"human",content:L};u(R=>[...R,D]),f(!0);try{await Da.sendMessage(n,L),await S(n),await b()}catch(R){console.error("Failed to send message:",R)}finally{f(!1)}},E=L=>{v({isOpen:!0,title:"Archive Session",description:"Are you sure you want to archive this session? It will be moved to the archives.",confirmJson:"Archive",onConfirm:async()=>{try{await Da.archiveSession(L),n===L&&a(null),await b()}catch(D){console.error("Failed to archive session:",D)}}})},O=L=>{v({isOpen:!0,title:"Delete Session",description:"Are you sure you want to DELETE this session? This action cannot be undone.",confirmJson:"Delete",variant:"destructive",onConfirm:async()=>{try{await Da.deleteSession(L),n===L&&a(null),await b()}catch(D){console.error("Failed to delete session:",D)}}})},N=async(L,D)=>{try{await Da.renameSession(L,D),await b()}catch(R){console.error("Failed to rename session:",R)}};return d.jsxs("div",{className:"flex h-full w-full overflow-hidden bg-gray-50 dark:bg-zinc-950",children:[d.jsx(OD,{sessions:e,activeSessionId:n,onSelectSession:a,onCreateSession:j,onArchiveSession:E,onDeleteSession:O,onRenameSession:N,isOpen:h,toggleSidebar:()=>m(!h)}),d.jsx("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:d.jsx(WL,{messages:s,onSendMessage:A,isLoading:l,activeSessionId:n})}),d.jsx(nj,{isOpen:y.isOpen,onClose:()=>v(L=>({...L,isOpen:!1})),onConfirm:y.onConfirm,title:y.title,description:y.description,confirmJson:y.confirmJson,variant:y.variant})]})};function n9(e){const t=new URLSearchParams,n=t.toString()?`?${t}`:"";return kt(`/chronos${n}`,()=>xe.get(`/chronos${n}`))}function r9(e,t=50){return kt(e?`/chronos/${e}/executions?limit=${t}`:null,()=>xe.get(`/chronos/${e}/executions?limit=${t}`))}function rj(){return kt("/config/chronos",()=>xe.get("/config/chronos"))}const Ei={createJob:e=>xe.post("/chronos",e),updateJob:(e,t)=>xe.put(`/chronos/${e}`,t),deleteJob:e=>xe.delete(`/chronos/${e}`),enableJob:e=>xe.patch(`/chronos/${e}/enable`,{}),disableJob:e=>xe.patch(`/chronos/${e}/disable`,{}),getConfig:()=>xe.get("/config/chronos"),updateConfig:e=>xe.post("/config/chronos",e),preview:(e,t,n)=>xe.post("/chronos/preview",{expression:e,schedule_type:t,timezone:n})};function ar({title:e,description:t,children:n}){return d.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg p-6 bg-azure-surface/50 dark:bg-matrix-base/50",children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:e}),t&&d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1",children:t})]}),d.jsx("div",{className:"space-y-4",children:n})]})}const a9=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},i9=(e,t)=>({classGroupId:e,validator:t}),aj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ed="-",Gk=[],s9="arbitrary..",o9=e=>{const t=u9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return l9(l);const f=l.split(ed),h=f[0]===""&&f.length>1?1:0;return ij(f,h,t)},getConflictingClassGroupIds:(l,f)=>{if(f){const h=a[l],m=n[l];return h?m?a9(m,h):h:m||Gk}return n[l]||Gk}}},ij=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],u=n.nextPart.get(s);if(u){const m=ij(e,t+1,u);if(m)return m}const l=n.validators;if(l===null)return;const f=t===0?e.join(ed):e.slice(t).join(ed),h=l.length;for(let m=0;m<h;m++){const g=l[m];if(g.validator(f))return g.classGroupId}},l9=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?s9+a:void 0})(),u9=e=>{const{theme:t,classGroups:n}=e;return c9(n,t)},c9=(e,t)=>{const n=aj();for(const a in e){const s=e[a];rx(s,n,a,t)}return n},rx=(e,t,n,a)=>{const s=e.length;for(let u=0;u<s;u++){const l=e[u];d9(l,t,n,a)}},d9=(e,t,n,a)=>{if(typeof e=="string"){f9(e,t,n);return}if(typeof e=="function"){h9(e,t,n,a);return}m9(e,t,n,a)},f9=(e,t,n)=>{const a=e===""?t:sj(t,e);a.classGroupId=n},h9=(e,t,n,a)=>{if(p9(e)){rx(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(i9(n,e))},m9=(e,t,n,a)=>{const s=Object.entries(e),u=s.length;for(let l=0;l<u;l++){const[f,h]=s[l];rx(h,sj(t,f),n,a)}},sj=(e,t)=>{let n=e;const a=t.split(ed),s=a.length;for(let u=0;u<s;u++){const l=a[u];let f=n.nextPart.get(l);f||(f=aj(),n.nextPart.set(l,f)),n=f}return n},p9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,g9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(u,l)=>{n[u]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(u){let l=n[u];if(l!==void 0)return l;if((l=a[u])!==void 0)return s(u,l),l},set(u,l){u in n?n[u]=l:s(u,l)}}},Bp="!",Yk=":",x9=[],Kk=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),y9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const u=[];let l=0,f=0,h=0,m;const g=s.length;for(let j=0;j<g;j++){const A=s[j];if(l===0&&f===0){if(A===Yk){u.push(s.slice(h,j)),h=j+1;continue}if(A==="/"){m=j;continue}}A==="["?l++:A==="]"?l--:A==="("?f++:A===")"&&f--}const y=u.length===0?s:s.slice(h);let v=y,b=!1;y.endsWith(Bp)?(v=y.slice(0,-1),b=!0):y.startsWith(Bp)&&(v=y.slice(1),b=!0);const S=m&&m>h?m-h:void 0;return Kk(u,b,v,S)};if(t){const s=t+Yk,u=a;a=l=>l.startsWith(s)?u(l.slice(s.length)):Kk(x9,!1,l,void 0,!0)}if(n){const s=a;a=u=>n({className:u,parseClassName:s})}return a},b9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let u=0;u<n.length;u++){const l=n[u],f=l[0]==="[",h=t.has(l);f||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(l)):s.push(l)}return s.length>0&&(s.sort(),a.push(...s)),a}},v9=e=>({cache:g9(e.cacheSize),parseClassName:y9(e),sortModifiers:b9(e),...o9(e)}),k9=/\s+/,w9=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:u}=t,l=[],f=e.trim().split(k9);let h="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:j}=n(g);if(y){h=g+(h.length>0?" "+h:h);continue}let A=!!j,E=a(A?S.substring(0,j):S);if(!E){if(!A){h=g+(h.length>0?" "+h:h);continue}if(E=a(S),!E){h=g+(h.length>0?" "+h:h);continue}A=!1}const O=v.length===0?"":v.length===1?v[0]:u(v).join(":"),N=b?O+Bp:O,L=N+E;if(l.indexOf(L)>-1)continue;l.push(L);const D=s(E,A);for(let R=0;R<D.length;++R){const q=D[R];l.push(N+q)}h=g+(h.length>0?" "+h:h)}return h},S9=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=oj(n))&&(s&&(s+=" "),s+=a);return s},oj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=oj(e[a]))&&(n&&(n+=" "),n+=t);return n},z9=(e,...t)=>{let n,a,s,u;const l=h=>{const m=t.reduce((g,y)=>y(g),e());return n=v9(m),a=n.cache.get,s=n.cache.set,u=f,f(h)},f=h=>{const m=a(h);if(m)return m;const g=w9(h,n);return s(h,g),g};return u=l,(...h)=>u(S9(...h))},_9=[],Xt=e=>{const t=n=>n[e]||_9;return t.isThemeGetter=!0,t},lj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j9=/^\d+\/\d+$/,N9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,E9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,T9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,A9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=e=>j9.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),$a=e=>!!e&&Number.isInteger(Number(e)),Mm=e=>e.endsWith("%")&&Le(e.slice(0,-1)),na=e=>N9.test(e),O9=()=>!0,R9=e=>C9.test(e)&&!E9.test(e),cj=()=>!1,M9=e=>T9.test(e),D9=e=>A9.test(e),$9=e=>!ye(e)&&!be(e),L9=e=>ao(e,hj,cj),ye=e=>lj.test(e),vi=e=>ao(e,mj,R9),Dm=e=>ao(e,Z9,Le),Xk=e=>ao(e,dj,cj),P9=e=>ao(e,fj,D9),Sc=e=>ao(e,pj,M9),be=e=>uj.test(e),cl=e=>io(e,mj),U9=e=>io(e,I9),Jk=e=>io(e,dj),V9=e=>io(e,hj),B9=e=>io(e,fj),zc=e=>io(e,pj,!0),ao=(e,t,n)=>{const a=lj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},io=(e,t,n=!1)=>{const a=uj.exec(e);return a?a[1]?t(a[1]):n:!1},dj=e=>e==="position"||e==="percentage",fj=e=>e==="image"||e==="url",hj=e=>e==="length"||e==="size"||e==="bg-size",mj=e=>e==="length",Z9=e=>e==="number",I9=e=>e==="family-name",pj=e=>e==="shadow",H9=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),a=Xt("font-weight"),s=Xt("tracking"),u=Xt("leading"),l=Xt("breakpoint"),f=Xt("container"),h=Xt("spacing"),m=Xt("radius"),g=Xt("shadow"),y=Xt("inset-shadow"),v=Xt("text-shadow"),b=Xt("drop-shadow"),S=Xt("blur"),j=Xt("perspective"),A=Xt("aspect"),E=Xt("ease"),O=Xt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...L(),be,ye],R=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto","contain","none"],B=()=>[be,ye,h],X=()=>[Ss,"full","auto",...B()],fe=()=>[$a,"none","subgrid",be,ye],se=()=>["auto",{span:["full",$a,be,ye]},$a,be,ye],le=()=>[$a,"auto",be,ye],ee=()=>["auto","min","max","fr",be,ye],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...B()],J=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],Z=()=>[e,be,ye],me=()=>[...L(),Jk,Xk,{position:[be,ye]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",V9,L9,{size:[be,ye]}],I=()=>[Mm,cl,vi],w=()=>["","none","full",m,be,ye],Y=()=>["",Le,cl,vi],de=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Le,Mm,Jk,Xk],Pe=()=>["","none",S,be,ye],Ae=()=>["none",Le,be,ye],pt=()=>["none",Le,be,ye],Rt=()=>[Le,be,ye],V=()=>[Ss,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[na],breakpoint:[na],color:[O9],container:[na],"drop-shadow":[na],ease:["in","out","in-out"],font:[$9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[na],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[na],shadow:[na],spacing:["px",Le],text:[na],"text-shadow":[na],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,ye,be,A]}],container:["container"],columns:[{columns:[Le,ye,be,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{start:X()}],end:[{end:X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[$a,"auto",be,ye]}],basis:[{basis:[Ss,"full","auto",f,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Ss,"auto","initial","none",ye]}],grow:[{grow:["",Le,be,ye]}],shrink:[{shrink:["",Le,be,ye]}],order:[{order:[$a,"first","last","none",be,ye]}],"grid-cols":[{"grid-cols":fe()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":fe()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[f,"screen",...J()]}],"min-w":[{"min-w":[f,"screen","none",...J()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,cl,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,be,Dm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mm,ye]}],"font-family":[{font:[U9,ye,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,be,ye]}],"line-clamp":[{"line-clamp":[Le,"none",be,Dm]}],leading:[{leading:[u,...B()]}],"list-image":[{"list-image":["none",be,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",be,vi]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Le,"auto",be,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$a,be,ye],radial:["",be,ye],conic:[$a,be,ye]},B9,P9]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:w()}],"rounded-s":[{"rounded-s":w()}],"rounded-e":[{"rounded-e":w()}],"rounded-t":[{"rounded-t":w()}],"rounded-r":[{"rounded-r":w()}],"rounded-b":[{"rounded-b":w()}],"rounded-l":[{"rounded-l":w()}],"rounded-ss":[{"rounded-ss":w()}],"rounded-se":[{"rounded-se":w()}],"rounded-ee":[{"rounded-ee":w()}],"rounded-es":[{"rounded-es":w()}],"rounded-tl":[{"rounded-tl":w()}],"rounded-tr":[{"rounded-tr":w()}],"rounded-br":[{"rounded-br":w()}],"rounded-bl":[{"rounded-bl":w()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,be,ye]}],"outline-w":[{outline:["",Le,cl,vi]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",g,zc,Sc]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",y,zc,Sc]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Le,vi]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",v,zc,Sc]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Le,be,ye]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Le]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[be,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":L()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ye]}],filter:[{filter:["","none",be,ye]}],blur:[{blur:Pe()}],brightness:[{brightness:[Le,be,ye]}],contrast:[{contrast:[Le,be,ye]}],"drop-shadow":[{"drop-shadow":["","none",b,zc,Sc]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Le,be,ye]}],"hue-rotate":[{"hue-rotate":[Le,be,ye]}],invert:[{invert:["",Le,be,ye]}],saturate:[{saturate:[Le,be,ye]}],sepia:[{sepia:["",Le,be,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ye]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Le,be,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Le,be,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,be,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,be,ye]}],"backdrop-invert":[{"backdrop-invert":["",Le,be,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Le,be,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Le,be,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,be,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Le,"initial",be,ye]}],ease:[{ease:["linear","initial",E,be,ye]}],delay:[{delay:[Le,be,ye]}],animate:[{animate:["none",O,be,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,be,ye]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:pt()}],"scale-x":[{"scale-x":pt()}],"scale-y":[{"scale-y":pt()}],"scale-z":[{"scale-z":pt()}],"scale-3d":["scale-3d"],skew:[{skew:Rt()}],"skew-x":[{"skew-x":Rt()}],"skew-y":[{"skew-y":Rt()}],transform:[{transform:[be,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,ye]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Le,cl,vi,Dm]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Bs=z9(H9);function Qe({label:e,error:t,helperText:n,className:a,...s}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.jsx("input",{className:Bs("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...s}),n&&!t&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&d.jsx("p",{className:"text-xs text-red-500",children:t})]})}function Er({label:e,options:t,error:n,helperText:a,className:s,...u}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.jsx("select",{className:Bs("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors appearance-none",n&&"border-red-500 focus:border-red-500 focus:ring-red-500",s),...u,children:t.map(l=>d.jsx("option",{value:l.value,className:"bg-azure-bg dark:bg-black",children:l.label},l.value))}),a&&!n&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a}),n&&d.jsx("p",{className:"text-xs text-red-500",children:n})]})}function yn({label:e,error:t,helperText:n,className:a,...s}){return d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx("label",{className:"text-sm font-medium text-azure-text-primary/80 dark:text-matrix-secondary",children:e}),d.jsx("input",{type:"number",className:Bs("bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary text-azure-text-primary dark:text-matrix-secondary placeholder-azure-text-secondary/50 dark:placeholder-matrix-secondary/50 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight transition-colors",t&&"border-red-500 focus:border-red-500 focus:ring-red-500",a),...s}),n&&!t&&d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:n}),t&&d.jsx("p",{className:"text-xs text-red-500",children:t})]})}function zs({label:e,checked:t,onChange:n,helperText:a,disabled:s}){return d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:Bs("text-sm font-medium text-azure-text-primary/80 dark:text-matrix-highlight/80",s&&"opacity-50"),children:e}),a&&d.jsx("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary",children:a})]}),d.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>!s&&n(!t),className:Bs("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:ring-offset-2 focus:ring-offset-azure-bg dark:focus:ring-offset-black",t?"bg-azure-primary dark:bg-matrix-highlight":"bg-slate-300 dark:bg-matrix-primary",s&&"opacity-50 cursor-not-allowed"),children:d.jsx("span",{className:Bs("inline-block h-4 w-4 transform rounded-full bg-white dark:bg-black transition-transform",t?"translate-x-6":"translate-x-1")})})]})}const ir={fetchConfig:async()=>xe.get("/config"),updateConfig:async e=>xe.post("/config",e),getSatiConfig:async()=>xe.get("/config/sati"),updateSatiConfig:async e=>xe.post("/config/sati",e),deleteSatiConfig:async()=>xe.delete("/config/sati"),getApocConfig:async()=>xe.get("/config/apoc"),updateApocConfig:async e=>xe.post("/config/apoc",e),deleteApocConfig:async()=>xe.delete("/config/apoc"),getNeoConfig:async()=>xe.get("/config/neo"),updateNeoConfig:async e=>xe.post("/config/neo",e),deleteNeoConfig:async()=>xe.delete("/config/neo"),getTrinityConfig:async()=>xe.get("/config/trinity"),updateTrinityConfig:async e=>xe.post("/config/trinity",e),deleteTrinityConfig:async()=>xe.delete("/config/trinity"),getEncryptionStatus:async()=>xe.get("/config/encryption-status"),getEnvOverrides:async()=>xe.get("/config/env-overrides")};function te(e,t,n){function a(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const v=g[y];v in f||(f[v]=m[v].bind(f))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(f){var h;const m=n?.Parent?new u:this;a(m,f),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let Zs=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},gj=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};const xj={};function Ga(e){return xj}function yj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Zp(e,t){return typeof t=="bigint"?t.toString():t}function vd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ax(e){return e==null}function ix(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function F9(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let s=(a.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(a)){const h=a.match(/\d?e-(\d?)/);h?.[1]&&(s=Number.parseInt(h[1]))}const u=n>s?n:s,l=Number.parseInt(e.toFixed(u).replace(".","")),f=Number.parseInt(t.toFixed(u).replace(".",""));return l%f/10**u}const Qk=Symbol("evaluating");function nt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Qk)return a===void 0&&(a=Qk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Mi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ja(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Wk(e){return JSON.stringify(e)}function q9(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const bj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ll(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const G9=vd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function qs(e){if(Ll(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ll(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function vj(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const Y9=new Set(["string","number","symbol"]);function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qa(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function ze(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function K9(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const X9={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function J9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Ja(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return Mi(this,"shape",l),l},checks:[]});return Qa(e,u)}function Q9(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Ja(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return Mi(this,"shape",l),l},checks:[]});return Qa(e,u)}function W9(e,t){if(!qs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ja(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Mi(this,"shape",u),u}});return Qa(e,s)}function eP(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ja(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Mi(this,"shape",a),a}});return Qa(e,n)}function tP(e,t){const n=Ja(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Mi(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Qa(e,n)}function nP(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ja(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(n)for(const m in n){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)h[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Mi(this,"shape",h),h},checks:[]});return Qa(t,l)}function rP(e,t,n){const a=Ja(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:s[l]}))}else for(const l in s)u[l]=new e({type:"nonoptional",innerType:s[l]});return Mi(this,"shape",u),u}});return Qa(t,a)}function Rs(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ms(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function _c(e){return typeof e=="string"?e:e?.message}function Ya(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=_c(e.inst?._zod.def?.error?.(e))??_c(t?.error?.(e))??_c(n.customError?.(e))??_c(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function sx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Pl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const kj=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Zp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wj=te("$ZodError",kj),Sj=te("$ZodError",kj,{Parent:Error});function aP(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function iP(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,f=0;for(;f<u.path.length;){const h=u.path[f];f===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const ox=e=>(t,n,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Zs;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Ya(h,u,Ga())));throw bj(f,s?.callee),f}return l.value},lx=e=>async(t,n,a,s)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Ya(h,u,Ga())));throw bj(f,s?.callee),f}return l.value},kd=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new Zs;return u.issues.length?{success:!1,error:new(e??wj)(u.issues.map(l=>Ya(l,s,Ga())))}:{success:!0,data:u.value}},sP=kd(Sj),wd=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Ya(l,s,Ga())))}:{success:!0,data:u.value}},oP=wd(Sj),lP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ox(e)(t,n,s)},uP=e=>(t,n,a)=>ox(e)(t,n,a),cP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return lx(e)(t,n,s)},dP=e=>async(t,n,a)=>lx(e)(t,n,a),fP=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kd(e)(t,n,s)},hP=e=>(t,n,a)=>kd(e)(t,n,a),mP=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wd(e)(t,n,s)},pP=e=>async(t,n,a)=>wd(e)(t,n,a),gP=/^[cC][^\s-]{8,}$/,xP=/^[0-9a-z]+$/,yP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bP=/^[0-9a-vA-V]{20}$/,vP=/^[A-Za-z0-9]{27}$/,kP=/^[a-zA-Z0-9_-]{21}$/,wP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,SP=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ew=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_P="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jP(){return new RegExp(_P,"u")}const NP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,CP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,EP=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,TP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,AP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zj=/^[A-Za-z0-9_-]*$/,OP=/^\+[1-9]\d{6,14}$/,_j="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",RP=new RegExp(`^${_j}$`);function jj(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function MP(e){return new RegExp(`^${jj(e)}$`)}function DP(e){const t=jj({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${_j}T(?:${a})$`)}const $P=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},LP=/^-?\d+$/,Nj=/^-?\d+(?:\.\d+)?$/,PP=/^(?:true|false)$/i,UP=/^[^A-Z]*$/,VP=/^[^a-z]*$/,Dn=te("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cj={number:"number",bigint:"bigint",object:"date"},Ej=te("$ZodCheckLessThan",(e,t)=>{Dn.init(e,t);const n=Cj[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tj=te("$ZodCheckGreaterThan",(e,t)=>{Dn.init(e,t);const n=Cj[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,u=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),BP=te("$ZodCheckMultipleOf",(e,t)=>{Dn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):F9(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ZP=te("$ZodCheckNumberFormat",(e,t)=>{Dn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,u]=X9[t.format];e._zod.onattach.push(l=>{const f=l._zod.bag;f.format=t.format,f.minimum=s,f.maximum=u,n&&(f.pattern=LP)}),e._zod.check=l=>{const f=l.value;if(n){if(!Number.isInteger(f)){l.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?l.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):l.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<s&&l.issues.push({origin:"number",input:f,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),f>u&&l.issues.push({origin:"number",input:f,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}}),IP=te("$ZodCheckMaxLength",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ax(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const l=sx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),HP=te("$ZodCheckMinLength",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ax(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const l=sx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),FP=te("$ZodCheckLengthEquals",(e,t)=>{var n;Dn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!ax(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===t.length)return;const l=sx(s),f=u>t.length;a.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Sd=te("$ZodCheckStringFormat",(e,t)=>{var n,a;Dn.init(e,t),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),qP=te("$ZodCheckRegex",(e,t)=>{Sd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),GP=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=UP),Sd.init(e,t)}),YP=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=VP),Sd.init(e,t)}),KP=te("$ZodCheckIncludes",(e,t)=>{Dn.init(e,t);const n=Gs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),XP=te("$ZodCheckStartsWith",(e,t)=>{Dn.init(e,t);const n=new RegExp(`^${Gs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),JP=te("$ZodCheckEndsWith",(e,t)=>{Dn.init(e,t);const n=new RegExp(`.*${Gs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),QP=te("$ZodCheckOverwrite",(e,t)=>{Dn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});let WP=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
33
|
-
`).filter(l=>l),s=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,s.join(`
|
|
34
|
-
`))}};const eU={major:4,minor:3,patch:6},jt=te("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eU;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const u of s._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(l,f,h)=>{let m=Rs(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,b=y._zod.check(l);if(b instanceof Promise&&h?.async===!1)throw new Zs;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,l.issues.length!==v&&(m||(m=Rs(l,v)))});else{if(l.issues.length===v)continue;m||(m=Rs(l,v))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Rs(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Zs;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,f)):u(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Zs;return h.then(m=>s(m,a,f))}return s(h,a,f)}}nt(e,"~standard",()=>({validate:s=>{try{const u=sP(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return oP(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),ux=te("$ZodString",(e,t)=>{jt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$P(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),St=te("$ZodStringFormat",(e,t)=>{Sd.init(e,t),ux.init(e,t)}),tU=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=SP),St.init(e,t)}),nU=te("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ew(a))}else t.pattern??(t.pattern=ew());St.init(e,t)}),rU=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zP),St.init(e,t)}),aU=te("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),iU=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=jP()),St.init(e,t)}),sU=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kP),St.init(e,t)}),oU=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gP),St.init(e,t)}),lU=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xP),St.init(e,t)}),uU=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yP),St.init(e,t)}),cU=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bP),St.init(e,t)}),dU=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vP),St.init(e,t)}),fU=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=DP(t)),St.init(e,t)}),hU=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=RP),St.init(e,t)}),mU=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=MP(t)),St.init(e,t)}),pU=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=wP),St.init(e,t)}),gU=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=NP),St.init(e,t),e._zod.bag.format="ipv4"}),xU=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=CP),St.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),yU=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=EP),St.init(e,t)}),bU=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=TP),St.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Aj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const vU=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=AP),St.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Aj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function kU(e){if(!zj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Aj(n)}const wU=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=zj),St.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{kU(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),SU=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=OP),St.init(e,t)});function zU(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const _U=te("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=n=>{zU(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Oj=te("$ZodNumber",(e,t)=>{jt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Nj,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),n}}),jU=te("$ZodNumberFormat",(e,t)=>{ZP.init(e,t),Oj.init(e,t)}),NU=te("$ZodBoolean",(e,t)=>{jt.init(e,t),e._zod.pattern=PP,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),CU=te("$ZodUnknown",(e,t)=>{jt.init(e,t),e._zod.parse=n=>n}),EU=te("$ZodNever",(e,t)=>{jt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function tw(e,t,n){e.issues.length&&t.issues.push(...Ms(n,e.issues)),t.value[n]=e.value}const TU=te("$ZodArray",(e,t)=>{jt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const u=[];for(let l=0;l<s.length;l++){const f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?u.push(h.then(m=>tw(m,n,l))):tw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function td(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...Ms(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Rj(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=K9(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Mj(e,t,n,a,s,u){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){l.push(y);continue}const v=h.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(b=>td(b,n,y,t,g))):td(v,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const AU=te("$ZodObject",(e,t)=>{if(jt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=vd(()=>Rj(t));nt(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const y of g.values)h[m].add(y)}}return h});const s=Ll,u=t.catchall;let l;e._zod.parse=(f,h)=>{l??(l=a.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const g=[],y=l.shape;for(const v of l.keys){const b=y[v],S=b._zod.optout==="optional",j=b._zod.run({value:m[v],issues:[]},h);j instanceof Promise?g.push(j.then(A=>td(A,f,v,m,S))):td(j,f,v,m,S)}return u?Mj(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),OU=te("$ZodObjectJIT",(e,t)=>{AU.init(e,t);const n=e._zod.parse,a=vd(()=>Rj(t)),s=v=>{const b=new WP(["shape","payload","ctx"]),S=a.value,j=N=>{const L=Wk(N);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};b.write("const input = payload.value;");const A=Object.create(null);let E=0;for(const N of S.keys)A[N]=`key_${E++}`;b.write("const newResult = {};");for(const N of S.keys){const L=A[N],D=Wk(N),q=v[N]?._zod?.optout==="optional";b.write(`const ${L} = ${j(N)};`),q?b.write(`
|
|
35
|
-
if (${L}.issues.length) {
|
|
36
|
-
if (${D} in input) {
|
|
37
|
-
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
38
|
-
...iss,
|
|
39
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
40
|
-
})));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (${L}.value === undefined) {
|
|
45
|
-
if (${D} in input) {
|
|
46
|
-
newResult[${D}] = undefined;
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
newResult[${D}] = ${L}.value;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
`):b.write(`
|
|
53
|
-
if (${L}.issues.length) {
|
|
54
|
-
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
55
|
-
...iss,
|
|
56
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
57
|
-
})));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (${L}.value === undefined) {
|
|
61
|
-
if (${D} in input) {
|
|
62
|
-
newResult[${D}] = undefined;
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
newResult[${D}] = ${L}.value;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const O=b.compile();return(N,L)=>O(v,N,L)};let u;const l=Ll,f=!xj.jitless,m=f&&G9.value,g=t.catchall;let y;e._zod.parse=(v,b)=>{y??(y=a.value);const S=v.value;return l(S)?f&&m&&b?.async===!1&&b.jitless!==!0?(u||(u=s(t.shape)),v=u(v,b),g?Mj([],S,v,b,y,e):v):n(v,b):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function nw(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const s=e.filter(u=>!Rs(u));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Ya(l,a,Ga())))}),t)}const Dj=te("$ZodUnion",(e,t)=>{jt.init(e,t),nt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),nt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),nt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),nt(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>ix(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,u)=>{if(n)return a(s,u);let l=!1;const f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)f.push(m),l=!0;else{if(m.issues.length===0)return m;f.push(m)}}return l?Promise.all(f).then(h=>nw(h,s,e,u)):nw(f,s,e,u)}}),RU=te("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Dj.init(e,t);const n=e._zod.parse;nt(e._zod,"propValues",()=>{const s={};for(const u of t.options){const l=u._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const[f,h]of Object.entries(l)){s[f]||(s[f]=new Set);for(const m of h)s[f].add(m)}}return s});const a=vd(()=>{const s=t.options,u=new Map;for(const l of s){const f=l._zod.propValues?.[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const h of f){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,l)}}return u});e._zod.parse=(s,u)=>{const l=s.value;if(!Ll(l))return s.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),s;const f=a.value.get(l?.[t.discriminator]);return f?f._zod.run(s,u):t.unionFallback?n(s,u):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),s)}}),MU=te("$ZodIntersection",(e,t)=>{jt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,u=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>rw(n,h,m)):rw(n,u,l)}});function Ip(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qs(e)&&qs(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(const u of a){const l=Ip(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};s[u]=l.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],u=t[a],l=Ip(s,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function rw(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const u=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(u.length&&s&&e.issues.push({...s,keys:u}),Rs(e))return e;const l=Ip(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const DU=te("$ZodRecord",(e,t)=>{jt.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!qs(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const u=[],l=t.keyType._zod.values;if(l){n.value={};const f=new Set;for(const m of l)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const g=t.valueType._zod.run({value:s[m],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Ms(m,y.issues)),n.value[m]=y.value})):(g.issues.length&&n.issues.push(...Ms(m,g.issues)),n.value[m]=g.value)}let h;for(const m in s)f.has(m)||(h=h??[],h.push(m));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const f of Reflect.ownKeys(s)){if(f==="__proto__")continue;let h=t.keyType._zod.run({value:f,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Nj.test(f)&&h.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(h=y)}if(h.issues.length){t.mode==="loose"?n.value[f]=s[f]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>Ya(y,a,Ga())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:s[f],issues:[]},a);g instanceof Promise?u.push(g.then(y=>{y.issues.length&&n.issues.push(...Ms(f,y.issues)),n.value[h.value]=y.value})):(g.issues.length&&n.issues.push(...Ms(f,g.issues)),n.value[h.value]=g.value)}}return u.length?Promise.all(u).then(()=>n):n}}),$U=te("$ZodEnum",(e,t)=>{jt.init(e,t);const n=yj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>Y9.has(typeof s)).map(s=>typeof s=="string"?Gs(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),LU=te("$ZodLiteral",(e,t)=>{if(jt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Gs(a):a?Gs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),PU=te("$ZodTransform",(e,t)=>{jt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new gj(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(l=>(n.value=l,n));if(s instanceof Promise)throw new Zs;return n.value=s,n}});function aw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $j=te("$ZodOptional",(e,t)=>{jt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",nt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),nt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ix(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>aw(u,n.value)):aw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),UU=te("$ZodExactOptional",(e,t)=>{$j.init(e,t),nt(e._zod,"values",()=>t.innerType._zod.values),nt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),VU=te("$ZodNullable",(e,t)=>{jt.init(e,t),nt(e._zod,"optin",()=>t.innerType._zod.optin),nt(e._zod,"optout",()=>t.innerType._zod.optout),nt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ix(n.source)}|null)$`):void 0}),nt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),BU=te("$ZodDefault",(e,t)=>{jt.init(e,t),e._zod.optin="optional",nt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>iw(u,t)):iw(s,t)}});function iw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ZU=te("$ZodPrefault",(e,t)=>{jt.init(e,t),e._zod.optin="optional",nt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),IU=te("$ZodNonOptional",(e,t)=>{jt.init(e,t),nt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>sw(u,e)):sw(s,e)}});function sw(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const HU=te("$ZodCatch",(e,t)=>{jt.init(e,t),nt(e._zod,"optin",()=>t.innerType._zod.optin),nt(e._zod,"optout",()=>t.innerType._zod.optout),nt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Ya(l,a,Ga()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Ya(u,a,Ga()))},input:n.value}),n.issues=[]),n)}}),FU=te("$ZodPipe",(e,t)=>{jt.init(e,t),nt(e._zod,"values",()=>t.in._zod.values),nt(e._zod,"optin",()=>t.in._zod.optin),nt(e._zod,"optout",()=>t.out._zod.optout),nt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>jc(l,t.in,a)):jc(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>jc(u,t.out,a)):jc(s,t.out,a)}});function jc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const qU=te("$ZodReadonly",(e,t)=>{jt.init(e,t),nt(e._zod,"propValues",()=>t.innerType._zod.propValues),nt(e._zod,"values",()=>t.innerType._zod.values),nt(e._zod,"optin",()=>t.innerType?._zod?.optin),nt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(ow):ow(s)}});function ow(e){return e.value=Object.freeze(e.value),e}const GU=te("$ZodCustom",(e,t)=>{Dn.init(e,t),jt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(u=>lw(u,n,a,e));lw(s,n,a,e)}});function lw(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Pl(s))}}var uw;let YU=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function KU(){return new YU}(uw=globalThis).__zod_globalRegistry??(uw.__zod_globalRegistry=KU());const gl=globalThis.__zod_globalRegistry;function XU(e,t){return new e({type:"string",...ze(t)})}function JU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function cw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function QU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function WU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function e8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function t8(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function n8(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function r8(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function a8(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function i8(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function s8(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function o8(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function l8(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function u8(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function c8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function d8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function f8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function h8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function m8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function p8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function g8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function x8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function y8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function b8(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function v8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function k8(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function w8(e,t){return new e({type:"number",checks:[],...ze(t)})}function S8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function z8(e,t){return new e({type:"boolean",...ze(t)})}function _8(e){return new e({type:"unknown"})}function j8(e,t){return new e({type:"never",...ze(t)})}function dw(e,t){return new Ej({check:"less_than",...ze(t),value:e,inclusive:!1})}function $m(e,t){return new Ej({check:"less_than",...ze(t),value:e,inclusive:!0})}function fw(e,t){return new Tj({check:"greater_than",...ze(t),value:e,inclusive:!1})}function Lm(e,t){return new Tj({check:"greater_than",...ze(t),value:e,inclusive:!0})}function hw(e,t){return new BP({check:"multiple_of",...ze(t),value:e})}function Lj(e,t){return new IP({check:"max_length",...ze(t),maximum:e})}function nd(e,t){return new HP({check:"min_length",...ze(t),minimum:e})}function Pj(e,t){return new FP({check:"length_equals",...ze(t),length:e})}function N8(e,t){return new qP({check:"string_format",format:"regex",...ze(t),pattern:e})}function C8(e){return new GP({check:"string_format",format:"lowercase",...ze(e)})}function E8(e){return new YP({check:"string_format",format:"uppercase",...ze(e)})}function T8(e,t){return new KP({check:"string_format",format:"includes",...ze(t),includes:e})}function A8(e,t){return new XP({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function O8(e,t){return new JP({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function so(e){return new QP({check:"overwrite",tx:e})}function R8(e){return so(t=>t.normalize(e))}function M8(){return so(e=>e.trim())}function D8(){return so(e=>e.toLowerCase())}function $8(){return so(e=>e.toUpperCase())}function L8(){return so(e=>q9(e))}function P8(e,t,n){return new e({type:"array",element:t,...ze(n)})}function U8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function V8(e){const t=B8(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Pl(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Pl(s))}},e(n.value,n)));return t}function B8(e,t){const n=new Dn({check:"custom",...ze(t)});return n._zod.check=e,n}function Uj(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??gl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ht(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const v=l.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,v,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),Ht(y,t,g),t.seen.get(y).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&bn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function Vj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const h=a.get(f);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,l[0])}}const s=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(y)return{ref:v(y)};const b=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(l[1]===n)return{ref:"#"};const m=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:h,defId:m}=s(l);f.def={...f.schema},m&&(f.defId=m);const g=f.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
69
|
-
|
|
70
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(f.cycle){u(l);continue}if(f.count>1&&e.reused==="ref"){u(l);continue}}}function Bj(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const f=e.seen.get(l);if(f.ref===null)return;const h=f.def??f.schema,m={...h},g=f.ref;if(f.ref=null,g){a(g);const v=e.seen.get(g),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(b)):Object.assign(h,b),Object.assign(h,m),l._zod.parent===g)for(const j in h)j==="$ref"||j==="allOf"||j in m||delete h[j];if(b.$ref&&v.def)for(const j in h)j==="$ref"||j==="allOf"||j in v.def&&JSON.stringify(h[j])===JSON.stringify(v.def[j])&&delete h[j]}const y=l._zod.parent;if(y&&y!==g){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(h.$ref=v.schema.$ref,v.def))for(const b in h)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(h[b])===JSON.stringify(v.def[b])&&delete h[b]}e.override({zodSchema:l,jsonSchema:h,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(u[f.defId]=f.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:rd(t,"input",e.processors),output:rd(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function bn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return bn(a.element,n);if(a.type==="set")return bn(a.valueType,n);if(a.type==="lazy")return bn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return bn(a.innerType,n);if(a.type==="intersection")return bn(a.left,n)||bn(a.right,n);if(a.type==="record"||a.type==="map")return bn(a.keyType,n)||bn(a.valueType,n);if(a.type==="pipe")return bn(a.in,n)||bn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(bn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(bn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(bn(s,n))return!0;return!!(a.rest&&bn(a.rest,n))}return!1}const Z8=(e,t={})=>n=>{const a=Uj({...n,processors:t});return Ht(e,a),Vj(a,e),Bj(a,e)},rd=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=Uj({...s??{},target:u,io:t,processors:n});return Ht(e,l),Vj(l,e),Bj(l,e)},I8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},H8=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),f&&(s.format=I8[f]??f,s.format===""&&delete s.format,f==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},F8=(e,t,n,a)=>{const s=n,{minimum:u,maximum:l,format:f,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?s.type="integer":s.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=g,s.exclusiveMinimum=!0):s.exclusiveMinimum=g),typeof u=="number"&&(s.minimum=u,typeof g=="number"&&t.target!=="draft-04"&&(g>=u?delete s.minimum:delete s.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=m,s.exclusiveMaximum=!0):s.exclusiveMaximum=m),typeof l=="number"&&(s.maximum=l,typeof m=="number"&&t.target!=="draft-04"&&(m<=l?delete s.maximum:delete s.exclusiveMaximum)),typeof h=="number"&&(s.multipleOf=h)},q8=(e,t,n,a)=>{n.type="boolean"},G8=(e,t,n,a)=>{n.not={}},Y8=(e,t,n,a)=>{},K8=(e,t,n,a)=>{const s=e._zod.def,u=yj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},X8=(e,t,n,a)=>{const s=e._zod.def,u=[];for(const l of s.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},J8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Q8=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},W8=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=Ht(u.element,t,{...a,path:[...a.path,"items"]})},eV=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object",s.properties={};const l=u.shape;for(const m in l)s.properties[m]=Ht(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Ht(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},tV=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((f,h)=>Ht(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},nV=(e,t,n,a)=>{const s=e._zod.def,u=Ht(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=Ht(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(u)?u.allOf:[u],...f(l)?l.allOf:[l]];n.allOf=h},rV=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object";const l=u.keyType,h=l._zod.bag?.patterns;if(u.mode==="loose"&&h&&h.size>0){const g=Ht(u.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const y of h)s.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ht(u.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=Ht(u.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=l._zod.values;if(m){const g=[...m].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(s.required=g)}},aV=(e,t,n,a)=>{const s=e._zod.def,u=Ht(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},iV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},sV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},oV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},lV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType;let l;try{l=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},uV=(e,t,n,a)=>{const s=e._zod.def,u=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ht(u,t,a);const l=t.seen.get(e);l.ref=u},cV=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},Zj=(e,t,n,a)=>{const s=e._zod.def;Ht(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},dV=te("ZodISODateTime",(e,t)=>{fU.init(e,t),Ct.init(e,t)});function fV(e){return y8(dV,e)}const hV=te("ZodISODate",(e,t)=>{hU.init(e,t),Ct.init(e,t)});function mV(e){return b8(hV,e)}const pV=te("ZodISOTime",(e,t)=>{mU.init(e,t),Ct.init(e,t)});function gV(e){return v8(pV,e)}const xV=te("ZodISODuration",(e,t)=>{pU.init(e,t),Ct.init(e,t)});function yV(e){return k8(xV,e)}const bV=(e,t)=>{wj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>iP(e,n)},flatten:{value:n=>aP(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Zp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Zp,2)}},isEmpty:{get(){return e.issues.length===0}}})},dr=te("ZodError",bV,{Parent:Error}),vV=ox(dr),kV=lx(dr),wV=kd(dr),SV=wd(dr),zV=lP(dr),_V=uP(dr),jV=cP(dr),NV=dP(dr),CV=fP(dr),EV=hP(dr),TV=mP(dr),AV=pP(dr),Nt=te("ZodType",(e,t)=>(jt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rd(e,"input"),output:rd(e,"output")}}),e.toJSONSchema=Z8(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ja(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Qa(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>vV(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>wV(e,n,a),e.parseAsync=async(n,a)=>kV(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>SV(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>zV(e,n,a),e.decode=(n,a)=>_V(e,n,a),e.encodeAsync=async(n,a)=>jV(e,n,a),e.decodeAsync=async(n,a)=>NV(e,n,a),e.safeEncode=(n,a)=>CV(e,n,a),e.safeDecode=(n,a)=>EV(e,n,a),e.safeEncodeAsync=async(n,a)=>TV(e,n,a),e.safeDecodeAsync=async(n,a)=>AV(e,n,a),e.refine=(n,a)=>e.check(_B(n,a)),e.superRefine=n=>e.check(jB(n)),e.overwrite=n=>e.check(so(n)),e.optional=()=>yw(e),e.exactOptional=()=>fB(e),e.nullable=()=>bw(e),e.nullish=()=>yw(bw(e)),e.nonoptional=n=>yB(e,n),e.array=()=>Ys(e),e.or=n=>qj([e,n]),e.and=n=>sB(e,n),e.transform=n=>vw(e,cB(n)),e.default=n=>pB(e,n),e.prefault=n=>xB(e,n),e.catch=n=>vB(e,n),e.pipe=n=>vw(e,n),e.readonly=()=>SB(e),e.describe=n=>{const a=e.clone();return gl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return gl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return gl.get(e);const a=e.clone();return gl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Ij=te("_ZodString",(e,t)=>{ux.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>H8(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(N8(...a)),e.includes=(...a)=>e.check(T8(...a)),e.startsWith=(...a)=>e.check(A8(...a)),e.endsWith=(...a)=>e.check(O8(...a)),e.min=(...a)=>e.check(nd(...a)),e.max=(...a)=>e.check(Lj(...a)),e.length=(...a)=>e.check(Pj(...a)),e.nonempty=(...a)=>e.check(nd(1,...a)),e.lowercase=a=>e.check(C8(a)),e.uppercase=a=>e.check(E8(a)),e.trim=()=>e.check(M8()),e.normalize=(...a)=>e.check(R8(...a)),e.toLowerCase=()=>e.check(D8()),e.toUpperCase=()=>e.check($8()),e.slugify=()=>e.check(L8())}),OV=te("ZodString",(e,t)=>{ux.init(e,t),Ij.init(e,t),e.email=n=>e.check(JU(RV,n)),e.url=n=>e.check(n8(MV,n)),e.jwt=n=>e.check(x8(KV,n)),e.emoji=n=>e.check(r8(DV,n)),e.guid=n=>e.check(cw(mw,n)),e.uuid=n=>e.check(QU(Nc,n)),e.uuidv4=n=>e.check(WU(Nc,n)),e.uuidv6=n=>e.check(e8(Nc,n)),e.uuidv7=n=>e.check(t8(Nc,n)),e.nanoid=n=>e.check(a8($V,n)),e.guid=n=>e.check(cw(mw,n)),e.cuid=n=>e.check(i8(LV,n)),e.cuid2=n=>e.check(s8(PV,n)),e.ulid=n=>e.check(o8(UV,n)),e.base64=n=>e.check(m8(qV,n)),e.base64url=n=>e.check(p8(GV,n)),e.xid=n=>e.check(l8(VV,n)),e.ksuid=n=>e.check(u8(BV,n)),e.ipv4=n=>e.check(c8(ZV,n)),e.ipv6=n=>e.check(d8(IV,n)),e.cidrv4=n=>e.check(f8(HV,n)),e.cidrv6=n=>e.check(h8(FV,n)),e.e164=n=>e.check(g8(YV,n)),e.datetime=n=>e.check(fV(n)),e.date=n=>e.check(mV(n)),e.time=n=>e.check(gV(n)),e.duration=n=>e.check(yV(n))});function We(e){return XU(OV,e)}const Ct=te("ZodStringFormat",(e,t)=>{St.init(e,t),Ij.init(e,t)}),RV=te("ZodEmail",(e,t)=>{rU.init(e,t),Ct.init(e,t)}),mw=te("ZodGUID",(e,t)=>{tU.init(e,t),Ct.init(e,t)}),Nc=te("ZodUUID",(e,t)=>{nU.init(e,t),Ct.init(e,t)}),MV=te("ZodURL",(e,t)=>{aU.init(e,t),Ct.init(e,t)}),DV=te("ZodEmoji",(e,t)=>{iU.init(e,t),Ct.init(e,t)}),$V=te("ZodNanoID",(e,t)=>{sU.init(e,t),Ct.init(e,t)}),LV=te("ZodCUID",(e,t)=>{oU.init(e,t),Ct.init(e,t)}),PV=te("ZodCUID2",(e,t)=>{lU.init(e,t),Ct.init(e,t)}),UV=te("ZodULID",(e,t)=>{uU.init(e,t),Ct.init(e,t)}),VV=te("ZodXID",(e,t)=>{cU.init(e,t),Ct.init(e,t)}),BV=te("ZodKSUID",(e,t)=>{dU.init(e,t),Ct.init(e,t)}),ZV=te("ZodIPv4",(e,t)=>{gU.init(e,t),Ct.init(e,t)}),IV=te("ZodIPv6",(e,t)=>{xU.init(e,t),Ct.init(e,t)}),HV=te("ZodCIDRv4",(e,t)=>{yU.init(e,t),Ct.init(e,t)}),FV=te("ZodCIDRv6",(e,t)=>{bU.init(e,t),Ct.init(e,t)}),qV=te("ZodBase64",(e,t)=>{vU.init(e,t),Ct.init(e,t)}),GV=te("ZodBase64URL",(e,t)=>{wU.init(e,t),Ct.init(e,t)}),YV=te("ZodE164",(e,t)=>{SU.init(e,t),Ct.init(e,t)}),KV=te("ZodJWT",(e,t)=>{_U.init(e,t),Ct.init(e,t)}),Hj=te("ZodNumber",(e,t)=>{Oj.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>F8(e,a,s),e.gt=(a,s)=>e.check(fw(a,s)),e.gte=(a,s)=>e.check(Lm(a,s)),e.min=(a,s)=>e.check(Lm(a,s)),e.lt=(a,s)=>e.check(dw(a,s)),e.lte=(a,s)=>e.check($m(a,s)),e.max=(a,s)=>e.check($m(a,s)),e.int=a=>e.check(pw(a)),e.safe=a=>e.check(pw(a)),e.positive=a=>e.check(fw(0,a)),e.nonnegative=a=>e.check(Lm(0,a)),e.negative=a=>e.check(dw(0,a)),e.nonpositive=a=>e.check($m(0,a)),e.multipleOf=(a,s)=>e.check(hw(a,s)),e.step=(a,s)=>e.check(hw(a,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Rr(e){return w8(Hj,e)}const XV=te("ZodNumberFormat",(e,t)=>{jU.init(e,t),Hj.init(e,t)});function pw(e){return S8(XV,e)}const JV=te("ZodBoolean",(e,t)=>{NU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>q8(e,n,a)});function Ua(e){return z8(JV,e)}const QV=te("ZodUnknown",(e,t)=>{CU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Y8()});function gw(){return _8(QV)}const WV=te("ZodNever",(e,t)=>{EU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>G8(e,n,a)});function eB(e){return j8(WV,e)}const tB=te("ZodArray",(e,t)=>{TU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>W8(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(nd(n,a)),e.nonempty=n=>e.check(nd(1,n)),e.max=(n,a)=>e.check(Lj(n,a)),e.length=(n,a)=>e.check(Pj(n,a)),e.unwrap=()=>e.element});function Ys(e,t){return P8(tB,e,t)}const nB=te("ZodObject",(e,t)=>{OU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eV(e,n,a,s),nt(e,"shape",()=>t.shape),e.keyof=()=>zd(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:gw()}),e.loose=()=>e.clone({...e._zod.def,catchall:gw()}),e.strict=()=>e.clone({...e._zod.def,catchall:eB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>W9(e,n),e.safeExtend=n=>eP(e,n),e.merge=n=>tP(e,n),e.pick=n=>J9(e,n),e.omit=n=>Q9(e,n),e.partial=(...n)=>nP(Gj,e,n[0]),e.required=(...n)=>rP(Yj,e,n[0])});function dn(e,t){const n={type:"object",shape:e??{},...ze(t)};return new nB(n)}const Fj=te("ZodUnion",(e,t)=>{Dj.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tV(e,n,a,s),e.options=t.options});function qj(e,t){return new Fj({type:"union",options:e,...ze(t)})}const rB=te("ZodDiscriminatedUnion",(e,t)=>{Fj.init(e,t),RU.init(e,t)});function aB(e,t,n){return new rB({type:"union",options:t,discriminator:e,...ze(n)})}const iB=te("ZodIntersection",(e,t)=>{MU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nV(e,n,a,s)});function sB(e,t){return new iB({type:"intersection",left:e,right:t})}const oB=te("ZodRecord",(e,t)=>{DU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rV(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function Bc(e,t,n){return new oB({type:"record",keyType:e,valueType:t,...ze(n)})}const Hp=te("ZodEnum",(e,t)=>{$U.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>K8(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Hp({...t,checks:[],...ze(s),entries:u})},e.exclude=(a,s)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Hp({...t,checks:[],...ze(s),entries:u})}});function zd(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Hp({type:"enum",entries:n,...ze(t)})}const lB=te("ZodLiteral",(e,t)=>{LU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>X8(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function xw(e,t){return new lB({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const uB=te("ZodTransform",(e,t)=>{PU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Q8(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new gj(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Pl(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Pl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function cB(e){return new uB({type:"transform",transform:e})}const Gj=te("ZodOptional",(e,t)=>{$j.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Zj(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yw(e){return new Gj({type:"optional",innerType:e})}const dB=te("ZodExactOptional",(e,t)=>{UU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Zj(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function fB(e){return new dB({type:"optional",innerType:e})}const hB=te("ZodNullable",(e,t)=>{VU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>aV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new hB({type:"nullable",innerType:e})}const mB=te("ZodDefault",(e,t)=>{BU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function pB(e,t){return new mB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vj(t)}})}const gB=te("ZodPrefault",(e,t)=>{ZU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function xB(e,t){return new gB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vj(t)}})}const Yj=te("ZodNonOptional",(e,t)=>{IU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>iV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yB(e,t){return new Yj({type:"nonoptional",innerType:e,...ze(t)})}const bB=te("ZodCatch",(e,t)=>{HU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vB(e,t){return new bB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const kB=te("ZodPipe",(e,t)=>{FU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uV(e,n,a,s),e.in=t.in,e.out=t.out});function vw(e,t){return new kB({type:"pipe",in:e,out:t})}const wB=te("ZodReadonly",(e,t)=>{qU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cV(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function SB(e){return new wB({type:"readonly",innerType:e})}const zB=te("ZodCustom",(e,t)=>{GU.init(e,t),Nt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>J8(e,n)});function _B(e,t={}){return U8(zB,e,t)}function jB(e){return V8(e)}const ft={agent:{name:"morpheus",personality:"helpful_dev"},logging:{enabled:!0,level:"info",retention:"14d"},audio:{provider:"google",model:"gemini-2.5-flash-lite",enabled:!0,maxDurationSeconds:300,supportedMimeTypes:["audio/ogg","audio/mp3","audio/mpeg","audio/wav"]},memory:{limit:100},runtime:{async_tasks:{enabled:!0}},llm:{provider:"openai",model:"gpt-4",temperature:.7,context_window:100},channels:{telegram:{enabled:!1,allowedUsers:[]},discord:{enabled:!1,allowedUsers:[]}},ui:{enabled:!0,port:3333}},NB=dn({provider:zd(["google","openai","openrouter","ollama"]).default(ft.audio.provider),model:We().min(1).default(ft.audio.model),enabled:Ua().default(ft.audio.enabled),apiKey:We().optional(),base_url:We().optional(),maxDurationSeconds:Rr().default(ft.audio.maxDurationSeconds),supportedMimeTypes:Ys(We()).default(ft.audio.supportedMimeTypes)}),oo=dn({provider:zd(["openai","anthropic","openrouter","ollama","gemini"]).default(ft.llm.provider),model:We().min(1).default(ft.llm.model),temperature:Rr().min(0).max(1).default(ft.llm.temperature),max_tokens:Rr().int().positive().optional(),api_key:We().optional(),base_url:We().optional(),context_window:Rr().int().positive().optional()}),CB=oo.extend({memory_limit:Rr().int().positive().optional(),enabled_archived_sessions:Ua().default(!0)}),EB=oo.extend({working_dir:We().optional(),timeout_ms:Rr().int().positive().optional()}),TB=oo,AB=oo,OB=oo.extend({skills_dir:We().optional()}),RB=dn({telegram_notify_all:Ua().optional()}).optional(),MB=dn({timezone:We().default("UTC"),check_interval_ms:Rr().min(6e4).default(6e4),max_active_jobs:Rr().min(1).max(1e3).default(100)}),DB=dn({agent:dn({name:We().default(ft.agent.name),personality:We().default(ft.agent.personality)}).default(ft.agent),llm:oo.default(ft.llm),sati:CB.optional(),neo:TB.optional(),apoc:EB.optional(),trinity:AB.optional(),keymaker:OB.optional(),webhooks:RB,audio:NB.default(ft.audio),memory:dn({limit:Rr().int().positive().optional()}).default(ft.memory),runtime:dn({async_tasks:dn({enabled:Ua().default(ft.runtime?.async_tasks.enabled)}).default(ft.runtime?.async_tasks??{enabled:!0})}).optional(),chronos:MB.optional(),channels:dn({telegram:dn({enabled:Ua().default(!1),token:We().optional(),allowedUsers:Ys(We()).default([])}).default(ft.channels.telegram),discord:dn({enabled:Ua().default(!1),token:We().optional(),allowedUsers:Ys(We()).default([])}).default(ft.channels.discord)}).default(ft.channels),ui:dn({enabled:Ua().default(ft.ui.enabled),port:Rr().default(ft.ui.port)}).default(ft.ui),logging:dn({enabled:Ua().default(ft.logging.enabled),level:zd(["debug","info","warn","error"]).default(ft.logging.level),retention:We().default(ft.logging.retention)}).default(ft.logging)}),$B=aB("transport",[dn({transport:xw("stdio"),command:We().min(1,"Command is required for stdio transport"),args:Ys(We()).optional().default([]),env:Bc(We(),We()).optional().default({}),_comment:We().optional()}),dn({transport:xw("http"),url:We().url("Valid URL is required for http transport"),headers:Bc(We(),We()).optional().default({}),args:Ys(We()).optional().default([]),env:Bc(We(),We()).optional().default({}),_comment:We().optional()})]);Bc(We(),qj([$B,We()]));function ie(e,t,n){function a(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:l,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const m=l.prototype,g=Object.keys(m);for(let y=0;y<g.length;y++){const v=g[y];v in f||(f[v]=m[v].bind(f))}}const s=n?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function l(f){var h;const m=n?.Parent?new u:this;a(m,f),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Is extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Kj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Xj={};function Ai(e){return Xj}function Jj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function Fp(e,t){return typeof t=="bigint"?t.toString():t}function cx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function dx(e){return e==null}function fx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const kw=Symbol("evaluating");function it(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==kw)return a===void 0&&(a=kw,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Di(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wa(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function ww(e){return JSON.stringify(e)}function LB(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Qj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ad(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const PB=cx(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ul(e){if(ad(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ad(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Wj(e){return Ul(e)?{...e}:Array.isArray(e)?[...e]:e}const UB=new Set(["string","number","symbol"]);function Ks(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ei(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function Te(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function VB(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function BB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Wa(e._zod.def,{get shape(){const l={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(l[f]=n.shape[f])}return Di(this,"shape",l),l},checks:[]});return ei(e,u)}function ZB(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Wa(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete l[f]}return Di(this,"shape",l),l},checks:[]});return ei(e,u)}function IB(e,t){if(!Ul(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(u,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Wa(e._zod.def,{get shape(){const u={...e._zod.def.shape,...t};return Di(this,"shape",u),u}});return ei(e,s)}function HB(e,t){if(!Ul(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Wa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Di(this,"shape",a),a}});return ei(e,n)}function FB(e,t){const n=Wa(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Di(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return ei(e,n)}function qB(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Wa(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(n)for(const m in n){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)h[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Di(this,"shape",h),h},checks:[]});return ei(t,l)}function GB(e,t,n){const a=Wa(t._zod.def,{get shape(){const s=t._zod.def.shape,u={...s};if(n)for(const l in n){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=new e({type:"nonoptional",innerType:s[l]}))}else for(const l in s)u[l]=new e({type:"nonoptional",innerType:s[l]});return Di(this,"shape",u),u}});return ei(t,a)}function Ds(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function e2(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Cc(e){return typeof e=="string"?e:e?.message}function Oi(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const s=Cc(e.inst?._zod.def?.error?.(e))??Cc(t?.error?.(e))??Cc(n.customError?.(e))??Cc(n.localeError?.(e))??"Invalid input";a.message=s}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function hx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const t2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Fp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},n2=ie("$ZodError",t2),r2=ie("$ZodError",t2,{Parent:Error});function YB(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function KB(e,t=n=>n.message){const n={_errors:[]},a=s=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>a({issues:l}));else if(u.code==="invalid_key")a({issues:u.issues});else if(u.code==="invalid_element")a({issues:u.issues});else if(u.path.length===0)n._errors.push(t(u));else{let l=n,f=0;for(;f<u.path.length;){const h=u.path[f];f===u.path.length-1?(l[h]=l[h]||{_errors:[]},l[h]._errors.push(t(u))):l[h]=l[h]||{_errors:[]},l=l[h],f++}}};return a(e),n}const mx=e=>(t,n,a,s)=>{const u=a?Object.assign(a,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise)throw new Is;if(l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Oi(h,u,Ai())));throw Qj(f,s?.callee),f}return l.value},px=e=>async(t,n,a,s)=>{const u=a?Object.assign(a,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){const f=new(s?.Err??e)(l.issues.map(h=>Oi(h,u,Ai())));throw Qj(f,s?.callee),f}return l.value},_d=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},s);if(u instanceof Promise)throw new Is;return u.issues.length?{success:!1,error:new(e??n2)(u.issues.map(l=>Oi(l,s,Ai())))}:{success:!0,data:u.value}},XB=_d(r2),jd=e=>async(t,n,a)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(l=>Oi(l,s,Ai())))}:{success:!0,data:u.value}},JB=jd(r2),QB=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return mx(e)(t,n,s)},WB=e=>(t,n,a)=>mx(e)(t,n,a),eZ=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return px(e)(t,n,s)},tZ=e=>async(t,n,a)=>px(e)(t,n,a),nZ=e=>(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return _d(e)(t,n,s)},rZ=e=>(t,n,a)=>_d(e)(t,n,a),aZ=e=>async(t,n,a)=>{const s=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jd(e)(t,n,s)},iZ=e=>async(t,n,a)=>jd(e)(t,n,a),sZ=/^[cC][^\s-]{8,}$/,oZ=/^[0-9a-z]+$/,lZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uZ=/^[0-9a-vA-V]{20}$/,cZ=/^[A-Za-z0-9]{27}$/,dZ=/^[a-zA-Z0-9_-]{21}$/,fZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hZ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Sw=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,mZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function gZ(){return new RegExp(pZ,"u")}const xZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,bZ=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,a2=/^[A-Za-z0-9_-]*$/,wZ=/^\+[1-9]\d{6,14}$/,i2="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",SZ=new RegExp(`^${i2}$`);function s2(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zZ(e){return new RegExp(`^${s2(e)}$`)}function _Z(e){const t=s2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${i2}T(?:${a})$`)}const jZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},NZ=/^[^A-Z]*$/,CZ=/^[^a-z]*$/,Lr=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),EZ=ie("$ZodCheckMaxLength",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!dx(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const l=hx(s);a.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),TZ=ie("$ZodCheckMinLength",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!dx(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const l=hx(s);a.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),AZ=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Lr.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!dx(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,u=s.length;if(u===t.length)return;const l=hx(s),f=u>t.length;a.issues.push({origin:l,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Nd=ie("$ZodCheckStringFormat",(e,t)=>{var n,a;Lr.init(e,t),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),OZ=ie("$ZodCheckRegex",(e,t)=>{Nd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),RZ=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=NZ),Nd.init(e,t)}),MZ=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=CZ),Nd.init(e,t)}),DZ=ie("$ZodCheckIncludes",(e,t)=>{Lr.init(e,t);const n=Ks(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),$Z=ie("$ZodCheckStartsWith",(e,t)=>{Lr.init(e,t);const n=new RegExp(`^${Ks(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),LZ=ie("$ZodCheckEndsWith",(e,t)=>{Lr.init(e,t);const n=new RegExp(`.*${Ks(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),PZ=ie("$ZodCheckOverwrite",(e,t)=>{Lr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class UZ{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
71
|
-
`).filter(l=>l),s=Math.min(...a.map(l=>l.length-l.trimStart().length)),u=a.map(l=>l.slice(s)).map(l=>" ".repeat(this.indent*2)+l);for(const l of u)this.content.push(l)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,s.join(`
|
|
72
|
-
`))}}const VZ={major:4,minor:3,patch:6},Ft=ie("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=VZ;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const u of s._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(l,f,h)=>{let m=Ds(l),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(m)continue;const v=l.issues.length,b=y._zod.check(l);if(b instanceof Promise&&h?.async===!1)throw new Is;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,l.issues.length!==v&&(m||(m=Ds(l,v)))});else{if(l.issues.length===v)continue;m||(m=Ds(l,v))}}return g?g.then(()=>l):l},u=(l,f,h)=>{if(Ds(l))return l.aborted=!0,l;const m=s(f,a,h);if(m instanceof Promise){if(h.async===!1)throw new Is;return m.then(g=>e._zod.parse(g,h))}return e._zod.parse(m,h)};e._zod.run=(l,f)=>{if(f.skipChecks)return e._zod.parse(l,f);if(f.direction==="backward"){const m=e._zod.parse({value:l.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(g=>u(g,l,f)):u(m,l,f)}const h=e._zod.parse(l,f);if(h instanceof Promise){if(f.async===!1)throw new Is;return h.then(m=>s(m,a,f))}return s(h,a,f)}}it(e,"~standard",()=>({validate:s=>{try{const u=XB(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return JB(e,s).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),gx=ie("$ZodString",(e,t)=>{Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??jZ(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),zt=ie("$ZodStringFormat",(e,t)=>{Nd.init(e,t),gx.init(e,t)}),BZ=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=hZ),zt.init(e,t)}),ZZ=ie("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Sw(a))}else t.pattern??(t.pattern=Sw());zt.init(e,t)}),IZ=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=mZ),zt.init(e,t)}),HZ=ie("$ZodURL",(e,t)=>{zt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),FZ=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=gZ()),zt.init(e,t)}),qZ=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=dZ),zt.init(e,t)}),GZ=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=sZ),zt.init(e,t)}),YZ=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=oZ),zt.init(e,t)}),KZ=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=lZ),zt.init(e,t)}),XZ=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=uZ),zt.init(e,t)}),JZ=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=cZ),zt.init(e,t)}),QZ=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=_Z(t)),zt.init(e,t)}),WZ=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=SZ),zt.init(e,t)}),e7=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zZ(t)),zt.init(e,t)}),t7=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fZ),zt.init(e,t)}),n7=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=xZ),zt.init(e,t),e._zod.bag.format="ipv4"}),r7=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=yZ),zt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),a7=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bZ),zt.init(e,t)}),i7=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vZ),zt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,u]=a;if(!u)throw new Error;const l=Number(u);if(`${l}`!==u)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function o2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const s7=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kZ),zt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{o2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function o7(e){if(!a2.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return o2(n)}const l7=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=a2),zt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{o7(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),u7=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=wZ),zt.init(e,t)});function c7(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const d7=ie("$ZodJWT",(e,t)=>{zt.init(e,t),e._zod.check=n=>{c7(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),f7=ie("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=n=>n}),h7=ie("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function zw(e,t,n){e.issues.length&&t.issues.push(...e2(n,e.issues)),t.value[n]=e.value}const m7=ie("$ZodArray",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const u=[];for(let l=0;l<s.length;l++){const f=s[l],h=t.element._zod.run({value:f,issues:[]},a);h instanceof Promise?u.push(h.then(m=>zw(m,n,l))):zw(h,n,l)}return u.length?Promise.all(u).then(()=>n):n}});function id(e,t,n,a,s){if(e.issues.length){if(s&&!(n in a))return;t.issues.push(...e2(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function l2(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=VB(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function u2(e,t,n,a,s,u){const l=[],f=s.keySet,h=s.catchall._zod,m=h.def.type,g=h.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){l.push(y);continue}const v=h.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(b=>id(b,n,y,t,g))):id(v,n,y,t,g)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>n):n}const p7=ie("$ZodObject",(e,t)=>{if(Ft.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=cx(()=>l2(t));it(e._zod,"propValues",()=>{const f=t.shape,h={};for(const m in f){const g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const y of g.values)h[m].add(y)}}return h});const s=ad,u=t.catchall;let l;e._zod.parse=(f,h)=>{l??(l=a.value);const m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const g=[],y=l.shape;for(const v of l.keys){const b=y[v],S=b._zod.optout==="optional",j=b._zod.run({value:m[v],issues:[]},h);j instanceof Promise?g.push(j.then(A=>id(A,f,v,m,S))):id(j,f,v,m,S)}return u?u2(g,m,f,h,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),g7=ie("$ZodObjectJIT",(e,t)=>{p7.init(e,t);const n=e._zod.parse,a=cx(()=>l2(t)),s=v=>{const b=new UZ(["shape","payload","ctx"]),S=a.value,j=N=>{const L=ww(N);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};b.write("const input = payload.value;");const A=Object.create(null);let E=0;for(const N of S.keys)A[N]=`key_${E++}`;b.write("const newResult = {};");for(const N of S.keys){const L=A[N],D=ww(N),q=v[N]?._zod?.optout==="optional";b.write(`const ${L} = ${j(N)};`),q?b.write(`
|
|
73
|
-
if (${L}.issues.length) {
|
|
74
|
-
if (${D} in input) {
|
|
75
|
-
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
76
|
-
...iss,
|
|
77
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
78
|
-
})));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (${L}.value === undefined) {
|
|
83
|
-
if (${D} in input) {
|
|
84
|
-
newResult[${D}] = undefined;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
newResult[${D}] = ${L}.value;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
`):b.write(`
|
|
91
|
-
if (${L}.issues.length) {
|
|
92
|
-
payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
|
|
93
|
-
...iss,
|
|
94
|
-
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
95
|
-
})));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (${L}.value === undefined) {
|
|
99
|
-
if (${D} in input) {
|
|
100
|
-
newResult[${D}] = undefined;
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
newResult[${D}] = ${L}.value;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const O=b.compile();return(N,L)=>O(v,N,L)};let u;const l=ad,f=!Xj.jitless,m=f&&PB.value,g=t.catchall;let y;e._zod.parse=(v,b)=>{y??(y=a.value);const S=v.value;return l(S)?f&&m&&b?.async===!1&&b.jitless!==!0?(u||(u=s(t.shape)),v=u(v,b),g?u2([],S,v,b,y,e):v):n(v,b):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function _w(e,t,n,a){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const s=e.filter(u=>!Ds(u));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(u=>u.issues.map(l=>Oi(l,a,Ai())))}),t)}const x7=ie("$ZodUnion",(e,t)=>{Ft.init(e,t),it(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),it(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),it(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),it(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${s.map(u=>fx(u.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(s,u)=>{if(n)return a(s,u);let l=!1;const f=[];for(const h of t.options){const m=h._zod.run({value:s.value,issues:[]},u);if(m instanceof Promise)f.push(m),l=!0;else{if(m.issues.length===0)return m;f.push(m)}}return l?Promise.all(f).then(h=>_w(h,s,e,u)):_w(f,s,e,u)}}),y7=ie("$ZodIntersection",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,u=t.left._zod.run({value:s,issues:[]},a),l=t.right._zod.run({value:s,issues:[]},a);return u instanceof Promise||l instanceof Promise?Promise.all([u,l]).then(([h,m])=>jw(n,h,m)):jw(n,u,l)}});function qp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ul(e)&&Ul(t)){const n=Object.keys(t),a=Object.keys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(const u of a){const l=qp(e[u],t[u]);if(!l.valid)return{valid:!1,mergeErrorPath:[u,...l.mergeErrorPath]};s[u]=l.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],u=t[a],l=qp(s,u);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function jw(e,t,n){const a=new Map;let s;for(const f of t.issues)if(f.code==="unrecognized_keys"){s??(s=f);for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(f);const u=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(u.length&&s&&e.issues.push({...s,keys:u}),Ds(e))return e;const l=qp(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const b7=ie("$ZodEnum",(e,t)=>{Ft.init(e,t);const n=Jj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>UB.has(typeof s)).map(s=>typeof s=="string"?Ks(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const l=s.value;return a.has(l)||s.issues.push({code:"invalid_value",values:n,input:l,inst:e}),s}}),v7=ie("$ZodLiteral",(e,t)=>{if(Ft.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Ks(a):a?Ks(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const u=a.value;return n.has(u)||a.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),a}}),k7=ie("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Kj(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(l=>(n.value=l,n));if(s instanceof Promise)throw new Is;return n.value=s,n}});function Nw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const c2=ie("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),it(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fx(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Nw(u,n.value)):Nw(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),w7=ie("$ZodExactOptional",(e,t)=>{c2.init(e,t),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),S7=ie("$ZodNullable",(e,t)=>{Ft.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fx(n.source)}|null)$`):void 0}),it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),z7=ie("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Cw(u,t)):Cw(s,t)}});function Cw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _7=ie("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),j7=ie("$ZodNonOptional",(e,t)=>{Ft.init(e,t),it(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>Ew(u,e)):Ew(s,e)}});function Ew(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const N7=ie("$ZodCatch",(e,t)=>{Ft.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(l=>Oi(l,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(u=>Oi(u,a,Ai()))},input:n.value}),n.issues=[]),n)}}),C7=ie("$ZodPipe",(e,t)=>{Ft.init(e,t),it(e._zod,"values",()=>t.in._zod.values),it(e._zod,"optin",()=>t.in._zod.optin),it(e._zod,"optout",()=>t.out._zod.optout),it(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const u=t.out._zod.run(n,a);return u instanceof Promise?u.then(l=>Ec(l,t.in,a)):Ec(u,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(u=>Ec(u,t.out,a)):Ec(s,t.out,a)}});function Ec(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const E7=ie("$ZodReadonly",(e,t)=>{Ft.init(e,t),it(e._zod,"propValues",()=>t.innerType._zod.propValues),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"optin",()=>t.innerType?._zod?.optin),it(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(Tw):Tw(s)}});function Tw(e){return e.value=Object.freeze(e.value),e}const T7=ie("$ZodCustom",(e,t)=>{Lr.init(e,t),Ft.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(u=>Aw(u,n,a,e));Aw(s,n,a,e)}});function Aw(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Vl(s))}}var Ow;class A7{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function O7(){return new A7}(Ow=globalThis).__zod_globalRegistry??(Ow.__zod_globalRegistry=O7());const xl=globalThis.__zod_globalRegistry;function R7(e,t){return new e({type:"string",...Te(t)})}function M7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(t)})}function Rw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(t)})}function D7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(t)})}function $7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(t)})}function L7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(t)})}function P7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(t)})}function U7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(t)})}function V7(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(t)})}function B7(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(t)})}function Z7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(t)})}function I7(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(t)})}function H7(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(t)})}function F7(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(t)})}function q7(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(t)})}function G7(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(t)})}function Y7(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(t)})}function K7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(t)})}function X7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(t)})}function J7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(t)})}function Q7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(t)})}function W7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(t)})}function eI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(t)})}function tI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(t)})}function nI(e,t){return new e({type:"string",format:"date",check:"string_format",...Te(t)})}function rI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(t)})}function aI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Te(t)})}function iI(e){return new e({type:"unknown"})}function sI(e,t){return new e({type:"never",...Te(t)})}function d2(e,t){return new EZ({check:"max_length",...Te(t),maximum:e})}function sd(e,t){return new TZ({check:"min_length",...Te(t),minimum:e})}function f2(e,t){return new AZ({check:"length_equals",...Te(t),length:e})}function oI(e,t){return new OZ({check:"string_format",format:"regex",...Te(t),pattern:e})}function lI(e){return new RZ({check:"string_format",format:"lowercase",...Te(e)})}function uI(e){return new MZ({check:"string_format",format:"uppercase",...Te(e)})}function cI(e,t){return new DZ({check:"string_format",format:"includes",...Te(t),includes:e})}function dI(e,t){return new $Z({check:"string_format",format:"starts_with",...Te(t),prefix:e})}function fI(e,t){return new LZ({check:"string_format",format:"ends_with",...Te(t),suffix:e})}function lo(e){return new PZ({check:"overwrite",tx:e})}function hI(e){return lo(t=>t.normalize(e))}function mI(){return lo(e=>e.trim())}function pI(){return lo(e=>e.toLowerCase())}function gI(){return lo(e=>e.toUpperCase())}function xI(){return lo(e=>LB(e))}function yI(e,t,n){return new e({type:"array",element:t,...Te(n)})}function bI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Te(n)})}function vI(e){const t=kI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Vl(a,n.value,t._zod.def));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Vl(s))}},e(n.value,n)));return t}function kI(e,t){const n=new Lr({check:"custom",...Te(t)});return n._zod.check=e,n}function h2(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??xl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function un(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,u=t.seen.get(e);if(u)return u.count++,n.schemaPath.includes(e)&&(u.cycle=n.path),u.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const f=e._zod.toJSONSchema?.();if(f)l.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,g);else{const v=l.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,v,g)}const y=e._zod.parent;y&&(l.ref||(l.ref=y),un(y,t,g),t.seen.get(y).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(l.schema,h),t.io==="input"&&vn(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function m2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const l of e.seen.entries()){const f=e.metadataRegistry.get(l[0])?.id;if(f){const h=a.get(f);if(h&&h!==l[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,l[0])}}const s=l=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(y)return{ref:v(y)};const b=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=b,{defId:b,ref:`${v("__shared")}#/${f}/${b}`}}if(l[1]===n)return{ref:"#"};const m=`#/${f}/`,g=l[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:m+g}},u=l=>{if(l[1].schema.$ref)return;const f=l[1],{ref:h,defId:m}=s(l);f.def={...f.schema},m&&(f.defId=m);const g=f.schema;for(const y in g)delete g[y];g.$ref=h};if(e.cycles==="throw")for(const l of e.seen.entries()){const f=l[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
107
|
-
|
|
108
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const f=l[1];if(t===l[0]){u(l);continue}if(e.external){const m=e.external.registry.get(l[0])?.id;if(t!==l[0]&&m){u(l);continue}}if(e.metadataRegistry.get(l[0])?.id){u(l);continue}if(f.cycle){u(l);continue}if(f.count>1&&e.reused==="ref"){u(l);continue}}}function p2(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=l=>{const f=e.seen.get(l);if(f.ref===null)return;const h=f.def??f.schema,m={...h},g=f.ref;if(f.ref=null,g){a(g);const v=e.seen.get(g),b=v.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(b)):Object.assign(h,b),Object.assign(h,m),l._zod.parent===g)for(const j in h)j==="$ref"||j==="allOf"||j in m||delete h[j];if(b.$ref&&v.def)for(const j in h)j==="$ref"||j==="allOf"||j in v.def&&JSON.stringify(h[j])===JSON.stringify(v.def[j])&&delete h[j]}const y=l._zod.parent;if(y&&y!==g){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(h.$ref=v.schema.$ref,v.def))for(const b in h)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(h[b])===JSON.stringify(v.def[b])&&delete h[b]}e.override({zodSchema:l,jsonSchema:h,path:f.path??[]})};for(const l of[...e.seen.entries()].reverse())a(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const u=e.external?.defs??{};for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(u[f.defId]=f.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:od(t,"input",e.processors),output:od(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function vn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return vn(a.element,n);if(a.type==="set")return vn(a.valueType,n);if(a.type==="lazy")return vn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return vn(a.innerType,n);if(a.type==="intersection")return vn(a.left,n)||vn(a.right,n);if(a.type==="record"||a.type==="map")return vn(a.keyType,n)||vn(a.valueType,n);if(a.type==="pipe")return vn(a.in,n)||vn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(vn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(vn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(vn(s,n))return!0;return!!(a.rest&&vn(a.rest,n))}return!1}const wI=(e,t={})=>n=>{const a=h2({...n,processors:t});return un(e,a),m2(a,e),p2(a,e)},od=(e,t,n={})=>a=>{const{libraryOptions:s,target:u}=a??{},l=h2({...s??{},target:u,io:t,processors:n});return un(e,l),m2(l,e),p2(l,e)},SI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zI=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:u,maximum:l,format:f,patterns:h,contentEncoding:m}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof l=="number"&&(s.maxLength=l),f&&(s.format=SI[f]??f,s.format===""&&delete s.format,f==="time"&&delete s.format),m&&(s.contentEncoding=m),h&&h.size>0){const g=[...h];g.length===1?s.pattern=g[0].source:g.length>1&&(s.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},_I=(e,t,n,a)=>{n.not={}},jI=(e,t,n,a)=>{},NI=(e,t,n,a)=>{const s=e._zod.def,u=Jj(s.entries);u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),n.enum=u},CI=(e,t,n,a)=>{const s=e._zod.def,u=[];for(const l of s.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(l))}else u.push(l);if(u.length!==0)if(u.length===1){const l=u[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else u.every(l=>typeof l=="number")&&(n.type="number"),u.every(l=>typeof l=="string")&&(n.type="string"),u.every(l=>typeof l=="boolean")&&(n.type="boolean"),u.every(l=>l===null)&&(n.type="null"),n.enum=u},EI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},TI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},AI=(e,t,n,a)=>{const s=n,u=e._zod.def,{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(s.minItems=l),typeof f=="number"&&(s.maxItems=f),s.type="array",s.items=un(u.element,t,{...a,path:[...a.path,"items"]})},OI=(e,t,n,a)=>{const s=n,u=e._zod.def;s.type="object",s.properties={};const l=u.shape;for(const m in l)s.properties[m]=un(l[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(l)),h=new Set([...f].filter(m=>{const g=u.shape[m]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));h.size>0&&(s.required=Array.from(h)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=un(u.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},RI=(e,t,n,a)=>{const s=e._zod.def,u=s.inclusive===!1,l=s.options.map((f,h)=>un(f,t,{...a,path:[...a.path,u?"oneOf":"anyOf",h]}));u?n.oneOf=l:n.anyOf=l},MI=(e,t,n,a)=>{const s=e._zod.def,u=un(s.left,t,{...a,path:[...a.path,"allOf",0]}),l=un(s.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,h=[...f(u)?u.allOf:[u],...f(l)?l.allOf:[l]];n.allOf=h},DI=(e,t,n,a)=>{const s=e._zod.def,u=un(s.innerType,t,a),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=s.innerType,n.nullable=!0):n.anyOf=[u,{type:"null"}]},$I=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},LI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},PI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},UI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType;let l;try{l=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},VI=(e,t,n,a)=>{const s=e._zod.def,u=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;un(u,t,a);const l=t.seen.get(e);l.ref=u},BI=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType,n.readOnly=!0},g2=(e,t,n,a)=>{const s=e._zod.def;un(s.innerType,t,a);const u=t.seen.get(e);u.ref=s.innerType},ZI=ie("ZodISODateTime",(e,t)=>{QZ.init(e,t),Et.init(e,t)});function II(e){return tI(ZI,e)}const HI=ie("ZodISODate",(e,t)=>{WZ.init(e,t),Et.init(e,t)});function FI(e){return nI(HI,e)}const qI=ie("ZodISOTime",(e,t)=>{e7.init(e,t),Et.init(e,t)});function GI(e){return rI(qI,e)}const YI=ie("ZodISODuration",(e,t)=>{t7.init(e,t),Et.init(e,t)});function KI(e){return aI(YI,e)}const x2=(e,t)=>{n2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>KB(e,n)},flatten:{value:n=>YB(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Fp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Fp,2)}},isEmpty:{get(){return e.issues.length===0}}})},XI=ie("ZodError",x2),fr=ie("ZodError",x2,{Parent:Error}),JI=mx(fr),QI=px(fr),WI=_d(fr),eH=jd(fr),tH=QB(fr),nH=WB(fr),rH=eZ(fr),aH=tZ(fr),iH=nZ(fr),sH=rZ(fr),oH=aZ(fr),lH=iZ(fr),qt=ie("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:od(e,"input"),output:od(e,"output")}}),e.toJSONSchema=wI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Wa(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>ei(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>JI(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>WI(e,n,a),e.parseAsync=async(n,a)=>QI(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>eH(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>tH(e,n,a),e.decode=(n,a)=>nH(e,n,a),e.encodeAsync=async(n,a)=>rH(e,n,a),e.decodeAsync=async(n,a)=>aH(e,n,a),e.safeEncode=(n,a)=>iH(e,n,a),e.safeDecode=(n,a)=>sH(e,n,a),e.safeEncodeAsync=async(n,a)=>oH(e,n,a),e.safeDecodeAsync=async(n,a)=>lH(e,n,a),e.refine=(n,a)=>e.check(tF(n,a)),e.superRefine=n=>e.check(nF(n)),e.overwrite=n=>e.check(lo(n)),e.optional=()=>Lw(e),e.exactOptional=()=>ZH(e),e.nullable=()=>Pw(e),e.nullish=()=>Lw(Pw(e)),e.nonoptional=n=>YH(e,n),e.array=()=>AH(e),e.or=n=>b2([e,n]),e.and=n=>$H(e,n),e.transform=n=>Uw(e,VH(n)),e.default=n=>FH(e,n),e.prefault=n=>GH(e,n),e.catch=n=>XH(e,n),e.pipe=n=>Uw(e,n),e.readonly=()=>WH(e),e.describe=n=>{const a=e.clone();return xl.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return xl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return xl.get(e);const a=e.clone();return xl.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),y2=ie("_ZodString",(e,t)=>{gx.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>zI(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(oI(...a)),e.includes=(...a)=>e.check(cI(...a)),e.startsWith=(...a)=>e.check(dI(...a)),e.endsWith=(...a)=>e.check(fI(...a)),e.min=(...a)=>e.check(sd(...a)),e.max=(...a)=>e.check(d2(...a)),e.length=(...a)=>e.check(f2(...a)),e.nonempty=(...a)=>e.check(sd(1,...a)),e.lowercase=a=>e.check(lI(a)),e.uppercase=a=>e.check(uI(a)),e.trim=()=>e.check(mI()),e.normalize=(...a)=>e.check(hI(...a)),e.toLowerCase=()=>e.check(pI()),e.toUpperCase=()=>e.check(gI()),e.slugify=()=>e.check(xI())}),uH=ie("ZodString",(e,t)=>{gx.init(e,t),y2.init(e,t),e.email=n=>e.check(M7(cH,n)),e.url=n=>e.check(U7(dH,n)),e.jwt=n=>e.check(eI(jH,n)),e.emoji=n=>e.check(V7(fH,n)),e.guid=n=>e.check(Rw(Mw,n)),e.uuid=n=>e.check(D7(Tc,n)),e.uuidv4=n=>e.check($7(Tc,n)),e.uuidv6=n=>e.check(L7(Tc,n)),e.uuidv7=n=>e.check(P7(Tc,n)),e.nanoid=n=>e.check(B7(hH,n)),e.guid=n=>e.check(Rw(Mw,n)),e.cuid=n=>e.check(Z7(mH,n)),e.cuid2=n=>e.check(I7(pH,n)),e.ulid=n=>e.check(H7(gH,n)),e.base64=n=>e.check(J7(SH,n)),e.base64url=n=>e.check(Q7(zH,n)),e.xid=n=>e.check(F7(xH,n)),e.ksuid=n=>e.check(q7(yH,n)),e.ipv4=n=>e.check(G7(bH,n)),e.ipv6=n=>e.check(Y7(vH,n)),e.cidrv4=n=>e.check(K7(kH,n)),e.cidrv6=n=>e.check(X7(wH,n)),e.e164=n=>e.check(W7(_H,n)),e.datetime=n=>e.check(II(n)),e.date=n=>e.check(FI(n)),e.time=n=>e.check(GI(n)),e.duration=n=>e.check(KI(n))});function Pm(e){return R7(uH,e)}const Et=ie("ZodStringFormat",(e,t)=>{zt.init(e,t),y2.init(e,t)}),cH=ie("ZodEmail",(e,t)=>{IZ.init(e,t),Et.init(e,t)}),Mw=ie("ZodGUID",(e,t)=>{BZ.init(e,t),Et.init(e,t)}),Tc=ie("ZodUUID",(e,t)=>{ZZ.init(e,t),Et.init(e,t)}),dH=ie("ZodURL",(e,t)=>{HZ.init(e,t),Et.init(e,t)}),fH=ie("ZodEmoji",(e,t)=>{FZ.init(e,t),Et.init(e,t)}),hH=ie("ZodNanoID",(e,t)=>{qZ.init(e,t),Et.init(e,t)}),mH=ie("ZodCUID",(e,t)=>{GZ.init(e,t),Et.init(e,t)}),pH=ie("ZodCUID2",(e,t)=>{YZ.init(e,t),Et.init(e,t)}),gH=ie("ZodULID",(e,t)=>{KZ.init(e,t),Et.init(e,t)}),xH=ie("ZodXID",(e,t)=>{XZ.init(e,t),Et.init(e,t)}),yH=ie("ZodKSUID",(e,t)=>{JZ.init(e,t),Et.init(e,t)}),bH=ie("ZodIPv4",(e,t)=>{n7.init(e,t),Et.init(e,t)}),vH=ie("ZodIPv6",(e,t)=>{r7.init(e,t),Et.init(e,t)}),kH=ie("ZodCIDRv4",(e,t)=>{a7.init(e,t),Et.init(e,t)}),wH=ie("ZodCIDRv6",(e,t)=>{i7.init(e,t),Et.init(e,t)}),SH=ie("ZodBase64",(e,t)=>{s7.init(e,t),Et.init(e,t)}),zH=ie("ZodBase64URL",(e,t)=>{l7.init(e,t),Et.init(e,t)}),_H=ie("ZodE164",(e,t)=>{u7.init(e,t),Et.init(e,t)}),jH=ie("ZodJWT",(e,t)=>{d7.init(e,t),Et.init(e,t)}),NH=ie("ZodUnknown",(e,t)=>{f7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>jI()});function Dw(){return iI(NH)}const CH=ie("ZodNever",(e,t)=>{h7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>_I(e,n,a)});function EH(e){return sI(CH,e)}const TH=ie("ZodArray",(e,t)=>{m7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>AI(e,n,a,s),e.element=t.element,e.min=(n,a)=>e.check(sd(n,a)),e.nonempty=n=>e.check(sd(1,n)),e.max=(n,a)=>e.check(d2(n,a)),e.length=(n,a)=>e.check(f2(n,a)),e.unwrap=()=>e.element});function AH(e,t){return yI(TH,e,t)}const OH=ie("ZodObject",(e,t)=>{g7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>OI(e,n,a,s),it(e,"shape",()=>t.shape),e.keyof=()=>LH(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Dw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Dw()}),e.strict=()=>e.clone({...e._zod.def,catchall:EH()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>IB(e,n),e.safeExtend=n=>HB(e,n),e.merge=n=>FB(e,n),e.pick=n=>BB(e,n),e.omit=n=>ZB(e,n),e.partial=(...n)=>qB(v2,e,n[0]),e.required=(...n)=>GB(k2,e,n[0])});function RH(e,t){const n={type:"object",shape:e??{},...Te(t)};return new OH(n)}const MH=ie("ZodUnion",(e,t)=>{x7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>RI(e,n,a,s),e.options=t.options});function b2(e,t){return new MH({type:"union",options:e,...Te(t)})}const DH=ie("ZodIntersection",(e,t)=>{y7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>MI(e,n,a,s)});function $H(e,t){return new DH({type:"intersection",left:e,right:t})}const Gp=ie("ZodEnum",(e,t)=>{b7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(a,s,u)=>NI(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const u={};for(const l of a)if(n.has(l))u[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Gp({...t,checks:[],...Te(s),entries:u})},e.exclude=(a,s)=>{const u={...t.entries};for(const l of a)if(n.has(l))delete u[l];else throw new Error(`Key ${l} not found in enum`);return new Gp({...t,checks:[],...Te(s),entries:u})}});function LH(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Gp({type:"enum",entries:n,...Te(t)})}const PH=ie("ZodLiteral",(e,t)=>{v7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>CI(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $w(e,t){return new PH({type:"literal",values:Array.isArray(e)?e:[e],...Te(t)})}const UH=ie("ZodTransform",(e,t)=>{k7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>TI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Kj(e.constructor.name);n.addIssue=u=>{if(typeof u=="string")n.issues.push(Vl(u,n.value,t));else{const l=u;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Vl(l))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(u=>(n.value=u,n)):(n.value=s,n)}});function VH(e){return new UH({type:"transform",transform:e})}const v2=ie("ZodOptional",(e,t)=>{c2.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>g2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Lw(e){return new v2({type:"optional",innerType:e})}const BH=ie("ZodExactOptional",(e,t)=>{w7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>g2(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function ZH(e){return new BH({type:"optional",innerType:e})}const IH=ie("ZodNullable",(e,t)=>{S7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>DI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function Pw(e){return new IH({type:"nullable",innerType:e})}const HH=ie("ZodDefault",(e,t)=>{z7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>LI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function FH(e,t){return new HH({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Wj(t)}})}const qH=ie("ZodPrefault",(e,t)=>{_7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>PI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function GH(e,t){return new qH({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Wj(t)}})}const k2=ie("ZodNonOptional",(e,t)=>{j7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>$I(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function YH(e,t){return new k2({type:"nonoptional",innerType:e,...Te(t)})}const KH=ie("ZodCatch",(e,t)=>{N7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>UI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XH(e,t){return new KH({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JH=ie("ZodPipe",(e,t)=>{C7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>VI(e,n,a,s),e.in=t.in,e.out=t.out});function Uw(e,t){return new JH({type:"pipe",in:e,out:t})}const QH=ie("ZodReadonly",(e,t)=>{E7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>BI(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function WH(e){return new QH({type:"readonly",innerType:e})}const eF=ie("ZodCustom",(e,t)=>{T7.init(e,t),qt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>EI(e,n)});function tF(e,t={}){return bI(eF,e,t)}function nF(e){return vI(e)}const rF=[{id:"general",label:"General"},{id:"agents",label:"Agents"},{id:"audio",label:"Audio"},{id:"channels",label:"Channels"},{id:"ui",label:"Interface"},{id:"logging",label:"Logging"},{id:"chronos",label:"Chronos"}],aF=[{id:"oracle",label:"Oracle"},{id:"sati",label:"Sati"},{id:"neo",label:"Neo"},{id:"apoc",label:"Apoc"},{id:"trinity",label:"Trinity"}],dl=[{label:"OpenAI",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"OpenRouter",value:"openrouter"},{label:"Ollama",value:"ollama"},{label:"Google Gemini",value:"gemini"}];function iF(){const{data:e,error:t}=kt("/api/config",ir.fetchConfig),{data:n}=kt("/api/config/sati",ir.getSatiConfig),{data:a}=kt("/api/config/apoc",ir.getApocConfig),{data:s}=kt("/api/config/neo",ir.getNeoConfig),{data:u}=kt("/api/config/trinity",ir.getTrinityConfig),{data:l}=kt("/api/config/encryption-status",()=>ir.getEncryptionStatus()),{data:f}=kt("/api/config/env-overrides",()=>ir.getEnvOverrides()),{data:h}=rj(),[m,g]=z.useState(null),[y,v]=z.useState(!1),[b,S]=z.useState(null),[j,A]=z.useState(null),[E,O]=z.useState(null),[N,L]=z.useState(null),[D,R]=z.useState(null),[q,B]=z.useState("general"),[X,fe]=z.useState("oracle"),[se,le]=z.useState(!1),[ee,oe]=z.useState({}),[ae,P]=z.useState(null);z.useEffect(()=>{e&&!b&&S(e)},[e]),z.useEffect(()=>{n&&!j&&A(n)},[n]),z.useEffect(()=>{a&&!N?L(a):!a&&!N&&b&&L({...b.apoc??b.llm,temperature:b.apoc?.temperature??.2,timeout_ms:b.apoc?.timeout_ms??3e4})},[a,b]),z.useEffect(()=>{s&&!E?O(s):!s&&!E&&b&&O({...b.neo??b.llm,temperature:b.neo?.temperature??.2})},[s,b]),z.useEffect(()=>{u&&!D?R(u):!u&&!D&&b&&R({...b.trinity??b.llm,temperature:b.trinity?.temperature??.2})},[u,b]),z.useEffect(()=>{h&&!m&&g(h)},[h]);const J=JSON.stringify(e)!==JSON.stringify(b)||JSON.stringify(n)!==JSON.stringify(j)||JSON.stringify(s)!==JSON.stringify(E)||JSON.stringify(a)!==JSON.stringify(N)||JSON.stringify(u)!==JSON.stringify(D),Z=(V,Ne)=>{if(!l?.apiKeysEncrypted)return null;const{morpheusSecretSet:Ge,apiKeysEncrypted:Lt}=l,Me=Lt[V];return!Ne?d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-azure-surface border border-azure-border text-azure-text-secondary dark:bg-matrix-primary/10 dark:border-matrix-primary dark:text-matrix-tertiary",children:"No API key"}):f&&f[me(V)]?null:Ge?Me?d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-emerald-100 border border-emerald-300 text-emerald-800 dark:bg-emerald-900/30 dark:border-emerald-700 dark:text-emerald-400",title:"API key encrypted with AES-256-GCM",children:"🔒 Encrypted"}):d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-amber-100 border border-amber-300 text-amber-800 dark:bg-amber-900/30 dark:border-amber-700 dark:text-amber-400",title:"Re-save this configuration to encrypt the API key",children:"⚠️ Re-save to encrypt"}):d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-amber-100 border border-amber-300 text-amber-800 dark:bg-amber-900/30 dark:border-amber-700 dark:text-amber-400",title:"Set MORPHEUS_SECRET to enable encryption",children:"⚠️ Plaintext"})},me=V=>({oracle:"llm.api_key",sati:"sati.api_key",neo:"neo.api_key",apoc:"apoc.api_key",trinity:"trinity.api_key",audio:"audio.apiKey"})[V],T=V=>!f||!f[V]?null:d.jsx("span",{className:"inline-flex items-center px-2 py-1 text-xs rounded bg-blue-100 border border-blue-300 text-blue-800 dark:bg-blue-900/30 dark:border-blue-700 dark:text-blue-400",title:"This field is set by an environment variable and cannot be edited",children:"🔒 Env Var"}),C=V=>!!(f&&f[V]),I=(V,Ne)=>{if(!b)return;const Ge=JSON.parse(JSON.stringify(b));let Lt=Ge;for(let Me=0;Me<V.length-1;Me++)Lt=Lt[V[Me]];Lt[V[V.length-1]]=Ne,S(Ge);try{DB.parse(Ge),oe({})}catch(Me){if(Me instanceof XI){const Xe={};Me.errors.forEach(st=>{const tt=st.path.join(".");Xe[tt]=st.message}),oe(Xe)}}},w=(V,Ne)=>{j&&A({...j,[V]:Ne})},Y=(V,Ne)=>{N&&L({...N,[V]:Ne})},de=(V,Ne)=>{E&&O({...E,[V]:Ne})},he=(V,Ne)=>{D&&R({...D,[V]:Ne})},pe=()=>{!b||!D||R({...D,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Pe=()=>{!b||!j||A({...j,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Ae=()=>{!b||!N||L({...N,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},pt=()=>{!b||!E||O({...E,provider:b.llm.provider,model:b.llm.model,api_key:b.llm.api_key})},Rt=async()=>{if(b){le(!0),P(null);try{await ir.updateConfig(b),j&&await ir.updateSatiConfig(j),E&&await ir.updateNeoConfig(E),N&&await ir.updateApocConfig(N),D&&await ir.updateTrinityConfig(D),On("/api/config"),On("/api/config/sati"),On("/api/config/neo"),On("/api/config/apoc"),On("/api/config/trinity"),P({type:"success",message:"Settings saved successfully. Restart Morpheus daemon for changes to take effect."})}catch(V){if(P({type:"error",message:V.message}),V.details&&Array.isArray(V.details)){const Ne={};V.details.forEach(Ge=>{const Lt=Ge.path.join(".");Ne[Lt]=Ge.message}),oe(Ne)}}finally{le(!1)}}};return t?d.jsx("div",{className:"p-8 text-red-500",children:"Failed to load configuration"}):b?d.jsxs("div",{className:"max-w-4xl mx-auto p-0 md:p-6 space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Zaion Settings"}),d.jsx("button",{onClick:Rt,disabled:!J||Object.keys(ee).length>0||se,className:`px-4 py-2 rounded font-medium transition-colors ${J&&Object.keys(ee).length===0?"bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90":"bg-azure-border text-azure-text-secondary cursor-not-allowed dark:bg-matrix-primary/50 dark:text-matrix-highlight/50"}`,children:se?"Saving...":"Save Changes"})]}),ae&&d.jsx("div",{className:`p-4 rounded border ${ae.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:ae.message}),d.jsx("div",{className:"overflow-x-auto py-1 hide-scrollbar",children:d.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px min-w-max",children:rF.map(V=>d.jsx("button",{onClick:()=>B(V.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors flex-shrink-0 ${q===V.id?"bg-azure-surface/50 text-azure-primary border-t border-x border-azure-border dark:bg-matrix-primary/20 dark:text-matrix-highlight dark:border-t dark:border-x dark:border-matrix-primary":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:V.label},V.id))})}),d.jsxs("div",{className:"space-y-6",children:[q==="general"&&d.jsxs(ar,{title:"Agent Identity",children:[d.jsx(Qe,{label:"Agent Name",value:b.agent.name,onChange:V=>I(["agent","name"],V.target.value),error:ee["agent.name"]}),d.jsx(Qe,{label:"Personality",value:b.agent.personality,onChange:V=>I(["agent","personality"],V.target.value),error:ee["agent.personality"]})]}),q==="agents"&&d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex space-x-1 border-b border-azure-border dark:border-matrix-primary pb-px",children:aF.map(V=>d.jsx("button",{onClick:()=>fe(V.id),className:`px-4 py-2 text-sm font-medium rounded-t-md transition-colors ${X===V.id?"bg-azure-primary/10 text-azure-primary border-b-2 border-azure-primary dark:bg-matrix-highlight/10 dark:text-matrix-highlight dark:border-matrix-highlight":"text-azure-text-secondary hover:text-azure-primary dark:text-matrix-secondary dark:hover:text-matrix-highlight"}`,children:V.label},V.id))}),X==="oracle"&&d.jsxs(ar,{title:"Oracle Agent",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Main orchestration agent — handles user requests and delegates to subagents"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("llm.provider")]}),d.jsx(Er,{label:"",value:b.llm.provider,onChange:V=>I(["llm","provider"],V.target.value),options:dl,error:ee["llm.provider"],disabled:C("llm.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("llm.model")]}),d.jsx(Qe,{label:"",value:b.llm.model,onChange:V=>I(["llm","model"],V.target.value),disabled:C("llm.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("llm.temperature")]}),d.jsx(yn,{label:"",value:b.llm.temperature,onChange:V=>I(["llm","temperature"],parseFloat(V.target.value)),step:.1,min:0,max:1,error:ee["llm.temperature"],disabled:C("llm.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),T("llm.max_tokens")]}),d.jsx(yn,{label:"",value:b.llm.max_tokens??"",onChange:V=>I(["llm","max_tokens"],V.target.value?parseInt(V.target.value):void 0),min:1,error:ee["llm.max_tokens"],helperText:"Maximum tokens per response. Leave empty for model default.",disabled:C("llm.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),T("llm.context_window")]}),d.jsx(yn,{label:"",value:b.llm.context_window??100,onChange:V=>I(["llm","context_window"],parseInt(V.target.value)),min:1,step:1,error:ee["llm.context_window"],helperText:"Number of past interactions to load into LLM context (e.g., 100).",disabled:C("llm.context_window")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("llm.api_key"),Z("oracle",b.llm.api_key)]})]}),d.jsx(Qe,{label:"",type:"password",value:b.llm.api_key||"",onChange:V=>I(["llm","api_key"],V.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("llm.api_key")}),b.llm.provider==="openrouter"&&d.jsx(Qe,{label:"Base URL",value:b.llm.base_url||"https://openrouter.ai/api/v1",onChange:V=>I(["llm","base_url"],V.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]}),X==="sati"&&d.jsxs(ar,{title:"Sati Agent",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Background memory consolidation agent — evaluates conversations and persists important context"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:Pe,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),j&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("sati.provider")]}),d.jsx(Er,{label:"",value:j.provider,onChange:V=>w("provider",V.target.value),options:dl,disabled:C("sati.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("sati.model")]}),d.jsx(Qe,{label:"",value:j.model,onChange:V=>w("model",V.target.value),disabled:C("sati.model")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("sati.api_key"),Z("sati",j.api_key)]})]}),d.jsx(Qe,{label:"",type:"password",value:j.api_key||"",onChange:V=>w("api_key",V.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("sati.api_key")}),j.provider==="openrouter"&&d.jsx(Qe,{label:"Base URL",value:j.base_url||"https://openrouter.ai/api/v1",onChange:V=>w("base_url",V.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(yn,{label:"Memory Limit",value:j.memory_limit??10,onChange:V=>w("memory_limit",parseInt(V.target.value)),min:1,step:1,helperText:"Number of memory items to retrieve from long-term storage."}),d.jsx(zs,{label:"Enable Archived Sessions in Memory Retrieval",checked:j.enabled_archived_sessions??!0,onChange:V=>w("enabled_archived_sessions",V)})]})]}),X==="neo"&&d.jsxs(ar,{title:"Neo Agent",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"MCP + internal tools subagent — executes analytical and operational tasks delegated by Oracle"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:pt,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),E&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("neo.provider")]}),d.jsx(Er,{label:"",value:E.provider,onChange:V=>de("provider",V.target.value),options:dl,disabled:C("neo.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("neo.model")]}),d.jsx(Qe,{label:"",value:E.model,onChange:V=>de("model",V.target.value),disabled:C("neo.model")}),d.jsx(Qe,{label:"Personality",value:E.personality||"analytical_engineer",onChange:V=>de("personality",V.target.value),placeholder:"analytical_engineer",helperText:"e.g., analytical_engineer, meticulous_auditor, systems_thinker"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("neo.temperature")]}),d.jsx(yn,{label:"",value:E.temperature,onChange:V=>de("temperature",parseFloat(V.target.value)),step:.1,min:0,max:1,disabled:C("neo.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),T("neo.max_tokens")]}),d.jsx(yn,{label:"",value:E.max_tokens??"",onChange:V=>de("max_tokens",V.target.value?parseInt(V.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:C("neo.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Context Window (Messages)"}),T("neo.context_window")]}),d.jsx(yn,{label:"",value:E.context_window??100,onChange:V=>de("context_window",parseInt(V.target.value)),min:1,step:1,disabled:C("neo.context_window")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("neo.api_key"),Z("neo",E.api_key)]})]}),d.jsx(Qe,{label:"",type:"password",value:E.api_key||"",onChange:V=>de("api_key",V.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("neo.api_key")}),E.provider==="openrouter"&&d.jsx(Qe,{label:"Base URL",value:E.base_url||"https://openrouter.ai/api/v1",onChange:V=>de("base_url",V.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),X==="trinity"&&d.jsxs(ar,{title:"Trinity Agent",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"Database subagent — interprets natural language queries and executes them against registered databases (PostgreSQL, MySQL, SQLite, MongoDB)"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:pe,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),D&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("trinity.provider")]}),d.jsx(Er,{label:"",value:D.provider,onChange:V=>he("provider",V.target.value),options:dl,disabled:C("trinity.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("trinity.model")]}),d.jsx(Qe,{label:"",value:D.model,onChange:V=>he("model",V.target.value),disabled:C("trinity.model")}),d.jsx(Qe,{label:"Personality",value:D.personality||"data_specialist",onChange:V=>he("personality",V.target.value),placeholder:"data_specialist",helperText:"e.g., data_specialist, query_optimizer, db_architect"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("trinity.temperature")]}),d.jsx(yn,{label:"",value:D.temperature,onChange:V=>he("temperature",parseFloat(V.target.value)),step:.1,min:0,max:1,disabled:C("trinity.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Tokens"}),T("trinity.max_tokens")]}),d.jsx(yn,{label:"",value:D.max_tokens??"",onChange:V=>he("max_tokens",V.target.value?parseInt(V.target.value):void 0),min:1,helperText:"Maximum tokens per response. Leave empty for model default.",disabled:C("trinity.max_tokens")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("trinity.api_key"),Z("trinity",D.api_key)]})]}),d.jsx(Qe,{label:"",type:"password",value:D.api_key||"",onChange:V=>he("api_key",V.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("trinity.api_key")}),D.provider==="openrouter"&&d.jsx(Qe,{label:"Base URL",value:D.base_url||"https://openrouter.ai/api/v1",onChange:V=>he("base_url",V.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"})]})]}),X==="apoc"&&d.jsxs(ar,{title:"Apoc Agent",children:[d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mb-4",children:"DevTools subagent — executes file, shell, git, network, and system operations on behalf of Oracle"}),d.jsxs("div",{className:"mb-4",children:[d.jsx("button",{type:"button",onClick:Ae,className:"px-3 py-1.5 text-sm bg-azure-surface border border-azure-border rounded hover:bg-azure-primary/10 dark:bg-matrix-primary/20 dark:border-matrix-primary dark:hover:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight transition-colors",children:"Copy from Oracle Agent"}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Copy Provider, Model, and API Key from Oracle Agent configuration"})]}),N&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("apoc.provider")]}),d.jsx(Er,{label:"",value:N.provider,onChange:V=>Y("provider",V.target.value),options:dl,disabled:C("apoc.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model Name"}),T("apoc.model")]}),d.jsx(Qe,{label:"",value:N.model,onChange:V=>Y("model",V.target.value),disabled:C("apoc.model")}),d.jsx(Qe,{label:"Personality",value:N.personality||"pragmatic_dev",onChange:V=>Y("personality",V.target.value),placeholder:"pragmatic_dev",helperText:"e.g., pragmatic_dev, cautious_admin, automation_specialist"}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Temperature"}),T("apoc.temperature")]}),d.jsx(yn,{label:"",value:N.temperature,onChange:V=>Y("temperature",parseFloat(V.target.value)),step:.1,min:0,max:1,disabled:C("apoc.temperature")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("apoc.api_key"),Z("apoc",N.api_key)]})]}),d.jsx(Qe,{label:"",type:"password",value:N.api_key||"",onChange:V=>Y("api_key",V.target.value),placeholder:"sk-...",helperText:"Stored locally.",disabled:C("apoc.api_key")}),N.provider==="openrouter"&&d.jsx(Qe,{label:"Base URL",value:N.base_url||"https://openrouter.ai/api/v1",onChange:V=>Y("base_url",V.target.value),placeholder:"https://openrouter.ai/api/v1",helperText:"Base URL for OpenRouter API"}),d.jsx(Qe,{label:"Working Directory",value:N.working_dir||"",onChange:V=>Y("working_dir",V.target.value),placeholder:"/home/user/projects",helperText:"Root directory for file and shell operations. Leave empty to use process working directory."}),d.jsx(yn,{label:"Timeout (ms)",value:N.timeout_ms??3e4,onChange:V=>Y("timeout_ms",parseInt(V.target.value)),min:1e3,step:1e3,helperText:"Maximum execution time for shell and system operations in milliseconds."})]})]})]}),q==="audio"&&d.jsxs(ar,{title:"Audio Transcription",children:[d.jsx(zs,{label:"Enable Audio",checked:b.audio.enabled,onChange:V=>I(["audio","enabled"],V)}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Provider"}),T("audio.provider")]}),d.jsx(Er,{label:"",value:b.audio.provider||"google",onChange:V=>I(["audio","provider"],V.target.value),options:[{label:"Google Gemini",value:"google"},{label:"OpenAI (Whisper)",value:"openai"},{label:"OpenRouter (multimodal)",value:"openrouter"},{label:"Ollama (Whisper local)",value:"ollama"}],error:ee["audio.provider"],disabled:C("audio.provider")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Model"}),T("audio.model")]}),d.jsx(Qe,{label:"",value:b.audio.model,onChange:V=>I(["audio","model"],V.target.value),placeholder:"e.g. whisper-1, gemini-2.5-flash-lite...",helperText:"Model to use for audio transcription.",error:ee["audio.model"],disabled:C("audio.model")}),b.audio.provider==="ollama"&&d.jsx(Qe,{label:"Base URL",value:b.audio.base_url||"",onChange:V=>I(["audio","base_url"],V.target.value),placeholder:"http://localhost:11434",helperText:"Ollama base URL. Requires a Whisper model loaded (ollama pull whisper)."}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"API Key"}),d.jsxs("div",{className:"flex items-center gap-2",children:[T("audio.apiKey"),Z("audio",b.audio.apiKey)]})]}),d.jsx(Qe,{label:"",type:"password",value:b.audio.apiKey||"",onChange:V=>I(["audio","apiKey"],V.target.value),placeholder:"If different from LLM key...",helperText:"Leave empty to use LLM API key if using the same provider.",disabled:C("audio.apiKey")}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-primary dark:text-matrix-secondary",children:"Max Duration (Seconds)"}),T("audio.maxDurationSeconds")]}),d.jsx(yn,{label:"",value:b.audio.maxDurationSeconds,onChange:V=>I(["audio","maxDurationSeconds"],parseInt(V.target.value)),min:1,disabled:C("audio.maxDurationSeconds")}),d.jsx(Qe,{label:"Supported Mime Types",value:b.audio.supportedMimeTypes.join(", "),onChange:V=>I(["audio","supportedMimeTypes"],V.target.value.split(",").map(Ne=>Ne.trim()).filter(Boolean)),helperText:"Comma separated list (e.g. audio/ogg, audio/mp3)"})]}),q==="channels"&&d.jsxs(d.Fragment,{children:[d.jsxs(ar,{title:"Telegram",children:[d.jsx(zs,{label:"Enable Telegram",checked:b.channels.telegram.enabled,onChange:V=>I(["channels","telegram","enabled"],V)}),b.channels.telegram.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(Qe,{label:"Bot Token",type:"password",value:b.channels.telegram.token||"",onChange:V=>I(["channels","telegram","token"],V.target.value)}),d.jsx(Qe,{label:"Allowed Users (comma separated)",value:b.channels.telegram.allowedUsers.join(", "),onChange:V=>I(["channels","telegram","allowedUsers"],V.target.value.split(",").map(Ne=>Ne.trim()).filter(Boolean)),helperText:"User IDs allowed to interact with the bot"})]})]}),d.jsxs(ar,{title:"Discord",children:[d.jsx(zs,{label:"Enable Discord",checked:b.channels.discord.enabled,onChange:V=>I(["channels","discord","enabled"],V)}),b.channels.discord.enabled&&d.jsxs("div",{className:"space-y-4 mt-4 pl-4 border-l border-matrix-primary",children:[d.jsx(Qe,{label:"Bot Token",type:"password",value:b.channels.discord.token||"",onChange:V=>I(["channels","discord","token"],V.target.value)}),d.jsx(Qe,{label:"Allowed Users (comma separated)",value:(b.channels.discord.allowedUsers??[]).join(", "),onChange:V=>I(["channels","discord","allowedUsers"],V.target.value.split(",").map(Ne=>Ne.trim()).filter(Boolean)),helperText:"Discord user IDs allowed to interact with the bot"})]})]})]}),q==="ui"&&d.jsxs(ar,{title:"Dashboard",children:[d.jsx(zs,{label:"Enable Web UI",checked:b.ui.enabled,onChange:V=>I(["ui","enabled"],V)}),d.jsx(yn,{label:"Port",value:b.ui.port,onChange:V=>I(["ui","port"],parseInt(V.target.value)),disabled:!0,helperText:"Requires restart to change."})]}),q==="logging"&&d.jsxs(ar,{title:"Logging",children:[d.jsx(zs,{label:"Enable Logging",checked:b.logging.enabled,onChange:V=>I(["logging","enabled"],V)}),d.jsx(Er,{label:"Log Level",value:b.logging.level,onChange:V=>I(["logging","level"],V.target.value),options:[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warning",value:"warn"},{label:"Error",value:"error"}]})]}),q==="chronos"&&m&&d.jsxs(ar,{title:"Chronos — Temporal Intent Engine",children:[d.jsx(Er,{label:"Timezone",value:m.timezone,onChange:V=>g({...m,timezone:V.target.value}),options:[{label:"UTC",value:"UTC"},{label:"America/New_York",value:"America/New_York"},{label:"America/Chicago",value:"America/Chicago"},{label:"America/Denver",value:"America/Denver"},{label:"America/Los_Angeles",value:"America/Los_Angeles"},{label:"America/Sao_Paulo",value:"America/Sao_Paulo"},{label:"America/Buenos_Aires",value:"America/Buenos_Aires"},{label:"America/Bogota",value:"America/Bogota"},{label:"America/Lima",value:"America/Lima"},{label:"America/Santiago",value:"America/Santiago"},{label:"America/Mexico_City",value:"America/Mexico_City"},{label:"America/Toronto",value:"America/Toronto"},{label:"America/Vancouver",value:"America/Vancouver"},{label:"Europe/London",value:"Europe/London"},{label:"Europe/Paris",value:"Europe/Paris"},{label:"Europe/Berlin",value:"Europe/Berlin"},{label:"Europe/Madrid",value:"Europe/Madrid"},{label:"Europe/Rome",value:"Europe/Rome"},{label:"Europe/Amsterdam",value:"Europe/Amsterdam"},{label:"Europe/Brussels",value:"Europe/Brussels"},{label:"Europe/Zurich",value:"Europe/Zurich"},{label:"Europe/Lisbon",value:"Europe/Lisbon"},{label:"Europe/Warsaw",value:"Europe/Warsaw"},{label:"Europe/Stockholm",value:"Europe/Stockholm"},{label:"Europe/Helsinki",value:"Europe/Helsinki"},{label:"Europe/Moscow",value:"Europe/Moscow"},{label:"Asia/Dubai",value:"Asia/Dubai"},{label:"Asia/Kolkata",value:"Asia/Kolkata"},{label:"Asia/Bangkok",value:"Asia/Bangkok"},{label:"Asia/Singapore",value:"Asia/Singapore"},{label:"Asia/Hong_Kong",value:"Asia/Hong_Kong"},{label:"Asia/Shanghai",value:"Asia/Shanghai"},{label:"Asia/Tokyo",value:"Asia/Tokyo"},{label:"Asia/Seoul",value:"Asia/Seoul"},{label:"Australia/Sydney",value:"Australia/Sydney"},{label:"Australia/Melbourne",value:"Australia/Melbourne"},{label:"Pacific/Auckland",value:"Pacific/Auckland"},{label:"Africa/Cairo",value:"Africa/Cairo"},{label:"Africa/Johannesburg",value:"Africa/Johannesburg"}]}),d.jsx(yn,{label:"Check Interval (seconds)",value:Math.round(m.check_interval_ms/1e3),onChange:V=>g({...m,check_interval_ms:Number(V.target.value)*1e3}),min:60}),d.jsx(yn,{label:"Max Active Jobs",value:m.max_active_jobs,onChange:V=>g({...m,max_active_jobs:Number(V.target.value)}),min:1,max:1e3}),d.jsx("div",{className:"flex justify-end pt-2",children:d.jsx("button",{onClick:async()=>{v(!0),P(null);try{await Ei.updateConfig(m),On("/api/config/chronos"),P({type:"success",message:"Chronos settings saved."})}catch(V){P({type:"error",message:V.message})}finally{v(!1)}},disabled:y,className:"px-4 py-2 rounded font-medium bg-azure-primary text-white hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:y?"Saving…":"Save Chronos Settings"})})]})]})]}):d.jsx("div",{className:"p-8 text-azure-primary dark:text-matrix-highlight",children:"Loading settings..."})}function sF(){const{data:e}=V4(),[t,n]=z.useState(null),{data:a,mutate:s}=B4(t),u=z.useRef(null);return z.useEffect(()=>{!t&&e&&e.length>0&&n(e[0].name)},[e,t]),z.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[a]),d.jsxs(qe.div,{className:"flex flex-col space-y-4 md:pt-0",style:{height:"calc(100vh - 2rem)"},initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.3},children:[d.jsxs("div",{className:"shrink-0",children:[d.jsx("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"SYSTEM LOGS"}),d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-80",children:"View runtime logs."})]}),d.jsxs("div",{className:"flex-1 flex gap-4 min-h-0 border border-azure-border dark:border-matrix-primary rounded bg-azure-surface dark:bg-zinc-950 p-4",children:[d.jsxs("div",{className:"hidden md:flex w-64 flex-col gap-2 border-r border-azure-border dark:border-matrix-primary pr-4 overflow-y-auto shrink-0",children:[d.jsx("h3",{className:"font-bold text-azure-text-secondary dark:text-matrix-secondary mb-2 sticky top-0 bg-azure-surface dark:bg-zinc-950",children:"LOG FILES"}),e?.map(l=>d.jsxs("button",{onClick:()=>n(l.name),className:`text-left px-3 py-2 rounded text-sm truncate flex items-center gap-2 group transition-colors ${t===l.name?"bg-azure-active text-azure-primary dark:bg-matrix-primary dark:text-matrix-highlight":"text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-zinc-900 group-hover:text-azure-primary dark:group-hover:text-matrix-highlight"}`,children:[d.jsx(cA,{className:"w-4 h-4 shrink-0"}),d.jsxs("div",{className:"flex flex-col overflow-hidden",children:[d.jsx("span",{className:"truncate font-bold",children:l.name}),d.jsxs("span",{className:"text-xs opacity-70",children:[(l.size/1024).toFixed(1)," KB"]})]})]},l.name))]}),d.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-azure-bg dark:bg-black border border-azure-border dark:border-matrix-primary/50 rounded",children:[d.jsxs("div",{className:"shrink-0 flex justify-between items-center gap-2 p-2 bg-azure-hover dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary/50",children:[d.jsx("select",{value:t??"",onChange:l=>n(l.target.value),className:"md:hidden flex-1 bg-transparent text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm border-none outline-none cursor-pointer",children:e?.map(l=>d.jsx("option",{value:l.name,children:l.name},l.name))}),d.jsx("span",{className:"hidden md:block text-azure-text-primary dark:text-matrix-highlight font-bold font-mono text-sm truncate",children:t}),d.jsx("button",{onClick:()=>s(),className:"shrink-0 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:d.jsx(yl,{className:"w-4 h-4"})})]}),d.jsx("div",{ref:u,className:"flex-1 overflow-x-hidden overflow-y-auto p-4 font-mono text-xs break-all text-azure-text-primary dark:text-white",children:a?a.lines.map((l,f)=>{const h=l.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s?(.*)/s);return h?d.jsxs("div",{children:[d.jsxs("span",{className:"hidden md:inline opacity-50",children:[h[1]," "]}),d.jsx("span",{children:h[2]})]},f):d.jsx("div",{children:l},f)}):d.jsx("span",{className:"opacity-50",children:"Select a log file to view content..."})})]})]})]})}function oF(){const[e,t]=z.useState(null),[n,a]=z.useState([]),[s,u]=z.useState(!0),[l,f]=z.useState("");if(z.useEffect(()=>{async function g(){try{const[y,v]=await Promise.all([Tp.fetchUsageStats(),Tp.fetchGroupedUsageStats()]);t(y),a(v)}catch(y){f("Failed to load usage statistics"),console.error(y)}finally{u(!1)}}g()},[]),s)return d.jsx("div",{className:"flex items-center justify-center h-64 text-azure-accent dark:text-matrix-highlight font-mono animate-pulse",children:"LOADING_DATA_STREAM..."});if(l)return d.jsxs("div",{className:"p-4 bg-red-900/20 border border-red-500/50 text-red-500 font-mono rounded",children:["ERROR_ACCESSING_DATABASE: ",l]});const h={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},m={hidden:{y:20,opacity:0},show:{y:0,opacity:1}};return d.jsxs(qe.div,{variants:h,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsx("div",{className:"flex items-center justify-between border-b border-azure-border dark:border-matrix-primary pb-4",children:d.jsxs("div",{children:[d.jsxs("h2",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight font-mono flex items-center gap-2",children:[d.jsx(Gm,{className:"w-6 h-6"}),"USAGE_ANALYTICS"]}),d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1 font-mono text-sm",children:"Resource consumption tracking and metrics"})]})}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[d.jsxs(qe.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(Cl,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Input Tokens"})]}),d.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalInputTokens.toLocaleString()??0})]}),d.jsxs(qe.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx($s,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Total Output Tokens"})]}),d.jsx("p",{className:"text-3xl font-bold text-azure-primary dark:text-matrix-highlight font-mono",children:e?.totalOutputTokens.toLocaleString()??0})]}),d.jsxs(qe.div,{variants:m,className:"p-6 bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg shadow-sm backdrop-blur-sm",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-2 text-azure-text-muted dark:text-matrix-secondary",children:[d.jsx(Hc,{className:"w-5 h-5"}),d.jsx("h3",{className:"font-mono text-sm font-bold uppercase",children:"Est. Total Cost"})]}),d.jsx("p",{className:"text-3xl font-bold text-green-600 dark:text-green-400 font-mono",children:e?.totalEstimatedCostUsd!=null?`$${e.totalEstimatedCostUsd.toFixed(4)}`:"—"})]})]}),d.jsxs(qe.div,{variants:m,className:"bg-azure-surface dark:bg-black/40 border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden backdrop-blur-sm",children:[d.jsx("div",{className:"p-4 border-b border-azure-border dark:border-matrix-primary bg-azure-bg dark:bg-zinc-900/50",children:d.jsx("h3",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono uppercase",children:"Usage Breakdown by Model"})}),d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-left font-mono text-sm",children:[d.jsx("thead",{className:"bg-azure-bg dark:bg-zinc-900/50 text-azure-text-secondary dark:text-matrix-secondary border-b border-azure-border dark:border-matrix-primary",children:d.jsxs("tr",{children:[d.jsx("th",{className:"p-4",children:"Provider"}),d.jsx("th",{className:"p-4",children:"Model"}),d.jsx("th",{className:"p-4 text-right",children:"Messages"}),d.jsx("th",{className:"p-4 text-right",children:"Input Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Output Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Total Tokens"}),d.jsx("th",{className:"p-4 text-right",children:"Audio (s)"}),d.jsx("th",{className:"p-4 text-right",children:"Est. Cost (USD)"})]})}),d.jsx("tbody",{className:"divide-y divide-azure-border dark:divide-matrix-primary/30",children:n.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:8,className:"p-8 text-center text-azure-text-muted dark:text-matrix-secondary italic",children:"NO_DATA_AVAILABLE"})}):n.map((g,y)=>d.jsxs("tr",{className:"hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsx("td",{className:"p-4 font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.provider}),d.jsx("td",{className:"p-4 text-azure-text-secondary dark:text-matrix-secondary",children:g.model}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.messageCount.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalInputTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalOutputTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right font-bold text-azure-text-primary dark:text-matrix-highlight",children:g.totalTokens.toLocaleString()}),d.jsx("td",{className:"p-4 text-right text-azure-text-primary dark:text-gray-300",children:g.totalAudioSeconds>0?g.totalAudioSeconds.toLocaleString():"—"}),d.jsx("td",{className:"p-4 text-right font-bold text-green-600 dark:text-green-400",children:g.estimatedCostUsd!=null?`$${g.estimatedCostUsd.toFixed(4)}`:"—"})]},`${g.provider}-${g.model}-${y}`))})]})})]})]})}const lF=()=>{const[e,t]=z.useState(""),[n,a]=z.useState(""),s=Wp(),u=Sr(),l=f=>{f.preventDefault(),e&&(a(""),fetch("/api/config",{headers:{"x-architect-pass":e}}).then(async h=>{if(h.ok){localStorage.setItem("morpheus.auth.token",e);const m=u.state?.from?.pathname||"/";s(m,{replace:!0})}else a("Invalid architect password")}).catch(()=>{a("Connection failed")}))};return d.jsx("div",{className:"flex items-center justify-center min-h-screen bg-azure-bg dark:bg-black text-azure-primary dark:text-green-500 font-mono",children:d.jsxs("div",{className:"max-w-md w-full p-8 border border-azure-primary dark:border-green-500 shadow-xl dark:shadow-[0_0_15px_rgba(34,197,94,0.3)] bg-white dark:bg-black rounded-lg dark:rounded-none",children:[d.jsx("h1",{className:"text-2xl font-bold mb-6 text-center tracking-widest uppercase text-azure-primary dark:text-green-500",children:"> The Architect Login"}),d.jsxs("form",{onSubmit:l,className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm mb-2 opacity-70 text-azure-text-secondary dark:text-green-500",children:"ACCESS_PASS:"}),d.jsx("input",{type:"password",value:e,onChange:f=>t(f.target.value),className:"w-full bg-azure-bg dark:bg-black border border-azure-border dark:border-green-800 p-2 focus:outline-none focus:border-azure-primary dark:focus:border-green-500 text-azure-text-primary dark:text-green-500 placeholder-azure-text-secondary/50 dark:placeholder-green-900 rounded dark:rounded-none",placeholder:"••••••••",autoFocus:!0})]}),n&&d.jsxs("div",{className:"text-red-500 text-sm animate-pulse",children:["[!] ERROR: ",n]}),d.jsx("button",{type:"submit",className:"w-full bg-azure-primary hover:bg-azure-active dark:bg-green-900 dark:hover:bg-green-700 text-white dark:text-black font-bold py-2 transition-colors duration-200 uppercase tracking-wider rounded dark:rounded-none",children:"Authenticate"})]}),d.jsx("div",{className:"mt-8 text-[10px] opacity-30 text-center uppercase text-azure-text-secondary dark:text-green-500",children:"Morpheus OS v0.1.5 | Unauthorized access is logged."})]})})},uF=({children:e})=>{const{isAuthenticated:t}=v_(),n=Sr();return t?d.jsx(d.Fragment,{children:e}):d.jsx(hS,{to:"/login",state:{from:n},replace:!0})},cF=({className:e,...t})=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{className:`w-full caption-bottom text-sm ${e}`,...t})}),dF=({...e})=>d.jsx("thead",{...e}),fF=({...e})=>d.jsx("tbody",{...e}),Um=({...e})=>d.jsx("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 transition-colors hover:bg-azure-hover/50 dark:hover:bg-matrix-primary/10",...e}),_s=({className:e,...t})=>d.jsx("th",{className:`h-12 px-4 text-left align-middle font-medium text-azure-text-secondary dark:text-matrix-secondary/70 [&:has([role=checkbox])]:pr-0 ${e}`,...t}),ki=({className:e,...t})=>d.jsx("td",{className:`p-4 align-middle [&:has([role=checkbox])]:pr-0 ${e}`,...t}),Vw=({checked:e,onCheckedChange:t,className:n,...a})=>{const s=u=>{t&&t(u.target.checked),a.onChange&&a.onChange(u)};return d.jsx("input",{type:"checkbox",checked:e,onChange:s,className:`h-4 w-4 rounded border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-primary dark:text-matrix-highlight focus:ring-azure-primary dark:focus:ring-matrix-highlight ${n||""}`,...a})},ld=({className:e,variant:t="default",...n})=>{const s=`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:focus:ring-zinc-300 ${t==="destructive"?"border-transparent bg-red-500 text-zinc-50 dark:bg-red-900 dark:text-zinc-50":t==="secondary"?"border-transparent bg-azure-surface dark:bg-zinc-800 text-azure-text-secondary dark:text-matrix-secondary":t==="outline"?"text-azure-text-primary dark:text-matrix-secondary border-azure-border dark:border-matrix-primary":"border-transparent bg-azure-primary dark:bg-matrix-highlight text-azure-text-inverse dark:text-black"} ${e||""}`;return d.jsx("div",{className:s,...n})},Vm=({className:e,...t})=>d.jsx("div",{className:`rounded-lg border border-azure-border dark:border-matrix-primary/30 bg-azure-surface dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary shadow-sm ${e||""}`,...t}),Bw=({className:e,...t})=>d.jsx("div",{className:`flex flex-col space-y-1.5 p-6 ${e||""}`,...t}),hF=({className:e,...t})=>d.jsx("h3",{className:`text-2xl font-semibold leading-none tracking-tight ${e||""}`,...t}),Bm=({className:e,...t})=>d.jsx("div",{className:`p-6 pt-0 ${e||""}`,...t}),mF=({className:e,variant:t="default",...n})=>{const s=`relative w-full rounded-lg border p-4 ${t==="destructive"?"border-red-500/50 text-red-700 dark:border-red-900/50 dark:text-red-300":"border-azure-border dark:border-matrix-primary"} ${e||""}`;return d.jsx("div",{className:s,...n})},pF=({className:e,...t})=>d.jsx("div",{className:`text-sm [&_p]:leading-relaxed ${e||""}`,...t}),w2=({isOpen:e,onClose:t,title:n,children:a,size:s="md"})=>{if(!e)return null;const u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[d.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),d.jsxs("div",{className:`relative bg-azure-surface dark:bg-black rounded-lg border border-azure-border dark:border-matrix-primary shadow-xl w-full ${u[s]} max-h-[90vh] overflow-hidden flex flex-col`,children:[n&&d.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-azure-border dark:border-matrix-primary",children:[n&&d.jsx("h3",{className:"text-lg font-semibold text-azure-text-primary dark:text-matrix-highlight",children:n}),t&&d.jsx("button",{onClick:t,className:"text-azure-text-secondary dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),d.jsx("div",{className:"overflow-y-auto flex-grow p-6",children:a})]})]})},gF=({isOpen:e,onClose:t,memory:n})=>n?d.jsx(w2,{isOpen:e,onClose:t,title:"Memory Details",size:"lg",children:d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ig,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Category"})]}),d.jsx("div",{children:d.jsx(ld,{variant:"outline",children:n.category})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(t4,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Importance"})]}),d.jsx("div",{children:d.jsx(ld,{variant:n.importance==="critical"?"destructive":n.importance==="high"?"default":n.importance==="medium"?"secondary":"outline",children:n.importance})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(kS,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Created"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.created_at).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ia,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Updated"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:new Date(n.updated_at).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Il,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Access Count"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.access_count}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(gA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Hash"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary break-all text-sm",children:n.hash}),n.source&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(vA,{className:"w-4 h-4 text-azure-text-secondary dark:text-matrix-tertiary"}),d.jsx("span",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm",children:"Source"})]}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary",children:n.source})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Summary"}),d.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md",children:n.summary})]}),n.details&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-azure-text-secondary dark:text-matrix-tertiary text-sm mb-2",children:"Details"}),d.jsx("div",{className:"text-azure-text-primary dark:text-matrix-secondary bg-azure-surface dark:bg-zinc-900 p-3 rounded-md whitespace-pre-wrap",children:n.details})]}),d.jsx("div",{className:"flex justify-end pt-4",children:d.jsx(lr,{onClick:t,children:"Close"})})]})}):null,S2=({isOpen:e,onClose:t,onConfirm:n,title:a="Confirm Deletion",message:s="Are you sure you want to delete this item? This action cannot be undone.",confirmButtonText:u="Delete",cancelButtonText:l="Cancel"})=>d.jsx(w2,{isOpen:e,onClose:t,title:a,size:"md",children:d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-azure-text-primary dark:text-matrix-secondary",children:s}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(lr,{variant:"outline",onClick:t,children:l}),d.jsx(lr,{variant:"destructive",onClick:()=>{n(),t()},children:u})]})]})}),xF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=z.useCallback(h=>(t(!0),a(null),xe.get(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]),u=z.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),l=z.useCallback((h,m)=>(t(!0),a(null),xe.post(h,m).then(g=>g).catch(g=>{throw a(g.message||"An error occurred"),g}).finally(()=>{t(!1)})),[]),f=z.useCallback(h=>(t(!0),a(null),xe.delete(h).then(m=>m).catch(m=>{throw a(m.message||"An error occurred"),m}).finally(()=>{t(!1)})),[]);return{get:s,post:u,put:l,del:f,loading:e,error:n}},yF=()=>{const[e,t]=z.useState([]),[n,a]=z.useState(!0),[s,u]=z.useState([]),[l,f]=z.useState(""),[h,m]=z.useState("all"),[g,y]=z.useState("all"),[v,b]=z.useState(null),[S,j]=z.useState(!1),[A,E]=z.useState(null),[O,N]=z.useState(!1),[L,D]=z.useState(null),[R,q]=z.useState(!1),{get:B,del:X,post:fe}=xF();z.useEffect(()=>{se()},[]);const se=async()=>{try{a(!0);const C=await B("/sati/memories");t(C),b(null)}catch(C){b("Failed to load memories. Please try again."),console.error("Error fetching memories:",C)}finally{a(!1)}},le=()=>{s.length===Z.length?u([]):u(Z.map(C=>C.id))},ee=C=>{s.includes(C)?u(s.filter(I=>I!==C)):u([...s,C])},oe=async()=>{if(s.length!==0)try{await fe("/sati/memories/bulk-delete",{ids:s}),await se(),u([]),j(!1)}catch(C){b("Failed to delete memories. Please try again."),console.error("Error deleting memories:",C)}},ae=C=>{D(C),q(!0)},P=async()=>{if(L)try{await X(`/sati/memories/${L}`),await se()}catch(C){b("Failed to delete memory. Please try again."),console.error("Error deleting memory:",C)}finally{D(null),q(!1)}},J=C=>{E(C),N(!0)},Z=e.filter(C=>{const I=C.summary.toLowerCase().includes(l.toLowerCase())||C.details?.toLowerCase().includes(l.toLowerCase())||C.category.toLowerCase().includes(l.toLowerCase()),w=h==="all"||C.category===h,Y=g==="all"||C.importance===g;return I&&w&&Y&&!C.archived}),me=Array.from(new Set(e.map(C=>C.category))),T=Array.from(new Set(e.map(C=>C.importance)));return n?d.jsx(Vm,{className:"w-full",children:d.jsx(Bm,{className:"flex justify-center items-center h-64",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-azure-primary dark:border-matrix-highlight"})})}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Sati Memories"}),d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary mt-1",children:"View and manage your long-term memories stored by Sati"})]}),s.length>0&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary",children:[s.length," selected"]}),d.jsxs(lr,{variant:"destructive",size:"sm",onClick:()=>j(!0),disabled:s.length===0,children:[d.jsx(Ti,{className:"w-4 h-4 mr-1"}),"Delete Selected"]})]})]}),v&&d.jsx(mF,{variant:"destructive",children:d.jsx(pF,{children:v})}),d.jsxs(Vm,{children:[d.jsx(Bw,{className:"border-b border-azure-border dark:border-matrix-primary",children:d.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[d.jsxs("div",{className:"flex flex-col relative w-full",children:[d.jsx(IA,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-azure-text-secondary dark:text-matrix-secondary w-4 h-4"}),d.jsx("input",{type:"text",placeholder:"Search memories...",value:l,onChange:C=>f(C.target.value),className:"w-full pl-10 pr-4 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight"})]}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[d.jsxs("select",{value:h,onChange:C=>m(C.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[d.jsx("option",{value:"all",children:"All Categories"}),me.map(C=>d.jsx("option",{value:C,children:C},C))]}),d.jsxs("select",{value:g,onChange:C=>y(C.target.value),className:"px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-md text-azure-text-primary dark:text-matrix-secondary focus:outline-none focus:ring-2 focus:ring-azure-primary dark:focus:ring-matrix-highlight flex-grow",children:[d.jsx("option",{value:"all",children:"All Importance"}),T.map(C=>d.jsx("option",{value:C,children:C},C))]})]})]})}),d.jsx(Bm,{className:"p-0",children:d.jsxs(cF,{children:[d.jsx(dF,{children:d.jsxs(Um,{className:"hover:bg-transparent",children:[d.jsx(_s,{className:"w-12",children:d.jsx(Vw,{checked:Z.length>0&&s.length===Z.length,onCheckedChange:le})}),d.jsx(_s,{children:"Summary"}),d.jsx(_s,{children:"Category"}),d.jsx(_s,{children:"Importance"}),d.jsx(_s,{children:"Created"}),d.jsx(_s,{className:"w-32",children:"Actions"})]})}),d.jsx(fF,{children:Z.length===0?d.jsx(Um,{children:d.jsx(ki,{colSpan:6,className:"text-center py-8 text-azure-text-secondary dark:text-matrix-secondary",children:n?"Loading memories...":"No memories found"})}):Z.map(C=>d.jsxs(Um,{children:[d.jsx(ki,{children:d.jsx(Vw,{checked:s.includes(C.id),onCheckedChange:()=>ee(C.id)})}),d.jsx(ki,{className:"font-medium max-w-xs truncate",children:C.summary}),d.jsx(ki,{children:d.jsx(ld,{variant:"outline",children:C.category})}),d.jsx(ki,{children:d.jsx(ld,{variant:C.importance==="critical"?"destructive":C.importance==="high"?"default":C.importance==="medium"?"secondary":"outline",children:C.importance})}),d.jsx(ki,{children:d.jsxs("div",{className:"flex items-center gap-1 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(kS,{className:"w-4 h-4"}),new Date(C.created_at).toLocaleDateString()]})}),d.jsx(ki,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(lr,{variant:"ghost",size:"sm",onClick:()=>J(C),className:"text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.jsx(Il,{className:"w-4 h-4"})}),d.jsx(lr,{variant:"ghost",size:"sm",onClick:()=>ae(C.id),className:"text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},C.id))})]})})]}),S&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsxs(Vm,{className:"w-full max-w-md mx-4",children:[d.jsx(Bw,{children:d.jsx(hF,{children:"Delete Memories"})}),d.jsxs(Bm,{children:[d.jsxs("p",{className:"mb-4",children:["Are you sure you want to delete ",s.length," ","memory(ies)? This action cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(lr,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),d.jsx(lr,{variant:"destructive",onClick:oe,children:"Delete"})]})]})]})}),d.jsx(gF,{isOpen:O,onClose:()=>N(!1),memory:A}),d.jsx(S2,{isOpen:R,onClose:()=>q(!1),onConfirm:P,title:"Confirm Memory Deletion",message:"Are you sure you want to delete this memory? This action cannot be undone.",confirmButtonText:"Delete Memory",cancelButtonText:"Cancel"})]})},wi=Ba.getInstance(),Si={fetchServers:async()=>wi.get("/mcp/servers"),addServer:async(e,t)=>wi.post("/mcp/servers",{name:e,config:t}),updateServer:async(e,t)=>wi.put(`/mcp/servers/${encodeURIComponent(e)}`,{config:t}),deleteServer:async e=>wi.delete(`/mcp/servers/${encodeURIComponent(e)}`),toggleServer:async(e,t)=>wi.patch(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{enabled:t}),reloadTools:async()=>wi.post("/mcp/reload",{}),fetchStatus:async()=>wi.get("/mcp/status")},bF=({label:e,values:t,onChange:n,placeholder:a})=>{const s=t.length>0?t:[""],u=(h,m)=>{const g=[...s];g[h]=m,n(g.filter(y=>y.trim().length>0))},l=()=>n([...s,""]),f=h=>{const m=s.filter((g,y)=>y!==h);n(m.filter(g=>g.trim().length>0))};return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),s.map((h,m)=>d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{className:"flex-1 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:h,placeholder:a,onChange:g=>u(m,g.target.value)}),d.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>f(m),children:"Remove"})]},`${e}-${m}`)),d.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:l,children:"Add argument"})]})},Zw=({label:e,values:t,onChange:n,keyPlaceholder:a,valuePlaceholder:s})=>{const u=z.useMemo(()=>t.length>0?t:[{key:"",value:""}],[t]),l=(m,g,y)=>{const v=[...u];v[m]={...v[m],[g]:y},n(v.filter(b=>b.key.trim().length>0||b.value.trim().length>0))},f=()=>n([...u,{key:"",value:""}]),h=m=>{const g=u.filter((y,v)=>v!==m);n(g.filter(y=>y.key.trim().length>0||y.value.trim().length>0))};return d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-sm font-semibold text-azure-text-primary dark:text-matrix-secondary",children:e}),u.map((m,g)=>d.jsxs("div",{className:"grid gap-2 md:grid-cols-5",children:[d.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.key,placeholder:a,onChange:y=>l(g,"key",y.target.value)}),d.jsx("input",{className:"col-span-2 rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:m.value,placeholder:s,onChange:y=>l(g,"value",y.target.value)}),d.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>h(g),children:"Remove"})]},`${e}-${g}`)),d.jsx("button",{type:"button",className:"text-sm font-semibold text-azure-primary hover:text-azure-secondary dark:text-matrix-highlight hover:dark:text-matrix-secondary",onClick:f,children:"Add entry"})]})},vF=({transport:e,command:t,url:n,args:a,env:s,headers:u,onCommandChange:l,onUrlChange:f,onArgsChange:h,onEnvChange:m,onHeadersChange:g})=>d.jsxs("div",{className:"space-y-4",children:[e==="stdio"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Command",d.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:t,onChange:y=>l(y.target.value),placeholder:"npx"})]}),d.jsx(bF,{label:"Arguments",values:a,onChange:h,placeholder:"--flag"})]}),e==="http"&&d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["URL",d.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:n,onChange:y=>f(y.target.value),placeholder:"https://example.com/mcp"})]}),d.jsx(Zw,{label:"Environment Variables",values:s,onChange:m,keyPlaceholder:"KEY",valuePlaceholder:"value"}),e==="http"&&d.jsx(Zw,{label:"Headers",values:u,onChange:g,keyPlaceholder:"Header",valuePlaceholder:"value"})]}),kF=RH({name:Pm().min(1,"Name is required"),transport:b2([$w("stdio"),$w("http")]),command:Pm().optional(),url:Pm().optional()}),Ac=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Zm=e=>e.reduce((t,n)=>(n.key.trim().length===0||(t[n.key]=n.value),t),{}),wF=({open:e,mode:t,initial:n,onClose:a,onSubmit:s})=>{const[u,l]=z.useState(n?.name??""),[f,h]=z.useState(n?.config.transport??"stdio"),[m,g]=z.useState(n?.config.transport==="stdio"?n.config.command:""),[y,v]=z.useState(n?.config.transport==="http"?n.config.url:""),[b,S]=z.useState(n?.config.args??[]),[j,A]=z.useState(Ac(n?.config.env)),[E,O]=z.useState(n?.config.transport==="http"?Ac(n.config.headers):[]),[N,L]=z.useState(null);z.useEffect(()=>{e&&(l(n?.name??""),h(n?.config.transport??"stdio"),g(n?.config.transport==="stdio"?n.config.command:""),v(n?.config.transport==="http"?n.config.url:""),S(n?.config.args??[]),A(Ac(n?.config.env)),O(n?.config.transport==="http"?Ac(n.config.headers):[]),L(null))},[e,n]);const D=t==="create",R=async()=>{const B=kF.safeParse({name:u,transport:f,command:m,url:y});if(!B.success){L(B.error.issues[0]?.message??"Invalid form");return}if(f==="stdio"&&(!m||m.trim().length===0)){L("Command is required for stdio transport.");return}if(f==="http"&&(!y||y.trim().length===0)){L("URL is required for http transport.");return}const X=f==="stdio"?{transport:"stdio",command:m.trim(),args:b.length>0?b:void 0,env:j.length>0?Zm(j):void 0}:{transport:"http",url:y.trim(),headers:E.length>0?Zm(E):void 0,env:j.length>0?Zm(j):void 0};L(null),await s(u.trim(),X)},q=z.useMemo(()=>t==="create"?"Add MCP Server":"Edit MCP Server",[t]);return d.jsx(vr,{open:e,onOpenChange:a,children:d.jsxs(Fs,{children:[d.jsx(kr,{children:d.jsx(wr,{children:q})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Name",d.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none disabled:bg-azure-border dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary dark:disabled:bg-matrix-primary/50",value:u,onChange:B=>l(B.target.value),placeholder:"coolify",disabled:!D})]}),d.jsxs("label",{className:"block space-y-2 text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Transport",d.jsxs("select",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:f,onChange:B=>h(B.target.value),children:[d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),d.jsx(vF,{transport:f,command:m,url:y,args:b,env:j,headers:E,onCommandChange:g,onUrlChange:v,onArgsChange:S,onEnvChange:A,onHeadersChange:O}),N&&d.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/50 dark:text-red-400",children:N}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:a,children:"Cancel"}),d.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:R,children:"Save"})]})]})]})})},SF=({server:e,probeResult:t,onEdit:n,onDelete:a,onToggle:s})=>d.jsxs("div",{className:"rounded-2xl border border-azure-border bg-azure-surface/80 p-4 shadow-sm overflow-hidden dark:border-matrix-primary dark:bg-zinc-950/70",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("div",{className:"text-lg font-semibold text-azure-text-primary break-words dark:text-matrix-highlight",children:e.name}),d.jsx("div",{className:"text-xs uppercase tracking-wide text-azure-text-muted dark:text-matrix-secondary",children:e.config.transport})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[t&&d.jsx("span",{title:t.ok?`${t.toolCount} tools`:t.error,className:`rounded-full px-2 py-0.5 text-xs font-semibold ${t.ok?"bg-green-500/20 text-green-600 dark:bg-green-400/20 dark:text-green-400":"bg-red-500/20 text-red-600 dark:bg-red-400/20 dark:text-red-400"}`,children:t.ok?`✓ ${t.toolCount} tools`:"✗ Failed"}),d.jsx("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-semibold ${e.enabled?"bg-matrix-highlight dark:text-matrix-primary":"bg-azure-border text-azure-text-secondary dark:bg-matrix-primary/50 dark:text-matrix-secondary"}`,onClick:()=>s(e,!e.enabled),children:e.enabled?"Enabled":"Disabled"})]})]}),d.jsxs("div",{className:"mt-4 space-y-2 text-sm text-azure-text-secondary dark:text-matrix-secondary",children:[e.config.transport==="stdio"&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Command:"})," ",e.config.command]}),e.config.transport==="http"&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"URL:"})," ",e.config.url]}),e.config.args&&e.config.args.length>0&&d.jsxs("div",{className:"break-all",children:[d.jsx("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:"Args:"})," ",e.config.args.join(" ")]}),t&&!t.ok&&t.error&&d.jsx("div",{className:"mt-1 break-all rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-600 dark:border-red-900 dark:bg-red-950/30 dark:text-red-400",children:t.error.length>120?t.error.slice(0,120)+"…":t.error})]}),d.jsxs("div",{className:"mt-4 flex gap-2",children:[d.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-3 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>n(e),children:"Edit"}),d.jsx("button",{type:"button",className:"rounded-md border border-red-300 px-3 py-2 text-sm text-red-600 hover:border-red-400 hover:text-red-500 dark:border-red-900 dark:text-red-400",onClick:()=>a(e),children:"Delete"})]})]}),zF=()=>{const{data:e,error:t,mutate:n,isLoading:a}=kt("/api/mcp/servers",()=>Si.fetchServers()),[s,u]=z.useState(""),[l,f]=z.useState("all"),[h,m]=z.useState(!1),[g,y]=z.useState(null),[v,b]=z.useState(!1),[S,j]=z.useState(null),[A,E]=z.useState(null),[O,N]=z.useState({}),[L,D]=z.useState(!1),[R,q]=z.useState(!1),B=e?.servers??[],X=z.useMemo(()=>B.filter(Z=>{const me=Z.name.toLowerCase().includes(s.toLowerCase()),T=l==="all"||Z.config.transport===l;return me&&T}),[B,s,l]),fe=()=>{y(null),m(!0)},se=Z=>{y(Z),m(!0)},le=async(Z,me)=>{try{g?await Si.updateServer(g.name,me):await Si.addServer(Z,me),m(!1),y(null),await n(),E({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(T){E({type:"error",message:T.message||"Failed to save MCP server."})}},ee=async Z=>{j(Z),b(!0)},oe=async()=>{if(S)try{await Si.deleteServer(S.name),await n(),b(!1),j(null),E({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(Z){E({type:"error",message:Z.message||"Failed to delete MCP server."})}},ae=async()=>{D(!0);try{const Z=await Si.fetchStatus(),me={};for(const T of Z.servers)me[T.name]=T;N(me)}catch(Z){E({type:"error",message:Z.message||"Failed to check MCP status."})}finally{D(!1)}},P=async()=>{q(!0);try{await Si.reloadTools(),E({type:"success",message:"MCP tools reloaded successfully."})}catch(Z){E({type:"error",message:Z.message||"Failed to reload MCP tools."})}finally{q(!1)}},J=async(Z,me)=>{try{await Si.toggleServer(Z.name,me),await n(),E({type:"success",message:"MCPs saved successfully. Restart MCPs for changes to take effect."})}catch(T){E({type:"error",message:T.message||"Failed to toggle MCP server."})}};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-semibold text-azure-primary dark:text-matrix-highlight",children:"MCP Servers"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Manage MCP servers stored in mcps.json."})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"button",disabled:L,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:ae,children:L?"Checking…":"Check Status"}),d.jsx("button",{type:"button",disabled:R,className:"rounded-md border border-azure-border px-4 py-2 text-sm font-semibold text-azure-text-primary shadow hover:border-azure-primary hover:text-azure-primary disabled:opacity-50 dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:P,children:R?"Reloading…":"Reload MCPs"}),d.jsx("button",{type:"button",className:"rounded-md bg-azure-primary px-4 py-2 text-sm font-semibold text-white shadow hover:bg-azure-secondary dark:bg-matrix-highlight dark:text-matrix-bg hover:dark:bg-matrix-secondary",onClick:fe,children:"Add Server"})]})]}),A&&d.jsx("div",{className:`p-4 rounded border ${A.type==="success"?"border-azure-primary text-azure-primary bg-azure-primary/10 dark:border-matrix-highlight dark:text-matrix-highlight dark:bg-matrix-highlight/10":"border-red-500 text-red-500 bg-red-900/10"}`,children:A.message}),d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[d.jsx("input",{className:"w-full rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:s,onChange:Z=>u(Z.target.value),placeholder:"Search by name"}),d.jsxs("select",{className:"rounded-md border border-azure-border bg-azure-surface px-3 py-2 text-sm text-azure-text-primary shadow-sm focus:border-azure-primary focus:outline-none dark:border-matrix-primary dark:bg-black dark:text-matrix-secondary",value:l,onChange:Z=>f(Z.target.value),children:[d.jsx("option",{value:"all",children:"All"}),d.jsx("option",{value:"stdio",children:"stdio"}),d.jsx("option",{value:"http",children:"http"})]})]}),a&&d.jsx("div",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Loading MCP servers..."}),t&&d.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to load MCP servers."}),!a&&X.length===0&&d.jsx("div",{className:"rounded-2xl border border-dashed border-azure-border bg-azure-surface/60 p-6 text-center text-sm text-azure-text-secondary dark:border-matrix-primary dark:bg-zinc-950/60 dark:text-matrix-secondary",children:"No MCP servers found. Add a server to get started."}),d.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:X.map(Z=>d.jsx(SF,{server:Z,probeResult:O[Z.name],onEdit:se,onDelete:ee,onToggle:J},`${Z.name}-${Z.enabled?"on":"off"}`))}),d.jsx(wF,{open:h,mode:g?"edit":"create",initial:g??void 0,onClose:()=>m(!1),onSubmit:le}),d.jsx(vr,{open:v,onOpenChange:b,children:d.jsxs(Fs,{children:[d.jsx(kr,{children:d.jsx(wr,{children:"Confirm Deletion"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:["Are you sure you want to delete the MCP server ",d.jsxs("span",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight",children:['"',S?.name,'"']}),"? This action cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{type:"button",className:"rounded-md border border-azure-border px-4 py-2 text-sm text-azure-text-primary hover:border-azure-primary hover:text-azure-primary dark:border-matrix-primary dark:text-matrix-secondary hover:dark:border-matrix-highlight hover:dark:text-matrix-highlight",onClick:()=>b(!1),children:"Cancel"}),d.jsx("button",{type:"button",className:"rounded-md bg-red-500 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-red-400 dark:bg-red-600 hover:dark:bg-red-500",onClick:oe,children:"Delete"})]})]})]})})]})},Im={list:()=>xe.get("/model-pricing"),upsert:e=>xe.post("/model-pricing",e),update:(e,t,n)=>xe.put(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,n),delete:(e,t)=>xe.delete(`/model-pricing/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)},_F={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Iw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},jF=["anthropic","openai","google","openrouter","ollama","other"],Hw=()=>({provider:"",model:"",input_price_per_1m:0,output_price_per_1m:0}),NF=()=>{const{data:e=[],mutate:t}=kt("/api/model-pricing",()=>Im.list()),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Hw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[v,b]=z.useState(!1),S=(N,L)=>{y({type:N,message:L}),setTimeout(()=>y(null),3e3)},j=()=>{u(null),f(Hw()),a(!0)},A=N=>{u(N),f({...N}),a(!0)},E=async()=>{if(!(!l.provider.trim()||!l.model.trim())){b(!0);try{await Im.upsert(l),await t(),a(!1),S("success",s?"Pricing updated.":"Pricing created.")}catch{S("error","Failed to save pricing entry.")}finally{b(!1)}}},O=async()=>{if(h)try{await Im.delete(h.provider,h.model),await t(),m(null),S("success","Pricing entry deleted.")}catch{S("error","Failed to delete pricing entry.")}};return d.jsxs(qe.div,{variants:_F,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(qe.div,{variants:Iw,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Hc,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Model Pricing"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Manage per-model pricing to estimate LLM costs in Usage Stats."})]})]}),d.jsxs("button",{onClick:j,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[d.jsx(fd,{className:"w-4 h-4"})," Add Pricing"]})]}),g&&d.jsx(qe.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),d.jsx(qe.div,{variants:Iw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Provider","Model","Input ($/1M tokens)","Output ($/1M tokens)","Actions"].map(N=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:N},N))})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:'No pricing entries. Click "Add Pricing" to get started.'})}):e.map(N=>d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text capitalize",children:N.provider}),d.jsx("td",{className:"px-4 py-3 font-mono text-azure-text-primary dark:text-matrix-highlight text-xs",children:N.model}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.input_price_per_1m.toFixed(4)]}),d.jsxs("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-text",children:["$",N.output_price_per_1m.toFixed(4)]}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>A(N),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",title:"Edit",children:d.jsx(ag,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(N),className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",title:"Delete",children:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},`${N.provider}/${N.model}`))})]})}),d.jsx(vr,{open:n,onOpenChange:a,children:d.jsxs(Fs,{children:[d.jsx(kr,{children:d.jsx(wr,{children:s?"Edit Pricing":"Add Pricing"})}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Provider"}),s?d.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm capitalize",children:l.provider}):d.jsxs("select",{value:l.provider,onChange:N=>f({...l,provider:N.target.value}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight",children:[d.jsx("option",{value:"",children:"Select provider..."}),jF.map(N=>d.jsx("option",{value:N,children:N},N))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Model"}),s?d.jsx("p",{className:"px-3 py-2 rounded-lg bg-azure-bg dark:bg-zinc-900 text-azure-text-primary dark:text-matrix-secondary text-sm font-mono",children:l.model}):d.jsx("input",{type:"text",value:l.model,onChange:N=>f({...l,model:N.target.value}),placeholder:"e.g. gpt-4o",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Input price / 1M tokens ($)"}),d.jsx("input",{type:"number",min:0,step:.001,value:l.input_price_per_1m,onChange:N=>f({...l,input_price_per_1m:parseFloat(N.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Output price / 1M tokens ($)"}),d.jsx("input",{type:"number",min:0,step:.001,value:l.output_price_per_1m,onChange:N=>f({...l,output_price_per_1m:parseFloat(N.target.value)||0}),className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight"})]})]}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[d.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),d.jsx("button",{onClick:E,disabled:v||!l.provider.trim()||!l.model.trim(),className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:v?"Saving...":"Save"})]})]})]})}),d.jsx(vr,{open:!!h,onOpenChange:N=>!N&&m(null),children:d.jsxs(Fs,{children:[d.jsx(kr,{children:d.jsx(wr,{children:"Delete Pricing Entry"})}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-text",children:["Are you sure you want to delete the pricing for"," ",d.jsxs("span",{className:"font-mono font-semibold text-azure-primary dark:text-matrix-highlight",children:[h?.provider,"/",h?.model]}),"? This cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),d.jsx("button",{onClick:O,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})})]})},CF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Fw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},EF=["ui","telegram","discord"],qw=()=>({name:"",prompt:"",notification_channels:["ui"]}),TF=()=>{const{data:e=[],mutate:t}=kt("/webhooks",()=>Pa.list(),{refreshInterval:1e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(qw()),[h,m]=z.useState(null),[g,y]=z.useState(null),[v,b]=z.useState(!1),[S,j]=z.useState(null),[A,E]=z.useState(null),O=(ee,oe)=>{y({type:ee,message:oe}),setTimeout(()=>y(null),3500)},N=()=>{u(null),f(qw()),E(null),a(!0)},L=ee=>{u(ee),f({name:ee.name,prompt:ee.prompt,notification_channels:ee.notification_channels}),E(null),a(!0)},D=ee=>/^[a-z0-9-_]+$/.test(ee),R=async()=>{if(!(!l.name.trim()||!l.prompt.trim())){if(!D(l.name)){E("Name must only contain lowercase letters, numbers, hyphens (-) and underscores (_).");return}if(l.notification_channels.length===0){E("Select at least one notification channel.");return}E(null),b(!0);try{s?(await Pa.update(s.id,l),O("success","Webhook updated.")):(await Pa.create(l),O("success","Webhook created.")),await t(),a(!1)}catch(ee){const oe=ee?.message||"Failed to save webhook.";E(oe)}finally{b(!1)}}},q=async ee=>{try{await Pa.update(ee.id,{enabled:!ee.enabled}),await t()}catch{O("error","Failed to toggle webhook.")}},B=async()=>{if(h)try{await Pa.delete(h.id),await t(),m(null),O("success","Webhook deleted.")}catch{O("error","Failed to delete webhook.")}},X=ee=>`${window.location.origin}/api/webhooks/trigger/${ee}`,fe=ee=>`curl -X POST ${X(ee.name)} \\
|
|
109
|
-
-H "x-api-key: ${ee.api_key}" \\
|
|
110
|
-
-H "Content-Type: application/json" \\
|
|
111
|
-
-d '{"event":"your_payload"}'`,se=async(ee,oe)=>{await navigator.clipboard.writeText(ee),j(oe),setTimeout(()=>j(null),2e3)},le=ee=>{const oe=l.notification_channels.includes(ee);f({...l,notification_channels:oe?l.notification_channels.filter(ae=>ae!==ee):[...l.notification_channels,ee]})};return d.jsxs(qe.div,{variants:CF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(qe.div,{variants:Fw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Qm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Webhooks"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-0.5",children:"Trigger Oracle agent tasks from external events."})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(Va,{to:"/notifications",className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[d.jsx(Nl,{className:"w-4 h-4"}),"Notifications"]}),d.jsxs("button",{onClick:N,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[d.jsx(fd,{className:"w-4 h-4"}),"New Webhook"]})]})]}),g&&d.jsx(qe.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:`px-4 py-3 rounded-lg text-sm font-medium border ${g.type==="success"?"bg-green-50 dark:bg-green-900/20 border-green-300 dark:border-green-700 text-green-800 dark:text-green-400":"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-700 text-red-800 dark:text-red-400"}`,children:g.message}),d.jsx(qe.div,{variants:Fw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Name","API Key","Channels","Triggers","Status","Actions"].map(ee=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-secondary",children:ee},ee))})}),d.jsx("tbody",{children:e.length===0?d.jsx("tr",{children:d.jsxs("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-secondary",children:["No webhooks yet."," ",d.jsx("button",{onClick:N,className:"underline text-azure-primary dark:text-matrix-highlight",children:"Create one"})]})}):e.map(ee=>d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors",children:[d.jsx("td",{className:"px-4 py-3",children:d.jsx("span",{className:"font-mono text-azure-text-primary dark:text-matrix-secondary font-medium",children:ee.name})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("code",{className:"text-xs font-mono text-azure-text-secondary dark:text-matrix-secondary truncate max-w-[140px]",children:[ee.api_key.slice(0,16),"…"]}),d.jsx("button",{onClick:()=>se(fe(ee),`curl-${ee.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy curl example",children:S===`curl-${ee.id}`?d.jsx(Ym,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(Jm,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:()=>se(ee.api_key,`key-${ee.id}`),className:"p-1 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary",title:"Copy API key",children:S===`key-${ee.id}`?d.jsx(Ym,{className:"w-3.5 h-3.5 text-green-500"}):d.jsx(aA,{className:"w-3.5 h-3.5"})})]})}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("div",{className:"flex gap-1 flex-wrap",children:ee.notification_channels.map(oe=>d.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-azure-border dark:bg-matrix-primary/20 text-azure-text-secondary dark:text-matrix-secondary capitalize",children:oe},oe))})}),d.jsx("td",{className:"px-4 py-3 text-azure-text-primary dark:text-matrix-secondary",children:ee.trigger_count}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("button",{onClick:()=>q(ee),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors ${ee.enabled?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/30":"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:ee.enabled?d.jsxs(d.Fragment,{children:[d.jsx(NS,{className:"w-3.5 h-3.5"})," Enabled"]}):d.jsxs(d.Fragment,{children:[d.jsx(jS,{className:"w-3.5 h-3.5"})," Disabled"]})})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:()=>L(ee),title:"Edit",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:d.jsx(ag,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>m(ee),title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-azure-text-secondary dark:text-matrix-secondary hover:text-red-600 dark:hover:text-red-400 transition-colors",children:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},ee.id))})]})})}),d.jsxs(vr,{open:n,onOpenChange:a,children:[d.jsx(kr,{children:d.jsx(wr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Webhook":"New Webhook"})}),d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:["Name ",d.jsx("span",{className:"text-azure-text-muted dark:text-matrix-secondary/60 font-normal",children:"(slug — used in URL)"})]}),d.jsx("input",{type:"text",value:l.name,onChange:ee=>{f({...l,name:ee.target.value.toLowerCase().replace(/\s+/g,"-")}),E(null)},placeholder:"e.g. deploy-done, github-issue-opened",disabled:!!s,className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight disabled:opacity-50 disabled:cursor-not-allowed"}),l.name&&d.jsxs("p",{className:"mt-1 text-xs text-azure-text-secondary dark:text-matrix-secondary",children:["Trigger URL:"," ",d.jsxs("code",{className:"font-mono text-azure-primary dark:text-matrix-highlight",children:["POST /api/webhooks/trigger/",l.name]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",children:"Agent Prompt"}),d.jsx("textarea",{rows:5,value:l.prompt,onChange:ee=>f({...l,prompt:ee.target.value}),placeholder:"Describe what Apoc should do when this webhook fires. The received payload will be appended automatically.",className:"w-full px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary text-sm focus:outline-none focus:ring-1 focus:ring-azure-primary dark:focus:ring-matrix-highlight focus:border-azure-primary dark:focus:border-matrix-highlight resize-none"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:"Notification Channels"}),d.jsx("div",{className:"flex gap-4",children:EF.map(ee=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:l.notification_channels.includes(ee),onChange:()=>le(ee),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),d.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary capitalize",children:ee})]},ee))})]}),A&&d.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded px-3 py-2",children:A}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[d.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),d.jsx("button",{onClick:R,disabled:v||!l.name.trim()||!l.prompt.trim()||l.notification_channels.length===0,className:"px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:v?"Saving…":s?"Update":"Create"})]})]})]}),d.jsxs(vr,{open:!!h,onOpenChange:ee=>!ee&&m(null),children:[d.jsx(kr,{children:d.jsx(wr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Delete Webhook"})}),d.jsxs("div",{className:"p-6 space-y-4",children:[d.jsxs("p",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary",children:["Delete"," ",d.jsx("span",{className:"font-semibold font-mono dark:text-matrix-highlight",children:h?.name}),"? This also removes all associated notifications and cannot be undone."]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{onClick:()=>m(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),d.jsx("button",{onClick:B,className:"px-4 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700 transition-colors",children:"Delete"})]})]})]})]})},AF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Gw={hidden:{opacity:0,y:10},show:{opacity:1,y:0}},Yw=({status:e})=>e==="completed"?d.jsxs("div",{className:"flex items-center gap-1.5 text-green-600 dark:text-green-400",children:[d.jsx(wS,{className:"w-4 h-4"}),d.jsx("span",{className:"text-xs",children:"Completed"})]}):e==="failed"?d.jsxs("div",{className:"flex items-center gap-1.5 text-red-600 dark:text-red-400",children:[d.jsx(Km,{className:"w-4 h-4"}),d.jsx("span",{className:"text-xs",children:"Failed"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 text-yellow-600 dark:text-yellow-400",children:[d.jsx(Ia,{className:"w-4 h-4 animate-pulse"}),d.jsx("span",{className:"text-xs",children:"Pending"})]}),Oc=e=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),OF=e=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},RF=()=>{const[e,t]=z.useState(!1),[n,a]=z.useState(null),{data:s=[],mutate:u}=kt(["/webhooks/notifications",e],()=>Pa.listNotifications({unreadOnly:e}),{refreshInterval:5e3}),l=s.filter(g=>!g.read).length,f=async g=>{g.length!==0&&(await Pa.markRead(g),await u())},h=()=>{const g=s.filter(y=>!y.read).map(y=>y.id);f(g)},m=async g=>{a(g),g.read||await f([g.id])};return d.jsxs(qe.div,{variants:AF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(qe.div,{variants:Gw,className:"flex items-center justify-between flex-wrap gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Nl,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),l>0&&d.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[10px] font-bold rounded-full w-4 h-4 flex items-center justify-center leading-none",children:l>9?"9+":l})]}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Notifications"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim mt-0.5",children:"Webhook execution results from the Oracle agent."})]})]}),d.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[d.jsxs(Va,{to:"/webhooks",className:"flex items-center gap-2 text-sm text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:[d.jsx(RT,{className:"w-4 h-4"}),"Back to Webhooks"]}),d.jsxs("button",{onClick:()=>t(!e),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm transition-colors ${e?"border-azure-primary dark:border-matrix-highlight bg-azure-active dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800"}`,children:[d.jsx(mA,{className:"w-4 h-4"}),"Unread only"]}),l>0&&d.jsxs("button",{onClick:h,className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-sm text-azure-text-secondary dark:text-matrix-dim hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:[d.jsx(qT,{className:"w-4 h-4"}),"Mark all read"]})]})]}),d.jsx(qe.div,{variants:Gw,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-hidden",children:d.jsx("div",{className:"overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["","Webhook","Status","Created","Completed","Actions"].map(g=>d.jsx("th",{className:"px-4 py-3 text-left font-semibold text-azure-text-secondary dark:text-matrix-dim",children:g},g))})}),d.jsx("tbody",{children:s.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:6,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:e?"No unread notifications.":"No notifications yet."})}):s.map(g=>d.jsxs("tr",{className:`border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-800/50 transition-colors ${g.read?"":"bg-blue-50/40 dark:bg-blue-900/10"}`,children:[d.jsx("td",{className:"px-4 py-3 w-6",children:!g.read&&d.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500 dark:bg-matrix-highlight"})}),d.jsx("td",{className:"px-4 py-3 font-mono font-medium text-azure-text-primary dark:text-matrix-text",children:g.webhook_name}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(Yw,{status:g.status})}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:Oc(g.created_at)}),d.jsx("td",{className:"px-4 py-3 text-xs text-azure-text-secondary dark:text-matrix-dim whitespace-nowrap",children:g.completed_at?Oc(g.completed_at):"—"}),d.jsx("td",{className:"px-4 py-3",children:d.jsx("button",{onClick:()=>m(g),title:"View details",className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim hover:text-azure-primary dark:hover:text-matrix-highlight transition-colors",children:d.jsx(Il,{className:"w-4 h-4"})})})]},g.id))})]})})}),d.jsxs(vr,{open:!!n,onOpenChange:g=>!g&&a(null),children:[d.jsx(kr,{children:d.jsxs(wr,{className:"text-azure-text-primary dark:text-matrix-highlight flex items-center gap-2",children:[d.jsx(Nl,{className:"w-4 h-4"}),n?.webhook_name]})}),n&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[65vh]",children:[d.jsxs("div",{className:"flex items-center gap-4 text-xs text-azure-text-secondary dark:text-matrix-dim",children:[d.jsx(Yw,{status:n.status}),d.jsx("span",{children:Oc(n.created_at)}),n.completed_at&&d.jsxs("span",{children:["→ ",Oc(n.completed_at)]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Received Payload"}),d.jsx("pre",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-44 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:OF(n.payload)})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-dim mb-1.5",children:"Agent Result"}),d.jsx("div",{className:"bg-azure-bg dark:bg-zinc-950 rounded-lg p-3 text-xs font-mono overflow-auto max-h-64 text-azure-text-primary dark:text-matrix-text border border-azure-border dark:border-matrix-primary/30 whitespace-pre-wrap",children:n.result??d.jsx("span",{className:"text-yellow-600 dark:text-yellow-400 animate-pulse",children:"Processing…"})})]}),d.jsx("div",{className:"flex justify-end pt-2",children:d.jsx("button",{onClick:()=>a(null),className:"px-4 py-2 rounded-lg border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-dim text-sm hover:bg-azure-surface dark:hover:bg-zinc-800 transition-colors",children:"Close"})})]})]})]})},MF={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Rc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}},DF={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"};function $F({status:e}){return e==="completed"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[d.jsx(wS,{className:"w-4 h-4"}),"Completed"]}):e==="failed"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600 dark:text-red-400",children:[d.jsx(Km,{className:"w-4 h-4"}),"Failed"]}):e==="running"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[d.jsx(zA,{className:"w-4 h-4 animate-spin"}),"Running"]}):e==="cancelled"?d.jsxs("span",{className:"inline-flex items-center gap-1 text-zinc-500 dark:text-zinc-400",children:[d.jsx(Km,{className:"w-4 h-4"}),"Cancelled"]}):d.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[d.jsx(Ia,{className:"w-4 h-4"}),"Pending"]})}const Kw=e=>e?new Date(e).toLocaleString():"—";function LF(){const[e,t]=z.useState(""),[n,a]=z.useState(""),[s,u]=z.useState(""),[l,f]=z.useState(""),[h,m]=z.useState(null),g=z.useMemo(()=>({status:e||void 0,agent:n||void 0,origin_channel:s||void 0,session_id:l.trim()||void 0,limit:200}),[e,n,s,l]),{data:y}=kt("/tasks/stats",()=>Ns.stats(),{refreshInterval:5e3}),{data:v=[],mutate:b}=kt(["/tasks",g],()=>Ns.list(g),{refreshInterval:3e3});return d.jsxs(qe.div,{variants:MF,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(qe.div,{variants:Rc,className:"flex items-center gap-3",children:[d.jsx(Xm,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Tasks"}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:"Async tasks delegated by Oracle and processed by workers."})]})]}),d.jsxs(qe.div,{variants:Rc,className:"grid grid-cols-2 md:grid-cols-6 gap-3",children:[d.jsx(js,{label:"Pending",value:y?.pending??0}),d.jsx(js,{label:"Running",value:y?.running??0}),d.jsx(js,{label:"Completed",value:y?.completed??0}),d.jsx(js,{label:"Failed",value:y?.failed??0}),d.jsx(js,{label:"Cancelled",value:y?.cancelled??0}),d.jsx(js,{label:"Total",value:y?.total??0})]}),d.jsxs(qe.div,{variants:Rc,className:"rounded-lg border border-azure-border dark:border-matrix-primary p-4 bg-azure-surface dark:bg-zinc-950 grid grid-cols-1 md:grid-cols-4 gap-3",children:[d.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:e,onChange:S=>t(S.target.value||""),children:[d.jsx("option",{value:"",children:"All status"}),Object.entries(DF).map(([S,j])=>d.jsx("option",{value:S,children:j},S))]}),d.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:n,onChange:S=>a(S.target.value||""),children:[d.jsx("option",{value:"",children:"All agents"}),d.jsx("option",{value:"apoc",children:"Apoc"}),d.jsx("option",{value:"neo",children:"Neo"})]}),d.jsxs("select",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:s,onChange:S=>u(S.target.value||""),children:[d.jsx("option",{value:"",children:"All channels"}),d.jsx("option",{value:"telegram",children:"Telegram"}),d.jsx("option",{value:"ui",children:"UI"}),d.jsx("option",{value:"api",children:"API"}),d.jsx("option",{value:"webhook",children:"Webhook"}),d.jsx("option",{value:"cli",children:"CLI"})]}),d.jsx("input",{className:"px-3 py-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-black text-azure-text-primary dark:text-matrix-secondary",value:l,onChange:S=>f(S.target.value),placeholder:"Filter by session id"})]}),d.jsx(qe.div,{variants:Rc,className:"rounded-lg border border-azure-border dark:border-matrix-primary overflow-x-auto",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-azure-surface dark:bg-zinc-900 border-b border-azure-border dark:border-matrix-primary",children:d.jsx("tr",{children:["Task ID","Status","Agent","Channel","Session","Attempts","Created","Finished","Actions"].map(S=>d.jsx("th",{className:"text-left px-4 py-3 font-semibold text-azure-text-secondary dark:text-matrix-dim",children:S},S))})}),d.jsx("tbody",{children:v.length===0?d.jsx("tr",{children:d.jsx("td",{colSpan:9,className:"px-4 py-10 text-center text-azure-text-secondary dark:text-matrix-dim",children:"No tasks found."})}):v.map(S=>d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 hover:bg-azure-surface/50 dark:hover:bg-zinc-900/40 transition-colors",children:[d.jsx("td",{className:"px-4 py-3 font-mono",children:S.id.slice(0,8)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx($F,{status:S.status})}),d.jsx("td",{className:"px-4 py-3",children:S.agent.toUpperCase()}),d.jsx("td",{className:"px-4 py-3",children:S.origin_channel.toUpperCase()}),d.jsx("td",{className:"px-4 py-3 font-mono",children:S.session_id}),d.jsxs("td",{className:"px-4 py-3",children:[S.attempt_count,"/",S.max_attempts]}),d.jsx("td",{className:"px-4 py-3",children:Kw(S.created_at)}),d.jsx("td",{className:"px-4 py-3",children:Kw(S.finished_at)}),d.jsxs("td",{className:"px-4 py-3 flex items-center gap-1",children:[d.jsx("button",{onClick:()=>m(S),className:"p-1.5 rounded hover:bg-azure-border dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-dim",children:d.jsx(Il,{className:"w-4 h-4"})}),(S.status==="pending"||S.status==="running")&&d.jsx("button",{onClick:async()=>{await Ns.cancel(S.id),await b()},title:"Cancel task",className:"p-1.5 rounded hover:bg-red-100 dark:hover:bg-red-900/30 text-red-500 dark:text-red-400",children:d.jsx($T,{className:"w-4 h-4"})})]})]},S.id))})]})}),d.jsxs(vr,{open:!!h,onOpenChange:S=>!S&&m(null),children:[d.jsx(kr,{children:d.jsx(wr,{className:"text-azure-text-primary dark:text-matrix-highlight",children:"Task Details"})}),h&&d.jsxs("div",{className:"p-6 space-y-4 overflow-y-auto max-h-[70vh] text-sm",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-azure-text-secondary dark:text-matrix-dim",children:[d.jsxs("div",{children:[d.jsx("b",{children:"ID:"})," ",d.jsx("span",{className:"font-mono",children:h.id})]}),d.jsxs("div",{children:[d.jsx("b",{children:"Status:"})," ",h.status]}),d.jsxs("div",{children:[d.jsx("b",{children:"Agent:"})," ",h.agent]}),d.jsxs("div",{children:[d.jsx("b",{children:"Origin:"})," ",h.origin_channel]}),d.jsxs("div",{children:[d.jsx("b",{children:"Session:"})," ",d.jsx("span",{className:"font-mono",children:h.session_id})]}),d.jsxs("div",{children:[d.jsx("b",{children:"Attempts:"})," ",h.attempt_count,"/",h.max_attempts]})]}),d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1",children:"Input"}),d.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.input})]}),h.output&&d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1",children:"Output"}),d.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-azure-border dark:border-matrix-primary/30 p-3 bg-azure-bg dark:bg-zinc-950",children:h.output})]}),h.error&&d.jsxs("section",{children:[d.jsx("p",{className:"font-medium mb-1 text-red-600 dark:text-red-400",children:"Error"}),d.jsx("pre",{className:"text-xs whitespace-pre-wrap rounded-lg border border-red-200 dark:border-red-900/50 p-3 bg-red-50 dark:bg-red-950/40",children:h.error})]}),(h.status==="failed"||h.status==="pending"||h.status==="running")&&d.jsxs("div",{className:"flex justify-end gap-2",children:[(h.status==="pending"||h.status==="running")&&d.jsx("button",{onClick:async()=>{await Ns.cancel(h.id),m(null),await b()},className:"px-4 py-2 rounded-lg border border-red-400 dark:border-red-500 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 text-sm",children:"Cancel Task"}),h.status==="failed"&&d.jsx("button",{onClick:async()=>{await Ns.retry(h.id),m(null),await b()},className:"px-4 py-2 rounded-lg bg-azure-primary text-white dark:bg-matrix-highlight dark:text-black text-sm",children:"Retry Task"})]})]})]})]})}function js({label:e,value:t}){return d.jsxs("div",{className:"rounded-lg border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950 px-4 py-3",children:[d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:e}),d.jsx("p",{className:"text-xl font-semibold text-azure-text-primary dark:text-matrix-highlight",children:t})]})}const Hm={postgresql:5432,mysql:3306,mongodb:27017,sqlite:0},Xw={name:"",type:"postgresql",host:"",port:"",database_name:"",username:"",password:"",connection_string:"",allow_read:!0,allow_insert:!1,allow_update:!1,allow_delete:!1,allow_ddl:!1},PF={postgresql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mysql:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],sqlite:[{key:"allow_read",label:"SELECT",description:"Permite consultas SELECT"},{key:"allow_insert",label:"INSERT",description:"Permite inserir registros"},{key:"allow_update",label:"UPDATE",description:"Permite atualizar registros"},{key:"allow_delete",label:"DELETE",description:"Permite excluir registros"},{key:"allow_ddl",label:"DDL",description:"CREATE / ALTER / DROP TABLE"}],mongodb:[{key:"allow_read",label:"find / aggregate",description:"Permite consultas e agregações"},{key:"allow_insert",label:"insertOne / insertMany",description:"Permite inserir documentos"},{key:"allow_update",label:"updateOne / updateMany",description:"Permite atualizar documentos"},{key:"allow_delete",label:"deleteOne / deleteMany",description:"Permite excluir documentos"},{key:"allow_ddl",label:"Schema changes",description:"createCollection / dropCollection / createIndex"}]};async function UF(){return xe.get("/trinity/databases")}function VF(){const{data:e,error:t}=kt("/trinity/databases",UF,{refreshInterval:3e4}),[n,a]=z.useState(!1),[s,u]=z.useState(null),[l,f]=z.useState(Xw),[h,m]=z.useState(!1),[g,y]=z.useState(null),[v,b]=z.useState({}),[S,j]=z.useState(null),[A,E]=z.useState({}),[O,N]=z.useState(null),[L,D]=z.useState(null),[R,q]=z.useState(null),[B,X]=z.useState(!1),fe=()=>{u(null),f(Xw),X(!1),y(null),a(!0)},se=w=>{u(w),f({name:w.name,type:w.type,host:w.host||"",port:w.port?String(w.port):"",database_name:w.database_name||"",username:w.username||"",password:"",connection_string:"",allow_read:w.allow_read,allow_insert:w.allow_insert,allow_update:w.allow_update,allow_delete:w.allow_delete,allow_ddl:w.allow_ddl}),X(!!w.connection_string),y(null),a(!0)},le=async()=>{if(m(!0),y(null),!B&&!l.database_name.trim()){y(l.type==="sqlite"?"File path is required.":"Database name is required."),m(!1);return}try{const w={name:l.name,type:l.type,allow_read:l.allow_read,allow_insert:l.allow_insert,allow_update:l.allow_update,allow_delete:l.allow_delete,allow_ddl:l.allow_ddl};B?(!s||l.connection_string)&&(w.connection_string=l.connection_string||null):(w.host=l.host||null,w.port=l.port?parseInt(l.port):null,w.database_name=l.database_name||null,w.username=l.username||null,(!s||l.password)&&(w.password=l.password||null)),s?await xe.put(`/trinity/databases/${s.id}`,w):await xe.post("/trinity/databases",w),await On("/trinity/databases"),a(!1)}catch(w){y(w.message||"Failed to save database")}finally{m(!1)}},ee=w=>{q(w)},oe=async()=>{if(!R)return;const w=R.id;D(w);try{await xe.delete(`/trinity/databases/${w}`),await On("/trinity/databases")}catch(Y){alert(`Delete failed: ${Y.message}`)}finally{D(null),q(null)}},ae=async w=>{j(w);try{const Y=await xe.post(`/trinity/databases/${w}/test`,{});E(de=>({...de,[w]:Y.success}))}catch{E(Y=>({...Y,[w]:!1}))}finally{j(null)}},P=async w=>{N(w);try{await xe.post(`/trinity/databases/${w}/refresh-schema`,{}),await On("/trinity/databases")}catch(Y){alert(`Schema refresh failed: ${Y.message}`)}finally{N(null)}},J=w=>{b(Y=>({...Y,[w]:!Y[w]}))},Z=w=>{w!=="mongodb"&&X(!1),f(Y=>({...Y,type:w,port:Hm[w]?String(Hm[w]):""}))},me=w=>{f(Y=>({...Y,[w]:!Y[w]}))};if(t)return d.jsxs("div",{className:"p-8 text-red-500",children:["Failed to load databases: ",t.message]});const T="w-full px-3 py-2 bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none focus:border-azure-primary dark:focus:border-matrix-highlight",C="block text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-1",I=w=>[{key:"allow_read",badge:"R"},{key:"allow_insert",badge:"I"},{key:"allow_update",badge:"U"},{key:"allow_delete",badge:"D"},{key:"allow_ddl",badge:"DDL"}].filter(de=>w[de.key]).map(de=>de.badge);return d.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx($s,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsx("h1",{className:"text-2xl font-bold text-azure-primary dark:text-matrix-highlight",children:"Trinity Databases"})]}),d.jsxs("button",{onClick:fe,className:"flex items-center gap-2 px-4 py-2 bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors text-sm font-medium",children:[d.jsx(fd,{className:"w-4 h-4"}),"Register Database"]})]}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary",children:"Register databases for Trinity to access. Configure permissions to control what operations Trinity can perform on each database."}),e?e.length===0?d.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded p-8 text-center text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx($s,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),d.jsx("p",{className:"font-medium",children:"No databases registered"}),d.jsx("p",{className:"text-sm mt-1 opacity-70",children:'Click "Register Database" to add your first database.'})]}):d.jsx("div",{className:"space-y-4",children:e.map(w=>{const Y=w.schema_json?JSON.parse(w.schema_json):null,de=!!Y?.databases,he=de?Y.databases.reduce((Ne,Ge)=>Ne+Ge.tables.length,0):Y?.tables?.length??0,pe=de?Y.databases.length:0,Pe=w.type==="mongodb"?"collection":"table",Ae=w.type==="mongodb"?"collections":"tables",pt=A[w.id],Rt=v[w.id],V=I(w);return d.jsxs("div",{className:"border border-azure-border dark:border-matrix-primary rounded-lg overflow-hidden",children:[d.jsxs("div",{className:"bg-azure-surface dark:bg-black/50 px-4 py-3 flex items-center gap-3",children:[d.jsx($s,{className:"w-5 h-5 text-azure-primary dark:text-matrix-highlight flex-shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:"font-bold text-azure-text-primary dark:text-matrix-highlight truncate",children:w.name}),d.jsx("span",{className:"text-xs px-2 py-0.5 rounded border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary uppercase flex-shrink-0",children:w.type}),pt===!0&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[d.jsx(Xh,{className:"w-3 h-3"})," Connected"]}),pt===!1&&d.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[d.jsx(s4,{className:"w-3 h-3"})," Failed"]}),V.length>0&&d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(P0,{className:"w-3 h-3 text-azure-text-secondary dark:text-matrix-secondary opacity-60"}),V.map(Ne=>d.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight font-mono",children:Ne},Ne))]})]}),d.jsxs("div",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary truncate mt-0.5",children:[w.host?`${w.host}:${w.port}${w.database_name?`/${w.database_name}`:""}`:w.database_name||"connection string configured",de&&pe>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",pe," database",pe!==1?"s":""," · ",he," ",he!==1?Ae:Pe]}),!de&&he>0&&d.jsxs("span",{className:"ml-2 opacity-70",children:["· ",he," ",he!==1?Ae:Pe]}),w.schema_updated_at&&d.jsxs("span",{className:"ml-2 opacity-50",children:["· schema ",new Date(w.schema_updated_at).toLocaleDateString()]})]})]}),d.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d.jsx("button",{onClick:()=>ae(w.id),disabled:S===w.id,title:"Test connection",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:S===w.id?d.jsx(Xh,{className:"w-4 h-4 animate-pulse"}):d.jsx(Xh,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>P(w.id),disabled:O===w.id,title:"Refresh schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:d.jsx(yl,{className:`w-4 h-4 ${O===w.id?"animate-spin":""}`})}),d.jsx("button",{onClick:()=>se(w),title:"Edit",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors text-xs font-medium px-2",children:"Edit"}),d.jsx("button",{onClick:()=>ee(w),disabled:L===w.id,title:"Delete",className:"p-1.5 rounded hover:bg-red-50 dark:hover:bg-red-900/20 text-red-500 transition-colors",children:d.jsx(Ti,{className:"w-4 h-4"})}),Y&&d.jsx("button",{onClick:()=>J(w.id),title:Rt?"Hide schema":"Show schema",className:"p-1.5 rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 text-azure-text-secondary dark:text-matrix-secondary transition-colors",children:Rt?d.jsx(KT,{className:"w-4 h-4"}):d.jsx(JT,{className:"w-4 h-4"})})]})]}),Rt&&Y&&d.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary px-4 py-3 bg-azure-bg dark:bg-black/20",children:[d.jsx("div",{className:"text-xs font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:de?`${pe} database${pe!==1?"s":""} — ${he} ${he!==1?Ae:Pe} total`:`Schema — ${he} ${he!==1?Ae:Pe}`}),d.jsx("div",{className:"space-y-2 max-h-72 overflow-y-auto",children:de?Y.databases?.map(Ne=>d.jsxs("div",{className:"text-xs",children:[d.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[d.jsx("span",{className:"font-bold text-azure-primary dark:text-matrix-highlight",children:Ne.name}),d.jsxs("span",{className:"opacity-40 text-azure-text-secondary dark:text-matrix-secondary",children:["(",Ne.tables.length," ",Ne.tables.length!==1?Ae:Pe,")"]})]}),d.jsxs("div",{className:"pl-3 space-y-1.5 border-l border-azure-border dark:border-matrix-primary/40 ml-1",children:[Ne.tables.map(Ge=>d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-azure-text-primary dark:text-matrix-secondary mb-0.5",children:Ge.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:Ge.columns?.map(Lt=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{children:Lt.name}),d.jsx("span",{className:"opacity-50 ml-2",children:Lt.type}),Lt.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40",children:"NOT NULL"})]},Lt.name))})]},Ge.name)),Ne.tables.length===0&&d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary opacity-50 italic",children:["no ",Ae]})]})]},Ne.name)):Y.tables?.map(Ne=>d.jsxs("div",{className:"text-xs",children:[d.jsx("div",{className:"font-bold text-azure-primary dark:text-matrix-highlight mb-1",children:Ne.name}),d.jsx("div",{className:"pl-3 space-y-0.5",children:Ne.columns?.map(Ge=>d.jsxs("div",{className:"text-azure-text-secondary dark:text-matrix-secondary font-mono",children:[d.jsx("span",{className:"text-azure-text-primary dark:text-matrix-secondary",children:Ge.name}),d.jsx("span",{className:"opacity-50 ml-2",children:Ge.type}),Ge.nullable===!1&&d.jsx("span",{className:"ml-1 opacity-40 text-xs",children:"NOT NULL"})]},Ge.name))})]},Ne.name))})]})]},w.id)})}):d.jsx("div",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:"Loading..."}),d.jsx(nj,{isOpen:!!R,onClose:()=>q(null),onConfirm:oe,title:"Delete database",description:`Remove "${R?.name}" from Trinity? The database itself won't be affected — only this registration will be deleted.`,confirmJson:"Delete",variant:"destructive"}),n&&d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>a(!1)}),d.jsxs("div",{className:"relative bg-azure-surface dark:bg-black border border-azure-border dark:border-matrix-primary rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[90vh] overflow-y-auto",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight",children:s?"Edit Database":"Register Database"}),d.jsx("button",{onClick:()=>a(!1),className:"text-azure-text-secondary dark:text-matrix-secondary hover:text-azure-text-primary dark:hover:text-matrix-highlight",children:d.jsx(og,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Name *"}),d.jsx("input",{className:T,value:l.name,onChange:w=>f(Y=>({...Y,name:w.target.value})),placeholder:"My Production DB"})]}),d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Type *"}),d.jsxs("select",{className:T,value:l.type,onChange:w=>Z(w.target.value),children:[d.jsx("option",{value:"postgresql",children:"PostgreSQL"}),d.jsx("option",{value:"mysql",children:"MySQL / MariaDB"}),d.jsx("option",{value:"sqlite",children:"SQLite"}),d.jsx("option",{value:"mongodb",children:"MongoDB"})]})]}),l.type==="mongodb"&&d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{type:"button",onClick:()=>X(!1),className:`text-xs px-3 py-1.5 rounded border transition-colors ${B?"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary":"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight"}`,children:"Individual fields"}),d.jsx("button",{type:"button",onClick:()=>X(!0),className:`text-xs px-3 py-1.5 rounded border transition-colors ${B?"border-azure-primary dark:border-matrix-highlight bg-azure-primary/10 dark:bg-matrix-highlight/10 text-azure-primary dark:text-matrix-highlight":"border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary"}`,children:"Connection string"})]}),l.type==="mongodb"&&B?d.jsxs("div",{children:[d.jsxs("label",{className:C,children:["Connection String ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:T,type:"password",value:l.connection_string,onChange:w=>f(Y=>({...Y,connection_string:w.target.value})),placeholder:s?"unchanged":"mongodb://user:pass@host:27017/dbname"}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]}):d.jsxs(d.Fragment,{children:[l.type!=="sqlite"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Host"}),d.jsx("input",{className:T,value:l.host,onChange:w=>f(Y=>({...Y,host:w.target.value})),placeholder:"localhost"})]}),d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Port"}),d.jsx("input",{className:T,type:"number",value:l.port,onChange:w=>f(Y=>({...Y,port:w.target.value})),placeholder:String(Hm[l.type]||"")})]})]}),d.jsxs("div",{children:[d.jsxs("label",{className:C,children:[l.type==="sqlite"?"File Path":"Database Name"," *"]}),d.jsx("input",{className:`w-full px-3 py-2 bg-azure-surface dark:bg-black border rounded text-azure-text-primary dark:text-matrix-secondary font-mono text-sm focus:outline-none ${g&&!l.database_name.trim()?"border-red-500 dark:border-red-500":"border-azure-border dark:border-matrix-primary focus:border-azure-primary dark:focus:border-matrix-highlight"}`,value:l.database_name,onChange:w=>f(Y=>({...Y,database_name:w.target.value})),placeholder:l.type==="sqlite"?"/path/to/database.db":"mydb"})]}),l.type!=="sqlite"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:C,children:"Username"}),d.jsx("input",{className:T,value:l.username,onChange:w=>f(Y=>({...Y,username:w.target.value})),placeholder:"postgres"})]}),d.jsxs("div",{children:[d.jsxs("label",{className:C,children:["Password ",s&&d.jsx("span",{className:"opacity-60",children:"(leave blank to keep existing)"})]}),d.jsx("input",{className:T,type:"password",value:l.password,onChange:w=>f(Y=>({...Y,password:w.target.value})),placeholder:s?"unchanged":"••••••••"}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mt-1",children:"Stored encrypted with AES-256-GCM. Requires MORPHEUS_SECRET env var."})]})]})]}),d.jsxs("div",{className:"border-t border-azure-border dark:border-matrix-primary pt-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(P0,{className:"w-4 h-4 text-azure-primary dark:text-matrix-highlight"}),d.jsx("span",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight",children:"Permissões"})]}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary mb-3",children:"Defina quais operações Trinity pode executar neste banco. Operações não permitidas retornarão erro de permissão."}),d.jsx("div",{className:"space-y-2",children:PF[l.type]?.map(({key:w,label:Y,description:de})=>d.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[d.jsxs("div",{className:"relative mt-0.5 flex-shrink-0",children:[d.jsx("input",{type:"checkbox",checked:!!l[w],onChange:()=>me(w),className:"sr-only"}),d.jsx("div",{className:`w-4 h-4 rounded border transition-colors flex items-center justify-center ${l[w]?"bg-azure-primary dark:bg-matrix-highlight border-azure-primary dark:border-matrix-highlight":"border-azure-border dark:border-matrix-primary bg-transparent"}`,children:l[w]&&d.jsx("svg",{className:"w-2.5 h-2.5 text-white dark:text-black",fill:"none",viewBox:"0 0 10 10",children:d.jsx("path",{d:"M1.5 5l2.5 2.5L8.5 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-sm text-azure-text-primary dark:text-matrix-secondary font-mono",children:Y}),d.jsx("p",{className:"text-xs text-azure-text-secondary dark:text-matrix-secondary opacity-70",children:de})]})]},w))})]}),g&&d.jsx("div",{className:"text-sm text-red-500 border border-red-500/30 bg-red-500/10 rounded px-3 py-2",children:g})]}),d.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-azure-border dark:border-matrix-primary",children:[d.jsx("button",{onClick:()=>a(!1),className:"px-4 py-2 text-sm text-azure-text-secondary dark:text-matrix-secondary border border-azure-border dark:border-matrix-primary rounded hover:bg-azure-hover dark:hover:bg-matrix-primary/30 transition-colors",children:"Cancel"}),d.jsx("button",{onClick:le,disabled:h||!l.name,className:"px-4 py-2 text-sm font-medium bg-azure-primary text-white rounded hover:bg-azure-active dark:bg-matrix-highlight dark:text-black dark:hover:bg-matrix-highlight/90 transition-colors disabled:opacity-50",children:h?"Saving...":s?"Update":"Register"})]})]})]})]})}const BF={running:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",success:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",failed:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",timeout:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400"};function ZF({jobId:e}){const{data:t,isLoading:n}=r9(e,50);return n?d.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary animate-pulse",children:"Loading history…"}):!t||t.length===0?d.jsx("div",{className:"p-4 dark:bg-zinc-900 rounded text-sm dark:text-matrix-secondary italic",children:"No executions yet."}):d.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary dark:bg-zinc-900 overflow-hidden",children:d.jsxs("table",{className:"w-full text-xs font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Triggered At"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Completed At"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Status"}),d.jsx("th",{className:"text-left px-3 py-2 text-azure-text-muted dark:text-matrix-tertiary",children:"Error"})]})}),d.jsx("tbody",{children:t.map(a=>d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0",children:[d.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:new Date(a.triggered_at).toLocaleString()}),d.jsx("td",{className:"px-3 py-2 dark:text-matrix-secondary",children:a.completed_at?new Date(a.completed_at).toLocaleString():"—"}),d.jsx("td",{className:"px-3 py-2",children:d.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold uppercase ${BF[a.status]}`,children:a.status})}),d.jsx("td",{className:"px-3 py-2 dark:text-red-400 max-w-xs truncate",children:a.error??"—"})]},a.id))})]})})}function IF({enabled:e}){return d.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold uppercase ${e?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-zinc-800 dark:text-matrix-tertiary"}`,children:e?"Enabled":"Disabled"})}function Jw(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function Qw(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function HF({onEdit:e}){const{data:t,isLoading:n}=n9(),[a,s]=z.useState(null),[u,l]=z.useState(null),[f,h]=z.useState(null),m=async y=>{l(y.id);try{y.enabled?await Ei.disableJob(y.id):await Ei.enableJob(y.id),await On(v=>typeof v=="string"&&v.startsWith("/chronos"))}finally{l(null)}},g=async()=>{if(f){l(f.id);try{await Ei.deleteJob(f.id),await On(y=>typeof y=="string"&&y.startsWith("/chronos"))}finally{l(null),h(null)}}};return n?d.jsx("div",{className:"rounded border border-azure-border dark:border-matrix-primary p-8 text-center dark:text-matrix-secondary animate-pulse",children:"Loading jobs…"}):!t||t.length===0?d.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary p-8 text-center dark:text-matrix-secondary",children:["No Chronos jobs yet. Click ",d.jsx("strong",{className:"dark:text-matrix-highlight",children:"New Job"})," to get started."]}):d.jsxs("div",{className:"rounded border border-azure-border dark:border-matrix-primary overflow-hidden",children:[d.jsxs("table",{className:"w-full text-sm font-mono",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900",children:[d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Prompt"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden md:table-cell",children:"Schedule"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden lg:table-cell",children:"Next Run"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium hidden lg:table-cell",children:"Last Run"}),d.jsx("th",{className:"text-left px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium",children:"Status"}),d.jsx("th",{className:"px-4 py-3 text-azure-text-muted dark:text-matrix-tertiary font-medium text-right",children:"Actions"})]})}),d.jsx("tbody",{children:t.map(y=>d.jsxs(d.Fragment,{children:[d.jsxs("tr",{className:"border-b border-azure-border dark:border-matrix-primary/30 last:border-0 hover:bg-azure-hover dark:hover:bg-matrix-primary/10 transition-colors",children:[d.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary max-w-xs",children:[d.jsx("span",{title:y.prompt,children:Jw(y.prompt,50)}),d.jsx("div",{className:"text-xs text-azure-text-muted dark:text-matrix-tertiary",children:y.created_by})]}),d.jsxs("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden md:table-cell text-xs",children:[d.jsx("div",{className:"capitalize",children:y.schedule_type}),d.jsx("div",{className:"text-azure-text-muted dark:text-matrix-tertiary truncate max-w-[140px]",title:y.schedule_expression,children:y.schedule_expression})]}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Qw(y.next_run_at)}),d.jsx("td",{className:"px-4 py-3 dark:text-matrix-secondary hidden lg:table-cell text-xs",children:Qw(y.last_run_at)}),d.jsx("td",{className:"px-4 py-3",children:d.jsx(IF,{enabled:y.enabled})}),d.jsx("td",{className:"px-4 py-3",children:d.jsxs("div",{className:"flex items-center justify-end gap-1",children:[d.jsx("button",{title:a===y.id?"Hide history":"View history",onClick:()=>s(a===y.id?null:y.id),className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors",children:a===y.id?d.jsx(WT,{className:"w-4 h-4"}):d.jsx(yA,{className:"w-4 h-4"})}),d.jsx("button",{title:"Edit",onClick:()=>e(y),className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors",children:d.jsx(MA,{className:"w-4 h-4"})}),d.jsx("button",{title:y.enabled?"Disable":"Enable",onClick:()=>m(y),disabled:u===y.id,className:"p-1.5 rounded dark:text-matrix-tertiary dark:hover:text-matrix-highlight hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors disabled:opacity-40",children:y.enabled?d.jsx(OA,{className:"w-4 h-4"}):d.jsx(LA,{className:"w-4 h-4"})}),d.jsx("button",{title:"Delete",onClick:()=>h(y),disabled:u===y.id,className:"p-1.5 rounded text-red-500 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-40",children:d.jsx(Ti,{className:"w-4 h-4"})})]})})]},y.id),a===y.id&&d.jsx("tr",{className:"bg-azure-surface dark:bg-zinc-900/50",children:d.jsxs("td",{colSpan:6,className:"px-4 py-3",children:[d.jsx("div",{className:"text-xs font-bold dark:text-matrix-highlight mb-2",children:"Execution History"}),d.jsx(ZF,{jobId:y.id})]})},`${y.id}-history`)]}))})]}),d.jsx(S2,{isOpen:!!f,onClose:()=>h(null),onConfirm:g,title:"Delete Chronos Job",message:f?`Delete job "${Jw(f.prompt,60)}"? This action cannot be undone.`:""})]})}function FF({scheduleExpression:e,scheduleType:t,timezone:n}){const[a,s]=z.useState(null),[u,l]=z.useState(null),f=z.useRef(null);if(z.useEffect(()=>{if(!e.trim()){s(null),l(null);return}return f.current&&clearTimeout(f.current),f.current=setTimeout(async()=>{try{const m=await Ei.preview(e,t,n);s(m),l(null)}catch(m){l(m.message??"Invalid expression"),s(null)}},500),()=>{f.current&&clearTimeout(f.current)}},[e,t,n]),!e.trim())return null;const h=(m,g)=>{try{return new Date(m).toLocaleString("pt-BR",{timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return new Date(m).toLocaleString()}};return d.jsx("div",{className:"mt-2 rounded border border-azure-border dark:border-matrix-primary bg-azure-surface dark:bg-zinc-900 p-3 text-sm",children:u?d.jsxs("p",{className:"text-red-500 dark:text-red-400 flex items-center gap-1.5",children:[d.jsx("span",{children:"⚠"})," ",u]}):a?d.jsxs("div",{className:"space-y-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-azure-text-secondary dark:text-matrix-secondary",children:[d.jsx(Ia,{className:"w-3.5 h-3.5 text-azure-primary dark:text-matrix-highlight shrink-0"}),d.jsx("span",{className:"font-medium dark:text-matrix-highlight",children:"Next run:"}),d.jsx("span",{children:h(a.next_run_at,n||"UTC")})]}),a.human_readable&&d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-secondary/70 pl-5",children:a.human_readable}),a.next_occurrences.length>0&&d.jsx("div",{className:"pl-5 space-y-0.5",children:a.next_occurrences.map((m,g)=>d.jsxs("p",{className:"text-azure-text-muted dark:text-matrix-tertiary text-xs",children:["#",g+2,": ",m]},g))})]}):d.jsx("p",{className:"text-azure-text-muted dark:text-matrix-tertiary italic",children:"Parsing…"})})}const qF=["UTC","America/Sao_Paulo","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Mexico_City","America/Buenos_Aires","America/Bogota","America/Lima","America/Santiago","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Europe/Madrid","Europe/Lisbon","Europe/Moscow","Europe/Istanbul","Asia/Dubai","Asia/Kolkata","Asia/Bangkok","Asia/Singapore","Asia/Tokyo","Asia/Shanghai","Asia/Seoul","Asia/Jakarta","Australia/Sydney","Australia/Melbourne","Pacific/Auckland","Africa/Cairo","Africa/Johannesburg","Africa/Lagos"],GF=[{value:"telegram",label:"Telegram"},{value:"discord",label:"Discord"}],YF=[{value:"once",label:"Once"},{value:"cron",label:"Recurring (Cron)"},{value:"interval",label:"Recurring (Interval)"}],KF={once:'e.g. "in 30 minutes", "tomorrow at 9am", "2026-03-01T09:00:00"',cron:'e.g. "0 9 * * 1-5" (weekdays at 9am)',interval:'e.g. "every 30 minutes", "every sunday at 9am", "every weekday"'};function XF({isOpen:e,onClose:t,onCreated:n,editJob:a}){const s=!!a,{data:u}=rj(),[l,f]=z.useState(""),[h,m]=z.useState("once"),[g,y]=z.useState(""),[v,b]=z.useState("UTC"),[S,j]=z.useState([]),[A,E]=z.useState(null),[O,N]=z.useState(!1),L=R=>{j(q=>q.includes(R)?q.filter(B=>B!==R):[...q,R])};z.useEffect(()=>{a?(f(a.prompt),m(a.schedule_type),y(a.schedule_expression),b(a.timezone),j(a.notify_channels??[])):(f(""),m("once"),y(""),b(u?.timezone??"UTC"),j([])),E(null)},[a,e,u?.timezone]);const D=async()=>{if(E(null),!l.trim()){E("Prompt is required");return}if(!g.trim()){E("Schedule expression is required");return}N(!0);try{if(s&&a){const R={prompt:l,schedule_expression:g,timezone:v,notify_channels:S};await Ei.updateJob(a.id,R)}else{const R={prompt:l,schedule_type:h,schedule_expression:g,timezone:v,notify_channels:S};await Ei.createJob(R)}await On(R=>typeof R=="string"&&R.startsWith("/chronos")),n(),t()}catch(R){E(R.message??"Failed to save job")}finally{N(!1)}};return e?d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),d.jsxs("div",{className:"relative z-10 w-full max-w-lg mx-4 rounded-lg border border-azure-border dark:border-matrix-primary bg-white dark:bg-black shadow-xl",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-azure-border dark:border-matrix-primary",children:[d.jsx("h2",{className:"text-lg font-bold text-azure-text-primary dark:text-matrix-highlight font-mono",children:s?"Edit Chronos Job":"New Chronos Job"}),d.jsx("button",{onClick:t,className:"p-1 rounded text-azure-text-muted dark:text-matrix-tertiary hover:text-azure-text-primary dark:hover:text-matrix-highlight transition-colors",children:d.jsx(og,{className:"w-5 h-5"})})]}),d.jsxs("div",{className:"p-4 space-y-4",children:[d.jsx(Qe,{label:"Prompt",value:l,onChange:R=>f(R.target.value),placeholder:"What should the Oracle do when this job triggers?"}),!s&&d.jsx(Er,{label:"Schedule Type",value:h,onChange:R=>m(R.target.value),options:YF}),d.jsxs("div",{children:[d.jsx(Qe,{label:"Schedule Expression",value:g,onChange:R=>y(R.target.value),placeholder:KF[h]}),d.jsx(FF,{scheduleExpression:g,scheduleType:h,timezone:v})]}),d.jsx(Er,{label:"Timezone",value:v,onChange:R=>b(R.target.value),options:qF.map(R=>({value:R,label:R}))}),d.jsxs("div",{children:[d.jsxs("p",{className:"text-sm font-medium text-azure-text-secondary dark:text-matrix-secondary mb-2",children:["Notify Channels ",d.jsx("span",{className:"text-xs font-normal opacity-60",children:"(empty = all active channels)"})]}),d.jsx("div",{className:"flex gap-4",children:GF.map(({value:R,label:q})=>d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:S.includes(R),onChange:()=>L(R),className:"rounded border-azure-border dark:border-matrix-primary accent-azure-primary dark:accent-matrix-highlight"}),d.jsx("span",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary capitalize",children:q})]},R))})]}),A&&d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:A})]}),d.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-azure-border dark:border-matrix-primary",children:[d.jsx("button",{onClick:t,className:"px-4 py-2 rounded text-sm border border-azure-border dark:border-matrix-primary text-azure-text-secondary dark:text-matrix-secondary hover:bg-azure-hover dark:hover:bg-matrix-primary/20 transition-colors font-mono",children:"Cancel"}),d.jsx("button",{onClick:D,disabled:O,className:"px-4 py-2 rounded text-sm bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight font-bold hover:opacity-90 disabled:opacity-50 transition-opacity font-mono",children:O?"Saving…":s?"Update":"Create"})]})]})]}):null}function JF(){const[e,t]=z.useState(!1),[n,a]=z.useState(null),s=f=>{a(f),t(!0)},u=()=>{t(!1),a(null)},l=()=>{On(f=>typeof f=="string"&&f.startsWith("/chronos"))};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Ia,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Chronos"}),d.jsx("p",{className:"text-sm text-azure-text-muted dark:text-matrix-secondary mt-0.5",children:"Temporal Intent Engine — schedule prompts for the Oracle"})]})]}),d.jsxs("button",{onClick:()=>{a(null),t(!0)},className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-matrix-highlight text-sm font-medium hover:opacity-90 transition-opacity",children:[d.jsx(fd,{className:"w-4 h-4"}),"New Job"]})]}),d.jsx(HF,{onEdit:s}),d.jsx(XF,{isOpen:e,onClose:u,onCreated:l,editJob:n})]})}const fl=Ba.getInstance(),hl={fetchSkills:async()=>fl.get("/skills"),fetchSkill:async e=>fl.get(`/skills/${encodeURIComponent(e)}`),reloadSkills:async()=>fl.post("/skills/reload",{}),enableSkill:async e=>fl.post(`/skills/${encodeURIComponent(e)}/enable`,{}),disableSkill:async e=>fl.post(`/skills/${encodeURIComponent(e)}/disable`,{})},Ww={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},Zc={hidden:{opacity:0,y:8},show:{opacity:1,y:0}};function QF({skill:e,onToggle:t,onView:n}){return d.jsxs(qe.div,{variants:Zc,className:`rounded-lg border p-4 transition-all ${e.enabled?"border-azure-primary dark:border-matrix-primary bg-azure-surface dark:bg-zinc-950":"border-azure-border dark:border-zinc-700 bg-azure-surface/50 dark:bg-zinc-900/50 opacity-60"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h3",{className:"font-semibold text-azure-text-primary dark:text-matrix-highlight truncate",children:e.name}),e.version&&d.jsxs("span",{className:"text-xs text-azure-text-secondary dark:text-matrix-dim",children:["v",e.version]})]}),d.jsx("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-secondary mt-1 line-clamp-2",children:e.description}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full bg-azure-primary/10 dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-primary",children:[d.jsx(ig,{className:"w-3 h-3"}),a]},a))})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:n,className:"p-2 rounded-lg hover:bg-azure-hover dark:hover:bg-zinc-800 text-azure-text-secondary dark:text-matrix-tertiary",title:"View details",children:d.jsx(Il,{className:"w-4 h-4"})}),d.jsx("button",{onClick:t,className:`p-2 rounded-lg transition-colors ${e.enabled?"text-green-600 dark:text-green-400 hover:bg-green-100 dark:hover:bg-green-900/20":"text-zinc-400 dark:text-zinc-600 hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,title:e.enabled?"Disable skill":"Enable skill",children:e.enabled?d.jsx(NS,{className:"w-5 h-5"}):d.jsx(jS,{className:"w-5 h-5"})})]})]}),e.author&&d.jsxs("div",{className:"flex items-center gap-1 mt-2 text-xs text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(sg,{className:"w-3 h-3"}),e.author]})]})}function WF({skill:e,open:t,onOpenChange:n}){return e?d.jsxs(vr,{open:t,onOpenChange:n,children:[d.jsx(kr,{children:d.jsx(wr,{children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(El,{className:"w-5 h-5"}),e.name,e.version&&d.jsxs("span",{className:"text-sm font-normal text-azure-text-secondary dark:text-matrix-dim",children:["v",e.version]})]})})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{children:d.jsx("p",{className:"text-azure-text-secondary dark:text-matrix-secondary",children:e.description})}),e.author&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(sg,{className:"w-4 h-4"}),"Author: ",e.author]}),d.jsxs("div",{className:"flex items-center gap-2 text-sm text-azure-text-tertiary dark:text-matrix-dim",children:[d.jsx(fA,{className:"w-4 h-4"}),"Path: ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:e.path})]}),e.tags&&e.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(a=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-azure-primary/10 dark:bg-matrix-primary/20 text-azure-primary dark:text-matrix-primary",children:[d.jsx(ig,{className:"w-3 h-3"}),a]},a))}),e.examples&&e.examples.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"Examples"}),d.jsx("ul",{className:"list-disc list-inside text-sm text-azure-text-secondary dark:text-matrix-secondary space-y-1",children:e.examples.map((a,s)=>d.jsx("li",{children:a},s))})]}),e.content&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium text-azure-text-primary dark:text-matrix-highlight mb-2",children:"SKILL.md Content"}),d.jsx("pre",{className:"p-3 rounded-lg bg-azure-hover dark:bg-zinc-900 text-xs overflow-auto max-h-64 text-azure-text-secondary dark:text-matrix-secondary whitespace-pre-wrap",children:e.content})]})]})]}):null}function eq(){const[e,t]=z.useState(null),[n,a]=z.useState(!1),{data:s,mutate:u,isLoading:l}=kt("/skills",()=>hl.fetchSkills(),{refreshInterval:1e4}),f=s?.skills??[],h=s?.enabled??0,m=async()=>{await hl.reloadSkills(),u()},g=async v=>{v.enabled?await hl.disableSkill(v.name):await hl.enableSkill(v.name),u()},y=async v=>{a(!0);try{const b=await hl.fetchSkill(v.name);t(b)}finally{a(!1)}};return d.jsxs(qe.div,{variants:Ww,initial:"hidden",animate:"show",className:"space-y-6",children:[d.jsxs(qe.div,{variants:Zc,className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(El,{className:"w-6 h-6 text-azure-primary dark:text-matrix-highlight"}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-2xl font-bold text-azure-text-primary dark:text-matrix-highlight",children:"Skills"}),d.jsxs("p",{className:"text-sm text-azure-text-secondary dark:text-matrix-dim",children:[f.length," skill",f.length!==1?"s":"",", ",h," enabled"]})]})]}),d.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-azure-primary dark:bg-matrix-primary text-white dark:text-black font-medium hover:opacity-90 transition-opacity",children:[d.jsx(yl,{className:"w-4 h-4"}),"Reload"]})]}),l?d.jsxs(qe.div,{variants:Zc,className:"text-center py-12",children:[d.jsx(yl,{className:"w-8 h-8 animate-spin mx-auto text-azure-text-secondary dark:text-matrix-dim"}),d.jsx("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-dim",children:"Loading skills..."})]}):f.length===0?d.jsxs(qe.div,{variants:Zc,className:"rounded-lg border border-dashed border-azure-border dark:border-matrix-primary p-8 text-center",children:[d.jsx(El,{className:"w-12 h-12 mx-auto text-azure-text-tertiary dark:text-matrix-dim"}),d.jsx("h3",{className:"mt-4 text-lg font-medium text-azure-text-primary dark:text-matrix-highlight",children:"No skills found"}),d.jsxs("p",{className:"mt-2 text-azure-text-secondary dark:text-matrix-secondary max-w-md mx-auto",children:["Add skills to ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"~/.morpheus/skills/"}),". Each skill should have a ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"skill.yaml"})," and"," ",d.jsx("code",{className:"bg-azure-hover dark:bg-zinc-800 px-1 rounded",children:"SKILL.md"})," file."]})]}):d.jsx(qe.div,{variants:Ww,initial:"hidden",animate:"show",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:f.map(v=>d.jsx(QF,{skill:v,onToggle:()=>g(v),onView:()=>y(v)},v.name))}),d.jsx(WF,{skill:e,open:!!e,onOpenChange:v=>!v&&t(null)}),n&&d.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:d.jsx(yl,{className:"w-8 h-8 animate-spin text-white"})})]})}function tq(){return d.jsx(hT,{children:d.jsxs(C0,{children:[d.jsx(tn,{path:"/login",element:d.jsx(lF,{})}),d.jsx(tn,{path:"/*",element:d.jsx(uF,{children:d.jsx(CD,{children:d.jsxs(C0,{children:[d.jsx(tn,{path:"/",element:d.jsx(AD,{})}),d.jsx(tn,{path:"/chat",element:d.jsx(t9,{})}),d.jsx(tn,{path:"/zaion",element:d.jsx(iF,{})}),d.jsx(tn,{path:"/logs",element:d.jsx(sF,{})}),d.jsx(tn,{path:"/stats",element:d.jsx(oF,{})}),d.jsx(tn,{path:"/sati-memories",element:d.jsx(yF,{})}),d.jsx(tn,{path:"/mcp-servers",element:d.jsx(zF,{})}),d.jsx(tn,{path:"/model-pricing",element:d.jsx(NF,{})}),d.jsx(tn,{path:"/webhooks",element:d.jsx(TF,{})}),d.jsx(tn,{path:"/notifications",element:d.jsx(RF,{})}),d.jsx(tn,{path:"/tasks",element:d.jsx(LF,{})}),d.jsx(tn,{path:"/trinity-databases",element:d.jsx(VF,{})}),d.jsx(tn,{path:"/chronos",element:d.jsx(JF,{})}),d.jsx(tn,{path:"/skills",element:d.jsx(eq,{})}),d.jsx(tn,{path:"*",element:d.jsx(hS,{to:"/",replace:!0})})]})})})})]})})}GC.createRoot(document.getElementById("root")).render(d.jsx(z.StrictMode,{children:d.jsx(tq,{})}));
|