@agent-team-foundation/first-tree-hub 0.10.3 → 0.10.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/{bootstrap-CBAVWQUT.mjs → bootstrap-jx5nN1qZ.mjs} +1 -0
- package/dist/cli/index.mjs +7 -7
- package/dist/{dist-DUCelK3Z.mjs → dist-CbX9mUVH.mjs} +52 -4
- package/dist/{feishu-Boy3n8CT.mjs → feishu-DvjRZMdZ.mjs} +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{invitation-C_zAhB8x-8Khychlu.mjs → invitation-BljIolbO-DLeHfURd.mjs} +3 -2
- package/dist/{invitation-BTlGMy0o-Coj07kYi.mjs → invitation-D3feYxet-366MNOor.mjs} +2 -2
- package/dist/{saas-connect-3p-vBkuY.mjs → saas-connect-2puW1r3r.mjs} +582 -84
- package/dist/web/assets/index-5SNLeFZA.js +392 -0
- package/dist/web/assets/{index-CHoaSIzI.js → index-BxQQDavm.js} +1 -1
- package/dist/web/assets/index-DKZFiOjh.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CP8uLPyO.css +0 -1
- package/dist/web/assets/index-D7OzKrI2.js +0 -387
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
var Z0=e=>{throw TypeError(e)};var Km=(e,t,n)=>t.has(e)||Z0("Cannot "+n);var M=(e,t,n)=>(Km(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Z0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,a)=>(Km(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),De=(e,t,n)=>(Km(e,t,"access private method"),n);var fd=(e,t,n,a)=>({set _(l){ge(e,t,l,n)},get _(){return M(e,t,a)}});function T2(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function lf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},Wo={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var V0;function R2(){if(V0)return Wo;V0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return Wo.Fragment=t,Wo.jsx=n,Wo.jsxs=n,Wo}var Q0;function z2(){return Q0||(Q0=1,Ym.exports=R2()),Ym.exports}var u=z2(),Xm={exports:{}},Be={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var G0;function O2(){if(G0)return Be;G0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function S(P){return P===null||typeof P!="object"?null:(P=b&&P[b]||P["@@iterator"],typeof P=="function"?P:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(P,B,_){this.props=P,this.context=B,this.refs=E,this.updater=_||k}C.prototype.isReactComponent={},C.prototype.setState=function(P,B){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,B,"setState")},C.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function A(){}A.prototype=C.prototype;function O(P,B,_){this.props=P,this.context=B,this.refs=E,this.updater=_||k}var L=O.prototype=new A;L.constructor=O,j(L,C.prototype),L.isPureReactComponent=!0;var D=Array.isArray;function z(){}var I={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ee(P,B,_){var $=_.ref;return{$$typeof:e,type:P,key:B,ref:$!==void 0?$:null,props:_}}function H(P,B){return ee(P.type,B,P.props)}function ne(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function X(P){var B={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(_){return B[_]})}var be=/\/+/g;function fe(P,B){return typeof P=="object"&&P!==null&&P.key!=null?X(""+P.key):B.toString(36)}function ie(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(z,z):(P.status="pending",P.then(function(B){P.status==="pending"&&(P.status="fulfilled",P.value=B)},function(B){P.status==="pending"&&(P.status="rejected",P.reason=B)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Z(P,B,_,$,J){var ue=typeof P;(ue==="undefined"||ue==="boolean")&&(P=null);var xe=!1;if(P===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(P.$$typeof){case e:case t:xe=!0;break;case g:return xe=P._init,Z(xe(P._payload),B,_,$,J)}}if(xe)return J=J(P),xe=$===""?"."+fe(P,0):$,D(J)?(_="",xe!=null&&(_=xe.replace(be,"$&/")+"/"),Z(J,B,_,"",function(Ct){return Ct})):J!=null&&(ne(J)&&(J=H(J,_+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace(be,"$&/")+"/")+xe)),B.push(J)),1;xe=0;var Le=$===""?".":$+":";if(D(P))for(var Se=0;Se<P.length;Se++)$=P[Se],ue=Le+fe($,Se),xe+=Z($,B,_,ue,J);else if(Se=S(P),typeof Se=="function")for(P=Se.call(P),Se=0;!($=P.next()).done;)$=$.value,ue=Le+fe($,Se++),xe+=Z($,B,_,ue,J);else if(ue==="object"){if(typeof P.then=="function")return Z(ie(P),B,_,$,J);throw B=String(P),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ae(P,B,_){if(P==null)return P;var $=[],J=0;return Z(P,$,"","",function(ue){return B.call(_,ue,J++)}),$}function K(P){if(P._status===-1){var B=P._result;B=B(),B.then(function(_){(P._status===0||P._status===-1)&&(P._status=1,P._result=_)},function(_){(P._status===0||P._status===-1)&&(P._status=2,P._result=_)}),P._status===-1&&(P._status=0,P._result=B)}if(P._status===1)return P._result.default;throw P._result}var he=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},T={map:ae,forEach:function(P,B,_){ae(P,function(){B.apply(this,arguments)},_)},count:function(P){var B=0;return ae(P,function(){B++}),B},toArray:function(P){return ae(P,function(B){return B})||[]},only:function(P){if(!ne(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Be.Activity=y,Be.Children=T,Be.Component=C,Be.Fragment=n,Be.Profiler=l,Be.PureComponent=O,Be.StrictMode=a,Be.Suspense=m,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Be.__COMPILER_RUNTIME={__proto__:null,c:function(P){return I.H.useMemoCache(P)}},Be.cache=function(P){return function(){return P.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(P,B,_){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var $=j({},P.props),J=P.key;if(B!=null)for(ue in B.key!==void 0&&(J=""+B.key),B)!F.call(B,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&B.ref===void 0||($[ue]=B[ue]);var ue=arguments.length-2;if(ue===1)$.children=_;else if(1<ue){for(var xe=Array(ue),Le=0;Le<ue;Le++)xe[Le]=arguments[Le+2];$.children=xe}return ee(P.type,J,$)},Be.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},Be.createElement=function(P,B,_){var $,J={},ue=null;if(B!=null)for($ in B.key!==void 0&&(ue=""+B.key),B)F.call(B,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(J[$]=B[$]);var xe=arguments.length-2;if(xe===1)J.children=_;else if(1<xe){for(var Le=Array(xe),Se=0;Se<xe;Se++)Le[Se]=arguments[Se+2];J.children=Le}if(P&&P.defaultProps)for($ in xe=P.defaultProps,xe)J[$]===void 0&&(J[$]=xe[$]);return ee(P,ue,J)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(P){return{$$typeof:f,render:P}},Be.isValidElement=ne,Be.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:K}},Be.memo=function(P,B){return{$$typeof:h,type:P,compare:B===void 0?null:B}},Be.startTransition=function(P){var B=I.T,_={};I.T=_;try{var $=P(),J=I.S;J!==null&&J(_,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(z,he)}catch(ue){he(ue)}finally{B!==null&&_.types!==null&&(B.types=_.types),I.T=B}},Be.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Be.use=function(P){return I.H.use(P)},Be.useActionState=function(P,B,_){return I.H.useActionState(P,B,_)},Be.useCallback=function(P,B){return I.H.useCallback(P,B)},Be.useContext=function(P){return I.H.useContext(P)},Be.useDebugValue=function(){},Be.useDeferredValue=function(P,B){return I.H.useDeferredValue(P,B)},Be.useEffect=function(P,B){return I.H.useEffect(P,B)},Be.useEffectEvent=function(P){return I.H.useEffectEvent(P)},Be.useId=function(){return I.H.useId()},Be.useImperativeHandle=function(P,B,_){return I.H.useImperativeHandle(P,B,_)},Be.useInsertionEffect=function(P,B){return I.H.useInsertionEffect(P,B)},Be.useLayoutEffect=function(P,B){return I.H.useLayoutEffect(P,B)},Be.useMemo=function(P,B){return I.H.useMemo(P,B)},Be.useOptimistic=function(P,B){return I.H.useOptimistic(P,B)},Be.useReducer=function(P,B,_){return I.H.useReducer(P,B,_)},Be.useRef=function(P){return I.H.useRef(P)},Be.useState=function(P){return I.H.useState(P)},Be.useSyncExternalStore=function(P,B,_){return I.H.useSyncExternalStore(P,B,_)},Be.useTransition=function(){return I.H.useTransition()},Be.version="19.2.4",Be}var K0;function Hg(){return K0||(K0=1,Xm.exports=O2()),Xm.exports}var x=Hg();const D2=lf(x),Zg=T2({__proto__:null,default:D2},[x]);var Jm={exports:{}},eu={},Wm={exports:{}},ep={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Y0;function M2(){return Y0||(Y0=1,(function(e){function t(Z,ae){var K=Z.length;Z.push(ae);e:for(;0<K;){var he=K-1>>>1,T=Z[he];if(0<l(T,ae))Z[he]=ae,Z[K]=T,K=he;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var ae=Z[0],K=Z.pop();if(K!==ae){Z[0]=K;e:for(var he=0,T=Z.length,P=T>>>1;he<P;){var B=2*(he+1)-1,_=Z[B],$=B+1,J=Z[$];if(0>l(_,K))$<T&&0>l(J,_)?(Z[he]=J,Z[$]=K,he=$):(Z[he]=_,Z[B]=K,he=B);else if($<T&&0>l(J,K))Z[he]=J,Z[$]=K,he=$;else break e}}return ae}function l(Z,ae){var K=Z.sortIndex-ae.sortIndex;return K!==0?K:Z.id-ae.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],g=1,y=null,b=3,S=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function L(Z){for(var ae=n(h);ae!==null;){if(ae.callback===null)a(h);else if(ae.startTime<=Z)a(h),ae.sortIndex=ae.expirationTime,t(m,ae);else break;ae=n(h)}}function D(Z){if(j=!1,L(Z),!k)if(n(m)!==null)k=!0,z||(z=!0,X());else{var ae=n(h);ae!==null&&ie(D,ae.startTime-Z)}}var z=!1,I=-1,F=5,ee=-1;function H(){return E?!0:!(e.unstable_now()-ee<F)}function ne(){if(E=!1,z){var Z=e.unstable_now();ee=Z;var ae=!0;try{e:{k=!1,j&&(j=!1,A(I),I=-1),S=!0;var K=b;try{t:{for(L(Z),y=n(m);y!==null&&!(y.expirationTime>Z&&H());){var he=y.callback;if(typeof he=="function"){y.callback=null,b=y.priorityLevel;var T=he(y.expirationTime<=Z);if(Z=e.unstable_now(),typeof T=="function"){y.callback=T,L(Z),ae=!0;break t}y===n(m)&&a(m),L(Z)}else a(m);y=n(m)}if(y!==null)ae=!0;else{var P=n(h);P!==null&&ie(D,P.startTime-Z),ae=!1}}break e}finally{y=null,b=K,S=!1}ae=void 0}}finally{ae?X():z=!1}}}var X;if(typeof O=="function")X=function(){O(ne)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,fe=be.port2;be.port1.onmessage=ne,X=function(){fe.postMessage(null)}}else X=function(){C(ne,0)};function ie(Z,ae){I=C(function(){Z(e.unstable_now())},ae)}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(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(Z){switch(b){case 1:case 2:case 3:var ae=3;break;default:ae=b}var K=b;b=ae;try{return Z()}finally{b=K}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(Z,ae){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var K=b;b=Z;try{return ae()}finally{b=K}},e.unstable_scheduleCallback=function(Z,ae,K){var he=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?he+K:he):K=he,Z){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=K+T,Z={id:g++,callback:ae,priorityLevel:Z,startTime:K,expirationTime:T,sortIndex:-1},K>he?(Z.sortIndex=K,t(h,Z),n(m)===null&&Z===n(h)&&(j?(A(I),I=-1):j=!0,ie(D,K-he))):(Z.sortIndex=T,t(m,Z),k||S||(k=!0,z||(z=!0,X()))),Z},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(Z){var ae=b;return function(){var K=b;b=ae;try{return Z.apply(this,arguments)}finally{b=K}}}})(ep)),ep}var X0;function L2(){return X0||(X0=1,Wm.exports=M2()),Wm.exports}var tp={exports:{}},wn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var J0;function I2(){if(J0)return wn;J0=1;var e=Hg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" 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},l=Symbol.for("react.portal");function o(m,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:m,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,wn.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,g)},wn.flushSync=function(m){var h=c.T,g=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=g,a.d.f()}},wn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},wn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},wn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:S}):g==="script"&&a.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},wn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=f(g,h.crossOrigin);a.d.L(m,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},wn.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},wn.requestFormReset=function(m){a.d.r(m)},wn.unstable_batchedUpdates=function(m,h){return m(h)},wn.useFormState=function(m,h,g){return c.H.useFormState(m,h,g)},wn.useFormStatus=function(){return c.H.useHostTransitionStatus()},wn.version="19.2.4",wn}var W0;function Pw(){if(W0)return tp.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(),tp.exports=I2(),tp.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var e1;function U2(){if(e1)return eu;e1=1;var e=L2(),t=Hg(),n=Pw();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(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 m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var w=!1,N=p.child;N;){if(N===s){w=!0,s=p,d=v;break}if(N===d){w=!0,d=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,d=p;break}if(N===d){w=!0,d=v,s=p;break}N=N.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?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,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function X(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var be=Symbol.for("react.client.reference");function fe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===be?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList";case ee:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case A: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 I:return i=r.displayName||null,i!==null?i:fe(r.type)||"Memo";case F:i=r._payload,r=r._init;try{return fe(r(i))}catch{}}return null}var ie=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],T=-1;function P(r){return{current:r}}function B(r){0>T||(r.current=he[T],he[T]=null,T--)}function _(r,i){T++,he[T]=r.current,r.current=i}var $=P(null),J=P(null),ue=P(null),xe=P(null);function Le(r,i){switch(_(ue,i),_(J,r),_($,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?m0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=m0(i),r=p0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B($),_($,r)}function Se(){B($),B(J),B(ue)}function Ct(r){r.memoizedState!==null&&_(xe,r);var i=$.current,s=p0(i,r.type);i!==s&&(_(J,r),_($,s))}function te(r){J.current===r&&(B($),B(J)),xe.current===r&&(B(xe),Ko._currentValue=K)}var Te,Ue;function Fe(r){if(Te===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Te=i&&i[1]||"",Ue=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Te+r+Ue}var Ft=!1;function un(r,i){if(!r||Ft)return"";Ft=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(W){var Y=W}Reflect.construct(r,[],ce)}else{try{ce.call()}catch(W){Y=W}r.call(ce.prototype)}}else{try{throw Error()}catch(W){Y=W}(ce=r())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(W){if(W&&Y&&typeof W.stack=="string")return[W.stack,Y.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),w=v[0],N=v[1];if(w&&N){var U=w.split(`
|
|
44
|
-
`),G=N.split(`
|
|
45
|
-
`);for(p=d=0;d<U.length&&!U[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===U.length||p===G.length)for(d=U.length-1,p=G.length-1;1<=d&&0<=p&&U[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if(U[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||U[d]!==G[p]){var re=`
|
|
46
|
-
`+U[d].replace(" at new "," at ");return r.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",r.displayName)),re}while(1<=d&&0<=p);break}}}finally{Ft=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Fe(s):""}function za(r,i){switch(r.tag){case 26:case 27:case 5:return Fe(r.type);case 16:return Fe("Lazy");case 13:return r.child!==i&&i!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return un(r.type,!1);case 11:return un(r.type.render,!1);case 1:return un(r.type,!0);case 31:return Fe("Activity");default:return""}}function _l(r){try{var i="",s=null;do i+=za(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
-
Error generating stack: `+d.message+`
|
|
48
|
-
`+d.stack}}var Oa=Object.prototype.hasOwnProperty,Da=e.unstable_scheduleCallback,Jr=e.unstable_cancelCallback,io=e.unstable_shouldYield,lo=e.unstable_requestPaint,cn=e.unstable_now,so=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,nt=e.unstable_IdlePriority,dn=e.log,cr=e.unstable_setDisableYieldValue,en=null,qt=null;function fn(r){if(typeof dn=="function"&&cr(r),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(en,r)}catch{}}var dt=Math.clz32?Math.clz32:Xu,Tr=Math.log,Mn=Math.LN2;function Xu(r){return r>>>=0,r===0?32:31-(Tr(r)/Mn|0)|0}var Mi=256,Li=262144,Ii=4194304;function Ir(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 Ui(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Ir(d):(w&=N,w!==0?p=Ir(w):s||(s=N&~r,s!==0&&(p=Ir(s))))):(N=d&~v,N!==0?p=Ir(N):w!==0?p=Ir(w):s||(s=d&~r,s!==0&&(p=Ir(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function Ma(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Ju(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 ve(){var r=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),r}function Ye(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function hn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Wr(r,i,s,d,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,U=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var re=31-dt(s),ce=1<<re;N[re]=0,U[re]=-1;var Y=G[re];if(Y!==null)for(G[re]=null,re=0;re<Y.length;re++){var W=Y[re];W!==null&&(W.lane&=-536870913)}s&=~ce}d!==0&&oo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function oo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-dt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function Wu(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-dt(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function Jy(r,i){var s=i&-i;return s=(s&42)!==0?1:Uf(s),(s&(r.suspendedLanes|i))!==0?0:s}function Uf(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 Pf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Wy(){var r=ae.p;return r!==0?r:(r=window.event,r===void 0?32:U0(r.type))}function ev(r,i){var s=ae.p;try{return ae.p=r,i()}finally{ae.p=s}}var La=Math.random().toString(36).slice(2),mn="__reactFiber$"+La,Ln="__reactProps$"+La,Al="__reactContainer$"+La,Bf="__reactEvents$"+La,bN="__reactListeners$"+La,xN="__reactHandles$"+La,tv="__reactResources$"+La,uo="__reactMarker$"+La;function $f(r){delete r[mn],delete r[Ln],delete r[Bf],delete r[bN],delete r[xN]}function Tl(r){var i=r[mn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Al]||s[mn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=w0(r);r!==null;){if(s=r[mn])return s;r=w0(r)}return i}r=s,s=r.parentNode}return null}function Rl(r){if(r=r[mn]||r[Al]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function co(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function zl(r){var i=r[tv];return i||(i=r[tv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ln(r){r[uo]=!0}var nv=new Set,rv={};function Pi(r,i){Ol(r,i),Ol(r+"Capture",i)}function Ol(r,i){for(rv[r]=i,r=0;r<i.length;r++)nv.add(i[r])}var SN=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]*$"),av={},iv={};function wN(r){return Oa.call(iv,r)?!0:Oa.call(av,r)?!1:SN.test(r)?iv[r]=!0:(av[r]=!0,!1)}function ec(r,i,s){if(wN(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function tc(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function ea(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function dr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function lv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function kN(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ff(r){if(!r._valueTracker){var i=lv(r)?"checked":"value";r._valueTracker=kN(r,i,""+r[i])}}function sv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=lv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function nc(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 jN=/[\n"\\]/g;function fr(r){return r.replace(jN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function qf(r,i,s,d,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+dr(i)):r.value!==""+dr(i)&&(r.value=""+dr(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?Hf(r,w,dr(i)):s!=null?Hf(r,w,dr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+dr(N):r.removeAttribute("name")}function ov(r,i,s,d,p,v,w,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Ff(r);return}s=s!=null?""+dr(s):"",i=i!=null?""+dr(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=N?r.checked:!!d,r.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Ff(r)}function Hf(r,i,s){i==="number"&&nc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Dl(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+dr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function uv(r,i,s){if(i!=null&&(i=""+dr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+dr(s):""}function cv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(ie(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=dr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Ff(r)}function Ml(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var CN=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 dv(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||CN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function fv(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&dv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&dv(r,v,i[v])}function Zf(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 EN=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"]]),NN=/^[\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 rc(r){return NN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ta(){}var Vf=null;function Qf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ll=null,Il=null;function hv(r){var i=Rl(r);if(i&&(r=i.stateNode)){var s=r[Ln]||null;e:switch(r=i.stateNode,i.type){case"input":if(qf(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+fr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Ln]||null;if(!p)throw Error(a(90));qf(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&sv(d)}break e;case"textarea":uv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Dl(r,!!s.multiple,i,!1)}}}var Gf=!1;function mv(r,i,s){if(Gf)return r(i,s);Gf=!0;try{var d=r(i);return d}finally{if(Gf=!1,(Ll!==null||Il!==null)&&(Hc(),Ll&&(i=Ll,r=Il,Il=Ll=null,hv(i),r)))for(i=0;i<r.length;i++)hv(r[i])}}function fo(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Ln]||null;if(d===null)return null;s=d[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":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kf=!1;if(na)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){Kf=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{Kf=!1}var Ia=null,Yf=null,ac=null;function pv(){if(ac)return ac;var r,i=Yf,s=i.length,d,p="value"in Ia?Ia.value:Ia.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(d=1;d<=w&&i[s-d]===p[v-d];d++);return ac=p.slice(r,1<d?1-d:void 0)}function ic(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 lc(){return!0}function gv(){return!1}function In(r){function i(s,d,p,v,w){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?lc:gv,this.isPropagationStopped=gv,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=lc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=lc)},persist:function(){},isPersistent:lc}),i}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sc=In(Bi),mo=y({},Bi,{view:0,detail:0}),_N=In(mo),Xf,Jf,po,oc=y({},mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eh,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!==po&&(po&&r.type==="mousemove"?(Xf=r.screenX-po.screenX,Jf=r.screenY-po.screenY):Jf=Xf=0,po=r),Xf)},movementY:function(r){return"movementY"in r?r.movementY:Jf}}),yv=In(oc),AN=y({},oc,{dataTransfer:0}),TN=In(AN),RN=y({},mo,{relatedTarget:0}),Wf=In(RN),zN=y({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),ON=In(zN),DN=y({},Bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),MN=In(DN),LN=y({},Bi,{data:0}),vv=In(LN),IN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UN={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"},PN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=PN[r])?!!i[r]:!1}function eh(){return BN}var $N=y({},mo,{key:function(r){if(r.key){var i=IN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ic(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?UN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eh,charCode:function(r){return r.type==="keypress"?ic(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ic(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),FN=In($N),qN=y({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bv=In(qN),HN=y({},mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eh}),ZN=In(HN),VN=y({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),QN=In(VN),GN=y({},oc,{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}),KN=In(GN),YN=y({},Bi,{newState:0,oldState:0}),XN=In(YN),JN=[9,13,27,32],th=na&&"CompositionEvent"in window,go=null;na&&"documentMode"in document&&(go=document.documentMode);var WN=na&&"TextEvent"in window&&!go,xv=na&&(!th||go&&8<go&&11>=go),Sv=" ",wv=!1;function kv(r,i){switch(r){case"keyup":return JN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ul=!1;function e_(r,i){switch(r){case"compositionend":return jv(i);case"keypress":return i.which!==32?null:(wv=!0,Sv);case"textInput":return r=i.data,r===Sv&&wv?null:r;default:return null}}function t_(r,i){if(Ul)return r==="compositionend"||!th&&kv(r,i)?(r=pv(),ac=Yf=Ia=null,Ul=!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 xv&&i.locale!=="ko"?null:i.data;default:return null}}var n_={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 Cv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!n_[r.type]:i==="textarea"}function Ev(r,i,s,d){Ll?Il?Il.push(d):Il=[d]:Ll=d,i=Xc(i,"onChange"),0<i.length&&(s=new sc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var yo=null,vo=null;function r_(r){o0(r,0)}function uc(r){var i=co(r);if(sv(i))return r}function Nv(r,i){if(r==="change")return i}var _v=!1;if(na){var nh;if(na){var rh="oninput"in document;if(!rh){var Av=document.createElement("div");Av.setAttribute("oninput","return;"),rh=typeof Av.oninput=="function"}nh=rh}else nh=!1;_v=nh&&(!document.documentMode||9<document.documentMode)}function Tv(){yo&&(yo.detachEvent("onpropertychange",Rv),vo=yo=null)}function Rv(r){if(r.propertyName==="value"&&uc(vo)){var i=[];Ev(i,vo,r,Qf(r)),mv(r_,i)}}function a_(r,i,s){r==="focusin"?(Tv(),yo=i,vo=s,yo.attachEvent("onpropertychange",Rv)):r==="focusout"&&Tv()}function i_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return uc(vo)}function l_(r,i){if(r==="click")return uc(i)}function s_(r,i){if(r==="input"||r==="change")return uc(i)}function o_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:o_;function bo(r,i){if(Yn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Oa.call(i,p)||!Yn(r[p],i[p]))return!1}return!0}function zv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Ov(r,i){var s=zv(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=zv(s)}}function Dv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Dv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Mv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=nc(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=nc(r.document)}return i}function ah(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 u_=na&&"documentMode"in document&&11>=document.documentMode,Pl=null,ih=null,xo=null,lh=!1;function Lv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;lh||Pl==null||Pl!==nc(d)||(d=Pl,"selectionStart"in d&&ah(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),xo&&bo(xo,d)||(xo=d,d=Xc(ih,"onSelect"),0<d.length&&(i=new sc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Pl)))}function $i(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Bl={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},sh={},Iv={};na&&(Iv=document.createElement("div").style,"AnimationEvent"in window||(delete Bl.animationend.animation,delete Bl.animationiteration.animation,delete Bl.animationstart.animation),"TransitionEvent"in window||delete Bl.transitionend.transition);function Fi(r){if(sh[r])return sh[r];if(!Bl[r])return r;var i=Bl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Iv)return sh[r]=i[s];return r}var Uv=Fi("animationend"),Pv=Fi("animationiteration"),Bv=Fi("animationstart"),c_=Fi("transitionrun"),d_=Fi("transitionstart"),f_=Fi("transitioncancel"),$v=Fi("transitionend"),Fv=new Map,oh="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(" ");oh.push("scrollEnd");function Rr(r,i){Fv.set(r,i),Pi(i,[r])}var cc=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)},hr=[],$l=0,uh=0;function dc(){for(var r=$l,i=uh=$l=0;i<r;){var s=hr[i];hr[i++]=null;var d=hr[i];hr[i++]=null;var p=hr[i];hr[i++]=null;var v=hr[i];if(hr[i++]=null,d!==null&&p!==null){var w=d.pending;w===null?p.next=p:(p.next=w.next,w.next=p),d.pending=p}v!==0&&qv(s,p,v)}}function fc(r,i,s,d){hr[$l++]=r,hr[$l++]=i,hr[$l++]=s,hr[$l++]=d,uh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function ch(r,i,s,d){return fc(r,i,s,d),hc(r)}function qi(r,i){return fc(r,null,null,i),hc(r)}function qv(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,d=v.alternate,d!==null&&(d.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-dt(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function hc(r){if(50<Fo)throw Fo=0,bm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Fl={};function h_(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(r,i,s,d){return new h_(r,i,s,d)}function dh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ra(r,i){var s=r.alternate;return s===null?(s=Xn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Hv(r,i){r.flags&=65011714;var s=r.alternate;return s===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=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function mc(r,i,s,d,p,v){var w=0;if(d=r,typeof r=="function")dh(r)&&(w=1);else if(typeof r=="string")w=v2(r,s,$.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case ee:return r=Xn(31,s,i,p),r.elementType=ee,r.lanes=v,r;case j:return Hi(s.children,p,v,i);case E:w=8,p|=24;break;case C:return r=Xn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case D:return r=Xn(13,s,i,p),r.elementType=D,r.lanes=v,r;case z:return r=Xn(19,s,i,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case A:w=9;break e;case L:w=11;break e;case I:w=14;break e;case F:w=16,d=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Xn(w,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Hi(r,i,s,d){return r=Xn(7,r,d,i),r.lanes=s,r}function fh(r,i,s){return r=Xn(6,r,null,i),r.lanes=s,r}function Zv(r){var i=Xn(18,null,null,0);return i.stateNode=r,i}function hh(r,i,s){return i=Xn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Vv=new WeakMap;function mr(r,i){if(typeof r=="object"&&r!==null){var s=Vv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:_l(i)},Vv.set(r,i),i)}return{value:r,source:i,stack:_l(i)}}var ql=[],Hl=0,pc=null,So=0,pr=[],gr=0,Ua=null,Ur=1,Pr="";function aa(r,i){ql[Hl++]=So,ql[Hl++]=pc,pc=r,So=i}function Qv(r,i,s){pr[gr++]=Ur,pr[gr++]=Pr,pr[gr++]=Ua,Ua=r;var d=Ur;r=Pr;var p=32-dt(d)-1;d&=~(1<<p),s+=1;var v=32-dt(i)+p;if(30<v){var w=p-p%5;v=(d&(1<<w)-1).toString(32),d>>=w,p-=w,Ur=1<<32-dt(i)+p|s<<p|d,Pr=v+r}else Ur=1<<v|s<<p|d,Pr=r}function mh(r){r.return!==null&&(aa(r,1),Qv(r,1,0))}function ph(r){for(;r===pc;)pc=ql[--Hl],ql[Hl]=null,So=ql[--Hl],ql[Hl]=null;for(;r===Ua;)Ua=pr[--gr],pr[gr]=null,Pr=pr[--gr],pr[gr]=null,Ur=pr[--gr],pr[gr]=null}function Gv(r,i){pr[gr++]=Ur,pr[gr++]=Pr,pr[gr++]=Ua,Ur=i.id,Pr=i.overflow,Ua=r}var pn=null,Et=null,rt=!1,Pa=null,yr=!1,gh=Error(a(519));function Ba(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wo(mr(i,r)),gh}function Kv(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[mn]=r,i[Ln]=d,s){case"dialog":Je("cancel",i),Je("close",i);break;case"iframe":case"object":case"embed":Je("load",i);break;case"video":case"audio":for(s=0;s<Ho.length;s++)Je(Ho[s],i);break;case"source":Je("error",i);break;case"img":case"image":case"link":Je("error",i),Je("load",i);break;case"details":Je("toggle",i);break;case"input":Je("invalid",i),ov(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",i);break;case"textarea":Je("invalid",i),cv(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||f0(i.textContent,s)?(d.popover!=null&&(Je("beforetoggle",i),Je("toggle",i)),d.onScroll!=null&&Je("scroll",i),d.onScrollEnd!=null&&Je("scrollend",i),d.onClick!=null&&(i.onclick=ta),i=!0):i=!1,i||Ba(r,!0)}function Yv(r){for(pn=r.return;pn;)switch(pn.tag){case 5:case 31:case 13:yr=!1;return;case 27:case 3:yr=!0;return;default:pn=pn.return}}function Zl(r){if(r!==pn)return!1;if(!rt)return Yv(r),rt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Dm(r.type,r.memoizedProps)),s=!s),s&&Et&&Ba(r),Yv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=S0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=S0(r)}else i===27?(i=Et,ei(r.type)?(r=Pm,Pm=null,Et=r):Et=i):Et=pn?br(r.stateNode.nextSibling):null;return!0}function Zi(){Et=pn=null,rt=!1}function yh(){var r=Pa;return r!==null&&($n===null?$n=r:$n.push.apply($n,r),Pa=null),r}function wo(r){Pa===null?Pa=[r]:Pa.push(r)}var vh=P(null),Vi=null,ia=null;function $a(r,i,s){_(vh,i._currentValue),i._currentValue=s}function la(r){r._currentValue=vh.current,B(vh)}function bh(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function xh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var U=0;U<i.length;U++)if(N.context===i[U]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),bh(v.return,s,r),d||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),bh(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Vl(r,i,s,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;Yn(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Ko):r=[Ko])}p=p.return}r!==null&&xh(i,r,s,d),i.flags|=262144}function gc(r){for(r=r.firstContext;r!==null;){if(!Yn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Qi(r){Vi=r,ia=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function gn(r){return Xv(Vi,r)}function yc(r,i){return Vi===null&&Qi(r),Xv(r,i)}function Xv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ia===null){if(r===null)throw Error(a(308));ia=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ia=ia.next=i;return s}var m_=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},p_=e.unstable_scheduleCallback,g_=e.unstable_NormalPriority,Qt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sh(){return{controller:new m_,data:new Map,refCount:0}}function ko(r){r.refCount--,r.refCount===0&&p_(g_,function(){r.controller.abort()})}var jo=null,wh=0,Ql=0,Gl=null;function y_(r,i){if(jo===null){var s=jo=[];wh=0,Ql=Cm(),Gl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return wh++,i.then(Jv,Jv),i}function Jv(){if(--wh===0&&jo!==null){Gl!==null&&(Gl.status="fulfilled");var r=jo;jo=null,Ql=0,Gl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function v_(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var Wv=Z.S;Z.S=function(r,i){Lx=cn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&y_(r,i),Wv!==null&&Wv(r,i)};var Gi=P(null);function kh(){var r=Gi.current;return r!==null?r:wt.pooledCache}function vc(r,i){i===null?_(Gi,Gi.current):_(Gi,i.pool)}function eb(){var r=kh();return r===null?null:{parent:Qt._currentValue,pool:r}}var Kl=Error(a(460)),jh=Error(a(474)),bc=Error(a(542)),xc={then:function(){}};function tb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function nb(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ta,ta),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,ab(r),r;default:if(typeof i.status=="string")i.then(ta,ta);else{if(r=wt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,ab(r),r}throw Yi=i,Kl}}function Ki(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Yi=s,Kl):s}}var Yi=null;function rb(){if(Yi===null)throw Error(a(459));var r=Yi;return Yi=null,r}function ab(r){if(r===Kl||r===bc)throw Error(a(483))}var Yl=null,Co=0;function Sc(r){var i=Co;return Co+=1,Yl===null&&(Yl=[]),nb(Yl,r,i)}function Eo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function wc(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function ib(r){function i(V,q){if(r){var Q=V.deletions;Q===null?(V.deletions=[q],V.flags|=16):Q.push(q)}}function s(V,q){if(!r)return null;for(;q!==null;)i(V,q),q=q.sibling;return null}function d(V){for(var q=new Map;V!==null;)V.key!==null?q.set(V.key,V):q.set(V.index,V),V=V.sibling;return q}function p(V,q){return V=ra(V,q),V.index=0,V.sibling=null,V}function v(V,q,Q){return V.index=Q,r?(Q=V.alternate,Q!==null?(Q=Q.index,Q<q?(V.flags|=67108866,q):Q):(V.flags|=67108866,q)):(V.flags|=1048576,q)}function w(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function N(V,q,Q,oe){return q===null||q.tag!==6?(q=fh(Q,V.mode,oe),q.return=V,q):(q=p(q,Q),q.return=V,q)}function U(V,q,Q,oe){var Re=Q.type;return Re===j?re(V,q,Q.props.children,oe,Q.key):q!==null&&(q.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===F&&Ki(Re)===q.type)?(q=p(q,Q.props),Eo(q,Q),q.return=V,q):(q=mc(Q.type,Q.key,Q.props,null,V.mode,oe),Eo(q,Q),q.return=V,q)}function G(V,q,Q,oe){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=hh(Q,V.mode,oe),q.return=V,q):(q=p(q,Q.children||[]),q.return=V,q)}function re(V,q,Q,oe,Re){return q===null||q.tag!==7?(q=Hi(Q,V.mode,oe,Re),q.return=V,q):(q=p(q,Q),q.return=V,q)}function ce(V,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=fh(""+q,V.mode,Q),q.return=V,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case S:return Q=mc(q.type,q.key,q.props,null,V.mode,Q),Eo(Q,q),Q.return=V,Q;case k:return q=hh(q,V.mode,Q),q.return=V,q;case F:return q=Ki(q),ce(V,q,Q)}if(ie(q)||X(q))return q=Hi(q,V.mode,Q,null),q.return=V,q;if(typeof q.then=="function")return ce(V,Sc(q),Q);if(q.$$typeof===O)return ce(V,yc(V,q),Q);wc(V,q)}return null}function Y(V,q,Q,oe){var Re=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:N(V,q,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Re?U(V,q,Q,oe):null;case k:return Q.key===Re?G(V,q,Q,oe):null;case F:return Q=Ki(Q),Y(V,q,Q,oe)}if(ie(Q)||X(Q))return Re!==null?null:re(V,q,Q,oe,null);if(typeof Q.then=="function")return Y(V,q,Sc(Q),oe);if(Q.$$typeof===O)return Y(V,q,yc(V,Q),oe);wc(V,Q)}return null}function W(V,q,Q,oe,Re){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Q)||null,N(q,V,""+oe,Re);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return V=V.get(oe.key===null?Q:oe.key)||null,U(q,V,oe,Re);case k:return V=V.get(oe.key===null?Q:oe.key)||null,G(q,V,oe,Re);case F:return oe=Ki(oe),W(V,q,Q,oe,Re)}if(ie(oe)||X(oe))return V=V.get(Q)||null,re(q,V,oe,Re,null);if(typeof oe.then=="function")return W(V,q,Q,Sc(oe),Re);if(oe.$$typeof===O)return W(V,q,Q,yc(q,oe),Re);wc(q,oe)}return null}function ke(V,q,Q,oe){for(var Re=null,ot=null,Ne=q,Ze=q=0,tt=null;Ne!==null&&Ze<Q.length;Ze++){Ne.index>Ze?(tt=Ne,Ne=null):tt=Ne.sibling;var ut=Y(V,Ne,Q[Ze],oe);if(ut===null){Ne===null&&(Ne=tt);break}r&&Ne&&ut.alternate===null&&i(V,Ne),q=v(ut,q,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut,Ne=tt}if(Ze===Q.length)return s(V,Ne),rt&&aa(V,Ze),Re;if(Ne===null){for(;Ze<Q.length;Ze++)Ne=ce(V,Q[Ze],oe),Ne!==null&&(q=v(Ne,q,Ze),ot===null?Re=Ne:ot.sibling=Ne,ot=Ne);return rt&&aa(V,Ze),Re}for(Ne=d(Ne);Ze<Q.length;Ze++)tt=W(Ne,V,Ze,Q[Ze],oe),tt!==null&&(r&&tt.alternate!==null&&Ne.delete(tt.key===null?Ze:tt.key),q=v(tt,q,Ze),ot===null?Re=tt:ot.sibling=tt,ot=tt);return r&&Ne.forEach(function(ii){return i(V,ii)}),rt&&aa(V,Ze),Re}function Oe(V,q,Q,oe){if(Q==null)throw Error(a(151));for(var Re=null,ot=null,Ne=q,Ze=q=0,tt=null,ut=Q.next();Ne!==null&&!ut.done;Ze++,ut=Q.next()){Ne.index>Ze?(tt=Ne,Ne=null):tt=Ne.sibling;var ii=Y(V,Ne,ut.value,oe);if(ii===null){Ne===null&&(Ne=tt);break}r&&Ne&&ii.alternate===null&&i(V,Ne),q=v(ii,q,Ze),ot===null?Re=ii:ot.sibling=ii,ot=ii,Ne=tt}if(ut.done)return s(V,Ne),rt&&aa(V,Ze),Re;if(Ne===null){for(;!ut.done;Ze++,ut=Q.next())ut=ce(V,ut.value,oe),ut!==null&&(q=v(ut,q,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut);return rt&&aa(V,Ze),Re}for(Ne=d(Ne);!ut.done;Ze++,ut=Q.next())ut=W(Ne,V,Ze,ut.value,oe),ut!==null&&(r&&ut.alternate!==null&&Ne.delete(ut.key===null?Ze:ut.key),q=v(ut,q,Ze),ot===null?Re=ut:ot.sibling=ut,ot=ut);return r&&Ne.forEach(function(A2){return i(V,A2)}),rt&&aa(V,Ze),Re}function bt(V,q,Q,oe){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Re=Q.key;q!==null;){if(q.key===Re){if(Re=Q.type,Re===j){if(q.tag===7){s(V,q.sibling),oe=p(q,Q.props.children),oe.return=V,V=oe;break e}}else if(q.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===F&&Ki(Re)===q.type){s(V,q.sibling),oe=p(q,Q.props),Eo(oe,Q),oe.return=V,V=oe;break e}s(V,q);break}else i(V,q);q=q.sibling}Q.type===j?(oe=Hi(Q.props.children,V.mode,oe,Q.key),oe.return=V,V=oe):(oe=mc(Q.type,Q.key,Q.props,null,V.mode,oe),Eo(oe,Q),oe.return=V,V=oe)}return w(V);case k:e:{for(Re=Q.key;q!==null;){if(q.key===Re)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){s(V,q.sibling),oe=p(q,Q.children||[]),oe.return=V,V=oe;break e}else{s(V,q);break}else i(V,q);q=q.sibling}oe=hh(Q,V.mode,oe),oe.return=V,V=oe}return w(V);case F:return Q=Ki(Q),bt(V,q,Q,oe)}if(ie(Q))return ke(V,q,Q,oe);if(X(Q)){if(Re=X(Q),typeof Re!="function")throw Error(a(150));return Q=Re.call(Q),Oe(V,q,Q,oe)}if(typeof Q.then=="function")return bt(V,q,Sc(Q),oe);if(Q.$$typeof===O)return bt(V,q,yc(V,Q),oe);wc(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,q!==null&&q.tag===6?(s(V,q.sibling),oe=p(q,Q),oe.return=V,V=oe):(s(V,q),oe=fh(Q,V.mode,oe),oe.return=V,V=oe),w(V)):s(V,q)}return function(V,q,Q,oe){try{Co=0;var Re=bt(V,q,Q,oe);return Yl=null,Re}catch(Ne){if(Ne===Kl||Ne===bc)throw Ne;var ot=Xn(29,Ne,null,V.mode);return ot.lanes=oe,ot.return=V,ot}finally{}}}var Xi=ib(!0),lb=ib(!1),Fa=!1;function Ch(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eh(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 qa(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ha(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ct&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=hc(r),qv(r,null,s),i}return fc(r,d,i,s),hc(r)}function No(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,Wu(r,s)}}function Nh(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var _h=!1;function _o(){if(_h){var r=Gl;if(r!==null)throw r}}function Ao(r,i,s,d){_h=!1;var p=r.updateQueue;Fa=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var U=N,G=U.next;U.next=null,w===null?v=G:w.next=G,w=U;var re=r.alternate;re!==null&&(re=re.updateQueue,N=re.lastBaseUpdate,N!==w&&(N===null?re.firstBaseUpdate=G:N.next=G,re.lastBaseUpdate=U))}if(v!==null){var ce=p.baseState;w=0,re=G=U=null,N=v;do{var Y=N.lane&-536870913,W=Y!==N.lane;if(W?(et&Y)===Y:(d&Y)===Y){Y!==0&&Y===Ql&&(_h=!0),re!==null&&(re=re.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ke=r,Oe=N;Y=i;var bt=s;switch(Oe.tag){case 1:if(ke=Oe.payload,typeof ke=="function"){ce=ke.call(bt,ce,Y);break e}ce=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Oe.payload,Y=typeof ke=="function"?ke.call(bt,ce,Y):ke,Y==null)break e;ce=y({},ce,Y);break e;case 2:Fa=!0}}Y=N.callback,Y!==null&&(r.flags|=64,W&&(r.flags|=8192),W=p.callbacks,W===null?p.callbacks=[Y]:W.push(Y))}else W={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},re===null?(G=re=W,U=ce):re=re.next=W,w|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;W=N,N=W.next,W.next=null,p.lastBaseUpdate=W,p.shared.pending=null}}while(!0);re===null&&(U=ce),p.baseState=U,p.firstBaseUpdate=G,p.lastBaseUpdate=re,v===null&&(p.shared.lanes=0),Ka|=w,r.lanes=w,r.memoizedState=ce}}function sb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function ob(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)sb(s[r],i)}var Xl=P(null),kc=P(0);function ub(r,i){r=pa,_(kc,r),_(Xl,i),pa=r|i.baseLanes}function Ah(){_(kc,pa),_(Xl,Xl.current)}function Th(){pa=kc.current,B(Xl),B(kc)}var Jn=P(null),vr=null;function Za(r){var i=r.alternate;_(Ht,Ht.current&1),_(Jn,r),vr===null&&(i===null||Xl.current!==null||i.memoizedState!==null)&&(vr=r)}function Rh(r){_(Ht,Ht.current),_(Jn,r),vr===null&&(vr=r)}function cb(r){r.tag===22?(_(Ht,Ht.current),_(Jn,r),vr===null&&(vr=r)):Va()}function Va(){_(Ht,Ht.current),_(Jn,Jn.current)}function Wn(r){B(Jn),vr===r&&(vr=null),B(Ht)}var Ht=P(0);function jc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Im(s)||Um(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===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 sa=0,He=null,yt=null,Gt=null,Cc=!1,Jl=!1,Ji=!1,Ec=0,To=0,Wl=null,b_=0;function Mt(){throw Error(a(321))}function zh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Yn(r[s],i[s]))return!1;return!0}function Oh(r,i,s,d,p,v){return sa=v,He=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Qb:Gh,Ji=!1,v=s(d,p),Ji=!1,Jl&&(v=fb(i,s,d,p)),db(r),v}function db(r){Z.H=Oo;var i=yt!==null&&yt.next!==null;if(sa=0,Gt=yt=He=null,Cc=!1,To=0,Wl=null,i)throw Error(a(300));r===null||Kt||(r=r.dependencies,r!==null&&gc(r)&&(Kt=!0))}function fb(r,i,s,d){He=r;var p=0;do{if(Jl&&(Wl=null),To=0,Jl=!1,25<=p)throw Error(a(301));if(p+=1,Gt=yt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=Gb,v=i(s,d)}while(Jl);return v}function x_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Ro(i):i,r=r.useState()[0],(yt!==null?yt.memoizedState:null)!==r&&(He.flags|=1024),i}function Dh(){var r=Ec!==0;return Ec=0,r}function Mh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Lh(r){if(Cc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Cc=!1}sa=0,Gt=yt=He=null,Jl=!1,To=Ec=0,Wl=null}function Tn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?He.memoizedState=Gt=r:Gt=Gt.next=r,Gt}function Zt(){if(yt===null){var r=He.alternate;r=r!==null?r.memoizedState:null}else r=yt.next;var i=Gt===null?He.memoizedState:Gt.next;if(i!==null)Gt=i,yt=r;else{if(r===null)throw He.alternate===null?Error(a(467)):Error(a(310));yt=r,r={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},Gt===null?He.memoizedState=Gt=r:Gt=Gt.next=r}return Gt}function Nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(r){var i=To;return To+=1,Wl===null&&(Wl=[]),r=nb(Wl,r,i),i=He,(Gt===null?i.memoizedState:Gt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Qb:Gh),r}function _c(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ro(r);if(r.$$typeof===O)return gn(r)}throw Error(a(438,String(r)))}function Ih(r){var i=null,s=He.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=He.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Nc(),He.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=H;return i.index++,s}function oa(r,i){return typeof i=="function"?i(r):i}function Ac(r){var i=Zt();return Uh(i,yt,r)}function Uh(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,U=null,G=i,re=!1;do{var ce=G.lane&-536870913;if(ce!==G.lane?(et&ce)===ce:(sa&ce)===ce){var Y=G.revertLane;if(Y===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ce===Ql&&(re=!0);else if((sa&Y)===Y){G=G.next,Y===Ql&&(re=!0);continue}else ce={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},U===null?(N=U=ce,w=v):U=U.next=ce,He.lanes|=Y,Ka|=Y;ce=G.action,Ji&&s(v,ce),v=G.hasEagerState?G.eagerState:s(v,ce)}else Y={lane:ce,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},U===null?(N=U=Y,w=v):U=U.next=Y,He.lanes|=ce,Ka|=ce;G=G.next}while(G!==null&&G!==i);if(U===null?w=v:U.next=N,!Yn(v,r.memoizedState)&&(Kt=!0,re&&(s=Gl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=U,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Ph(r){var i=Zt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);Yn(v,i.memoizedState)||(Kt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function hb(r,i,s){var d=He,p=Zt(),v=rt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Yn((yt||p).memoizedState,s);if(w&&(p.memoizedState=s,Kt=!0),p=p.queue,Fh(gb.bind(null,d,p,r),[r]),p.getSnapshot!==i||w||Gt!==null&&Gt.memoizedState.tag&1){if(d.flags|=2048,es(9,{destroy:void 0},pb.bind(null,d,p,s,i),null),wt===null)throw Error(a(349));v||(sa&127)!==0||mb(d,i,s)}return s}function mb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=He.updateQueue,i===null?(i=Nc(),He.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function pb(r,i,s,d){i.value=s,i.getSnapshot=d,yb(i)&&vb(r)}function gb(r,i,s){return s(function(){yb(i)&&vb(r)})}function yb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Yn(r,s)}catch{return!0}}function vb(r){var i=qi(r,2);i!==null&&Fn(i,r,2)}function Bh(r){var i=Tn();if(typeof r=="function"){var s=r;if(r=s(),Ji){fn(!0);try{s()}finally{fn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},i}function bb(r,i,s,d){return r.baseState=s,Uh(r,yt,typeof d=="function"?d:oa)}function S_(r,i,s,d,p){if(zc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,xb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function xb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,w={};Z.T=w;try{var N=s(p,d),U=Z.S;U!==null&&U(w,N),Sb(r,i,N)}catch(G){$h(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),Z.T=v}}else try{v=s(p,d),Sb(r,i,v)}catch(G){$h(r,i,G)}}function Sb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){wb(r,i,d)},function(d){return $h(r,i,d)}):wb(r,i,s)}function wb(r,i,s){i.status="fulfilled",i.value=s,kb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,xb(r,s)))}function $h(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,kb(i),i=i.next;while(i!==d)}r.action=null}function kb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function jb(r,i){return i}function Cb(r,i){if(rt){var s=wt.formState;if(s!==null){e:{var d=He;if(rt){if(Et){t:{for(var p=Et,v=yr;p.nodeType!==8;){if(!v){p=null;break t}if(p=br(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=br(p.nextSibling),d=p.data==="F!";break e}}Ba(d)}d=!1}d&&(i=s[0])}}return s=Tn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jb,lastRenderedState:i},s.queue=d,s=Hb.bind(null,He,d),d.dispatch=s,d=Bh(!1),v=Qh.bind(null,He,!1,d.queue),d=Tn(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=S_.bind(null,He,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Eb(r){var i=Zt();return Nb(i,yt,r)}function Nb(r,i,s){if(i=Uh(r,i,jb)[0],r=Ac(oa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Ro(i)}catch(w){throw w===Kl?bc:w}else d=i;i=Zt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(He.flags|=2048,es(9,{destroy:void 0},w_.bind(null,p,s),null)),[d,v,r]}function w_(r,i){r.action=i}function _b(r){var i=Zt(),s=yt;if(s!==null)return Nb(i,s,r);Zt(),i=i.memoizedState,s=Zt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function es(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=He.updateQueue,i===null&&(i=Nc(),He.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function Ab(){return Zt().memoizedState}function Tc(r,i,s,d){var p=Tn();He.flags|=r,p.memoizedState=es(1|i,{destroy:void 0},s,d===void 0?null:d)}function Rc(r,i,s,d){var p=Zt();d=d===void 0?null:d;var v=p.memoizedState.inst;yt!==null&&d!==null&&zh(d,yt.memoizedState.deps)?p.memoizedState=es(i,v,s,d):(He.flags|=r,p.memoizedState=es(1|i,v,s,d))}function Tb(r,i){Tc(8390656,8,r,i)}function Fh(r,i){Rc(2048,8,r,i)}function k_(r){He.flags|=4;var i=He.updateQueue;if(i===null)i=Nc(),He.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Rb(r){var i=Zt().memoizedState;return k_({ref:i,nextImpl:r}),function(){if((ct&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function zb(r,i){return Rc(4,2,r,i)}function Ob(r,i){return Rc(4,4,r,i)}function Db(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Mb(r,i,s){s=s!=null?s.concat([r]):null,Rc(4,4,Db.bind(null,i,r),s)}function qh(){}function Lb(r,i){var s=Zt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&zh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Ib(r,i){var s=Zt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&zh(i,d[1]))return d[0];if(d=r(),Ji){fn(!0);try{r()}finally{fn(!1)}}return s.memoizedState=[d,i],d}function Hh(r,i,s){return s===void 0||(sa&1073741824)!==0&&(et&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Ux(),He.lanes|=r,Ka|=r,s)}function Ub(r,i,s,d){return Yn(s,i)?s:Xl.current!==null?(r=Hh(r,s,d),Yn(r,i)||(Kt=!0),r):(sa&42)===0||(sa&1073741824)!==0&&(et&261930)===0?(Kt=!0,r.memoizedState=s):(r=Ux(),He.lanes|=r,Ka|=r,i)}function Pb(r,i,s,d,p){var v=ae.p;ae.p=v!==0&&8>v?v:8;var w=Z.T,N={};Z.T=N,Qh(r,!1,i,s);try{var U=p(),G=Z.S;if(G!==null&&G(N,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=v_(U,d);zo(r,i,re,nr(r))}else zo(r,i,d,nr(r))}catch(ce){zo(r,i,{then:function(){},status:"rejected",reason:ce},nr())}finally{ae.p=v,w!==null&&N.types!==null&&(w.types=N.types),Z.T=w}}function j_(){}function Zh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=Bb(r).queue;Pb(r,p,i,K,s===null?j_:function(){return $b(r),s(d)})}function Bb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function $b(r){var i=Bb(r);i.next===null&&(i=r.alternate.memoizedState),zo(r,i.next.queue,{},nr())}function Vh(){return gn(Ko)}function Fb(){return Zt().memoizedState}function qb(){return Zt().memoizedState}function C_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=nr();r=qa(s);var d=Ha(i,r,s);d!==null&&(Fn(d,i,s),No(d,i,s)),i={cache:Sh()},r.payload=i;return}i=i.return}}function E_(r,i,s){var d=nr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},zc(r)?Zb(i,s):(s=ch(r,i,s,d),s!==null&&(Fn(s,r,d),Vb(s,i,d)))}function Hb(r,i,s){var d=nr();zo(r,i,s,d)}function zo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(zc(r))Zb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,Yn(N,w))return fc(r,i,p,0),wt===null&&dc(),!1}catch{}finally{}if(s=ch(r,i,p,d),s!==null)return Fn(s,r,d),Vb(s,i,d),!0}return!1}function Qh(r,i,s,d){if(d={lane:2,revertLane:Cm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},zc(r)){if(i)throw Error(a(479))}else i=ch(r,s,d,2),i!==null&&Fn(i,r,2)}function zc(r){var i=r.alternate;return r===He||i!==null&&i===He}function Zb(r,i){Jl=Cc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Vb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,Wu(r,s)}}var Oo={readContext:gn,use:_c,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};Oo.useEffectEvent=Mt;var Qb={readContext:gn,use:_c,useCallback:function(r,i){return Tn().memoizedState=[r,i===void 0?null:i],r},useContext:gn,useEffect:Tb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Tc(4194308,4,Db.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Tc(4194308,4,r,i)},useInsertionEffect:function(r,i){Tc(4,2,r,i)},useMemo:function(r,i){var s=Tn();i=i===void 0?null:i;var d=r();if(Ji){fn(!0);try{r()}finally{fn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Tn();if(s!==void 0){var p=s(i);if(Ji){fn(!0);try{s(i)}finally{fn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=E_.bind(null,He,r),[d.memoizedState,r]},useRef:function(r){var i=Tn();return r={current:r},i.memoizedState=r},useState:function(r){r=Bh(r);var i=r.queue,s=Hb.bind(null,He,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:qh,useDeferredValue:function(r,i){var s=Tn();return Hh(s,r,i)},useTransition:function(){var r=Bh(!1);return r=Pb.bind(null,He,r.queue,!0,!1),Tn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=He,p=Tn();if(rt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),wt===null)throw Error(a(349));(et&127)!==0||mb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Tb(gb.bind(null,d,v,r),[r]),d.flags|=2048,es(9,{destroy:void 0},pb.bind(null,d,v,s,i),null),s},useId:function(){var r=Tn(),i=wt.identifierPrefix;if(rt){var s=Pr,d=Ur;s=(d&~(1<<32-dt(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ec++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=b_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Vh,useFormState:Cb,useActionState:Cb,useOptimistic:function(r){var i=Tn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Qh.bind(null,He,!0,s),s.dispatch=i,[r,i]},useMemoCache:Ih,useCacheRefresh:function(){return Tn().memoizedState=C_.bind(null,He)},useEffectEvent:function(r){var i=Tn(),s={impl:r};return i.memoizedState=s,function(){if((ct&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Gh={readContext:gn,use:_c,useCallback:Lb,useContext:gn,useEffect:Fh,useImperativeHandle:Mb,useInsertionEffect:zb,useLayoutEffect:Ob,useMemo:Ib,useReducer:Ac,useRef:Ab,useState:function(){return Ac(oa)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return Ub(s,yt.memoizedState,r,i)},useTransition:function(){var r=Ac(oa)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:Ro(r),i]},useSyncExternalStore:hb,useId:Fb,useHostTransitionStatus:Vh,useFormState:Eb,useActionState:Eb,useOptimistic:function(r,i){var s=Zt();return bb(s,yt,r,i)},useMemoCache:Ih,useCacheRefresh:qb};Gh.useEffectEvent=Rb;var Gb={readContext:gn,use:_c,useCallback:Lb,useContext:gn,useEffect:Fh,useImperativeHandle:Mb,useInsertionEffect:zb,useLayoutEffect:Ob,useMemo:Ib,useReducer:Ph,useRef:Ab,useState:function(){return Ph(oa)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return yt===null?Hh(s,r,i):Ub(s,yt.memoizedState,r,i)},useTransition:function(){var r=Ph(oa)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:Ro(r),i]},useSyncExternalStore:hb,useId:Fb,useHostTransitionStatus:Vh,useFormState:_b,useActionState:_b,useOptimistic:function(r,i){var s=Zt();return yt!==null?bb(s,yt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Ih,useCacheRefresh:qb};Gb.useEffectEvent=Rb;function Kh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:y({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Yh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=nr(),p=qa(d);p.payload=i,s!=null&&(p.callback=s),i=Ha(r,p,d),i!==null&&(Fn(i,r,d),No(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=nr(),p=qa(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Ha(r,p,d),i!==null&&(Fn(i,r,d),No(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=nr(),d=qa(s);d.tag=2,i!=null&&(d.callback=i),i=Ha(r,d,s),i!==null&&(Fn(i,r,s),No(i,r,s))}};function Kb(r,i,s,d,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,w):i.prototype&&i.prototype.isPureReactComponent?!bo(s,d)||!bo(p,v):!0}function Yb(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Yh.enqueueReplaceState(i,i.state,null)}function Wi(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=y({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function Xb(r){cc(r)}function Jb(r){console.error(r)}function Wb(r){cc(r)}function Oc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function ex(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Xh(r,i,s){return s=qa(s),s.tag=3,s.payload={element:null},s.callback=function(){Oc(r,i)},s}function tx(r){return r=qa(r),r.tag=3,r}function nx(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){ex(i,s,d)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){ex(i,s,d),typeof p!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function N_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Vl(i,s,p,!0),s=Jn.current,s!==null){switch(s.tag){case 31:case 13:return vr===null?Zc():s.alternate===null&&Lt===0&&(Lt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===xc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),wm(r,d,p)),!1;case 22:return s.flags|=65536,d===xc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),wm(r,d,p)),!1}throw Error(a(435,s.tag))}return wm(r,d,p),Zc(),!1}if(rt)return i=Jn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==gh&&(r=Error(a(422),{cause:d}),wo(mr(r,s)))):(d!==gh&&(i=Error(a(423),{cause:d}),wo(mr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=mr(d,s),p=Xh(r.stateNode,d,p),Nh(r,p),Lt!==4&&(Lt=2)),!1;var v=Error(a(520),{cause:d});if(v=mr(v,s),$o===null?$o=[v]:$o.push(v),Lt!==4&&(Lt=2),i===null)return!0;d=mr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Xh(s.stateNode,d,r),Nh(s,r),!1;case 1:if(i=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ya===null||!Ya.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=tx(p),nx(p,r,s,d),Nh(s,p),!1}s=s.return}while(s!==null);return!1}var Jh=Error(a(461)),Kt=!1;function yn(r,i,s,d){i.child=r===null?lb(i,null,s,d):Xi(i,r.child,s,d)}function rx(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var w={};for(var N in d)N!=="ref"&&(w[N]=d[N])}else w=d;return Qi(i),d=Oh(r,i,s,w,v,p),N=Dh(),r!==null&&!Kt?(Mh(r,i,p),ua(r,i,p)):(rt&&N&&mh(i),i.flags|=1,yn(r,i,d,p),i.child)}function ax(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!dh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,ix(r,i,v,d,p)):(r=mc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!lm(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:bo,s(w,d)&&r.ref===i.ref)return ua(r,i,p)}return i.flags|=1,r=ra(v,d),r.ref=i.ref,r.return=i,i.child=r}function ix(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(bo(v,d)&&r.ref===i.ref)if(Kt=!1,i.pendingProps=d=v,lm(r,p))(r.flags&131072)!==0&&(Kt=!0);else return i.lanes=r.lanes,ua(r,i,p)}return Wh(r,i,s,d,p)}function lx(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return sx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&vc(i,v!==null?v.cachePool:null),v!==null?ub(i,v):Ah(),cb(i);else return d=i.lanes=536870912,sx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(vc(i,v.cachePool),ub(i,v),Va(),i.memoizedState=null):(r!==null&&vc(i,null),Ah(),Va());return yn(r,i,p,s),i.child}function Do(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function sx(r,i,s,d,p){var v=kh();return v=v===null?null:{parent:Qt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&vc(i,null),Ah(),cb(i),r!==null&&Vl(r,i,d,!0),i.childLanes=p,null}function Dc(r,i){return i=Lc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function ox(r,i,s){return Xi(i,r.child,null,s),r=Dc(i,i.pendingProps),r.flags|=2,Wn(i),i.memoizedState=null,r}function __(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(rt){if(d.mode==="hidden")return r=Dc(i,d),i.lanes=536870912,Do(null,r);if(Rh(i),(r=Et)?(r=x0(r,yr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ua!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},s=Zv(r),s.return=i,i.child=s,pn=i,Et=null)):r=null,r===null)throw Ba(i);return i.lanes=536870912,null}return Dc(i,d)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(Rh(i),p)if(i.flags&256)i.flags&=-257,i=ox(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Kt||Vl(r,i,s,!1),p=(s&r.childLanes)!==0,Kt||p){if(d=wt,d!==null&&(w=Jy(d,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,qi(r,w),Fn(d,r,w),Jh;Zc(),i=ox(r,i,s)}else r=v.treeContext,Et=br(w.nextSibling),pn=i,rt=!0,Pa=null,yr=!1,r!==null&&Gv(i,r),i=Dc(i,d),i.flags|=4096;return i}return r=ra(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Mc(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Wh(r,i,s,d,p){return Qi(i),s=Oh(r,i,s,d,void 0,p),d=Dh(),r!==null&&!Kt?(Mh(r,i,p),ua(r,i,p)):(rt&&d&&mh(i),i.flags|=1,yn(r,i,s,p),i.child)}function ux(r,i,s,d,p,v){return Qi(i),i.updateQueue=null,s=fb(i,d,s,p),db(r),d=Dh(),r!==null&&!Kt?(Mh(r,i,v),ua(r,i,v)):(rt&&d&&mh(i),i.flags|=1,yn(r,i,s,v),i.child)}function cx(r,i,s,d,p){if(Qi(i),i.stateNode===null){var v=Fl,w=s.contextType;typeof w=="object"&&w!==null&&(v=gn(w)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Yh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Ch(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?gn(w):Fl,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Kh(i,s,w,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Yh.enqueueReplaceState(v,v.state,null),Ao(i,d,v,p),_o(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,U=Wi(s,N);v.props=U;var G=v.context,re=s.contextType;w=Fl,typeof re=="object"&&re!==null&&(w=gn(re));var ce=s.getDerivedStateFromProps;re=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&Yb(i,v,d,w),Fa=!1;var Y=i.memoizedState;v.state=Y,Ao(i,d,v,p),_o(),G=i.memoizedState,N||Y!==G||Fa?(typeof ce=="function"&&(Kh(i,s,ce,d),G=i.memoizedState),(U=Fa||Kb(i,s,U,d,Y,G,w))?(re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=G),v.props=d,v.state=G,v.context=w,d=U):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Eh(r,i),w=i.memoizedProps,re=Wi(s,w),v.props=re,ce=i.pendingProps,Y=v.context,G=s.contextType,U=Fl,typeof G=="object"&&G!==null&&(U=gn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||Y!==U)&&Yb(i,v,d,U),Fa=!1,Y=i.memoizedState,v.state=Y,Ao(i,d,v,p),_o();var W=i.memoizedState;w!==ce||Y!==W||Fa||r!==null&&r.dependencies!==null&&gc(r.dependencies)?(typeof N=="function"&&(Kh(i,s,N,d),W=i.memoizedState),(re=Fa||Kb(i,s,re,d,Y,W,U)||r!==null&&r.dependencies!==null&&gc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,W,U),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,W,U)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=W),v.props=d,v.state=W,v.context=U,d=re):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Mc(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Xi(i,r.child,null,p),i.child=Xi(i,null,s,p)):yn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ua(r,i,p),r}function dx(r,i,s,d){return Zi(),i.flags|=256,yn(r,i,s,d),i.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(r){return{baseLanes:r,cachePool:eb()}}function nm(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=tr),r}function fx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Ht.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(rt){if(p?Za(i):Va(),(r=Et)?(r=x0(r,yr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ua!==null?{id:Ur,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},s=Zv(r),s.return=i,i.child=s,pn=i,Et=null)):r=null,r===null)throw Ba(i);return Um(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(Va(),p=i.mode,N=Lc({mode:"hidden",children:N},p),d=Hi(d,p,s,null),N.return=i,d.return=i,N.sibling=d,i.child=N,d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,w,s),i.memoizedState=em,Do(null,d)):(Za(i),rm(i,N))}var U=r.memoizedState;if(U!==null&&(N=U.dehydrated,N!==null)){if(v)i.flags&256?(Za(i),i.flags&=-257,i=am(r,i,s)):i.memoizedState!==null?(Va(),i.child=r.child,i.flags|=128,i=null):(Va(),N=d.fallback,p=i.mode,d=Lc({mode:"visible",children:d.children},p),N=Hi(N,p,s,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Xi(i,r.child,null,s),d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,w,s),i.memoizedState=em,i=Do(null,d));else if(Za(i),Um(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,d=Error(a(419)),d.stack="",d.digest=w,wo({value:d,source:null,stack:null}),i=am(r,i,s)}else if(Kt||Vl(r,i,s,!1),w=(s&r.childLanes)!==0,Kt||w){if(w=wt,w!==null&&(d=Jy(w,s),d!==0&&d!==U.retryLane))throw U.retryLane=d,qi(r,d),Fn(w,r,d),Jh;Im(N)||Zc(),i=am(r,i,s)}else Im(N)?(i.flags|=192,i.child=r.child,i=null):(r=U.treeContext,Et=br(N.nextSibling),pn=i,rt=!0,Pa=null,yr=!1,r!==null&&Gv(i,r),i=rm(i,d.children),i.flags|=4096);return i}return p?(Va(),N=d.fallback,p=i.mode,U=r.child,G=U.sibling,d=ra(U,{mode:"hidden",children:d.children}),d.subtreeFlags=U.subtreeFlags&65011712,G!==null?N=ra(G,N):(N=Hi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,Do(null,d),d=i.child,N=r.child.memoizedState,N===null?N=tm(s):(p=N.cachePool,p!==null?(U=Qt._currentValue,p=p.parent!==U?{parent:U,pool:U}:p):p=eb(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=nm(r,w,s),i.memoizedState=em,Do(r.child,d)):(Za(i),s=r.child,r=s.sibling,s=ra(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function rm(r,i){return i=Lc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Lc(r,i){return r=Xn(22,r,null,i),r.lanes=0,r}function am(r,i,s){return Xi(i,r.child,null,s),r=rm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function hx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),bh(r.return,i,s)}function im(r,i,s,d,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function mx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var w=Ht.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Ht,w),yn(r,i,d,s),d=rt?So:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&hx(r,s,i);else if(r.tag===19)hx(r,s,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(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&jc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),im(i,!1,p,s,v,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&jc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}im(i,!0,s,null,v,d);break;case"together":im(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ua(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Ka|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Vl(r,i,s,!1),(s&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,s=ra(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=ra(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function lm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&gc(r)))}function A_(r,i,s){switch(i.tag){case 3:Le(i,i.stateNode.containerInfo),$a(i,Qt,r.memoizedState.cache),Zi();break;case 27:case 5:Ct(i);break;case 4:Le(i,i.stateNode.containerInfo);break;case 10:$a(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Rh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Za(i),i.flags|=128,null):(s&i.child.childLanes)!==0?fx(r,i,s):(Za(i),r=ua(r,i,s),r!==null?r.sibling:null);Za(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Vl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return mx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Ht,Ht.current),d)break;return null;case 22:return i.lanes=0,lx(r,i,s,i.pendingProps);case 24:$a(i,Qt,r.memoizedState.cache)}return ua(r,i,s)}function px(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Kt=!0;else{if(!lm(r,s)&&(i.flags&128)===0)return Kt=!1,A_(r,i,s);Kt=(r.flags&131072)!==0}else Kt=!1,rt&&(i.flags&1048576)!==0&&Qv(i,So,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Ki(i.elementType),i.type=r,typeof r=="function")dh(r)?(d=Wi(r,d),i.tag=1,i=cx(null,i,r,d,s)):(i.tag=0,i=Wh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===L){i.tag=11,i=rx(null,i,r,d,s);break e}else if(p===I){i.tag=14,i=ax(null,i,r,d,s);break e}}throw i=fe(r)||r,Error(a(306,i,""))}}return i;case 0:return Wh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=Wi(d,i.pendingProps),cx(r,i,d,p,s);case 3:e:{if(Le(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Eh(r,i),Ao(i,d,null,s);var w=i.memoizedState;if(d=w.cache,$a(i,Qt,d),d!==v.cache&&xh(i,[Qt],s,!0),_o(),d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=dx(r,i,d,s);break e}else if(d!==p){p=mr(Error(a(424)),i),wo(p),i=dx(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Et=br(r.firstChild),pn=i,rt=!0,Pa=null,yr=!0,s=lb(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Zi(),d===p){i=ua(r,i,s);break e}yn(r,i,d,s)}i=i.child}return i;case 26:return Mc(r,i),r===null?(s=E0(i.type,null,i.pendingProps,null))?i.memoizedState=s:rt||(s=i.type,r=i.pendingProps,d=Jc(ue.current).createElement(s),d[mn]=i,d[Ln]=r,vn(d,s,r),ln(d),i.stateNode=d):i.memoizedState=E0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ct(i),r===null&&rt&&(d=i.stateNode=k0(i.type,i.pendingProps,ue.current),pn=i,yr=!0,p=Et,ei(i.type)?(Pm=p,Et=br(d.firstChild)):Et=p),yn(r,i,i.pendingProps.children,s),Mc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&rt&&((p=d=Et)&&(d=i2(d,i.type,i.pendingProps,yr),d!==null?(i.stateNode=d,pn=i,Et=br(d.firstChild),yr=!1,p=!0):p=!1),p||Ba(i)),Ct(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,d=v.children,Dm(p,v)?d=null:w!==null&&Dm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=Oh(r,i,x_,null,null,s),Ko._currentValue=p),Mc(r,i),yn(r,i,d,s),i.child;case 6:return r===null&&rt&&((r=s=Et)&&(s=l2(s,i.pendingProps,yr),s!==null?(i.stateNode=s,pn=i,Et=null,r=!0):r=!1),r||Ba(i)),null;case 13:return fx(r,i,s);case 4:return Le(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Xi(i,null,d,s):yn(r,i,d,s),i.child;case 11:return rx(r,i,i.type,i.pendingProps,s);case 7:return yn(r,i,i.pendingProps,s),i.child;case 8:return yn(r,i,i.pendingProps.children,s),i.child;case 12:return yn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,$a(i,i.type,d.value),yn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Qi(i),p=gn(p),d=d(p),i.flags|=1,yn(r,i,d,s),i.child;case 14:return ax(r,i,i.type,i.pendingProps,s);case 15:return ix(r,i,i.type,i.pendingProps,s);case 19:return mx(r,i,s);case 31:return __(r,i,s);case 22:return lx(r,i,s,i.pendingProps);case 24:return Qi(i),d=gn(Qt),r===null?(p=kh(),p===null&&(p=wt,v=Sh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Ch(i),$a(i,Qt,p)):((r.lanes&s)!==0&&(Eh(r,i),Ao(i,null,null,s),_o()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),$a(i,Qt,d)):(d=v.cache,$a(i,Qt,d),d!==p.cache&&xh(i,[Qt],s,!0))),yn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ca(r){r.flags|=4}function sm(r,i,s,d,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(Fx())r.flags|=8192;else throw Yi=xc,jh}else r.flags&=-16777217}function gx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!R0(i))if(Fx())r.flags|=8192;else throw Yi=xc,jh}function Ic(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ve():536870912,r.lanes|=i,as|=i)}function Mo(r,i){if(!rt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Nt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function T_(r,i,s){var d=i.pendingProps;switch(ph(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),la(Qt),Se(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Zl(i)?ca(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,yh())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ca(i),v!==null?(Nt(i),gx(i,v)):(Nt(i),sm(i,p,null,d,s))):v?v!==r.memoizedState?(ca(i),Nt(i),gx(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&ca(i),Nt(i),sm(i,p,r,d,s)),null;case 27:if(te(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ca(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=$.current,Zl(i)?Kv(i):(r=k0(p,d,s),i.stateNode=r,ca(i))}return Nt(i),null;case 5:if(te(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ca(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=$.current,Zl(i))Kv(i);else{var w=Jc(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?w.createElement(p,{is:d.is}):w.createElement(p)}}v[mn]=i,v[Ln]=d;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(vn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ca(i)}}return Nt(i),sm(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&ca(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Zl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=pn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[mn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||f0(r.nodeValue,s)),r||Ba(i,!0)}else r=Jc(r).createTextNode(d),r[mn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Zl(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[mn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Wn(i),i):(Wn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Zl(i),d!==null&&d.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[mn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Wn(i),i):(Wn(i),null)}return Wn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Ic(i,i.updateQueue),Nt(i),null);case 4:return Se(),r===null&&Am(i.stateNode.containerInfo),Nt(i),null;case 10:return la(i.type),Nt(i),null;case 19:if(B(Ht),d=i.memoizedState,d===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Mo(d,!1);else{if(Lt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=jc(r),v!==null){for(i.flags|=128,Mo(d,!1),r=v.updateQueue,i.updateQueue=r,Ic(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Hv(s,r),s=s.sibling;return _(Ht,Ht.current&1|2),rt&&aa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&cn()>Fc&&(i.flags|=128,p=!0,Mo(d,!1),i.lanes=4194304)}else{if(!p)if(r=jc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Ic(i,r),Mo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!rt)return Nt(i),null}else 2*cn()-d.renderingStartTime>Fc&&s!==536870912&&(i.flags|=128,p=!0,Mo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=cn(),r.sibling=null,s=Ht.current,_(Ht,p?s&1|2:s&1),rt&&aa(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return Wn(i),Th(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&Ic(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&B(Gi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),la(Qt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function R_(r,i){switch(ph(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return la(Qt),Se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return te(i),null;case 31:if(i.memoizedState!==null){if(Wn(i),i.alternate===null)throw Error(a(340));Zi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Wn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Zi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(Ht),null;case 4:return Se(),null;case 10:return la(i.type),null;case 22:case 23:return Wn(i),Th(),r!==null&&B(Gi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return la(Qt),null;case 25:return null;default:return null}}function yx(r,i){switch(ph(i),i.tag){case 3:la(Qt),Se();break;case 26:case 27:case 5:te(i);break;case 4:Se();break;case 31:i.memoizedState!==null&&Wn(i);break;case 13:Wn(i);break;case 19:B(Ht);break;case 10:la(i.type);break;case 22:case 23:Wn(i),Th(),r!==null&&B(Gi);break;case 24:la(Qt)}}function Lo(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,w=s.inst;d=v(),w.destroy=d}s=s.next}while(s!==p)}}catch(N){pt(i,i.return,N)}}function Qa(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var w=d.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var U=s,G=N;try{G()}catch(re){pt(p,U,re)}}}d=d.next}while(d!==v)}}catch(re){pt(i,i.return,re)}}function vx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{ob(i,s)}catch(d){pt(r,r.return,d)}}}function bx(r,i,s){s.props=Wi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){pt(r,i,d)}}function Io(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){pt(r,i,p)}}function Br(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){pt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){pt(r,i,p)}else s.current=null}function xx(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){pt(r,r.return,p)}}function om(r,i,s){try{var d=r.stateNode;W_(d,r.type,s,i),d[Ln]=i}catch(p){pt(r,r.return,p)}}function Sx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ei(r.type)||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Sx(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&&ei(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 cm(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=ta));else if(d!==4&&(d===27&&ei(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(cm(r,i,s),r=r.sibling;r!==null;)cm(r,i,s),r=r.sibling}function Uc(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ei(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Uc(r,i,s),r=r.sibling;r!==null;)Uc(r,i,s),r=r.sibling}function wx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);vn(i,d,s),i[mn]=r,i[Ln]=s}catch(v){pt(r,r.return,v)}}var da=!1,Yt=!1,dm=!1,kx=typeof WeakSet=="function"?WeakSet:Set,sn=null;function z_(r,i){if(r=r.containerInfo,zm=id,r=Mv(r),ah(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,U=-1,G=0,re=0,ce=r,Y=null;t:for(;;){for(var W;ce!==s||p!==0&&ce.nodeType!==3||(N=w+p),ce!==v||d!==0&&ce.nodeType!==3||(U=w+d),ce.nodeType===3&&(w+=ce.nodeValue.length),(W=ce.firstChild)!==null;)Y=ce,ce=W;for(;;){if(ce===r)break t;if(Y===s&&++G===p&&(N=w),Y===v&&++re===d&&(U=w),(W=ce.nextSibling)!==null)break;ce=Y,Y=ce.parentNode}ce=W}s=N===-1||U===-1?null:{start:N,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Om={focusedElem:r,selectionRange:s},id=!1,sn=i;sn!==null;)if(i=sn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,sn=r;else for(;sn!==null;){switch(i=sn,v=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(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=i,p=v.memoizedProps,v=v.memoizedState,d=s.stateNode;try{var ke=Wi(s.type,p);r=d.getSnapshotBeforeUpdate(ke,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Oe){pt(s,s.return,Oe)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Lm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Lm(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,sn=r;break}sn=i.return}}function jx(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ha(r,s),d&4&&Lo(5,s);break;case 1:if(ha(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){pt(s,s.return,w)}else{var p=Wi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){pt(s,s.return,w)}}d&64&&vx(s),d&512&&Io(s,s.return);break;case 3:if(ha(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{ob(r,i)}catch(w){pt(s,s.return,w)}}break;case 27:i===null&&d&4&&wx(s);case 26:case 5:ha(r,s),i===null&&d&4&&xx(s),d&512&&Io(s,s.return);break;case 12:ha(r,s);break;case 31:ha(r,s),d&4&&Nx(r,s);break;case 13:ha(r,s),d&4&&_x(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=$_.bind(null,s),s2(r,s))));break;case 22:if(d=s.memoizedState!==null||da,!d){i=i!==null&&i.memoizedState!==null||Yt,p=da;var v=Yt;da=d,(Yt=i)&&!v?ma(r,s,(s.subtreeFlags&8772)!==0):ha(r,s),da=p,Yt=v}break;case 30:break;default:ha(r,s)}}function Cx(r){var i=r.alternate;i!==null&&(r.alternate=null,Cx(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&$f(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 _t=null,Un=!1;function fa(r,i,s){for(s=s.child;s!==null;)Ex(r,i,s),s=s.sibling}function Ex(r,i,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(en,s)}catch{}switch(s.tag){case 26:Yt||Br(s,i),fa(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Yt||Br(s,i);var d=_t,p=Un;ei(s.type)&&(_t=s.stateNode,Un=!1),fa(r,i,s),Vo(s.stateNode),_t=d,Un=p;break;case 5:Yt||Br(s,i);case 6:if(d=_t,p=Un,_t=null,fa(r,i,s),_t=d,Un=p,_t!==null)if(Un)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(v){pt(s,i,v)}else try{_t.removeChild(s.stateNode)}catch(v){pt(s,i,v)}break;case 18:_t!==null&&(Un?(r=_t,v0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),fs(r)):v0(_t,s.stateNode));break;case 4:d=_t,p=Un,_t=s.stateNode.containerInfo,Un=!0,fa(r,i,s),_t=d,Un=p;break;case 0:case 11:case 14:case 15:Qa(2,s,i),Yt||Qa(4,s,i),fa(r,i,s);break;case 1:Yt||(Br(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&bx(s,i,d)),fa(r,i,s);break;case 21:fa(r,i,s);break;case 22:Yt=(d=Yt)||s.memoizedState!==null,fa(r,i,s),Yt=d;break;default:fa(r,i,s)}}function Nx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{fs(r)}catch(s){pt(i,i.return,s)}}}function _x(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{fs(r)}catch(s){pt(i,i.return,s)}}function O_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new kx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new kx),i;default:throw Error(a(435,r.tag))}}function Pc(r,i){var s=O_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=F_.bind(null,r,d);d.then(p,p)}})}function Pn(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ei(N.type)){_t=N.stateNode,Un=!1;break e}break;case 5:_t=N.stateNode,Un=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Un=!0;break e}N=N.return}if(_t===null)throw Error(a(160));Ex(v,w,p),_t=null,Un=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Ax(i,r),i=i.sibling}var zr=null;function Ax(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Pn(i,r),Bn(r),d&4&&(Qa(3,r,r.return),Lo(3,r),Qa(5,r,r.return));break;case 1:Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),d&64&&da&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=zr;if(Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[uo]||v[mn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),vn(v,d,s),v[mn]=r,ln(v),d=v;break e;case"link":var w=A0("link","href",p).get(d+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(d),vn(v,d,s),p.head.appendChild(v);break;case"meta":if(w=A0("meta","content",p).get(d+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(d),vn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[mn]=r,ln(v),d=v}r.stateNode=d}else T0(p,r.type,r.stateNode);else r.stateNode=_0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?T0(p,r.type,r.stateNode):_0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&om(r,r.memoizedProps,s.memoizedProps)}break;case 27:Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),s!==null&&d&4&&om(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Pn(i,r),Bn(r),d&512&&(Yt||s===null||Br(s,s.return)),r.flags&32){p=r.stateNode;try{Ml(p,"")}catch(ke){pt(r,r.return,ke)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,om(r,p,s!==null?s.memoizedProps:p)),d&1024&&(dm=!0);break;case 6:if(Pn(i,r),Bn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(ke){pt(r,r.return,ke)}}break;case 3:if(td=null,p=zr,zr=Wc(i.containerInfo),Pn(i,r),zr=p,Bn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{fs(i.containerInfo)}catch(ke){pt(r,r.return,ke)}dm&&(dm=!1,Tx(r));break;case 4:d=zr,zr=Wc(r.stateNode.containerInfo),Pn(i,r),Bn(r),zr=d;break;case 12:Pn(i,r),Bn(r);break;case 31:Pn(i,r),Bn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Pc(r,d)));break;case 13:Pn(i,r),Bn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&($c=cn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Pc(r,d)));break;case 22:p=r.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,G=da,re=Yt;if(da=G||p,Yt=re||U,Pn(i,r),Yt=re,da=G,Bn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||U||da||Yt||el(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){U=s=i;try{if(v=U.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=U.stateNode;var ce=U.memoizedProps.style,Y=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ke){pt(U,U.return,ke)}}}else if(i.tag===6){if(s===null){U=i;try{U.stateNode.nodeValue=p?"":U.memoizedProps}catch(ke){pt(U,U.return,ke)}}}else if(i.tag===18){if(s===null){U=i;try{var W=U.stateNode;p?b0(W,!0):b0(U.stateNode,!1)}catch(ke){pt(U,U.return,ke)}}}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;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Pc(r,s))));break;case 19:Pn(i,r),Bn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Pc(r,d)));break;case 30:break;case 21:break;default:Pn(i,r),Bn(r)}}function Bn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Sx(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=um(r);Uc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Ml(w,""),s.flags&=-33);var N=um(r);Uc(r,N,w);break;case 3:case 4:var U=s.stateNode.containerInfo,G=um(r);cm(r,G,U);break;default:throw Error(a(161))}}catch(re){pt(r,r.return,re)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Tx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Tx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ha(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)jx(r,i.alternate,i),i=i.sibling}function el(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Qa(4,i,i.return),el(i);break;case 1:Br(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&bx(i,i.return,s),el(i);break;case 27:Vo(i.stateNode);case 26:case 5:Br(i,i.return),el(i);break;case 22:i.memoizedState===null&&el(i);break;case 30:el(i);break;default:el(i)}r=r.sibling}}function ma(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:ma(p,v,s),Lo(4,v);break;case 1:if(ma(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){pt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var N=d.stateNode;try{var U=p.shared.hiddenCallbacks;if(U!==null)for(p.shared.hiddenCallbacks=null,p=0;p<U.length;p++)sb(U[p],N)}catch(G){pt(d,d.return,G)}}s&&w&64&&vx(v),Io(v,v.return);break;case 27:wx(v);case 26:case 5:ma(p,v,s),s&&d===null&&w&4&&xx(v),Io(v,v.return);break;case 12:ma(p,v,s);break;case 31:ma(p,v,s),s&&w&4&&Nx(p,v);break;case 13:ma(p,v,s),s&&w&4&&_x(p,v);break;case 22:v.memoizedState===null&&ma(p,v,s),Io(v,v.return);break;case 30:break;default:ma(p,v,s)}i=i.sibling}}function fm(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&ko(s))}function hm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&ko(r))}function Or(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Rx(r,i,s,d),i=i.sibling}function Rx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Or(r,i,s,d),p&2048&&Lo(9,i);break;case 1:Or(r,i,s,d);break;case 3:Or(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&ko(r)));break;case 12:if(p&2048){Or(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(U){pt(i,i.return,U)}}else Or(r,i,s,d);break;case 31:Or(r,i,s,d);break;case 13:Or(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?Or(r,i,s,d):Uo(r,i):v._visibility&2?Or(r,i,s,d):(v._visibility|=2,ts(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&fm(w,i);break;case 24:Or(r,i,s,d),p&2048&&hm(i.alternate,i);break;default:Or(r,i,s,d)}}function ts(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,U=d,G=w.flags;switch(w.tag){case 0:case 11:case 15:ts(v,w,N,U,p),Lo(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?ts(v,w,N,U,p):Uo(v,w):(re._visibility|=2,ts(v,w,N,U,p)),p&&G&2048&&fm(w.alternate,w);break;case 24:ts(v,w,N,U,p),p&&G&2048&&hm(w.alternate,w);break;default:ts(v,w,N,U,p)}i=i.sibling}}function Uo(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:Uo(s,d),p&2048&&fm(d.alternate,d);break;case 24:Uo(s,d),p&2048&&hm(d.alternate,d);break;default:Uo(s,d)}i=i.sibling}}var Po=8192;function ns(r,i,s){if(r.subtreeFlags&Po)for(r=r.child;r!==null;)zx(r,i,s),r=r.sibling}function zx(r,i,s){switch(r.tag){case 26:ns(r,i,s),r.flags&Po&&r.memoizedState!==null&&b2(s,zr,r.memoizedState,r.memoizedProps);break;case 5:ns(r,i,s);break;case 3:case 4:var d=zr;zr=Wc(r.stateNode.containerInfo),ns(r,i,s),zr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Po,Po=16777216,ns(r,i,s),Po=d):ns(r,i,s));break;default:ns(r,i,s)}}function Ox(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 Bo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];sn=d,Mx(d,r)}Ox(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Dx(r),r=r.sibling}function Dx(r){switch(r.tag){case 0:case 11:case 15:Bo(r),r.flags&2048&&Qa(9,r,r.return);break;case 3:Bo(r);break;case 12:Bo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Bc(r)):Bo(r);break;default:Bo(r)}}function Bc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];sn=d,Mx(d,r)}Ox(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Qa(8,i,i.return),Bc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Bc(i));break;default:Bc(i)}r=r.sibling}}function Mx(r,i){for(;sn!==null;){var s=sn;switch(s.tag){case 0:case 11:case 15:Qa(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:ko(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,sn=d;else e:for(s=r;sn!==null;){d=sn;var p=d.sibling,v=d.return;if(Cx(d),d===s){sn=null;break e}if(p!==null){p.return=v,sn=p;break e}sn=v}}}var D_={getCacheForType:function(r){var i=gn(Qt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return gn(Qt).controller.signal}},M_=typeof WeakMap=="function"?WeakMap:Map,ct=0,wt=null,Xe=null,et=0,mt=0,er=null,Ga=!1,rs=!1,mm=!1,pa=0,Lt=0,Ka=0,tl=0,pm=0,tr=0,as=0,$o=null,$n=null,gm=!1,$c=0,Lx=0,Fc=1/0,qc=null,Ya=null,tn=0,Xa=null,is=null,ga=0,ym=0,vm=null,Ix=null,Fo=0,bm=null;function nr(){return(ct&2)!==0&&et!==0?et&-et:Z.T!==null?Cm():Wy()}function Ux(){if(tr===0)if((et&536870912)===0||rt){var r=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),tr=r}else tr=536870912;return r=Jn.current,r!==null&&(r.flags|=32),tr}function Fn(r,i,s){(r===wt&&(mt===2||mt===9)||r.cancelPendingCommit!==null)&&(ls(r,0),Ja(r,et,tr,!1)),hn(r,s),((ct&2)===0||r!==wt)&&(r===wt&&((ct&2)===0&&(tl|=s),Lt===4&&Ja(r,et,tr,!1)),$r(r))}function Px(r,i,s){if((ct&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ma(r,i),p=d?U_(r,i):Sm(r,i,!0),v=d;do{if(p===0){rs&&!d&&Ja(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!L_(s)){p=Sm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=$o;var U=N.current.memoizedState.isDehydrated;if(U&&(ls(N,w).flags|=256),w=Sm(N,w,!1),w!==2){if(mm&&!U){N.errorRecoveryDisabledLanes|=v,tl|=v,p=4;break e}v=$n,$n=p,v!==null&&($n===null?$n=v:$n.push.apply($n,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){ls(r,0),Ja(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ja(d,i,tr,!Ga);break e;case 2:$n=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=$c+300-cn(),10<p)){if(Ja(d,i,tr,!Ga),Ui(d,0,!0)!==0)break e;ga=i,d.timeoutHandle=g0(Bx.bind(null,d,s,$n,qc,gm,i,tr,tl,as,Ga,v,"Throttled",-0,0),p);break e}Bx(d,s,$n,qc,gm,i,tr,tl,as,Ga,v,null,-0,0)}}break}while(!0);$r(r)}function Bx(r,i,s,d,p,v,w,N,U,G,re,ce,Y,W){if(r.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ta},zx(i,v,ce);var ke=(v&62914560)===v?$c-cn():(v&4194048)===v?Lx-cn():0;if(ke=x2(ce,ke),ke!==null){ga=v,r.cancelPendingCommit=ke(Gx.bind(null,r,i,v,s,d,p,w,N,U,re,ce,null,Y,W)),Ja(r,v,w,!G);return}}Gx(r,i,v,s,d,p,w,N,U)}function L_(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],v=p.getSnapshot;p=p.value;try{if(!Yn(v(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;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,s,d){i&=~pm,i&=~tl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-dt(p),w=1<<v;d[v]=-1,p&=~w}s!==0&&oo(r,s,i)}function Hc(){return(ct&6)===0?(qo(0),!1):!0}function xm(){if(Xe!==null){if(mt===0)var r=Xe.return;else r=Xe,ia=Vi=null,Lh(r),Yl=null,Co=0,r=Xe;for(;r!==null;)yx(r.alternate,r),r=r.return;Xe=null}}function ls(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,n2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ga=0,xm(),wt=r,Xe=s=ra(r.current,null),et=i,mt=0,er=null,Ga=!1,rs=Ma(r,i),mm=!1,as=tr=pm=tl=Ka=Lt=0,$n=$o=null,gm=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-dt(d),v=1<<p;i|=r[p],d&=~v}return pa=i,dc(),s}function $x(r,i){He=null,Z.H=Oo,i===Kl||i===bc?(i=rb(),mt=3):i===jh?(i=rb(),mt=4):mt=i===Jh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,er=i,Xe===null&&(Lt=1,Oc(r,mr(i,r.current)))}function Fx(){var r=Jn.current;return r===null?!0:(et&4194048)===et?vr===null:(et&62914560)===et||(et&536870912)!==0?r===vr:!1}function qx(){var r=Z.H;return Z.H=Oo,r===null?Oo:r}function Hx(){var r=Z.A;return Z.A=D_,r}function Zc(){Lt=4,Ga||(et&4194048)!==et&&Jn.current!==null||(rs=!0),(Ka&134217727)===0&&(tl&134217727)===0||wt===null||Ja(wt,et,tr,!1)}function Sm(r,i,s){var d=ct;ct|=2;var p=qx(),v=Hx();(wt!==r||et!==i)&&(qc=null,ls(r,i)),i=!1;var w=Lt;e:do try{if(mt!==0&&Xe!==null){var N=Xe,U=er;switch(mt){case 8:xm(),w=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(i=!0);var G=mt;if(mt=0,er=null,ss(r,N,U,G),s&&rs){w=0;break e}break;default:G=mt,mt=0,er=null,ss(r,N,U,G)}}I_(),w=Lt;break}catch(re){$x(r,re)}while(!0);return i&&r.shellSuspendCounter++,ia=Vi=null,ct=d,Z.H=p,Z.A=v,Xe===null&&(wt=null,et=0,dc()),w}function I_(){for(;Xe!==null;)Zx(Xe)}function U_(r,i){var s=ct;ct|=2;var d=qx(),p=Hx();wt!==r||et!==i?(qc=null,Fc=cn()+500,ls(r,i)):rs=Ma(r,i);e:do try{if(mt!==0&&Xe!==null){i=Xe;var v=er;t:switch(mt){case 1:mt=0,er=null,ss(r,i,v,1);break;case 2:case 9:if(tb(v)){mt=0,er=null,Vx(i);break}i=function(){mt!==2&&mt!==9||wt!==r||(mt=7),$r(r)},v.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:tb(v)?(mt=0,er=null,Vx(i)):(mt=0,er=null,ss(r,i,v,7));break;case 5:var w=null;switch(Xe.tag){case 26:w=Xe.memoizedState;case 5:case 27:var N=Xe;if(w?R0(w):N.stateNode.complete){mt=0,er=null;var U=N.sibling;if(U!==null)Xe=U;else{var G=N.return;G!==null?(Xe=G,Vc(G)):Xe=null}break t}}mt=0,er=null,ss(r,i,v,5);break;case 6:mt=0,er=null,ss(r,i,v,6);break;case 8:xm(),Lt=6;break e;default:throw Error(a(462))}}P_();break}catch(re){$x(r,re)}while(!0);return ia=Vi=null,Z.H=d,Z.A=p,ct=s,Xe!==null?0:(wt=null,et=0,dc(),Lt)}function P_(){for(;Xe!==null&&!io();)Zx(Xe)}function Zx(r){var i=px(r.alternate,r,pa);r.memoizedProps=r.pendingProps,i===null?Vc(r):Xe=i}function Vx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=ux(s,i,i.pendingProps,i.type,void 0,et);break;case 11:i=ux(s,i,i.pendingProps,i.type.render,i.ref,et);break;case 5:Lh(i);default:yx(s,i),i=Xe=Hv(i,pa),i=px(s,i,pa)}r.memoizedProps=r.pendingProps,i===null?Vc(r):Xe=i}function ss(r,i,s,d){ia=Vi=null,Lh(i),Yl=null,Co=0;var p=i.return;try{if(N_(r,p,i,s,et)){Lt=1,Oc(r,mr(s,r.current)),Xe=null;return}}catch(v){if(p!==null)throw Xe=p,v;Lt=1,Oc(r,mr(s,r.current)),Xe=null;return}i.flags&32768?(rt||d===1?r=!0:rs||(et&536870912)!==0?r=!1:(Ga=r=!0,(d===2||d===9||d===3||d===6)&&(d=Jn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Qx(i,r)):Vc(i)}function Vc(r){var i=r;do{if((i.flags&32768)!==0){Qx(i,Ga);return}r=i.return;var s=T_(i.alternate,i,pa);if(s!==null){Xe=s;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=r}while(i!==null);Lt===0&&(Lt=5)}function Qx(r,i){do{var s=R_(r.alternate,r);if(s!==null){s.flags&=32767,Xe=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Xe=r;return}Xe=r=s}while(r!==null);Lt=6,Xe=null}function Gx(r,i,s,d,p,v,w,N,U){r.cancelPendingCommit=null;do Qc();while(tn!==0);if((ct&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=uh,Wr(r,s,v,w,N,U),r===wt&&(Xe=wt=null,et=0),is=i,Xa=r,ga=s,ym=v,vm=p,Ix=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,q_(Me,function(){return Wx(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=ae.p,ae.p=2,w=ct,ct|=4;try{z_(r,i,s)}finally{ct=w,ae.p=p,Z.T=d}}tn=1,Kx(),Yx(),Xx()}}function Kx(){if(tn===1){tn=0;var r=Xa,i=is,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=ae.p;ae.p=2;var p=ct;ct|=4;try{Ax(i,r);var v=Om,w=Mv(r.containerInfo),N=v.focusedElem,U=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&Dv(N.ownerDocument.documentElement,N)){if(U!==null&&ah(N)){var G=U.start,re=U.end;if(re===void 0&&(re=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(re,N.value.length);else{var ce=N.ownerDocument||document,Y=ce&&ce.defaultView||window;if(Y.getSelection){var W=Y.getSelection(),ke=N.textContent.length,Oe=Math.min(U.start,ke),bt=U.end===void 0?Oe:Math.min(U.end,ke);!W.extend&&Oe>bt&&(w=bt,bt=Oe,Oe=w);var V=Ov(N,Oe),q=Ov(N,bt);if(V&&q&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==q.node||W.focusOffset!==q.offset)){var Q=ce.createRange();Q.setStart(V.node,V.offset),W.removeAllRanges(),Oe>bt?(W.addRange(Q),W.extend(q.node,q.offset)):(Q.setEnd(q.node,q.offset),W.addRange(Q))}}}}for(ce=[],W=N;W=W.parentNode;)W.nodeType===1&&ce.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ce.length;N++){var oe=ce[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}id=!!zm,Om=zm=null}finally{ct=p,ae.p=d,Z.T=s}}r.current=i,tn=2}}function Yx(){if(tn===2){tn=0;var r=Xa,i=is,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=ae.p;ae.p=2;var p=ct;ct|=4;try{jx(r,i.alternate,i)}finally{ct=p,ae.p=d,Z.T=s}}tn=3}}function Xx(){if(tn===4||tn===3){tn=0,lo();var r=Xa,i=is,s=ga,d=Ix;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?tn=5:(tn=0,is=Xa=null,Jx(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ya=null),Pf(s),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(en,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=ae.p,ae.p=2,Z.T=null;try{for(var v=r.onRecoverableError,w=0;w<d.length;w++){var N=d[w];v(N.value,{componentStack:N.stack})}}finally{Z.T=i,ae.p=p}}(ga&3)!==0&&Qc(),$r(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===bm?Fo++:(Fo=0,bm=r):Fo=0,qo(0)}}function Jx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,ko(i)))}function Qc(){return Kx(),Yx(),Xx(),Wx()}function Wx(){if(tn!==5)return!1;var r=Xa,i=ym;ym=0;var s=Pf(ga),d=Z.T,p=ae.p;try{ae.p=32>s?32:s,Z.T=null,s=vm,vm=null;var v=Xa,w=ga;if(tn=0,is=Xa=null,ga=0,(ct&6)!==0)throw Error(a(331));var N=ct;if(ct|=4,Dx(v.current),Rx(v,v.current,w,s),ct=N,qo(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(en,v)}catch{}return!0}finally{ae.p=p,Z.T=d,Jx(r,i)}}function e0(r,i,s){i=mr(s,i),i=Xh(r.stateNode,i,2),r=Ha(r,i,2),r!==null&&(hn(r,2),$r(r))}function pt(r,i,s){if(r.tag===3)e0(r,r,s);else for(;i!==null;){if(i.tag===3){e0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ya===null||!Ya.has(d))){r=mr(s,r),s=tx(2),d=Ha(i,s,2),d!==null&&(nx(s,d,i,r),hn(d,2),$r(d));break}}i=i.return}}function wm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new M_;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(mm=!0,p.add(s),r=B_.bind(null,r,i,s),i.then(r,r))}function B_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,wt===r&&(et&s)===s&&(Lt===4||Lt===3&&(et&62914560)===et&&300>cn()-$c?(ct&2)===0&&ls(r,0):pm|=s,as===et&&(as=0)),$r(r)}function t0(r,i){i===0&&(i=ve()),r=qi(r,i),r!==null&&(hn(r,i),$r(r))}function $_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),t0(r,s)}function F_(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),t0(r,s)}function q_(r,i){return Da(r,i)}var Gc=null,os=null,km=!1,Kc=!1,jm=!1,Wa=0;function $r(r){r!==os&&r.next===null&&(os===null?Gc=os=r:os=os.next=r),Kc=!0,km||(km=!0,Z_())}function qo(r,i){if(!jm&&Kc){jm=!0;do for(var s=!1,d=Gc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var w=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-dt(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,i0(d,v))}else v=et,v=Ui(d,d===wt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||Ma(d,v)||(s=!0,i0(d,v));d=d.next}while(s);jm=!1}}function H_(){n0()}function n0(){Kc=km=!1;var r=0;Wa!==0&&t2()&&(r=Wa);for(var i=cn(),s=null,d=Gc;d!==null;){var p=d.next,v=r0(d,i);v===0?(d.next=null,s===null?Gc=p:s.next=p,p===null&&(os=s)):(s=d,(r!==0||(v&3)!==0)&&(Kc=!0)),d=p}tn!==0&&tn!==5||qo(r),Wa!==0&&(Wa=0)}function r0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-dt(v),N=1<<w,U=p[w];U===-1?((N&s)===0||(N&d)!==0)&&(p[w]=Ju(N,i)):U<=i&&(r.expiredLanes|=N),v&=~N}if(i=wt,s=et,s=Ui(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(mt===2||mt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Jr(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ma(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&Jr(d),Pf(s)){case 2:case 8:s=ye;break;case 32:s=Me;break;case 268435456:s=nt;break;default:s=Me}return d=a0.bind(null,r),s=Da(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Jr(d),r.callbackPriority=2,r.callbackNode=null,2}function a0(r,i){if(tn!==0&&tn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Qc()&&r.callbackNode!==s)return null;var d=et;return d=Ui(r,r===wt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Px(r,d,i),r0(r,cn()),r.callbackNode!=null&&r.callbackNode===s?a0.bind(null,r):null)}function i0(r,i){if(Qc())return null;Px(r,i,!0)}function Z_(){r2(function(){(ct&6)!==0?Da(le,H_):n0()})}function Cm(){if(Wa===0){var r=Ql;r===0&&(r=Mi,Mi<<=1,(Mi&261888)===0&&(Mi=256)),Wa=r}return Wa}function l0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:rc(""+r)}function s0(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function V_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=l0((p[Ln]||null).action),w=d.submitter;w&&(i=(i=w[Ln]||null)?l0(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new sc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Wa!==0){var U=w?s0(p,w):new FormData(p);Zh(s,{pending:!0,data:U,method:p.method,action:v},null,U)}}else typeof v=="function"&&(N.preventDefault(),U=w?s0(p,w):new FormData(p),Zh(s,{pending:!0,data:U,method:p.method,action:v},v,U))},currentTarget:p}]})}}for(var Em=0;Em<oh.length;Em++){var Nm=oh[Em],Q_=Nm.toLowerCase(),G_=Nm[0].toUpperCase()+Nm.slice(1);Rr(Q_,"on"+G_)}Rr(Uv,"onAnimationEnd"),Rr(Pv,"onAnimationIteration"),Rr(Bv,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(c_,"onTransitionRun"),Rr(d_,"onTransitionStart"),Rr(f_,"onTransitionCancel"),Rr($v,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ho="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(" "),K_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ho));function o0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var w=d.length-1;0<=w;w--){var N=d[w],U=N.instance,G=N.currentTarget;if(N=N.listener,U!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(re){cc(re)}p.currentTarget=null,v=U}else for(w=0;w<d.length;w++){if(N=d[w],U=N.instance,G=N.currentTarget,N=N.listener,U!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(re){cc(re)}p.currentTarget=null,v=U}}}}function Je(r,i){var s=i[Bf];s===void 0&&(s=i[Bf]=new Set);var d=r+"__bubble";s.has(d)||(u0(i,r,2,!1),s.add(d))}function _m(r,i,s){var d=0;i&&(d|=4),u0(s,r,d,i)}var Yc="_reactListening"+Math.random().toString(36).slice(2);function Am(r){if(!r[Yc]){r[Yc]=!0,nv.forEach(function(s){s!=="selectionchange"&&(K_.has(s)||_m(s,!1,r),_m(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Yc]||(i[Yc]=!0,_m("selectionchange",!1,i))}}function u0(r,i,s,d){switch(U0(i)){case 2:var p=k2;break;case 8:p=j2;break;default:p=Hm}s=p.bind(null,i,s,r),p=void 0,!Kf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function Tm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var N=d.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=d.return;w!==null;){var U=w.tag;if((U===3||U===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=Tl(N),w===null)return;if(U=w.tag,U===5||U===6||U===26||U===27){d=v=w;continue e}N=N.parentNode}}d=d.return}mv(function(){var G=v,re=Qf(s),ce=[];e:{var Y=Fv.get(r);if(Y!==void 0){var W=sc,ke=r;switch(r){case"keypress":if(ic(s)===0)break e;case"keydown":case"keyup":W=FN;break;case"focusin":ke="focus",W=Wf;break;case"focusout":ke="blur",W=Wf;break;case"beforeblur":case"afterblur":W=Wf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=yv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=TN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=ZN;break;case Uv:case Pv:case Bv:W=ON;break;case $v:W=QN;break;case"scroll":case"scrollend":W=_N;break;case"wheel":W=KN;break;case"copy":case"cut":case"paste":W=MN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=bv;break;case"toggle":case"beforetoggle":W=XN}var Oe=(i&4)!==0,bt=!Oe&&(r==="scroll"||r==="scrollend"),V=Oe?Y!==null?Y+"Capture":null:Y;Oe=[];for(var q=G,Q;q!==null;){var oe=q;if(Q=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Q===null||V===null||(oe=fo(q,V),oe!=null&&Oe.push(Zo(q,oe,Q))),bt)break;q=q.return}0<Oe.length&&(Y=new W(Y,ke,null,s,re),ce.push({event:Y,listeners:Oe}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",W=r==="mouseout"||r==="pointerout",Y&&s!==Vf&&(ke=s.relatedTarget||s.fromElement)&&(Tl(ke)||ke[Al]))break e;if((W||Y)&&(Y=re.window===re?re:(Y=re.ownerDocument)?Y.defaultView||Y.parentWindow:window,W?(ke=s.relatedTarget||s.toElement,W=G,ke=ke?Tl(ke):null,ke!==null&&(bt=o(ke),Oe=ke.tag,ke!==bt||Oe!==5&&Oe!==27&&Oe!==6)&&(ke=null)):(W=null,ke=G),W!==ke)){if(Oe=yv,oe="onMouseLeave",V="onMouseEnter",q="mouse",(r==="pointerout"||r==="pointerover")&&(Oe=bv,oe="onPointerLeave",V="onPointerEnter",q="pointer"),bt=W==null?Y:co(W),Q=ke==null?Y:co(ke),Y=new Oe(oe,q+"leave",W,s,re),Y.target=bt,Y.relatedTarget=Q,oe=null,Tl(re)===G&&(Oe=new Oe(V,q+"enter",ke,s,re),Oe.target=Q,Oe.relatedTarget=bt,oe=Oe),bt=oe,W&&ke)t:{for(Oe=Y_,V=W,q=ke,Q=0,oe=V;oe;oe=Oe(oe))Q++;oe=0;for(var Re=q;Re;Re=Oe(Re))oe++;for(;0<Q-oe;)V=Oe(V),Q--;for(;0<oe-Q;)q=Oe(q),oe--;for(;Q--;){if(V===q||q!==null&&V===q.alternate){Oe=V;break t}V=Oe(V),q=Oe(q)}Oe=null}else Oe=null;W!==null&&c0(ce,Y,W,Oe,!1),ke!==null&&bt!==null&&c0(ce,bt,ke,Oe,!0)}}e:{if(Y=G?co(G):window,W=Y.nodeName&&Y.nodeName.toLowerCase(),W==="select"||W==="input"&&Y.type==="file")var ot=Nv;else if(Cv(Y))if(_v)ot=s_;else{ot=i_;var Ne=a_}else W=Y.nodeName,!W||W.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Zf(G.elementType)&&(ot=Nv):ot=l_;if(ot&&(ot=ot(r,G))){Ev(ce,ot,s,re);break e}Ne&&Ne(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&Hf(Y,"number",Y.value)}switch(Ne=G?co(G):window,r){case"focusin":(Cv(Ne)||Ne.contentEditable==="true")&&(Pl=Ne,ih=G,xo=null);break;case"focusout":xo=ih=Pl=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,Lv(ce,s,re);break;case"selectionchange":if(u_)break;case"keydown":case"keyup":Lv(ce,s,re)}var Ze;if(th)e:{switch(r){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Ul?kv(r,s)&&(tt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(tt="onCompositionStart");tt&&(xv&&s.locale!=="ko"&&(Ul||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ul&&(Ze=pv()):(Ia=re,Yf="value"in Ia?Ia.value:Ia.textContent,Ul=!0)),Ne=Xc(G,tt),0<Ne.length&&(tt=new vv(tt,r,null,s,re),ce.push({event:tt,listeners:Ne}),Ze?tt.data=Ze:(Ze=jv(s),Ze!==null&&(tt.data=Ze)))),(Ze=WN?e_(r,s):t_(r,s))&&(tt=Xc(G,"onBeforeInput"),0<tt.length&&(Ne=new vv("onBeforeInput","beforeinput",null,s,re),ce.push({event:Ne,listeners:tt}),Ne.data=Ze)),V_(ce,r,G,s,re)}o0(ce,i)})}function Zo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function Xc(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=fo(r,s),p!=null&&d.unshift(Zo(r,p,v)),p=fo(r,i),p!=null&&d.push(Zo(r,p,v))),r.tag===3)return d;r=r.return}return[]}function Y_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function c0(r,i,s,d,p){for(var v=i._reactName,w=[];s!==null&&s!==d;){var N=s,U=N.alternate,G=N.stateNode;if(N=N.tag,U!==null&&U===d)break;N!==5&&N!==26&&N!==27||G===null||(U=G,p?(G=fo(s,v),G!=null&&w.unshift(Zo(s,G,U))):p||(G=fo(s,v),G!=null&&w.push(Zo(s,G,U)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var X_=/\r\n?/g,J_=/\u0000|\uFFFD/g;function d0(r){return(typeof r=="string"?r:""+r).replace(X_,`
|
|
49
|
-
`).replace(J_,"")}function f0(r,i){return i=d0(i),d0(r)===i}function vt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ml(r,""+d);break;case"className":tc(r,"class",d);break;case"tabIndex":tc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":tc(r,s,d);break;case"style":fv(r,d,v);break;case"data":if(i!=="object"){tc(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=rc(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(i!=="input"&&vt(r,i,"name",p.name,p,null),vt(r,i,"formEncType",p.formEncType,p,null),vt(r,i,"formMethod",p.formMethod,p,null),vt(r,i,"formTarget",p.formTarget,p,null)):(vt(r,i,"encType",p.encType,p,null),vt(r,i,"method",p.method,p,null),vt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=rc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=ta);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=rc(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":Je("beforetoggle",r),Je("toggle",r),ec(r,"popover",d);break;case"xlinkActuate":ea(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ea(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ea(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ea(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ea(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ea(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ea(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ea(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ea(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ec(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=EN.get(s)||s,ec(r,s,d))}}function Rm(r,i,s,d,p,v){switch(s){case"style":fv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Ml(r,d):(typeof d=="number"||typeof d=="bigint")&&Ml(r,""+d);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"onClick":d!=null&&(r.onclick=ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rv.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),v=r[Ln]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):ec(r,s,d)}}}function vn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",r),Je("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:vt(r,i,v,w,s,null)}}p&&vt(r,i,"srcSet",s.srcSet,s,null),d&&vt(r,i,"src",s.src,s,null);return;case"input":Je("invalid",r);var N=v=w=p=null,U=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var re=s[d];if(re!=null)switch(d){case"name":p=re;break;case"type":w=re;break;case"checked":U=re;break;case"defaultChecked":G=re;break;case"value":v=re;break;case"defaultValue":N=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:vt(r,i,d,re,s,null)}}ov(r,v,N,U,G,w,p,!1);return;case"select":Je("invalid",r),d=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":d=N;default:vt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!d,i!=null?Dl(r,!!d,i,!1):s!=null&&Dl(r,!!d,s,!0);return;case"textarea":Je("invalid",r),v=p=d=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":d=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:vt(r,i,w,N,s,null)}cv(r,d,p,v);return;case"option":for(U in s)if(s.hasOwnProperty(U)&&(d=s[U],d!=null))switch(U){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:vt(r,i,U,d,s,null)}return;case"dialog":Je("beforetoggle",r),Je("toggle",r),Je("cancel",r),Je("close",r);break;case"iframe":case"object":Je("load",r);break;case"video":case"audio":for(d=0;d<Ho.length;d++)Je(Ho[d],r);break;case"image":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"embed":case"source":case"link":Je("error",r),Je("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(G in s)if(s.hasOwnProperty(G)&&(d=s[G],d!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:vt(r,i,G,d,s,null)}return;default:if(Zf(i)){for(re in s)s.hasOwnProperty(re)&&(d=s[re],d!==void 0&&Rm(r,i,re,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&vt(r,i,N,d,s,null))}function W_(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,N=null,U=null,G=null,re=null;for(W in s){var ce=s[W];if(s.hasOwnProperty(W)&&ce!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":U=ce;default:d.hasOwnProperty(W)||vt(r,i,W,null,d,ce)}}for(var Y in d){var W=d[Y];if(ce=s[Y],d.hasOwnProperty(Y)&&(W!=null||ce!=null))switch(Y){case"type":v=W;break;case"name":p=W;break;case"checked":G=W;break;case"defaultChecked":re=W;break;case"value":w=W;break;case"defaultValue":N=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:W!==ce&&vt(r,i,Y,W,d,ce)}}qf(r,w,N,U,G,re,v,p);return;case"select":W=w=N=Y=null;for(v in s)if(U=s[v],s.hasOwnProperty(v)&&U!=null)switch(v){case"value":break;case"multiple":W=U;default:d.hasOwnProperty(v)||vt(r,i,v,null,d,U)}for(p in d)if(v=d[p],U=s[p],d.hasOwnProperty(p)&&(v!=null||U!=null))switch(p){case"value":Y=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==U&&vt(r,i,p,v,d,U)}i=N,s=w,d=W,Y!=null?Dl(r,!!s,Y,!1):!!d!=!!s&&(i!=null?Dl(r,!!s,i,!0):Dl(r,!!s,s?[]:"",!1));return;case"textarea":W=Y=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:vt(r,i,N,null,d,p)}for(w in d)if(p=d[w],v=s[w],d.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":Y=p;break;case"defaultValue":W=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&vt(r,i,w,p,d,v)}uv(r,Y,W);return;case"option":for(var ke in s)if(Y=s[ke],s.hasOwnProperty(ke)&&Y!=null&&!d.hasOwnProperty(ke))switch(ke){case"selected":r.selected=!1;break;default:vt(r,i,ke,null,d,Y)}for(U in d)if(Y=d[U],W=s[U],d.hasOwnProperty(U)&&Y!==W&&(Y!=null||W!=null))switch(U){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:vt(r,i,U,Y,d,W)}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 Oe in s)Y=s[Oe],s.hasOwnProperty(Oe)&&Y!=null&&!d.hasOwnProperty(Oe)&&vt(r,i,Oe,null,d,Y);for(G in d)if(Y=d[G],W=s[G],d.hasOwnProperty(G)&&Y!==W&&(Y!=null||W!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:vt(r,i,G,Y,d,W)}return;default:if(Zf(i)){for(var bt in s)Y=s[bt],s.hasOwnProperty(bt)&&Y!==void 0&&!d.hasOwnProperty(bt)&&Rm(r,i,bt,void 0,d,Y);for(re in d)Y=d[re],W=s[re],!d.hasOwnProperty(re)||Y===W||Y===void 0&&W===void 0||Rm(r,i,re,Y,d,W);return}}for(var V in s)Y=s[V],s.hasOwnProperty(V)&&Y!=null&&!d.hasOwnProperty(V)&&vt(r,i,V,null,d,Y);for(ce in d)Y=d[ce],W=s[ce],!d.hasOwnProperty(ce)||Y===W||Y==null&&W==null||vt(r,i,ce,Y,d,W)}function h0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function e2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,w=p.initiatorType,N=p.duration;if(v&&N&&h0(w)){for(w=0,N=p.responseEnd,d+=1;d<s.length;d++){var U=s[d],G=U.startTime;if(G>N)break;var re=U.transferSize,ce=U.initiatorType;re&&h0(ce)&&(U=U.responseEnd,w+=re*(U<N?1:(N-G)/(U-G)))}if(--d,i+=8*(v+w)/(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 zm=null,Om=null;function Jc(r){return r.nodeType===9?r:r.ownerDocument}function m0(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 p0(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 Dm(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 Mm=null;function t2(){var r=window.event;return r&&r.type==="popstate"?r===Mm?!1:(Mm=r,!0):(Mm=null,!1)}var g0=typeof setTimeout=="function"?setTimeout:void 0,n2=typeof clearTimeout=="function"?clearTimeout:void 0,y0=typeof Promise=="function"?Promise:void 0,r2=typeof queueMicrotask=="function"?queueMicrotask:typeof y0<"u"?function(r){return y0.resolve(null).then(r).catch(a2)}:g0;function a2(r){setTimeout(function(){throw r})}function ei(r){return r==="head"}function v0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),fs(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Vo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Vo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[uo]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Vo(r.ownerDocument.body);s=p}while(s);fs(i)}function b0(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Lm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Lm(s),$f(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function i2(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[uo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==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(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=br(r.nextSibling),r===null)break}return null}function l2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=br(r.nextSibling),r===null))return null;return r}function x0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=br(r.nextSibling),r===null))return null;return r}function Im(r){return r.data==="$?"||r.data==="$~"}function Um(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function s2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function br(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 Pm=null;function S0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return br(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function w0(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function k0(r,i,s){switch(i=Jc(s),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 Vo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);$f(r)}var xr=new Map,j0=new Set;function Wc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ya=ae.d;ae.d={f:o2,r:u2,D:c2,C:d2,L:f2,m:h2,X:p2,S:m2,M:g2};function o2(){var r=ya.f(),i=Hc();return r||i}function u2(r){var i=Rl(r);i!==null&&i.tag===5&&i.type==="form"?$b(i):ya.r(r)}var us=typeof document>"u"?null:document;function C0(r,i,s){var d=us;if(d&&typeof i=="string"&&i){var p=fr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),j0.has(p)||(j0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),vn(i,"link",r),ln(i),d.head.appendChild(i)))}}function c2(r){ya.D(r),C0("dns-prefetch",r,null)}function d2(r,i){ya.C(r,i),C0("preconnect",r,i)}function f2(r,i,s){ya.L(r,i,s);var d=us;if(d&&r&&i){var p='link[rel="preload"][as="'+fr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+fr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+fr(s.imageSizes)+'"]')):p+='[href="'+fr(r)+'"]';var v=p;switch(i){case"style":v=cs(r);break;case"script":v=ds(r)}xr.has(v)||(r=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),xr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Qo(v))||i==="script"&&d.querySelector(Go(v))||(i=d.createElement("link"),vn(i,"link",r),ln(i),d.head.appendChild(i)))}}function h2(r,i){ya.m(r,i);var s=us;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+fr(d)+'"][href="'+fr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ds(r)}if(!xr.has(v)&&(r=y({rel:"modulepreload",href:r},i),xr.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Go(v)))return}d=s.createElement("link"),vn(d,"link",r),ln(d),s.head.appendChild(d)}}}function m2(r,i,s){ya.S(r,i,s);var d=us;if(d&&r){var p=zl(d).hoistableStyles,v=cs(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=d.querySelector(Qo(v)))N.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},s),(s=xr.get(v))&&Bm(r,s);var U=w=d.createElement("link");ln(U),vn(U,"link",r),U._p=new Promise(function(G,re){U.onload=G,U.onerror=re}),U.addEventListener("load",function(){N.loading|=1}),U.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ed(w,i,d)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function p2(r,i){ya.X(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Go(p)),v||(r=y({src:r,async:!0},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),ln(v),vn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function g2(r,i){ya.M(r,i);var s=us;if(s&&r){var d=zl(s).hoistableScripts,p=ds(r),v=d.get(p);v||(v=s.querySelector(Go(p)),v||(r=y({src:r,async:!0,type:"module"},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),ln(v),vn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function E0(r,i,s,d){var p=(p=ue.current)?Wc(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=cs(s.href),s=zl(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=cs(s.href);var v=zl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Qo(r)))&&!v._p&&(w.instance=v,w.state.loading=5),xr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xr.set(r,s),v||y2(p,r,s,w.state))),i&&d===null)throw Error(a(528,""));return w}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ds(s),s=zl(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function cs(r){return'href="'+fr(r)+'"'}function Qo(r){return'link[rel="stylesheet"]['+r+"]"}function N0(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function y2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),vn(i,"link",s),ln(i),r.head.appendChild(i))}function ds(r){return'[src="'+fr(r)+'"]'}function Go(r){return"script[async]"+r}function _0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+fr(s.href)+'"]');if(d)return i.instance=d,ln(d),d;var p=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),ln(d),vn(d,"style",p),ed(d,s.precedence,r),i.instance=d;case"stylesheet":p=cs(s.href);var v=r.querySelector(Qo(p));if(v)return i.state.loading|=4,i.instance=v,ln(v),v;d=N0(s),(p=xr.get(p))&&Bm(d,p),v=(r.ownerDocument||r).createElement("link"),ln(v);var w=v;return w._p=new Promise(function(N,U){w.onload=N,w.onerror=U}),vn(v,"link",d),i.state.loading|=4,ed(v,s.precedence,r),i.instance=v;case"script":return v=ds(s.src),(p=r.querySelector(Go(v)))?(i.instance=p,ln(p),p):(d=s,(p=xr.get(v))&&(d=y({},s),$m(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),ln(p),vn(p,"link",d),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&&(d=i.instance,i.state.loading|=4,ed(d,s.precedence,r));return i.instance}function ed(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,w=0;w<d.length;w++){var N=d[w];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function Bm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function $m(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var td=null;function A0(r,i,s){if(td===null){var d=new Map,p=td=new Map;p.set(s,d)}else p=td,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[uo]||v[mn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=d.get(w);N?N.push(v):d.set(w,[v])}}return d}function T0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function v2(r,i,s){if(s===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;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!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 R0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function b2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=cs(d.href),v=i.querySelector(Qo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=nd.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,ln(v);return}v=i.ownerDocument||i,d=N0(d),(p=xr.get(p))&&Bm(d,p),v=v.createElement("link"),ln(v);var w=v;w._p=new Promise(function(N,U){w.onload=N,w.onerror=U}),vn(v,"link",d),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=nd.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Fm=0;function x2(r,i){return r.stylesheets&&r.count===0&&ad(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&ad(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Fm===0&&(Fm=62500*e2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ad(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Fm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function nd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var rd=null;function ad(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,rd=new Map,i.forEach(S2,r),rd=null,nd.call(r))}function S2(r,i){if(!(i.state.loading&4)){var s=rd.get(r);if(s)var d=s.get(null);else{s=new Map,rd.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),d=w)}d&&s.set(null,d)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||d,v===d&&s.set(null,p),s.set(w,p),this.count++,d=nd.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Ko={$$typeof:O,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function w2(r,i,s,d,p,v,w,N,U){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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function z0(r,i,s,d,p,v,w,N,U,G,re,ce){return r=new w2(r,i,s,w,U,G,re,ce,N),i=1,v===!0&&(i|=24),v=Xn(3,null,null,i),r.current=v,v.stateNode=r,i=Sh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Ch(v),r}function O0(r){return r?(r=Fl,r):Fl}function D0(r,i,s,d,p,v){p=O0(p),d.context===null?d.context=p:d.pendingContext=p,d=qa(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Ha(r,d,i),s!==null&&(Fn(s,r,i),No(s,r,i))}function M0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function qm(r,i){M0(r,i),(r=r.alternate)&&M0(r,i)}function L0(r){if(r.tag===13||r.tag===31){var i=qi(r,67108864);i!==null&&Fn(i,r,67108864),qm(r,67108864)}}function I0(r){if(r.tag===13||r.tag===31){var i=nr();i=Uf(i);var s=qi(r,i);s!==null&&Fn(s,r,i),qm(r,i)}}var id=!0;function k2(r,i,s,d){var p=Z.T;Z.T=null;var v=ae.p;try{ae.p=2,Hm(r,i,s,d)}finally{ae.p=v,Z.T=p}}function j2(r,i,s,d){var p=Z.T;Z.T=null;var v=ae.p;try{ae.p=8,Hm(r,i,s,d)}finally{ae.p=v,Z.T=p}}function Hm(r,i,s,d){if(id){var p=Zm(d);if(p===null)Tm(r,i,d,ld,s),P0(r,d);else if(E2(p,r,i,s,d))d.stopPropagation();else if(P0(r,d),i&4&&-1<C2.indexOf(r)){for(;p!==null;){var v=Rl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ir(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var U=1<<31-dt(w);N.entanglements[1]|=U,w&=~U}$r(v),(ct&6)===0&&(Fc=cn()+500,qo(0))}}break;case 31:case 13:N=qi(v,2),N!==null&&Fn(N,v,2),Hc(),qm(v,2)}if(v=Zm(d),v===null&&Tm(r,i,d,ld,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Tm(r,i,d,null,s)}}function Zm(r){return r=Qf(r),Vm(r)}var ld=null;function Vm(r){if(ld=null,r=Tl(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return ld=r,null}function U0(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(so()){case le:return 2;case ye:return 8;case Me:case Pe:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Qm=!1,ti=null,ni=null,ri=null,Yo=new Map,Xo=new Map,ai=[],C2="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 P0(r,i){switch(r){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":Yo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(i.pointerId)}}function Jo(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Rl(i),i!==null&&L0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function E2(r,i,s,d,p){switch(i){case"focusin":return ti=Jo(ti,r,i,s,d,p),!0;case"dragenter":return ni=Jo(ni,r,i,s,d,p),!0;case"mouseover":return ri=Jo(ri,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Yo.set(v,Jo(Yo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,Xo.set(v,Jo(Xo.get(v)||null,r,i,s,d,p)),!0}return!1}function B0(r){var i=Tl(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,ev(r.priority,function(){I0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,ev(r.priority,function(){I0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function sd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Zm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Vf=d,s.target.dispatchEvent(d),Vf=null}else return i=Rl(s),i!==null&&L0(i),r.blockedOn=s,!1;i.shift()}return!0}function $0(r,i,s){sd(r)&&s.delete(i)}function N2(){Qm=!1,ti!==null&&sd(ti)&&(ti=null),ni!==null&&sd(ni)&&(ni=null),ri!==null&&sd(ri)&&(ri=null),Yo.forEach($0),Xo.forEach($0)}function od(r,i){r.blockedOn===i&&(r.blockedOn=null,Qm||(Qm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,N2)))}var ud=null;function F0(r){ud!==r&&(ud=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ud===r&&(ud=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(Vm(d||s)===null)continue;break}var v=Rl(s);v!==null&&(r.splice(i,3),i-=3,Zh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function fs(r){function i(U){return od(U,r)}ti!==null&&od(ti,r),ni!==null&&od(ni,r),ri!==null&&od(ri,r),Yo.forEach(i),Xo.forEach(i);for(var s=0;s<ai.length;s++){var d=ai[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ai.length&&(s=ai[0],s.blockedOn===null);)B0(s),s.blockedOn===null&&ai.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],w=p[Ln]||null;if(typeof v=="function")w||F0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[Ln]||null)N=w.formAction;else if(Vm(p)!==null)continue}else N=w.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),F0(s)}}}function q0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Gm(r){this._internalRoot=r}cd.prototype.render=Gm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=nr();D0(s,d,r,i,null,null)},cd.prototype.unmount=Gm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;D0(r.current,2,null,r,null,null),Hc(),i[Al]=null}};function cd(r){this._internalRoot=r}cd.prototype.unstable_scheduleHydration=function(r){if(r){var i=Wy();r={blockedOn:null,target:r,priority:i};for(var s=0;s<ai.length&&i!==0&&i<ai[s].priority;s++);ai.splice(s,0,r),s===0&&B0(r)}};var H0=t.version;if(H0!=="19.2.4")throw Error(a(527,H0,"19.2.4"));ae.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=h(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var _2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dd.isDisabled&&dd.supportsFiber)try{en=dd.inject(_2),qt=dd}catch{}}return eu.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=Xb,v=Jb,w=Wb;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=z0(r,1,!1,null,null,s,d,null,p,v,w,q0),r[Al]=i.current,Am(r),new Gm(i)},eu.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=Xb,w=Jb,N=Wb,U=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),i=z0(r,1,!0,i,s??null,d,p,U,v,w,N,q0),i.context=O0(null),s=i.current,d=nr(),d=Uf(d),p=qa(d),p.callback=null,Ha(s,p,d),s=d,i.current.lanes=s,hn(i,s),$r(i),r[Al]=i.current,Am(r),new cd(i)},eu.version="19.2.4",eu}var t1;function P2(){if(t1)return Jm.exports;t1=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(),Jm.exports=U2(),Jm.exports}var B2=P2(),wl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},il,fi,As,Nw,$2=(Nw=class extends wl{constructor(){super();we(this,il);we(this,fi);we(this,As);ge(this,As,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,fi)||this.setEventListener(M(this,As))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,fi))==null||t.call(this),ge(this,fi,void 0))}setEventListener(t){var n;ge(this,As,t),(n=M(this,fi))==null||n.call(this),ge(this,fi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){M(this,il)!==t&&(ge(this,il,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,il)=="boolean"?M(this,il):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},il=new WeakMap,fi=new WeakMap,As=new WeakMap,Nw),Vg=new $2,F2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hi,qg,_w,q2=(_w=class{constructor(){we(this,hi,F2);we(this,qg,!1)}setTimeoutProvider(e){ge(this,hi,e)}setTimeout(e,t){return M(this,hi).setTimeout(e,t)}clearTimeout(e){M(this,hi).clearTimeout(e)}setInterval(e,t){return M(this,hi).setInterval(e,t)}clearInterval(e){M(this,hi).clearInterval(e)}},hi=new WeakMap,qg=new WeakMap,_w),al=new q2;function H2(e){setTimeout(e,0)}var Z2=typeof window>"u"||"Deno"in globalThis;function Cn(){}function V2(e,t){return typeof e=="function"?e(t):e}function Hp(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ki(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function n1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Qg(c,t.options))return!1}else if(!bu(t.queryKey,c))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function r1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ml(t.options.mutationKey)!==ml(o))return!1}else if(!bu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Qg(e,t){return((t==null?void 0:t.queryKeyHashFn)||ml)(e)}function ml(e){return JSON.stringify(e,(t,n)=>Zp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function bu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>bu(e[n],t[n])):!1}var Q2=Object.prototype.hasOwnProperty;function Gg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=a1(e)&&a1(t);if(!a&&!(Zp(e)&&Zp(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let g=0;g<f;g++){const y=a?g:c[g],b=e[y],S=t[y];if(b===S){m[y]=b,(a?g<o:Q2.call(e,y))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[y]=S;continue}const k=Gg(b,S,n+1);m[y]=k,k===b&&h++}return o===f&&h===o?e:m}function xu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function a1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zp(e){if(!i1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!i1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function i1(e){return Object.prototype.toString.call(e)==="[object Object]"}function G2(e){return new Promise(t=>{al.setTimeout(t,e)})}function Vp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Gg(e,t):t}function K2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function Y2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Kg=Symbol();function $w(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Yg(e,t){return typeof e=="function"?e(...t):!!e}function X2(e,t,n){let a=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),a||(a=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var Su=(()=>{let e=()=>Z2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Qp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function a(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{a({status:"fulfilled",value:l}),e(l)},n.reject=l=>{a({status:"rejected",reason:l}),t(l)},n}var J2=H2;function W2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=J2;const o=f=>{t?e.push(f):l(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Ut=W2(),Ts,mi,Rs,Aw,eA=(Aw=class extends wl{constructor(){super();we(this,Ts,!0);we(this,mi);we(this,Rs);ge(this,Rs,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){M(this,mi)||this.setEventListener(M(this,Rs))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,mi))==null||t.call(this),ge(this,mi,void 0))}setEventListener(t){var n;ge(this,Rs,t),(n=M(this,mi))==null||n.call(this),ge(this,mi,t(this.setOnline.bind(this)))}setOnline(t){M(this,Ts)!==t&&(ge(this,Ts,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return M(this,Ts)}},Ts=new WeakMap,mi=new WeakMap,Rs=new WeakMap,Aw),Fd=new eA;function tA(e){return Math.min(1e3*2**e,3e4)}function Fw(e){return(e??"online")==="online"?Fd.isOnline():!0}var Gp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function qw(e){let t=!1,n=0,a;const l=Qp(),o=()=>l.status!=="pending",c=j=>{var E;if(!o()){const C=new Gp(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Vg.isFocused()&&(e.networkMode==="always"||Fd.isOnline())&&e.canRun(),g=()=>Fw(e.networkMode)&&e.canRun(),y=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},S=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(y).catch(C=>{var z;if(o())return;const A=e.retry??(Su.isServer()?0:3),O=e.retryDelay??tA,L=typeof O=="function"?O(n,C):O,D=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!D){b(C);return}n++,(z=e.onFail)==null||z.call(e,n,C),G2(L).then(()=>h()?void 0:S()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:g,start:()=>(g()?k():S().then(k),l)}}var ll,Tw,Hw=(Tw=class{constructor(){we(this,ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hp(this.gcTime)&&ge(this,ll,al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Su.isServer()?1/0:300*1e3))}clearGcTimeout(){M(this,ll)&&(al.clearTimeout(M(this,ll)),ge(this,ll,void 0))}},ll=new WeakMap,Tw),sl,zs,Sr,ol,on,Ru,ul,lr,Zw,ba,Rw,nA=(Rw=class extends Hw{constructor(t){super();we(this,lr);we(this,sl);we(this,zs);we(this,Sr);we(this,ol);we(this,on);we(this,Ru);we(this,ul);ge(this,ul,!1),ge(this,Ru,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,ol,t.client),ge(this,Sr,M(this,ol).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,sl,s1(this.options)),this.state=t.state??M(this,sl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,on))==null?void 0:t.promise}setOptions(t){if(this.options={...M(this,Ru),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=s1(this.options);n.data!==void 0&&(this.setState(l1(n.data,n.dataUpdatedAt)),ge(this,sl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,Sr).remove(this)}setData(t,n){const a=Vp(this.state.data,t,this.options);return De(this,lr,ba).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){De(this,lr,ba).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=M(this,on))==null?void 0:a.promise;return(l=M(this,on))==null||l.cancel(t),n?n.then(Cn).catch(Cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return M(this,sl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ki(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,on))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,on))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,Sr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,on)&&(M(this,ul)||De(this,lr,Zw).call(this)?M(this,on).cancel({revert:!0}):M(this,on).cancelRetry()),this.scheduleGc()),M(this,Sr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,lr,ba).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,g,y,b,S,k,j,E,C,A,O;if(this.state.fetchStatus!=="idle"&&((m=M(this,on))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,on))return M(this,on).continueRetry(),M(this,on).promise}if(t&&this.setOptions(t),!this.options.queryFn){const L=this.observers.find(D=>D.options.queryFn);L&&this.setOptions(L.options)}const a=new AbortController,l=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(ge(this,ul,!0),a.signal)})},o=()=>{const L=$w(this.options,n),z=(()=>{const I={client:M(this,ol),queryKey:this.queryKey,meta:this.meta};return l(I),I})();return ge(this,ul,!1),this.options.persister?this.options.persister(L,z,this):L(z)},f=(()=>{const L={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,ol),state:this.state,fetchFn:o};return l(L),L})();(h=this.options.behavior)==null||h.onFetch(f,this),ge(this,zs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=f.fetchOptions)==null?void 0:g.meta))&&De(this,lr,ba).call(this,{type:"fetch",meta:(y=f.fetchOptions)==null?void 0:y.meta}),ge(this,on,qw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:L=>{L instanceof Gp&&L.revert&&this.setState({...M(this,zs),fetchStatus:"idle"}),a.abort()},onFail:(L,D)=>{De(this,lr,ba).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{De(this,lr,ba).call(this,{type:"pause"})},onContinue:()=>{De(this,lr,ba).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const L=await M(this,on).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(S=(b=M(this,Sr).config).onSuccess)==null||S.call(b,L,this),(j=(k=M(this,Sr).config).onSettled)==null||j.call(k,L,this.state.error,this),L}catch(L){if(L instanceof Gp){if(L.silent)return M(this,on).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw De(this,lr,ba).call(this,{type:"error",error:L}),(C=(E=M(this,Sr).config).onError)==null||C.call(E,L,this),(O=(A=M(this,Sr).config).onSettled)==null||O.call(A,this.state.data,L,this),L}finally{this.scheduleGc()}}},sl=new WeakMap,zs=new WeakMap,Sr=new WeakMap,ol=new WeakMap,on=new WeakMap,Ru=new WeakMap,ul=new WeakMap,lr=new WeakSet,Zw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ba=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Vw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...l1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,zs,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Ut.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),M(this,Sr).notify({query:this,type:"updated",action:t})})},Rw);function Vw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hn,at,zu,zn,cl,Os,xa,pi,Ou,Ds,Ms,dl,fl,gi,Ls,ht,cu,Kp,Yp,Xp,Jp,Wp,eg,tg,Qw,zw,Xg=(zw=class extends wl{constructor(t,n){super();we(this,ht);we(this,Hn);we(this,at);we(this,zu);we(this,zn);we(this,cl);we(this,Os);we(this,xa);we(this,pi);we(this,Ou);we(this,Ds);we(this,Ms);we(this,dl);we(this,fl);we(this,gi);we(this,Ls,new Set);this.options=n,ge(this,Hn,t),ge(this,pi,null),ge(this,xa,Qp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,at).addObserver(this),o1(M(this,at),this.options)?De(this,ht,cu).call(this):this.updateResult(),De(this,ht,Jp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ng(M(this,at),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ng(M(this,at),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,ht,Wp).call(this),De(this,ht,eg).call(this),M(this,at).removeObserver(this)}setOptions(t){const n=this.options,a=M(this,at);if(this.options=M(this,Hn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,M(this,at))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,ht,tg).call(this),M(this,at).setOptions(this.options),n._defaulted&&!xu(this.options,n)&&M(this,Hn).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,at),observer:this});const l=this.hasListeners();l&&u1(M(this,at),a,this.options,n)&&De(this,ht,cu).call(this),this.updateResult(),l&&(M(this,at)!==a||kr(this.options.enabled,M(this,at))!==kr(n.enabled,M(this,at))||ki(this.options.staleTime,M(this,at))!==ki(n.staleTime,M(this,at)))&&De(this,ht,Kp).call(this);const o=De(this,ht,Yp).call(this);l&&(M(this,at)!==a||kr(this.options.enabled,M(this,at))!==kr(n.enabled,M(this,at))||o!==M(this,gi))&&De(this,ht,Xp).call(this,o)}getOptimisticResult(t){const n=M(this,Hn).getQueryCache().build(M(this,Hn),t),a=this.createResult(n,t);return aA(this,a)&&(ge(this,zn,a),ge(this,Os,this.options),ge(this,cl,M(this,at).state)),a}getCurrentResult(){return M(this,zn)}trackResult(t,n){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&M(this,xa).status==="pending"&&M(this,xa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){M(this,Ls).add(t)}getCurrentQuery(){return M(this,at)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=M(this,Hn).defaultQueryOptions(t),a=M(this,Hn).getQueryCache().build(M(this,Hn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return De(this,ht,cu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,zn)))}createResult(t,n){var ee;const a=M(this,at),l=this.options,o=M(this,zn),c=M(this,cl),f=M(this,Os),h=t!==a?t.state:M(this,zu),{state:g}=t;let y={...g},b=!1,S;if(n._optimisticResults){const H=this.hasListeners(),ne=!H&&o1(t,n),X=H&&u1(t,a,n,l);(ne||X)&&(y={...y,...Vw(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=y;S=y.data;let C=!1;if(n.placeholderData!==void 0&&S===void 0&&E==="pending"){let H;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(H=o.data,C=!0):H=typeof n.placeholderData=="function"?n.placeholderData((ee=M(this,Ms))==null?void 0:ee.state.data,M(this,Ms)):n.placeholderData,H!==void 0&&(E="success",S=Vp(o==null?void 0:o.data,H,n),b=!0)}if(n.select&&S!==void 0&&!C)if(o&&S===(c==null?void 0:c.data)&&n.select===M(this,Ou))S=M(this,Ds);else try{ge(this,Ou,n.select),S=n.select(S),S=Vp(o==null?void 0:o.data,S,n),ge(this,Ds,S),ge(this,pi,null)}catch(H){ge(this,pi,H)}M(this,pi)&&(k=M(this,pi),S=M(this,Ds),j=Date.now(),E="error");const A=y.fetchStatus==="fetching",O=E==="pending",L=E==="error",D=O&&A,z=S!==void 0,F={status:E,fetchStatus:y.fetchStatus,isPending:O,isSuccess:E==="success",isError:L,isInitialLoading:D,isLoading:D,data:S,dataUpdatedAt:y.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!O,isLoadingError:L&&!z,isPaused:y.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:L&&z,isStale:Jg(t,n),refetch:this.refetch,promise:M(this,xa),isEnabled:kr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const H=F.data!==void 0,ne=F.status==="error"&&!H,X=ie=>{ne?ie.reject(F.error):H&&ie.resolve(F.data)},be=()=>{const ie=ge(this,xa,F.promise=Qp());X(ie)},fe=M(this,xa);switch(fe.status){case"pending":t.queryHash===a.queryHash&&X(fe);break;case"fulfilled":(ne||F.data!==fe.value)&&be();break;case"rejected":(!ne||F.error!==fe.reason)&&be();break}}return F}updateResult(){const t=M(this,zn),n=this.createResult(M(this,at),this.options);if(ge(this,cl,M(this,at).state),ge(this,Os,this.options),M(this,cl).data!==void 0&&ge(this,Ms,M(this,at)),xu(n,t))return;ge(this,zn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!M(this,Ls).size)return!0;const c=new Set(o??M(this,Ls));return this.options.throwOnError&&c.add("error"),Object.keys(M(this,zn)).some(f=>{const m=f;return M(this,zn)[m]!==t[m]&&c.has(m)})};De(this,ht,Qw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,ht,Jp).call(this)}},Hn=new WeakMap,at=new WeakMap,zu=new WeakMap,zn=new WeakMap,cl=new WeakMap,Os=new WeakMap,xa=new WeakMap,pi=new WeakMap,Ou=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,dl=new WeakMap,fl=new WeakMap,gi=new WeakMap,Ls=new WeakMap,ht=new WeakSet,cu=function(t){De(this,ht,tg).call(this);let n=M(this,at).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Cn)),n},Kp=function(){De(this,ht,Wp).call(this);const t=ki(this.options.staleTime,M(this,at));if(Su.isServer()||M(this,zn).isStale||!Hp(t))return;const a=Bw(M(this,zn).dataUpdatedAt,t)+1;ge(this,dl,al.setTimeout(()=>{M(this,zn).isStale||this.updateResult()},a))},Yp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,at)):this.options.refetchInterval)??!1},Xp=function(t){De(this,ht,eg).call(this),ge(this,gi,t),!(Su.isServer()||kr(this.options.enabled,M(this,at))===!1||!Hp(M(this,gi))||M(this,gi)===0)&&ge(this,fl,al.setInterval(()=>{(this.options.refetchIntervalInBackground||Vg.isFocused())&&De(this,ht,cu).call(this)},M(this,gi)))},Jp=function(){De(this,ht,Kp).call(this),De(this,ht,Xp).call(this,De(this,ht,Yp).call(this))},Wp=function(){M(this,dl)&&(al.clearTimeout(M(this,dl)),ge(this,dl,void 0))},eg=function(){M(this,fl)&&(al.clearInterval(M(this,fl)),ge(this,fl,void 0))},tg=function(){const t=M(this,Hn).getQueryCache().build(M(this,Hn),this.options);if(t===M(this,at))return;const n=M(this,at);ge(this,at,t),ge(this,zu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Qw=function(t){Ut.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(M(this,zn))}),M(this,Hn).getQueryCache().notify({query:M(this,at),type:"observerResultsUpdated"})})},zw);function rA(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function o1(e,t){return rA(e,t)||e.state.data!==void 0&&ng(e,t,t.refetchOnMount)}function ng(e,t,n){if(kr(t.enabled,e)!==!1&&ki(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Jg(e,t)}return!1}function u1(e,t,n,a){return(e!==t||kr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Jg(e,n)}function Jg(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(ki(t.staleTime,e))}function aA(e,t){return!xu(e.getCurrentResult(),t)}function c1(e){return{onFetch:(t,n)=>{var g,y,b,S,k;const a=t.options,l=(b=(y=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:b.direction,o=((S=t.state.data)==null?void 0:S.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{X2(O,()=>t.signal,()=>j=!0)},C=$w(t.options,t.fetchOptions),A=async(O,L,D)=>{if(j)return Promise.reject();if(L==null&&O.pages.length)return Promise.resolve(O);const I=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:L,direction:D?"backward":"forward",meta:t.options.meta};return E(ne),ne})(),F=await C(I),{maxPages:ee}=t.options,H=D?Y2:K2;return{pages:H(O.pages,F,ee),pageParams:H(O.pageParams,L,ee)}};if(l&&o.length){const O=l==="backward",L=O?iA:d1,D={pages:o,pageParams:c},z=L(a,D);f=await A(D,z,O)}else{const O=e??o.length;do{const L=m===0?c[0]??a.initialPageParam:d1(a,f);if(m>0&&L==null)break;f=await A(f,L),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function d1(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function iA(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Du,qr,kn,hl,Hr,ui,Ow,lA=(Ow=class extends Hw{constructor(t){super();we(this,Hr);we(this,Du);we(this,qr);we(this,kn);we(this,hl);ge(this,Du,t.client),this.mutationId=t.mutationId,ge(this,kn,t.mutationCache),ge(this,qr,[]),this.state=t.state||Gw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,qr).includes(t)||(M(this,qr).push(t),this.clearGcTimeout(),M(this,kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,qr,M(this,qr).filter(n=>n!==t)),this.scheduleGc(),M(this,kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,qr).length||(this.state.status==="pending"?this.scheduleGc():M(this,kn).remove(this))}continue(){var t;return((t=M(this,hl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,g,y,b,S,k,j,E,C,A,O,L,D,z,I;const n=()=>{De(this,Hr,ui).call(this,{type:"continue"})},a={client:M(this,Du),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,hl,qw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(F,ee)=>{De(this,Hr,ui).call(this,{type:"failed",failureCount:F,error:ee})},onPause:()=>{De(this,Hr,ui).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,kn).canRun(this)}));const l=this.state.status==="pending",o=!M(this,hl).canStart();try{if(l)n();else{De(this,Hr,ui).call(this,{type:"pending",variables:t,isPaused:o}),M(this,kn).config.onMutate&&await M(this,kn).config.onMutate(t,this,a);const ee=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));ee!==this.state.context&&De(this,Hr,ui).call(this,{type:"pending",context:ee,variables:t,isPaused:o})}const F=await M(this,hl).start();return await((h=(m=M(this,kn).config).onSuccess)==null?void 0:h.call(m,F,t,this.state.context,this,a)),await((y=(g=this.options).onSuccess)==null?void 0:y.call(g,F,t,this.state.context,a)),await((S=(b=M(this,kn).config).onSettled)==null?void 0:S.call(b,F,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,F,null,t,this.state.context,a)),De(this,Hr,ui).call(this,{type:"success",data:F}),F}catch(F){try{await((C=(E=M(this,kn).config).onError)==null?void 0:C.call(E,F,t,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await((O=(A=this.options).onError)==null?void 0:O.call(A,F,t,this.state.context,a))}catch(ee){Promise.reject(ee)}try{await((D=(L=M(this,kn).config).onSettled)==null?void 0:D.call(L,void 0,F,this.state.variables,this.state.context,this,a))}catch(ee){Promise.reject(ee)}try{await((I=(z=this.options).onSettled)==null?void 0:I.call(z,void 0,F,t,this.state.context,a))}catch(ee){Promise.reject(ee)}throw De(this,Hr,ui).call(this,{type:"error",error:F}),F}finally{M(this,kn).runNext(this)}}},Du=new WeakMap,qr=new WeakMap,kn=new WeakMap,hl=new WeakMap,Hr=new WeakSet,ui=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ut.batch(()=>{M(this,qr).forEach(a=>{a.onMutationUpdate(t)}),M(this,kn).notify({mutation:this,type:"updated",action:t})})},Ow);function Gw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sa,Dr,Mu,Dw,sA=(Dw=class extends wl{constructor(t={}){super();we(this,Sa);we(this,Dr);we(this,Mu);this.config=t,ge(this,Sa,new Set),ge(this,Dr,new Map),ge(this,Mu,0)}build(t,n,a){const l=new lA({client:t,mutationCache:this,mutationId:++fd(this,Mu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){M(this,Sa).add(t);const n=hd(t);if(typeof n=="string"){const a=M(this,Dr).get(n);a?a.push(t):M(this,Dr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,Sa).delete(t)){const n=hd(t);if(typeof n=="string"){const a=M(this,Dr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&M(this,Dr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=hd(t);if(typeof n=="string"){const a=M(this,Dr).get(n),l=a==null?void 0:a.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var a;const n=hd(t);if(typeof n=="string"){const l=(a=M(this,Dr).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ut.batch(()=>{M(this,Sa).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,Sa).clear(),M(this,Dr).clear()})}getAll(){return Array.from(M(this,Sa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>r1(n,a))}findAll(t={}){return this.getAll().filter(n=>r1(t,n))}notify(t){Ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ut.batch(()=>Promise.all(t.map(n=>n.continue().catch(Cn))))}},Sa=new WeakMap,Dr=new WeakMap,Mu=new WeakMap,Dw);function hd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var wa,yi,Zn,ka,Ca,Od,rg,Mw,oA=(Mw=class extends wl{constructor(n,a){super();we(this,Ca);we(this,wa);we(this,yi);we(this,Zn);we(this,ka);ge(this,wa,n),this.setOptions(a),this.bindMethods(),De(this,Ca,Od).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const a=this.options;this.options=M(this,wa).defaultMutationOptions(n),xu(this.options,a)||M(this,wa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,Zn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ml(a.mutationKey)!==ml(this.options.mutationKey)?this.reset():((l=M(this,Zn))==null?void 0:l.state.status)==="pending"&&M(this,Zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=M(this,Zn))==null||n.removeObserver(this)}onMutationUpdate(n){De(this,Ca,Od).call(this),De(this,Ca,rg).call(this,n)}getCurrentResult(){return M(this,yi)}reset(){var n;(n=M(this,Zn))==null||n.removeObserver(this),ge(this,Zn,void 0),De(this,Ca,Od).call(this),De(this,Ca,rg).call(this)}mutate(n,a){var l;return ge(this,ka,a),(l=M(this,Zn))==null||l.removeObserver(this),ge(this,Zn,M(this,wa).getMutationCache().build(M(this,wa),this.options)),M(this,Zn).addObserver(this),M(this,Zn).execute(n)}},wa=new WeakMap,yi=new WeakMap,Zn=new WeakMap,ka=new WeakMap,Ca=new WeakSet,Od=function(){var a;const n=((a=M(this,Zn))==null?void 0:a.state)??Gw();ge(this,yi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},rg=function(n){Ut.batch(()=>{var a,l,o,c,f,m,h,g;if(M(this,ka)&&this.hasListeners()){const y=M(this,yi).variables,b=M(this,yi).context,S={client:M(this,wa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=M(this,ka)).onSuccess)==null||l.call(a,n.data,y,b,S)}catch(k){Promise.reject(k)}try{(c=(o=M(this,ka)).onSettled)==null||c.call(o,n.data,null,y,b,S)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=M(this,ka)).onError)==null||m.call(f,n.error,y,b,S)}catch(k){Promise.reject(k)}try{(g=(h=M(this,ka)).onSettled)==null||g.call(h,void 0,n.error,y,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(y=>{y(M(this,yi))})})},Mw);function f1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function uA(e,t,n){const a=e.slice(0);return a[t]=n,a}var Is,ir,Us,Ps,wr,vi,Lu,Iu,Uu,Pu,Sn,ag,ig,lg,sg,og,Lw,cA=(Lw=class extends wl{constructor(t,n,a){super();we(this,Sn);we(this,Is);we(this,ir);we(this,Us);we(this,Ps);we(this,wr);we(this,vi);we(this,Lu);we(this,Iu);we(this,Uu);we(this,Pu,[]);ge(this,Is,t),ge(this,Ps,a),ge(this,Us,[]),ge(this,wr,[]),ge(this,ir,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&M(this,wr).forEach(t=>{t.subscribe(n=>{De(this,Sn,sg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,M(this,wr).forEach(t=>{t.destroy()})}setQueries(t,n){ge(this,Us,t),ge(this,Ps,n),Ut.batch(()=>{const a=M(this,wr),l=De(this,Sn,lg).call(this,M(this,Us));l.forEach(y=>y.observer.setOptions(y.defaultedQueryOptions));const o=l.map(y=>y.observer),c=o.map(y=>y.getCurrentResult()),f=a.length!==o.length,m=o.some((y,b)=>y!==a[b]),h=f||m,g=h?!0:c.some((y,b)=>{const S=M(this,ir)[b];return!S||!xu(y,S)});!h&&!g||(h&&(ge(this,Pu,l),ge(this,wr,o)),ge(this,ir,c),this.hasListeners()&&(h&&(f1(a,o).forEach(y=>{y.destroy()}),f1(o,a).forEach(y=>{y.subscribe(b=>{De(this,Sn,sg).call(this,y,b)})})),De(this,Sn,og).call(this)))})}getCurrentResult(){return M(this,ir)}getQueries(){return M(this,wr).map(t=>t.getCurrentQuery())}getObservers(){return M(this,wr)}getOptimisticResult(t,n){const a=De(this,Sn,lg).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>De(this,Sn,ig).call(this,c??l,n,o),()=>De(this,Sn,ag).call(this,l,a)]}},Is=new WeakMap,ir=new WeakMap,Us=new WeakMap,Ps=new WeakMap,wr=new WeakMap,vi=new WeakMap,Lu=new WeakMap,Iu=new WeakMap,Uu=new WeakMap,Pu=new WeakMap,Sn=new WeakSet,ag=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},ig=function(t,n,a){if(n){const l=M(this,Uu),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!M(this,vi)||M(this,ir)!==M(this,Iu)||o||n!==M(this,Lu))&&(ge(this,Lu,n),ge(this,Iu,M(this,ir)),a!==void 0&&ge(this,Uu,a),ge(this,vi,Gg(M(this,vi),n(t)))),M(this,vi)}return t},lg=function(t){const n=new Map;M(this,wr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=M(this,Is).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new Xg(M(this,Is),o);a.push({defaultedQueryOptions:o,observer:f})}),a},sg=function(t,n){const a=M(this,wr).indexOf(t);a!==-1&&(ge(this,ir,uA(M(this,ir),a,n)),De(this,Sn,og).call(this))},og=function(){var t;if(this.hasListeners()){const n=M(this,vi),a=De(this,Sn,ag).call(this,M(this,ir),M(this,Pu)),l=De(this,Sn,ig).call(this,a,(t=M(this,Ps))==null?void 0:t.combine);n!==l&&Ut.batch(()=>{this.listeners.forEach(o=>{o(M(this,ir))})})}},Lw),Zr,Iw,dA=(Iw=class extends wl{constructor(t={}){super();we(this,Zr);this.config=t,ge(this,Zr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Qg(l,n);let c=this.get(o);return c||(c=new nA({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){M(this,Zr).has(t.queryHash)||(M(this,Zr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,Zr).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,Zr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,Zr).get(t)}getAll(){return[...M(this,Zr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>n1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>n1(t,a)):n}notify(t){Ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Zr=new WeakMap,Iw),It,bi,xi,Bs,$s,Si,Fs,qs,Uw,fA=(Uw=class{constructor(e={}){we(this,It);we(this,bi);we(this,xi);we(this,Bs);we(this,$s);we(this,Si);we(this,Fs);we(this,qs);ge(this,It,e.queryCache||new dA),ge(this,bi,e.mutationCache||new sA),ge(this,xi,e.defaultOptions||{}),ge(this,Bs,new Map),ge(this,$s,new Map),ge(this,Si,0)}mount(){fd(this,Si)._++,M(this,Si)===1&&(ge(this,Fs,Vg.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,It).onFocus())})),ge(this,qs,Fd.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,It).onOnline())})))}unmount(){var e,t;fd(this,Si)._--,M(this,Si)===0&&((e=M(this,Fs))==null||e.call(this),ge(this,Fs,void 0),(t=M(this,qs))==null||t.call(this),ge(this,qs,void 0))}isFetching(e){return M(this,It).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,bi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,It).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,It).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ki(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return M(this,It).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=M(this,It).get(a.queryHash),o=l==null?void 0:l.state.data,c=V2(t,o);if(c!==void 0)return M(this,It).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Ut.batch(()=>M(this,It).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,It).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,It);Ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,It);return Ut.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Ut.batch(()=>M(this,It).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Cn).catch(Cn)}invalidateQueries(e,t={}){return Ut.batch(()=>(M(this,It).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Ut.batch(()=>M(this,It).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(Cn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(Cn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,It).build(this,t);return n.isStaleByTime(ki(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cn).catch(Cn)}fetchInfiniteQuery(e){return e.behavior=c1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cn).catch(Cn)}ensureInfiniteQueryData(e){return e.behavior=c1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fd.isOnline()?M(this,bi).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,It)}getMutationCache(){return M(this,bi)}getDefaultOptions(){return M(this,xi)}setDefaultOptions(e){ge(this,xi,e)}setQueryDefaults(e,t){M(this,Bs).set(ml(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Bs).values()],n={};return t.forEach(a=>{bu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){M(this,$s).set(ml(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,$s).values()],n={};return t.forEach(a=>{bu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Kg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,It).clear(),M(this,bi).clear()}},It=new WeakMap,bi=new WeakMap,xi=new WeakMap,Bs=new WeakMap,$s=new WeakMap,Si=new WeakMap,Fs=new WeakMap,qs=new WeakMap,Uw),Kw=x.createContext(void 0),Nn=e=>{const t=x.useContext(Kw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hA=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Kw.Provider,{value:e,children:t})),Yw=x.createContext(!1),Xw=()=>x.useContext(Yw);Yw.Provider;function mA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pA=x.createContext(mA()),Jw=()=>x.useContext(pA),Ww=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Yg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},ek=e=>{x.useEffect(()=>{e.clearReset()},[e])},tk=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Yg(n,[e.error,a])),nk=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>n(a(...l)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gA=(e,t)=>e.isLoading&&e.isFetching&&!t,ug=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,cg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yA({queries:e,...t},n){const a=Nn(),l=Xw(),o=Jw(),c=x.useMemo(()=>e.map(j=>{const E=a.defaultQueryOptions(j);return E._optimisticResults=l?"isRestoring":"optimistic",E}),[e,a,l]);c.forEach(j=>{nk(j);const E=a.getQueryCache().get(j.queryHash);Ww(j,o,E)}),ek(o);const[f]=x.useState(()=>new cA(a,c,t)),[m,h,g]=f.getOptimisticResult(c,t.combine),y=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>y?f.subscribe(Ut.batchCalls(j)):Cn,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const S=m.some((j,E)=>ug(c[E],j))?m.flatMap((j,E)=>{const C=c[E];if(C&&ug(C,j)){const A=new Xg(a,C);return cg(C,A,o)}return[]}):[];if(S.length>0)throw Promise.all(S);const k=m.find((j,E)=>{const C=c[E];return C&&tk({result:j,errorResetBoundary:o,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(k!=null&&k.error)throw k.error;return h(g())}function vA(e,t,n){var b,S,k,j;const a=Xw(),l=Jw(),o=Nn(),c=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",nk(c),Ww(c,l,f),ek(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),g=h.getOptimisticResult(c),y=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=y?h.subscribe(Ut.batchCalls(E)):Cn;return h.updateResult(),C},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),ug(c,g))throw cg(c,h,l);if(tk({result:g,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw g.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,g),c.experimental_prefetchInRender&&!Su.isServer()&&gA(g,a)){const E=m?cg(c,h,l):f==null?void 0:f.promise;E==null||E.catch(Cn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?g:h.trackResult(g)}function qe(e,t){return vA(e,Xg)}function gt(e,t){const n=Nn(),[a]=x.useState(()=>new oA(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Ut.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(Cn)},[a]);if(l.error&&Yg(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:o,mutateAsync:l.mutate}}/**
|
|
50
|
-
* react-router v7.13.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var h1="popstate";function m1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function bA(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return dg("",{pathname:c,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:wu(l)}return SA(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xA(){return Math.random().toString(36).substring(2,10)}function p1(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Js(t):t,state:n,key:t&&t.key||a||xA(),unstable_mask:l}}function wu({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 Js(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 SA(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=g();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function g(){return(c.state||{idx:null}).idx}function y(){f="POP";let E=g(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let A=m1(E)?E:dg(j.location,E,C);h=g()+1;let O=p1(A,h),L=j.createHref(A.unstable_mask||A);try{c.pushState(O,"",L)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(L)}o&&m&&m({action:f,location:j.location,delta:1})}function S(E,C){f="REPLACE";let A=m1(E)?E:dg(j.location,E,C);h=g();let O=p1(A,h),L=j.createHref(A.unstable_mask||A);c.replaceState(O,"",L),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return wA(E)}let j={get action(){return f},get location(){return e(l,c)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(h1,y),m=E,()=>{l.removeEventListener(h1,y),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(E){return c.go(E)}};return j}function wA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:wu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function rk(e,t,n="/"){return kA(e,t,n,!1)}function kA(e,t,n,a){let l=typeof t=="string"?Js(t):t,o=Ea(l.pathname||"/",n);if(o==null)return null;let c=ak(e);jA(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=MA(o);f=OA(c[m],h,a)}return f}function ak(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let g={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&m)return;At(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=Gr([a,g.relativePath]),b=n.concat(g);c.children&&c.children.length>0&&(At(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),ak(c.children,t,b,y,m)),!(c.path==null&&!c.index)&&t.push({path:y,score:RA(y,c.index),routesMeta:b})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of ik(c.path))o(c,f,!0,h)}),t}function ik(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let c=ik(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function jA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:zA(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var CA=/^:[\w-]+$/,EA=3,NA=2,_A=1,AA=10,TA=-2,g1=e=>e==="*";function RA(e,t){let n=e.split("/"),a=n.length;return n.some(g1)&&(a+=TA),t&&(a+=NA),n.filter(l=>!g1(l)).reduce((l,o)=>l+(CA.test(o)?EA:o===""?_A:AA),a)}function zA(e,t){return e.length===t.length&&e.slice(0,-1).every((a,l)=>a===t[l])?e[e.length-1]-t[t.length-1]:0}function OA(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,g=o==="/"?t:t.slice(o.length)||"/",y=qd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),b=m.route;if(!y&&h&&n&&!a[a.length-1].route.index&&(y=qd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!y)return null;Object.assign(l,y.params),c.push({params:l,pathname:Gr([o,y.pathname]),pathnameBase:PA(Gr([o,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(o=Gr([o,y.pathnameBase]))}return c}function qd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=DA(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:g,isOptional:y},b)=>{if(g==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const S=f[b];return y&&!S?h[g]=void 0:h[g]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function DA(e,t=!1,n=!0){Cr(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=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,g)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let y=g.charAt(h+c.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function MA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cr(!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 Ea(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 LA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function IA(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Js(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=y1(n.substring(1),"/"):o=y1(n,t)):o=t,{pathname:o,search:BA(a),hash:$A(l)}}function y1(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function np(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 UA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wg(e){let t=UA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function sf(e,t,n,a=!1){let l;typeof e=="string"?l=Js(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),np("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),np("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),np("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,f;if(c==null)f=n;else{let y=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),y-=1;l.pathname=b.join("/")}f=y>=0?t[y]:"/"}let m=IA(l,f),h=c&&c!=="/"&&c.endsWith("/"),g=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var Gr=e=>e.join("/").replace(/\/\/+/g,"/"),PA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),BA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$A=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,FA=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 qA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function HA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sk(e,t){let n=e;if(typeof n!="string"||!LA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(lk)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ea(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{Cr(!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:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ok=["POST","PUT","PATCH","DELETE"];new Set(ok);var ZA=["GET",...ok];new Set(ZA);var Ws=x.createContext(null);Ws.displayName="DataRouter";var of=x.createContext(null);of.displayName="DataRouterState";var VA=x.createContext(!1),uk=x.createContext({isTransitioning:!1});uk.displayName="ViewTransition";var QA=x.createContext(new Map);QA.displayName="Fetchers";var GA=x.createContext(null);GA.displayName="Await";var ur=x.createContext(null);ur.displayName="Navigation";var Bu=x.createContext(null);Bu.displayName="Location";var Er=x.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var ey=x.createContext(null);ey.displayName="RouteError";var ck="REACT_ROUTER_ERROR",KA="REDIRECT",YA="ROUTE_ERROR_RESPONSE";function XA(e){if(e.startsWith(`${ck}:${KA}:{`))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 JA(e){if(e.startsWith(`${ck}:${YA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new FA(t.status,t.statusText,t.data)}catch{}}function WA(e,{relative:t}={}){At(eo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(ur),{hash:l,pathname:o,search:c}=$u(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Gr([n,o])),a.createHref({pathname:f,search:c,hash:l})}function eo(){return x.useContext(Bu)!=null}function Dn(){return At(eo(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Bu).location}var dk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fk(e){x.useContext(ur).static||x.useLayoutEffect(e)}function _n(){let{isDataRoute:e}=x.useContext(Er);return e?mT():eT()}function eT(){At(eo(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ws),{basename:t,navigator:n}=x.useContext(ur),{matches:a}=x.useContext(Er),{pathname:l}=Dn(),o=JSON.stringify(Wg(a)),c=x.useRef(!1);return fk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Cr(c.current,dk),!c.current)return;if(typeof m=="number"){n.go(m);return}let g=sf(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Gr([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,o,l,e])}var tT=x.createContext(null);function nT(e){let t=x.useContext(Er).outlet;return x.useMemo(()=>t&&x.createElement(tT.Provider,{value:e},t),[t,e])}function hk(){let{matches:e}=x.useContext(Er),t=e[e.length-1];return t?t.params:{}}function $u(e,{relative:t}={}){let{matches:n}=x.useContext(Er),{pathname:a}=Dn(),l=JSON.stringify(Wg(n));return x.useMemo(()=>sf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function rT(e,t){return mk(e,t)}function mk(e,t,n){var E;At(eo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(ur),{matches:l}=x.useContext(Er),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";gk(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=Dn(),y;if(t){let C=typeof t=="string"?Js(t):t;At(m==="/"||((E=C.pathname)==null?void 0:E.startsWith(m)),`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 "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=g;let b=y.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=rk(e,{pathname:S});Cr(h||k!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Cr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 j=oT(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:Gr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:Gr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(Bu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},j):j}function aT(){let e=hT(),t=qA(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)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,c)}var iT=x.createElement(aT,null),pk=class extends x.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=JA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Er.Provider,{value:this.props.routeContext},x.createElement(ey.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(lT,{error:e},t):t}};pk.contextType=VA;var rp=new WeakMap;function lT({children:e,error:t}){let{basename:n}=x.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=XA(t.digest);if(a){let l=rp.get(t);if(l)throw l;let o=sk(a.location,n);if(lk&&!rp.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw rp.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function sT({routeContext:e,match:t,children:n}){let a=x.useContext(Ws);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Er.Provider,{value:e},n)}function oT(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let g=l.findIndex(y=>y.route.id&&(o==null?void 0:o[y.route.id])!==void 0);At(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,g+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let g=0;g<l.length;g++){let y=l[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=g),y.route.id){let{loaderData:b,errors:S}=a,k=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||k){n.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(g,y)=>{var b,S;m(g,{location:a.location,params:((S=(b=a.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:HA(a.matches),errorInfo:y})}:void 0;return l.reduceRight((g,y,b)=>{let S,k=!1,j=null,E=null;a&&(S=o&&y.route.id?o[y.route.id]:void 0,j=y.route.errorElement||iT,c&&(f<0&&b===0?(gk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=y.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),A=()=>{let O;return S?O=j:k?O=E:y.route.Component?O=x.createElement(y.route.Component,null):y.route.element?O=y.route.element:O=g,x.createElement(sT,{match:y,routeContext:{outlet:g,matches:C,isDataRoute:a!=null},children:O})};return a&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?x.createElement(pk,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:A(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):A()},null)}function ty(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uT(e){let t=x.useContext(Ws);return At(t,ty(e)),t}function cT(e){let t=x.useContext(of);return At(t,ty(e)),t}function dT(e){let t=x.useContext(Er);return At(t,ty(e)),t}function ny(e){let t=dT(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function fT(){return ny("useRouteId")}function hT(){var a;let e=x.useContext(ey),t=cT("useRouteError"),n=ny("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function mT(){let{router:e}=uT("useNavigate"),t=ny("useNavigate"),n=x.useRef(!1);return fk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Cr(n.current,dk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var v1={};function gk(e,t,n){!t&&!v1[e]&&(v1[e]=!0,Cr(!1,n))}x.memo(pT);function pT({routes:e,future:t,state:n,isStatic:a,onError:l}){return mk(e,void 0,{state:n,isStatic:a,onError:l})}function uf({to:e,replace:t,state:n,relative:a}){At(eo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(ur);Cr(!l,"<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:o}=x.useContext(Er),{pathname:c}=Dn(),f=_n(),m=sf(e,Wg(o),c,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function fg(e){return nT(e.context)}function rr(e){At(!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 gT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){At(!eo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:c,future:{}}),[f,l,o,c]);typeof n=="string"&&(n=Js(n));let{pathname:h="/",search:g="",hash:y="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Ea(h,f);return E==null?null:{location:{pathname:E,search:g,hash:y,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,g,y,b,S,a,k]);return Cr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(ur.Provider,{value:m},x.createElement(Bu.Provider,{children:t,value:j}))}function yT({children:e,location:t}){return rT(hg(e),t)}function hg(e,t=[]){let n=[];return x.Children.forEach(e,(a,l)=>{if(!x.isValidElement(a))return;let o=[...t,l];if(a.type===x.Fragment){n.push.apply(n,hg(a.props.children,o));return}At(a.type===rr,`[${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>`),At(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.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&&(c.children=hg(a.props.children,o)),n.push(c)}),n}var Dd="get",Md="application/x-www-form-urlencoded";function cf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vT(e){return cf(e)&&e.tagName.toLowerCase()==="button"}function bT(e){return cf(e)&&e.tagName.toLowerCase()==="form"}function xT(e){return cf(e)&&e.tagName.toLowerCase()==="input"}function ST(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wT(e,t){return e.button===0&&(!t||t==="_self")&&!ST(e)}function mg(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(l=>[n,l]):[[n,a]])},[]))}function kT(e,t){let n=mg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var md=null;function jT(){if(md===null)try{new FormData(document.createElement("form"),0),md=!1}catch{md=!0}return md}var CT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ap(e){return e!=null&&!CT.has(e)?(Cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Md}"`),null):e}function ET(e,t){let n,a,l,o,c;if(bT(e)){let f=e.getAttribute("action");a=f?Ea(f,t):null,n=e.getAttribute("method")||Dd,l=ap(e.getAttribute("enctype"))||Md,o=new FormData(e)}else if(vT(e)||xT(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 m=e.getAttribute("formaction")||f.getAttribute("action");if(a=m?Ea(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Dd,l=ap(e.getAttribute("formenctype"))||ap(f.getAttribute("enctype"))||Md,o=new FormData(f,e),!jT()){let{name:h,type:g,value:y}=e;if(g==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,y)}}else{if(cf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Dd,a=null,l=Md,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ry(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function NT(e,t,n,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&Ea(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function _T(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 AT(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 l=>{let o=t.routes[l.route.id];if(o){let c=await _T(o,n);return c.links?c.links():[]}return[]}));return DT(a.flat(1).filter(AT).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function b1(e,t,n,a,l,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var g;return n[h].pathname!==m.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var y;let g=a.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(c(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((y=n[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function RT(e,t,{includeHydrateFallback:n}={}){return zT(e.map(a=>{let l=t.routes[a.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function zT(e){return[...new Set(e)]}function OT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function DT(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(OT(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function yk(){let e=x.useContext(Ws);return ry(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function MT(){let e=x.useContext(of);return ry(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ay=x.createContext(void 0);ay.displayName="FrameworkContext";function vk(){let e=x.useContext(ay);return ry(e,"You must render this element inside a <HydratedRouter> element"),e}function LT(e,t){let n=x.useContext(ay),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(A=>{c(A.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:tu(f,S),onBlur:tu(m,k),onMouseEnter:tu(h,S),onMouseLeave:tu(g,k),onTouchStart:tu(y,S)}]:[!1,b,{}]}function tu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function IT({page:e,...t}){let{router:n}=yk(),a=x.useMemo(()=>rk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(PT,{page:e,matches:a,...t}):null}function UT(e){let{manifest:t,routeModules:n}=vk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return TT(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function PT({page:e,matches:t,...n}){let a=Dn(),{future:l,manifest:o,routeModules:c}=vk(),{basename:f}=yk(),{loaderData:m,matches:h}=MT(),g=x.useMemo(()=>b1(e,t,h,o,a,"data"),[e,t,h,o,a]),y=x.useMemo(()=>b1(e,t,h,o,a,"assets"),[e,t,h,o,a]),b=x.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(A=>{var L;let O=o.routes[A.route.id];!O||!O.hasLoader||(!g.some(D=>D.route.id===A.route.id)&&A.route.id in m&&((L=c[A.route.id])!=null&&L.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(A.route.id))}),j.size===0)return[];let C=NT(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,g,t,e,c]),S=x.useMemo(()=>RT(y,o),[y,o]),k=UT(y);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function BT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$T&&(window.__reactRouterVersion="7.13.1")}catch{}function FT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=bA({window:a,v5Compat:!0}));let o=l.current,[c,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(gT,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var bk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iy=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:g,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},j){let{basename:E,navigator:C,unstable_useTransitions:A}=x.useContext(ur),O=typeof g=="string"&&bk.test(g),L=sk(g,E);g=L.to;let D=WA(g,{relative:l}),z=Dn(),I=null;if(f){let ie=sf(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);E!=="/"&&(ie.pathname=ie.pathname==="/"?E:Gr([E,ie.pathname])),I=C.createHref(ie)}let[F,ee,H]=LT(a,k),ne=ZT(g,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:y,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function X(ie){t&&t(ie),ie.defaultPrevented||ne(ie)}let be=!(L.isExternal||o),fe=x.createElement("a",{...k,...H,href:(be?I:void 0)||L.absoluteURL||D,onClick:be?X:t,ref:BT(j,ee),target:h,"data-discover":!O&&n==="render"?"true":void 0});return F&&!O?x.createElement(x.Fragment,null,fe,x.createElement(IT,{page:D})):fe});iy.displayName="Link";var xk=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},g){let y=$u(c,{relative:h.relative}),b=Dn(),S=x.useContext(of),{navigator:k,basename:j}=x.useContext(ur),E=S!=null&&YT(y)&&f===!0,C=k.encodeLocation?k.encodeLocation(y).pathname:y.pathname,A=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(A=A.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=Ea(O,j)||O);const L=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let D=A===C||!l&&A.startsWith(C)&&A.charAt(L)==="/",z=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),I={isActive:D,isPending:z,isTransitioning:E},F=D?t:void 0,ee;typeof a=="function"?ee=a(I):ee=[a,D?"active":null,z?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(I):o;return x.createElement(iy,{...h,"aria-current":F,className:ee,ref:g,style:H,to:c,viewTransition:f},typeof m=="function"?m(I):m)});xk.displayName="NavLink";var qT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Dd,action:f,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(ur),E=GT(),C=KT(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&bk.test(f),L=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let z=D.nativeEvent.submitter,I=(z==null?void 0:z.getAttribute("formmethod"))||c,F=()=>E(z||D.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:l,state:o,relative:h,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>F()):F()};return x.createElement("form",{ref:k,method:A,action:C,onSubmit:a?m:L,...S,"data-discover":!O&&e==="render"?"true":void 0})});qT.displayName="Form";function HT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sk(e){let t=x.useContext(Ws);return At(t,HT(e)),t}function ZT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let g=_n(),y=Dn(),b=$u(e,{relative:c});return x.useCallback(S=>{if(wT(S,t)){S.preventDefault();let k=n!==void 0?n:wu(y)===wu(b),j=()=>g(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[y,g,b,n,a,l,t,e,o,c,f,m,h])}function df(e){Cr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(mg(e)),n=x.useRef(!1),a=Dn(),l=x.useMemo(()=>kT(a.search,n.current?null:t.current),[a.search]),o=_n(),c=x.useCallback((f,m)=>{const h=mg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var VT=0,QT=()=>`__${String(++VT)}__`;function GT(){let{router:e}=Sk("useSubmit"),{basename:t}=x.useContext(ur),n=fT(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:g,body:y}=ET(o,t);if(c.navigate===!1){let b=c.fetcherKey||QT();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:y,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:y,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,l,t,n])}function KT(e,{relative:t}={}){let{basename:n}=x.useContext(ur),a=x.useContext(Er);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...$u(e||".",{relative:t})},c=Dn();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(g=>g==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let g=f.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Gr([n,o.pathname])),wu(o)}function YT(e,{relative:t}={}){let n=x.useContext(uk);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Sk("useViewTransitionState"),l=$u(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ea(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Ea(n.nextLocation.pathname,a)||n.nextLocation.pathname;return qd(l.pathname,c)!=null||qd(l.pathname,o)!=null}const XT="/api/v1";async function JT(e,t){const n=await fetch(`${XT}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const a=await n.text();let l;try{l=JSON.parse(a).error??a}catch{l=a}throw new Error(l)}return await n.json()}const wk="/api/v1",ly="first-tree-hub:tokens";function sy(){const e=localStorage.getItem(ly);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function pg(e){localStorage.setItem(ly,JSON.stringify(e))}function kk(){localStorage.removeItem(ly)}class Fu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let nu=null;async function WT(e){return nu||(nu=(async()=>{try{const t=await fetch(`${wk}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),a={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return pg(a),a}catch{return null}finally{nu=null}})(),nu)}async function pd(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${wk}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=sy();let c=await l(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await WT(o.refreshToken);f&&(c=await l(f.accessToken))}if(!c.ok){c.status===401&&(kk(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await c.text();let m,h;try{const g=JSON.parse(f);m=g.error??f,Array.isArray(g.details)&&(h=g.details.filter(y=>typeof y=="object"&&y!==null&&Array.isArray(y.path)))}catch{m=f}throw new Fu(c.status,m,h)}if(c.status!==204)return await c.json()}const je={get:e=>pd(e),post:(e,t)=>pd(e,{method:"POST",body:t}),patch:(e,t)=>pd(e,{method:"PATCH",body:t}),delete:e=>pd(e,{method:"DELETE"})},jk=x.createContext(null);function eR({children:e}){const[t,n]=x.useState(()=>!!sy()),[a,l]=x.useState(null),[o,c]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState(null),[y,b]=x.useState(null),[S,k]=x.useState(null),j=x.useCallback(()=>{kk(),n(!1),l(null),c(null),m(null),g(null),b(null),k(null)},[]),E=x.useCallback(async()=>{var O;try{const L=await je.get("/me");l(L.member.role),c(L.member.id),m(L.member.agentId),g(L.member.organizationId),b(L.user??null),k(((O=L.wizard)==null?void 0:O.step)??null)}catch{}},[]),C=x.useCallback(async(O,L)=>{const D=await JT(O,L);pg({accessToken:D.accessToken,refreshToken:D.refreshToken}),n(!0),await E()},[E]),A=x.useCallback(async O=>{pg(O),n(!0),await E()},[E]);return x.useEffect(()=>{t&&!a&&E()},[t,a,E]),x.useEffect(()=>{const O=()=>j();return window.addEventListener("auth:logout",O),()=>window.removeEventListener("auth:logout",O)},[j]),u.jsx(jk.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,organizationId:h,user:y,wizardStep:S,login:C,adoptTokens:A,refreshMe:E,logout:j},children:e})}function an(){const e=x.useContext(jk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const tR="modulepreload",nR=function(e){return"/"+e},x1={},rR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(n.map(h=>{if(h=nR(h),h in x1)return;x1[h]=!0;const g=h.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":tR,g||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),g)return new Promise((S,k)=>{b.addEventListener("load",S),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},aR=x.lazy(()=>rR(()=>import("./index-CHoaSIzI.js"),[]).then(e=>({default:e.LandingPage}))),iR=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function lR(){const{isAuthenticated:e}=an(),t=Dn();return e?u.jsx(fg,{}):t.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(iR,{}),children:u.jsx(aR,{})}):u.jsx(uf,{to:"/login",replace:!0,state:{from:t}})}/**
|
|
61
|
-
* @license lucide-react v0.577.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const Ck=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.577.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const sR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
-
* @license lucide-react v0.577.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const oR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
|
|
76
|
-
* @license lucide-react v0.577.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const S1=e=>{const t=oR(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
81
|
-
* @license lucide-react v0.577.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var uR={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"};/**
|
|
86
|
-
* @license lucide-react v0.577.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const cR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
91
|
-
* @license lucide-react v0.577.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const dR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},m)=>x.createElement("svg",{ref:m,...uR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ck("lucide",l),...!o&&!cR(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,g])=>x.createElement(h,g)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
-
* @license lucide-react v0.577.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const lt=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(dR,{ref:o,iconNode:t,className:Ck(`lucide-${sR(S1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=S1(e),n};/**
|
|
101
|
-
* @license lucide-react v0.577.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const fR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],hR=lt("arrow-left",fR);/**
|
|
106
|
-
* @license lucide-react v0.577.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const mR=[["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"}]],pR=lt("bell",mR);/**
|
|
111
|
-
* @license lucide-react v0.577.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const gR=[["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"}]],yR=lt("bot",gR);/**
|
|
116
|
-
* @license lucide-react v0.577.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const vR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Na=lt("check",vR);/**
|
|
121
|
-
* @license lucide-react v0.577.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const bR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ek=lt("chevron-down",bR);/**
|
|
126
|
-
* @license lucide-react v0.577.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const xR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],SR=lt("chevron-right",xR);/**
|
|
131
|
-
* @license lucide-react v0.577.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const wR=[["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"}]],oy=lt("copy",wR);/**
|
|
136
|
-
* @license lucide-react v0.577.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const kR=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],jR=lt("eye-off",kR);/**
|
|
141
|
-
* @license lucide-react v0.577.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const CR=[["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"}]],ER=lt("eye",CR);/**
|
|
146
|
-
* @license lucide-react v0.577.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const NR=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Nk=lt("github",NR);/**
|
|
151
|
-
* @license lucide-react v0.577.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const _R=[["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"}]],AR=lt("layout-dashboard",_R);/**
|
|
156
|
-
* @license lucide-react v0.577.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const TR=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],gg=lt("link-2",TR);/**
|
|
161
|
-
* @license lucide-react v0.577.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const RR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zR=lt("loader-circle",RR);/**
|
|
166
|
-
* @license lucide-react v0.577.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const OR=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],_k=lt("lock",OR);/**
|
|
171
|
-
* @license lucide-react v0.577.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const DR=[["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"}]],MR=lt("log-out",DR);/**
|
|
176
|
-
* @license lucide-react v0.577.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const LR=[["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"}]],uy=lt("message-square",LR);/**
|
|
181
|
-
* @license lucide-react v0.577.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const IR=[["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"}]],UR=lt("moon",IR);/**
|
|
186
|
-
* @license lucide-react v0.577.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const PR=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],BR=lt("paperclip",PR);/**
|
|
191
|
-
* @license lucide-react v0.577.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const $R=[["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"}]],FR=lt("pause",$R);/**
|
|
196
|
-
* @license lucide-react v0.577.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const qR=[["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"}]],qu=lt("pencil",qR);/**
|
|
201
|
-
* @license lucide-react v0.577.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const HR=[["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"}]],Ak=lt("play",HR);/**
|
|
206
|
-
* @license lucide-react v0.577.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const ZR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_a=lt("plus",ZR);/**
|
|
211
|
-
* @license lucide-react v0.577.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const VR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ff=lt("search",VR);/**
|
|
216
|
-
* @license lucide-react v0.577.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const QR=[["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"}]],GR=lt("send",QR);/**
|
|
221
|
-
* @license lucide-react v0.577.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const KR=[["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"}]],YR=lt("settings",KR);/**
|
|
226
|
-
* @license lucide-react v0.577.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const XR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],JR=lt("square",XR);/**
|
|
231
|
-
* @license lucide-react v0.577.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const WR=[["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"}]],ez=lt("sun",WR);/**
|
|
236
|
-
* @license lucide-react v0.577.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const tz=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],nz=lt("terminal",tz);/**
|
|
241
|
-
* @license lucide-react v0.577.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const rz=[["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"}]],Hs=lt("trash-2",rz);/**
|
|
246
|
-
* @license lucide-react v0.577.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const az=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],iz=lt("triangle-alert",az);/**
|
|
251
|
-
* @license lucide-react v0.577.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const lz=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],sz=lt("undo-2",lz);/**
|
|
256
|
-
* @license lucide-react v0.577.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const oz=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],uz=lt("unplug",oz);/**
|
|
261
|
-
* @license lucide-react v0.577.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const cz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],dz=lt("user-plus",cz);/**
|
|
266
|
-
* @license lucide-react v0.577.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const fz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ku=lt("x",fz);/**
|
|
271
|
-
* @license lucide-react v0.577.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const hz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],mz=lt("zap",hz);function Tk(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=Tk(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Rk(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Tk(e))&&(a&&(a+=" "),a+=t);return a}const pz=(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},gz=(e,t)=>({classGroupId:e,validator:t}),zk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Hd="-",w1=[],yz="arbitrary..",vz=e=>{const t=xz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return bz(c);const f=c.split(Hd),m=f[0]===""&&f.length>1?1:0;return Ok(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?pz(h,m):m:h||w1}return n[c]||w1}}},Ok=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Ok(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Hd):e.slice(t).join(Hd),m=c.length;for(let h=0;h<m;h++){const g=c[h];if(g.validator(f))return g.classGroupId}},bz=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?yz+a:void 0})(),xz=e=>{const{theme:t,classGroups:n}=e;return Sz(n,t)},Sz=(e,t)=>{const n=zk();for(const a in e){const l=e[a];cy(l,n,a,t)}return n},cy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];wz(c,t,n,a)}},wz=(e,t,n,a)=>{if(typeof e=="string"){kz(e,t,n);return}if(typeof e=="function"){jz(e,t,n,a);return}Cz(e,t,n,a)},kz=(e,t,n)=>{const a=e===""?t:Dk(t,e);a.classGroupId=n},jz=(e,t,n,a)=>{if(Ez(e)){cy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(gz(n,e))},Cz=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];cy(m,Dk(t,f),n,a)}},Dk=(e,t)=>{let n=e;const a=t.split(Hd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=zk(),n.nextPart.set(c,f)),n=f}return n},Ez=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Nz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},yg="!",k1=":",_z=[],j1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Az=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const g=l.length;for(let j=0;j<g;j++){const E=l[j];if(c===0&&f===0){if(E===k1){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const y=o.length===0?l:l.slice(m);let b=y,S=!1;y.endsWith(yg)?(b=y.slice(0,-1),S=!0):y.startsWith(yg)&&(b=y.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return j1(o,S,b,k)};if(t){const l=t+k1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):j1(_z,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Tz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],f=c[0]==="[",m=t.has(c);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},Rz=e=>({cache:Nz(e.cacheSize),parseClassName:Az(e),sortModifiers:Tz(e),...vz(e)}),zz=/\s+/,Oz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(zz);let m="";for(let h=f.length-1;h>=0;h-=1){const g=f[h],{isExternal:y,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:j}=n(g);if(y){m=g+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=g+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=g+(m.length>0?" "+m:m);continue}E=!1}const A=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=S?A+yg:A,L=O+C;if(c.indexOf(L)>-1)continue;c.push(L);const D=l(C,E);for(let z=0;z<D.length;++z){const I=D[z];c.push(O+I)}m=g+(m.length>0?" "+m:m)}return m},Dz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Mk(n))&&(l&&(l+=" "),l+=a);return l},Mk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Mk(e[a]))&&(n&&(n+=" "),n+=t);return n},Mz=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((g,y)=>y(g),e());return n=Rz(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const g=Oz(m,n);return l(m,g),g};return o=c,(...m)=>o(Dz(...m))},Lz=[],nn=e=>{const t=n=>n[e]||Lz;return t.isThemeGetter=!0,t},Lk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ik=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Iz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Uz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Pz=/\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$/,Bz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,li=e=>Iz.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),si=e=>!!e&&Number.isInteger(Number(e)),ip=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),va=e=>Uz.test(e),Uk=()=>!0,qz=e=>Pz.test(e)&&!Bz.test(e),dy=()=>!1,Hz=e=>$z.test(e),Zz=e=>Fz.test(e),Vz=e=>!Ce(e)&&!Ee(e),Qz=e=>Ri(e,$k,dy),Ce=e=>Lk.test(e),nl=e=>Ri(e,Fk,qz),C1=e=>Ri(e,tO,Ge),Gz=e=>Ri(e,Hk,Uk),Kz=e=>Ri(e,qk,dy),E1=e=>Ri(e,Pk,dy),Yz=e=>Ri(e,Bk,Zz),gd=e=>Ri(e,Zk,Hz),Ee=e=>Ik.test(e),ru=e=>kl(e,Fk),Xz=e=>kl(e,qk),N1=e=>kl(e,Pk),Jz=e=>kl(e,$k),Wz=e=>kl(e,Bk),yd=e=>kl(e,Zk,!0),eO=e=>kl(e,Hk,!0),Ri=(e,t,n)=>{const a=Lk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},kl=(e,t,n=!1)=>{const a=Ik.exec(e);return a?a[1]?t(a[1]):n:!1},Pk=e=>e==="position"||e==="percentage",Bk=e=>e==="image"||e==="url",$k=e=>e==="length"||e==="size"||e==="bg-size",Fk=e=>e==="length",tO=e=>e==="number",qk=e=>e==="family-name",Hk=e=>e==="number"||e==="weight",Zk=e=>e==="shadow",nO=()=>{const e=nn("color"),t=nn("font"),n=nn("text"),a=nn("font-weight"),l=nn("tracking"),o=nn("leading"),c=nn("breakpoint"),f=nn("container"),m=nn("spacing"),h=nn("radius"),g=nn("shadow"),y=nn("inset-shadow"),b=nn("text-shadow"),S=nn("drop-shadow"),k=nn("blur"),j=nn("perspective"),E=nn("aspect"),C=nn("ease"),A=nn("animate"),O=()=>["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(),Ee,Ce],z=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],F=()=>[Ee,Ce,m],ee=()=>[li,"full","auto",...F()],H=()=>[si,"none","subgrid",Ee,Ce],ne=()=>["auto",{span:["full",si,Ee,Ce]},si,Ee,Ce],X=()=>[si,"auto",Ee,Ce],be=()=>["auto","min","max","fr",Ee,Ce],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...F()],ae=()=>[li,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],K=()=>[li,"screen","full","dvw","lvw","svw","min","max","fit",...F()],he=()=>[li,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],T=()=>[e,Ee,Ce],P=()=>[...L(),N1,E1,{position:[Ee,Ce]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",Jz,Qz,{size:[Ee,Ce]}],$=()=>[ip,ru,nl],J=()=>["","none","full",h,Ee,Ce],ue=()=>["",Ge,ru,nl],xe=()=>["solid","dashed","dotted","double"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Ge,ip,N1,E1],Ct=()=>["","none",k,Ee,Ce],te=()=>["none",Ge,Ee,Ce],Te=()=>["none",Ge,Ee,Ce],Ue=()=>[Ge,Ee,Ce],Fe=()=>[li,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[va],breakpoint:[va],color:[Uk],container:[va],"drop-shadow":[va],ease:["in","out","in-out"],font:[Vz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[va],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[va],shadow:[va],spacing:["px",Ge],text:[va],"text-shadow":[va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",li,Ce,Ee,E]}],container:["container"],columns:[{columns:[Ge,Ce,Ee,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[si,"auto",Ee,Ce]}],basis:[{basis:[li,"full","auto",f,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,li,"auto","initial","none",Ce]}],grow:[{grow:["",Ge,Ee,Ce]}],shrink:[{shrink:["",Ge,Ee,Ce]}],order:[{order:[si,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[f,"screen",...ae()]}],"min-w":[{"min-w":[f,"screen","none",...ae()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",n,ru,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,eO,Gz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ip,Ce]}],"font-family":[{font:[Xz,Kz,t]}],"font-features":[{"font-features":[Ce]}],"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:[l,Ee,Ce]}],"line-clamp":[{"line-clamp":[Ge,"none",Ee,C1]}],leading:[{leading:[o,...F()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ee,nl]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Ge,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],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",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},si,Ee,Ce],radial:["",Ee,Ce],conic:[si,Ee,Ce]},Wz,Yz]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ee,Ce]}],"outline-w":[{outline:["",Ge,ru,nl]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",g,yd,gd]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",y,yd,gd]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Ge,nl]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",b,yd,gd]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Ge,Ee,Ce]}],"mix-blend":[{"mix-blend":[...Le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Le()}],"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":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Ct()}],brightness:[{brightness:[Ge,Ee,Ce]}],contrast:[{contrast:[Ge,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",S,yd,gd]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Ge,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ge,Ee,Ce]}],invert:[{invert:["",Ge,Ee,Ce]}],saturate:[{saturate:[Ge,Ee,Ce]}],sepia:[{sepia:["",Ge,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Ct()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",C,Ee,Ce]}],delay:[{delay:[Ge,Ee,Ce]}],animate:[{animate:["none",A,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ee,Ce]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",Ee,Ce]}],"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":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ee,Ce]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Ge,ru,nl,C1]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},rO=Mz(nO);function _e(...e){return rO(Rk(e))}function Ci(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"—"}function aO(e){return je.delete(`/clients/${encodeURIComponent(e)}`)}function Hu(){return je.get("/admin/agents/activity")}function Zs(){return je.get("/clients")}function Vk(e){return je.get(`/clients/${e}`)}function iO(e){return je.post(`/clients/${e}/disconnect`)}function Qk(){return je.post("/connect-tokens")}const Gk=(e,t)=>["session",e,t],Zd=e=>["agent-sessions",e];function lO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function sO(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="sdk"&&t.source!=="runtime"&&t.source!=="tool"||typeof t.message!="string"?null:{source:t.source,message:t.message}}function oO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function to(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const a=n.toString();return je.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function uO(e,t,n){const a=new URLSearchParams;a.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&a.set("cursor",String(n.cursor)),n!=null&&n.direction&&a.set("direction",n.direction);const l=a.toString();return je.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function cO(e,t){return je.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function dO(e,t){return je.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var _1=1,fO=.9,hO=.8,mO=.17,lp=.1,sp=.999,pO=.9999,gO=.99,yO=/[\\\/_+.#"@\[\(\{&]/,vO=/[\\\/_+.#"@\[\(\{&]/g,bO=/[\s-]/,Kk=/[\s-]/g;function vg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?_1:gO;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),g=0,y,b,S,k;h>=0;)y=vg(e,t,n,a,h+1,o+1,c),y>g&&(h===l?y*=_1:yO.test(e.charAt(h-1))?(y*=hO,S=e.slice(l,h-1).match(vO),S&&l>0&&(y*=Math.pow(sp,S.length))):bO.test(e.charAt(h-1))?(y*=fO,k=e.slice(l,h-1).match(Kk),k&&l>0&&(y*=Math.pow(sp,k.length))):(y*=mO,l>0&&(y*=Math.pow(sp,h-l))),e.charAt(h)!==t.charAt(o)&&(y*=pO)),(y<lp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=vg(e,t,n,a,h+1,o+2,c),b*lp>y&&(y=b*lp)),y>g&&(g=y),h=n.indexOf(m,h+1);return c[f]=g,g}function A1(e){return e.toLowerCase().replace(Kk," ")}function xO(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,vg(e,t,A1(e),A1(t),0,0,{})}function ji(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function T1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ei(...e){return t=>{let n=!1;const a=e.map(l=>{const o=T1(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<a.length;l++){const o=a[l];typeof o=="function"?o():T1(e[l],null)}}}}function jl(...e){return x.useCallback(Ei(...e),e)}function SO(e,t){const n=x.createContext(t),a=o=>{const{children:c,...f}=o,m=x.useMemo(()=>f,Object.values(f));return u.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function l(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function wO(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=y=>{var C;const{scope:b,children:S,...k}=y,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:E,children:S})};h.displayName=o+"Provider";function g(y,b){var j;const S=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(S);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${o}\``)}return[h,g]}const l=()=>{const o=n.map(c=>x.createContext(c));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,kO(l,...t)]}function kO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((f,{useScope:m,scopeName:h})=>{const y=m(o)[`__scope${h}`];return{...f,...y}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var ju=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},jO=Zg[" useId ".trim().toString()]||(()=>{}),CO=0;function ja(e){const[t,n]=x.useState(jO());return ju(()=>{n(a=>a??String(CO++))},[e]),t?`radix-${t}`:""}var EO=Zg[" useInsertionEffect ".trim().toString()]||ju;function NO({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=_O({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const g=x.useRef(e!==void 0);x.useEffect(()=>{const y=g.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,a])}const h=x.useCallback(g=>{var y;if(f){const b=AO(g)?g(e):g;b!==e&&((y=c.current)==null||y.call(c,b))}else o(g)},[f,e,o,c]);return[m,h]}function _O({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return EO(()=>{o.current=t},[t]),x.useEffect(()=>{var c;l.current!==n&&((c=o.current)==null||c.call(o,n),l.current=n)},[n,l]),[n,a,o]}function AO(e){return typeof e=="function"}var fy=Pw();const TO=lf(fy);function Yk(e){const t=RO(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(OO);if(m){const h=m.props.children,g=f.map(y=>y===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:y);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function RO(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=MO(l),f=DO(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ei(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zO=Symbol("radix.slottable");function OO(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zO}function DO(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function MO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var LO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Aa=LO.reduce((e,t)=>{const n=Yk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function IO(e,t){e&&fy.flushSync(()=>e.dispatchEvent(t))}function Cu(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function UO(e,t=globalThis==null?void 0:globalThis.document){const n=Cu(e);x.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var PO="DismissableLayer",bg="dismissableLayer.update",BO="dismissableLayer.pointerDownOutside",$O="dismissableLayer.focusOutside",R1,Xk=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jk=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(Xk),[g,y]=x.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=jl(t,I=>y(I)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),A=g?j.indexOf(g):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,L=A>=C,D=HO(I=>{const F=I.target,ee=[...h.branches].some(H=>H.contains(F));!L||ee||(l==null||l(I),c==null||c(I),I.defaultPrevented||f==null||f())},b),z=ZO(I=>{const F=I.target;[...h.branches].some(H=>H.contains(F))||(o==null||o(I),c==null||c(I),I.defaultPrevented||f==null||f())},b);return UO(I=>{A===h.layers.size-1&&(a==null||a(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},b),x.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(R1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),z1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=R1)}},[g,b,n,h]),x.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),z1())},[g,h]),x.useEffect(()=>{const I=()=>S({});return document.addEventListener(bg,I),()=>document.removeEventListener(bg,I)},[]),u.jsx(Aa.div,{...m,ref:k,style:{pointerEvents:O?L?"auto":"none":void 0,...e.style},onFocusCapture:ji(e.onFocusCapture,z.onFocusCapture),onBlurCapture:ji(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:ji(e.onPointerDownCapture,D.onPointerDownCapture)})});Jk.displayName=PO;var FO="DismissableLayerBranch",qO=x.forwardRef((e,t)=>{const n=x.useContext(Xk),a=x.useRef(null),l=jl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Aa.div,{...e,ref:l})});qO.displayName=FO;function HO(e,t=globalThis==null?void 0:globalThis.document){const n=Cu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){Wk(BO,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function ZO(e,t=globalThis==null?void 0:globalThis.document){const n=Cu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&Wk($O,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function z1(){const e=new CustomEvent(bg);document.dispatchEvent(e)}function Wk(e,t,n,{discrete:a}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?IO(l,o):l.dispatchEvent(o)}var op="focusScope.autoFocusOnMount",up="focusScope.autoFocusOnUnmount",O1={bubbles:!1,cancelable:!0},VO="FocusScope",ej=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=Cu(l),g=Cu(o),y=x.useRef(null),b=jl(t,j=>m(j)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(S.paused||!f)return;const L=O.target;f.contains(L)?y.current=L:ci(y.current,{select:!0})},E=function(O){if(S.paused||!f)return;const L=O.relatedTarget;L!==null&&(f.contains(L)||ci(y.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const D of O)D.removedNodes.length>0&&ci(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const A=new MutationObserver(C);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),A.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){M1.add(S);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(op,O1);f.addEventListener(op,h),f.dispatchEvent(C),C.defaultPrevented||(QO(JO(tj(f)),{select:!0}),document.activeElement===j&&ci(f))}return()=>{f.removeEventListener(op,h),setTimeout(()=>{const C=new CustomEvent(up,O1);f.addEventListener(up,g),f.dispatchEvent(C),C.defaultPrevented||ci(j??document.body,{select:!0}),f.removeEventListener(up,g),M1.remove(S)},0)}}},[f,h,g,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const A=j.currentTarget,[O,L]=GO(A);O&&L?!j.shiftKey&&C===L?(j.preventDefault(),n&&ci(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&ci(L,{select:!0})):C===A&&j.preventDefault()}},[n,a,S.paused]);return u.jsx(Aa.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});ej.displayName=VO;function QO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ci(a,{select:t}),document.activeElement!==n)return}function GO(e){const t=tj(e),n=D1(t,e),a=D1(t.reverse(),e);return[n,a]}function tj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function D1(e,t){for(const n of e)if(!KO(n,{upTo:t}))return n}function KO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function YO(e){return e instanceof HTMLInputElement&&"select"in e}function ci(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&YO(e)&&t&&e.select()}}var M1=XO();function XO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=L1(e,t),e.unshift(t)},remove(t){var n;e=L1(e,t),(n=e[0])==null||n.resume()}}}function L1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function JO(e){return e.filter(t=>t.tagName!=="A")}var WO="Portal",nj=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);ju(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?TO.createPortal(u.jsx(Aa.div,{...a,ref:t}),c):null});nj.displayName=WO;function e3(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var hf=e=>{const{present:t,children:n}=e,a=t3(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=jl(a.ref,n3(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};hf.displayName="Presence";function t3(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=e3(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=vd(a.current);o.current=f==="mounted"?h:"none"},[f]),ju(()=>{const h=a.current,g=l.current;if(g!==e){const b=o.current,S=vd(h);e?m("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),ju(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,y=S=>{const j=vd(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=S=>{S.target===t&&(o.current=vd(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function vd(e){return(e==null?void 0:e.animationName)||"none"}function n3(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cp=0;function r3(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??I1()),document.body.insertAdjacentElement("beforeend",e[1]??I1()),cp++,()=>{cp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cp--}},[])}function I1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Vr=function(){return Vr=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vr.apply(this,arguments)};function rj(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function a3(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var Ld="right-scroll-bar-position",Id="width-before-scroll-bar",i3="with-scroll-bars-hidden",l3="--removed-body-scroll-bar-size";function dp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function s3(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var o3=typeof window<"u"?x.useLayoutEffect:x.useEffect,U1=new WeakMap;function u3(e,t){var n=s3(null,function(a){return e.forEach(function(l){return dp(l,a)})});return o3(function(){var a=U1.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||dp(f,null)}),o.forEach(function(f){l.has(f)||dp(f,c)})}U1.set(n,e)},[e]),n}function c3(e){return e}function d3(e,t){t===void 0&&(t=c3);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,a);return n.push(c),function(){n=n.filter(function(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var g=c;c=[],g.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(g){c.push(g),h()},filter:function(g){return c=c.filter(g),n}}}};return l}function f3(e){e===void 0&&(e={});var t=d3(null);return t.options=Vr({async:!0,ssr:!1},e),t}var aj=function(e){var t=e.sideCar,n=rj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,Vr({},n))};aj.isSideCarExport=!0;function h3(e,t){return e.useMedium(t),aj}var ij=f3(),fp=function(){},mf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:fp,onWheelCapture:fp,onTouchMoveCapture:fp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,g=e.enabled,y=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,O=e.gapMode,L=rj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,z=u3([n,t]),I=Vr(Vr({},L),l);return x.createElement(x.Fragment,null,g&&x.createElement(D,{sideCar:ij,removeScrollBar:h,shards:y,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),c?x.cloneElement(x.Children.only(f),Vr(Vr({},I),{ref:z})):x.createElement(A,Vr({},I,{className:m,ref:z}),f))});mf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mf.classNames={fullWidth:Id,zeroRight:Ld};var m3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function p3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=m3();return t&&e.setAttribute("nonce",t),e}function g3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function y3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var v3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=p3())&&(g3(t,n),y3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b3=function(){var e=v3();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lj=function(){var e=b3(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},x3={left:0,top:0,right:0,gap:0},hp=function(e){return parseInt(e||"",10)||0},S3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[hp(n),hp(a),hp(l)]},w3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return x3;var t=S3(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},k3=lj(),Es="data-scroll-locked",j3=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
276
|
-
.`.concat(i3,` {
|
|
277
|
-
overflow: hidden `).concat(a,`;
|
|
278
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
279
|
-
}
|
|
280
|
-
body[`).concat(Es,`] {
|
|
281
|
-
overflow: hidden `).concat(a,`;
|
|
282
|
-
overscroll-behavior: contain;
|
|
283
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
284
|
-
padding-left: `.concat(l,`px;
|
|
285
|
-
padding-top: `).concat(o,`px;
|
|
286
|
-
padding-right: `).concat(c,`px;
|
|
287
|
-
margin-left:0;
|
|
288
|
-
margin-top:0;
|
|
289
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
290
|
-
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.`).concat(Ld,` {
|
|
294
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.`).concat(Id,` {
|
|
298
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.`).concat(Ld," .").concat(Ld,` {
|
|
302
|
-
right: 0 `).concat(a,`;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.`).concat(Id," .").concat(Id,` {
|
|
306
|
-
margin-right: 0 `).concat(a,`;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
body[`).concat(Es,`] {
|
|
310
|
-
`).concat(l3,": ").concat(f,`px;
|
|
311
|
-
}
|
|
312
|
-
`)},P1=function(){var e=parseInt(document.body.getAttribute(Es)||"0",10);return isFinite(e)?e:0},C3=function(){x.useEffect(function(){return document.body.setAttribute(Es,(P1()+1).toString()),function(){var e=P1()-1;e<=0?document.body.removeAttribute(Es):document.body.setAttribute(Es,e.toString())}},[])},E3=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;C3();var o=x.useMemo(function(){return w3(l)},[l]);return x.createElement(k3,{styles:j3(o,!t,l,n?"":"!important")})},xg=!1;if(typeof window<"u")try{var bd=Object.defineProperty({},"passive",{get:function(){return xg=!0,!0}});window.addEventListener("test",bd,bd),window.removeEventListener("test",bd,bd)}catch{xg=!1}var hs=xg?{passive:!1}:!1,N3=function(e){return e.tagName==="TEXTAREA"},sj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!N3(e)&&n[t]==="visible")},_3=function(e){return sj(e,"overflowY")},A3=function(e){return sj(e,"overflowX")},B1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=oj(e,a);if(l){var o=uj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},T3=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},R3=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},oj=function(e,t){return e==="v"?_3(t):A3(t)},uj=function(e,t){return e==="v"?T3(t):R3(t)},z3=function(e,t){return e==="h"&&t==="rtl"?-1:1},O3=function(e,t,n,a,l){var o=z3(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,g=c>0,y=0,b=0;do{if(!f)break;var S=uj(e,f),k=S[0],j=S[1],E=S[2],C=j-E-o*k;(k||C)&&oj(e,f)&&(y+=C,b+=k);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(y)<1||!g&&Math.abs(b)<1)&&(h=!0),h},xd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$1=function(e){return[e.deltaX,e.deltaY]},F1=function(e){return e&&"current"in e?e.current:e},D3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},M3=function(e){return`
|
|
313
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
-
`)},L3=0,ms=[];function I3(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(L3++)[0],o=x.useState(lj)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=a3([e.lockRef.current],(e.shards||[]).map(F1),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var C=xd(j),A=n.current,O="deltaX"in j?j.deltaX:A[0]-C[0],L="deltaY"in j?j.deltaY:A[1]-C[1],D,z=j.target,I=Math.abs(O)>Math.abs(L)?"h":"v";if("touches"in j&&I==="h"&&z.type==="range")return!1;var F=window.getSelection(),ee=F&&F.anchorNode,H=ee?ee===z||ee.contains(z):!1;if(H)return!1;var ne=B1(I,z);if(!ne)return!0;if(ne?D=I:(D=I==="v"?"h":"v",ne=B1(I,z)),!ne)return!1;if(!a.current&&"changedTouches"in j&&(O||L)&&(a.current=D),!D)return!0;var X=a.current||D;return O3(X,E,j,X==="h"?O:L)},[]),m=x.useCallback(function(j){var E=j;if(!(!ms.length||ms[ms.length-1]!==o)){var C="deltaY"in E?$1(E):xd(E),A=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&D3(D.delta,C)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var O=(c.current.shards||[]).map(F1).filter(Boolean).filter(function(D){return D.contains(E.target)}),L=O.length>0?f(E,O[0]):!c.current.noIsolation;L&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,A){var O={name:j,delta:E,target:C,should:A,shadowParent:U3(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(L){return L!==O})},1)},[]),g=x.useCallback(function(j){n.current=xd(j),a.current=void 0},[]),y=x.useCallback(function(j){h(j.type,$1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,xd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ms.push(o),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",m,hs),document.addEventListener("touchmove",m,hs),document.addEventListener("touchstart",g,hs),function(){ms=ms.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,hs),document.removeEventListener("touchmove",m,hs),document.removeEventListener("touchstart",g,hs)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:M3(l)}):null,S?x.createElement(E3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function U3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const P3=h3(ij,I3);var cj=x.forwardRef(function(e,t){return x.createElement(mf,Vr({},e,{ref:t,sideCar:P3}))});cj.classNames=mf.classNames;var B3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ps=new WeakMap,Sd=new WeakMap,wd={},mp=0,dj=function(e){return e&&(e.host||dj(e.parentNode))},$3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=dj(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},F3=function(e,t,n,a){var l=$3(t,Array.isArray(e)?e:[e]);wd[n]||(wd[n]=new WeakMap);var o=wd[n],c=[],f=new Set,m=new Set(l),h=function(y){!y||f.has(y)||(f.add(y),h(y.parentNode))};l.forEach(h);var g=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))g(b);else try{var S=b.getAttribute(a),k=S!==null&&S!=="false",j=(ps.get(b)||0)+1,E=(o.get(b)||0)+1;ps.set(b,j),o.set(b,E),c.push(b),j===1&&k&&Sd.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return g(t),f.clear(),mp++,function(){c.forEach(function(y){var b=ps.get(y)-1,S=o.get(y)-1;ps.set(y,b),o.set(y,S),b||(Sd.has(y)||y.removeAttribute(a),Sd.delete(y)),S||y.removeAttribute(n)}),mp--,mp||(ps=new WeakMap,ps=new WeakMap,Sd=new WeakMap,wd={})}},q3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=B3(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),F3(a,l,n,"aria-hidden")):function(){return null}},pf="Dialog",[fj]=wO(pf),[H3,Lr]=fj(pf),hj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,g]=NO({prop:a,defaultProp:l??!1,onChange:o,caller:pf});return u.jsx(H3,{scope:t,triggerRef:f,contentRef:m,contentId:ja(),titleId:ja(),descriptionId:ja(),open:h,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(y=>!y),[g]),modal:c,children:n})};hj.displayName=pf;var mj="DialogTrigger",pj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(mj,n),o=jl(t,l.triggerRef);return u.jsx(Aa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":py(l.open),...a,ref:o,onClick:ji(e.onClick,l.onOpenToggle)})});pj.displayName=mj;var hy="DialogPortal",[Z3,gj]=fj(hy,{forceMount:void 0}),yj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Lr(hy,t);return u.jsx(Z3,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(hf,{present:n||o.open,children:u.jsx(nj,{asChild:!0,container:l,children:c})}))})};yj.displayName=hy;var Vd="DialogOverlay",vj=x.forwardRef((e,t)=>{const n=gj(Vd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(Vd,e.__scopeDialog);return o.modal?u.jsx(hf,{present:a||o.open,children:u.jsx(Q3,{...l,ref:t})}):null});vj.displayName=Vd;var V3=Yk("DialogOverlay.RemoveScroll"),Q3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Vd,n);return u.jsx(cj,{as:V3,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(Aa.div,{"data-state":py(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),pl="DialogContent",bj=x.forwardRef((e,t)=>{const n=gj(pl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(pl,e.__scopeDialog);return u.jsx(hf,{present:a||o.open,children:o.modal?u.jsx(G3,{...l,ref:t}):u.jsx(K3,{...l,ref:t})})});bj.displayName=pl;var G3=x.forwardRef((e,t)=>{const n=Lr(pl,e.__scopeDialog),a=x.useRef(null),l=jl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return q3(o)},[]),u.jsx(xj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ji(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ji(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:ji(e.onFocusOutside,o=>o.preventDefault())})}),K3=x.forwardRef((e,t)=>{const n=Lr(pl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(xj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),xj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Lr(pl,n),m=x.useRef(null),h=jl(t,m);return r3(),u.jsxs(u.Fragment,{children:[u.jsx(ej,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(Jk,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":py(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Y3,{titleId:f.titleId}),u.jsx(J3,{contentRef:m,descriptionId:f.descriptionId})]})]})}),my="DialogTitle",Sj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(my,n);return u.jsx(Aa.h2,{id:l.titleId,...a,ref:t})});Sj.displayName=my;var wj="DialogDescription",kj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(wj,n);return u.jsx(Aa.p,{id:l.descriptionId,...a,ref:t})});kj.displayName=wj;var jj="DialogClose",Cj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(jj,n);return u.jsx(Aa.button,{type:"button",...a,ref:t,onClick:ji(e.onClick,()=>l.onOpenChange(!1))})});Cj.displayName=jj;function py(e){return e?"open":"closed"}var Ej="DialogTitleWarning",[AH,Nj]=SO(Ej,{contentName:pl,titleName:my,docsSlug:"dialog"}),Y3=({titleId:e})=>{const t=Nj(Ej),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
316
|
-
|
|
317
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
318
|
-
|
|
319
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},X3="DialogDescriptionWarning",J3=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nj(X3).contentName}}.`;return x.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},_j=hj,W3=pj,Aj=yj,Tj=vj,Rj=bj,eD=Sj,tD=kj,nD=Cj,rD=Symbol.for("react.lazy"),Qd=Zg[" use ".trim().toString()];function aD(e){return typeof e=="object"&&e!==null&&"then"in e}function zj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rD&&"_payload"in e&&aD(e._payload)}function Oj(e){const t=lD(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;zj(o)&&typeof Qd=="function"&&(o=Qd(o._payload));const f=x.Children.toArray(o),m=f.find(oD);if(m){const h=m.props.children,g=f.map(y=>y===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:y);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,g):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var iD=Oj("Slot");function lD(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(zj(l)&&typeof Qd=="function"&&(l=Qd(l._payload)),x.isValidElement(l)){const c=cD(l),f=uD(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ei(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sD=Symbol("radix.slottable");function oD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sD}function uD(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function cD(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=dD.reduce((e,t)=>{const n=Oj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),au='[cmdk-group=""]',pp='[cmdk-group-items=""]',fD='[cmdk-group-heading=""]',Dj='[cmdk-item=""]',q1=`${Dj}:not([aria-disabled="true"])`,Sg="cmdk-item-select",bs="data-value",hD=(e,t,n)=>xO(e,t,n),Mj=x.createContext(void 0),Zu=()=>x.useContext(Mj),Lj=x.createContext(void 0),gy=()=>x.useContext(Lj),Ij=x.createContext(void 0),Uj=x.forwardRef((e,t)=>{let n=xs(()=>{var B,_;return{search:"",value:(_=(B=e.value)!=null?B:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=xs(()=>new Set),l=xs(()=>new Map),o=xs(()=>new Map),c=xs(()=>new Set),f=Pj(e),{label:m,children:h,value:g,onValueChange:y,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,A=ja(),O=ja(),L=ja(),D=x.useRef(null),z=jD();gl(()=>{if(g!==void 0){let B=g.trim();n.current.value=B,I.emit()}},[g]),gl(()=>{z(6,be)},[]);let I=x.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,_,$)=>{var J,ue,xe,Le;if(!Object.is(n.current[B],_)){if(n.current[B]=_,B==="search")X(),H(),z(1,ne);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Se=document.getElementById(L);Se?Se.focus():(J=document.getElementById(A))==null||J.focus()}if(z(7,()=>{var Se;n.current.selectedItemId=(Se=fe())==null?void 0:Se.id,I.emit()}),$||z(5,be),((ue=f.current)==null?void 0:ue.value)!==void 0){let Se=_??"";(Le=(xe=f.current).onValueChange)==null||Le.call(xe,Se);return}}I.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),F=x.useMemo(()=>({value:(B,_,$)=>{var J;_!==((J=o.current.get(B))==null?void 0:J.value)&&(o.current.set(B,{value:_,keywords:$}),n.current.filtered.items.set(B,ee(_,$)),z(2,()=>{H(),I.emit()}))},item:(B,_)=>(a.current.add(B),_&&(l.current.has(_)?l.current.get(_).add(B):l.current.set(_,new Set([B]))),z(3,()=>{X(),H(),n.current.value||ne(),I.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let $=fe();z(4,()=>{X(),($==null?void 0:$.getAttribute("id"))===B&&ne(),I.emit()})}),group:B=>(l.current.has(B)||l.current.set(B,new Set),()=>{o.current.delete(B),l.current.delete(B)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:A,inputId:L,labelId:O,listInnerRef:D}),[]);function ee(B,_){var $,J;let ue=(J=($=f.current)==null?void 0:$.filter)!=null?J:hD;return B?ue(B,n.current.search,_):0}function H(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(J=>{let ue=l.current.get(J),xe=0;ue.forEach(Le=>{let Se=B.get(Le);xe=Math.max(Se,xe)}),_.push([J,xe])});let $=D.current;ie().sort((J,ue)=>{var xe,Le;let Se=J.getAttribute("id"),Ct=ue.getAttribute("id");return((xe=B.get(Ct))!=null?xe:0)-((Le=B.get(Se))!=null?Le:0)}).forEach(J=>{let ue=J.closest(pp);ue?ue.appendChild(J.parentElement===ue?J:J.closest(`${pp} > *`)):$.appendChild(J.parentElement===$?J:J.closest(`${pp} > *`))}),_.sort((J,ue)=>ue[1]-J[1]).forEach(J=>{var ue;let xe=(ue=D.current)==null?void 0:ue.querySelector(`${au}[${bs}="${encodeURIComponent(J[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function ne(){let B=ie().find($=>$.getAttribute("aria-disabled")!=="true"),_=B==null?void 0:B.getAttribute(bs);I.setState("value",_||void 0)}function X(){var B,_,$,J;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let xe of a.current){let Le=(_=(B=o.current.get(xe))==null?void 0:B.value)!=null?_:"",Se=(J=($=o.current.get(xe))==null?void 0:$.keywords)!=null?J:[],Ct=ee(Le,Se);n.current.filtered.items.set(xe,Ct),Ct>0&&ue++}for(let[xe,Le]of l.current)for(let Se of Le)if(n.current.filtered.items.get(Se)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=ue}function be(){var B,_,$;let J=fe();J&&(((B=J.parentElement)==null?void 0:B.firstChild)===J&&(($=(_=J.closest(au))==null?void 0:_.querySelector(fD))==null||$.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function fe(){var B;return(B=D.current)==null?void 0:B.querySelector(`${Dj}[aria-selected="true"]`)}function ie(){var B;return Array.from(((B=D.current)==null?void 0:B.querySelectorAll(q1))||[])}function Z(B){let _=ie()[B];_&&I.setState("value",_.getAttribute(bs))}function ae(B){var _;let $=fe(),J=ie(),ue=J.findIndex(Le=>Le===$),xe=J[ue+B];(_=f.current)!=null&&_.loop&&(xe=ue+B<0?J[J.length-1]:ue+B===J.length?J[0]:J[ue+B]),xe&&I.setState("value",xe.getAttribute(bs))}function K(B){let _=fe(),$=_==null?void 0:_.closest(au),J;for(;$&&!J;)$=B>0?wD($,au):kD($,au),J=$==null?void 0:$.querySelector(q1);J?I.setState("value",J.getAttribute(bs)):ae(B)}let he=()=>Z(ie().length-1),T=B=>{B.preventDefault(),B.metaKey?he():B.altKey?K(1):ae(1)},P=B=>{B.preventDefault(),B.metaKey?Z(0):B.altKey?K(-1):ae(-1)};return x.createElement(Ta.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:B=>{var _;(_=C.onKeyDown)==null||_.call(C,B);let $=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||$))switch(B.key){case"n":case"j":{E&&B.ctrlKey&&T(B);break}case"ArrowDown":{T(B);break}case"p":case"k":{E&&B.ctrlKey&&P(B);break}case"ArrowUp":{P(B);break}case"Home":{B.preventDefault(),Z(0);break}case"End":{B.preventDefault(),he();break}case"Enter":{B.preventDefault();let J=fe();if(J){let ue=new Event(Sg);J.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:F.inputId,id:F.labelId,style:ED},m),gf(e,B=>x.createElement(Lj.Provider,{value:I},x.createElement(Mj.Provider,{value:F},B))))}),mD=x.forwardRef((e,t)=>{var n,a;let l=ja(),o=x.useRef(null),c=x.useContext(Ij),f=Zu(),m=Pj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;gl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let g=Bj(l,o,[e.value,e.children,o],e.keywords),y=gy(),b=Ni(z=>z.value&&z.value===g.current),S=Ni(z=>h||f.filter()===!1?!0:z.search?z.filtered.items.get(l)>0:!0);x.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Sg,k),()=>z.removeEventListener(Sg,k)},[S,e.onSelect,e.disabled]);function k(){var z,I;j(),(I=(z=m.current).onSelect)==null||I.call(z,g.current)}function j(){y.setState("value",g.current,!0)}if(!S)return null;let{disabled:E,value:C,onSelect:A,forceMount:O,keywords:L,...D}=e;return x.createElement(Ta.div,{ref:Ei(o,t),...D,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),pD=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=ja(),f=x.useRef(null),m=x.useRef(null),h=ja(),g=Zu(),y=Ni(S=>l||g.filter()===!1?!0:S.search?S.filtered.groups.has(c):!0);gl(()=>g.group(c),[]),Bj(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Ta.div,{ref:Ei(f,t),...o,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),gf(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Ij.Provider,{value:b},S))))}),gD=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ni(c=>!c.search);return!n&&!o?null:x.createElement(Ta.div,{ref:Ei(l,t),...a,"cmdk-separator":"",role:"separator"})}),yD=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=gy(),c=Ni(h=>h.search),f=Ni(h=>h.selectedItemId),m=Zu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Ta.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:c,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),vD=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ni(h=>h.selectedItemId),m=Zu();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,g=o.current,y,b=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let S=h.offsetHeight;g.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(y),b.unobserve(h)}}},[]),x.createElement(Ta.div,{ref:Ei(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},gf(e,h=>x.createElement("div",{ref:Ei(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),bD=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(_j,{open:n,onOpenChange:a},x.createElement(Aj,{container:c},x.createElement(Tj,{"cmdk-overlay":"",className:l}),x.createElement(Rj,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(Uj,{ref:t,...f}))))}),xD=x.forwardRef((e,t)=>Ni(n=>n.filtered.count===0)?x.createElement(Ta.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),SD=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Ta.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},gf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Qn=Object.assign(Uj,{List:vD,Item:mD,Input:yD,Group:pD,Separator:gD,Dialog:bD,Empty:xD,Loading:SD});function wD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function kD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pj(e){let t=x.useRef(e);return gl(()=>{t.current=e}),t}var gl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function xs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ni(e){let t=gy(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Bj(e,t,n,a=[]){let l=x.useRef(),o=Zu();return gl(()=>{var c;let f=(()=>{var h;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(h=g.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(c=t.current)==null||c.setAttribute(bs,f),l.current=f}),l}var jD=()=>{let[e,t]=x.useState(),n=xs(()=>new Map);return gl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function CD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function gf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(CD(t),{ref:t.ref},n(t.props.children)):n(t)}var ED={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Pt=_j,ND=W3,_D=Aj,$j=x.forwardRef(({className:e,...t},n)=>u.jsx(Tj,{ref:n,className:_e("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));$j.displayName="DialogOverlay";const Rt=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(_D,{children:[u.jsx($j,{}),u.jsxs(Rj,{ref:a,className:_e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,u.jsxs(nD,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(ku,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Rt.displayName="DialogContent";function Vt({className:e,...t}){return u.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Wt({className:e,...t}){return u.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Bt=x.forwardRef(({className:e,...t},n)=>u.jsx(eD,{ref:n,className:_e("text-subtitle leading-none tracking-tight",e),...t}));Bt.displayName="DialogTitle";const yf=x.forwardRef(({className:e,...t},n)=>u.jsx(tD,{ref:n,className:_e("text-body text-muted-foreground",e),...t}));yf.displayName="DialogDescription";const Fj=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Fj.displayName=Qn.displayName;function AD({open:e,onOpenChange:t,children:n}){return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsx(Rt,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(Fj,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})})}const qj=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(ff,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Qn.Input,{ref:n,className:_e("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));qj.displayName=Qn.Input.displayName;const Hj=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.List,{ref:n,className:_e("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Hj.displayName=Qn.List.displayName;const Zj=x.forwardRef((e,t)=>u.jsx(Qn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Zj.displayName=Qn.Empty.displayName;const Ud=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Group,{ref:n,className:_e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ud.displayName=Qn.Group.displayName;const wg=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));wg.displayName=Qn.Separator.displayName;const Pd=x.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Item,{ref:n,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Pd.displayName=Qn.Item.displayName;function Vu(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return je.get(`/admin/agents${n?`?${n}`:""}`)}function TD(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return je.get(`/admin/agents/all${n?`?${n}`:""}`)}function Vj(e){return je.get(`/admin/agents/${encodeURIComponent(e)}`)}function RD(e){return je.post("/admin/agents",e)}function zD(e){return je.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function H1(e,t){return je.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function OD(e,t){return je.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function DD(e){return je.delete(`/admin/agents/${encodeURIComponent(e)}`)}function MD(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function LD(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function ID(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Cl(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Vu({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName);return n=>n?t.get(n)??n:"—"},[e])}function yy(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Vu({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,{name:n.name,displayName:n.displayName});return n=>n?t.get(n)??null:null},[e])}const UD=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function PD({open:e,onOpenChange:t}){const n=_n(),a=Cl(),{data:l}=qe({queryKey:["activity"],queryFn:Hu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=qe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const g of o)try{const y=await to(g.agentId);for(const b of y)h.push({agentId:g.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return u.jsxs(AD,{open:e,onOpenChange:t,children:[u.jsx(qj,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(Hj,{children:[u.jsx(Zj,{children:"No results"}),o.length>0&&u.jsx(Ud,{heading:"Agents",children:o.map(h=>{const g=a(h.agentId);return u.jsxs(Pd,{value:`agent ${g} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(yR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:g}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(wg,{}),u.jsx(Ud,{heading:"Chats",children:f.map(({agentId:h,session:g})=>{const y=a(h);return u.jsxs(Pd,{value:`chat ${y} ${g.chatId}`,onSelect:()=>m(`/?a=${h}&c=${g.chatId}`),children:[u.jsx(uy,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:y}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:g.chatId.slice(0,8)})]},`${h}-${g.chatId}`)})})]}),u.jsx(wg,{}),u.jsx(Ud,{heading:"Pages",children:UD.map(h=>u.jsxs(Pd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(AR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function yl(e){return u.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),u.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),u.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),u.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),u.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function kg(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return je.get(`/admin/notifications${n?`?${n}`:""}`)}function Qj(e){return je.post(`/admin/notifications/${e}/read`)}function BD(){return je.post("/admin/notifications/read-all")}const $D={agent_error:"Error",session_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale",agent_disconnected:"Disconnected",agent_connected:"Connected",agent_needs_decision:"Decision",session_completed:"Completed"};function FD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Gj({notification:e,onClick:t,clickable:n}){const a=($D[e.type]??e.type).toString(),l=FD(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:_e("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:c=>{o&&(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{c.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[u.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[u.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Ci(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function qD(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=_n(),c=Nn(),{data:f}=qe({queryKey:["notifications","bell"],queryFn:()=>kg({limit:8}),refetchInterval:1e4}),{data:m}=qe({queryKey:["notifications","unread-count"],queryFn:()=>kg({read:!1,limit:100}),refetchInterval:1e4}),h=((S=m==null?void 0:m.items)==null?void 0:S.length)??0,g=h>0,y=x.useCallback(async k=>{k.read||(Qj(k.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,c]),b=x.useCallback(async()=>{a(null);try{await BD(),await c.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[c]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[u.jsx(pR,{className:"h-4 w-4"}),g&&u.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),u.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),g&&u.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),u.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?u.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>u.jsx(Gj,{notification:k,clickable:!!k.agentId,onClick:()=>y(k)},k.id))})]})]})]})}const Kj="onboarding:autoOpen",Yj="onboarding:joinPath";function Xj(e){typeof window>"u"||(window.sessionStorage.setItem(Kj,"1"),window.sessionStorage.setItem(Yj,e))}const HD=Kj,ZD=Yj,gp=HD,Z1=ZD,Jj=x.createContext(null);function VD({children:e}){const{wizardStep:t,isAuthenticated:n}=an(),[a,l]=x.useState(!1),[o,c]=x.useState(()=>{const g=typeof window<"u"?window.sessionStorage.getItem(Z1):null;return g==="solo"||g==="invite"?g:null});x.useEffect(()=>{if(!n||t===null||t==="completed")return;window.sessionStorage.getItem(gp)==="1"&&(l(!0),window.sessionStorage.removeItem(gp))},[n,t]),x.useEffect(()=>{t==="completed"&&(l(!1),window.sessionStorage.removeItem(gp),window.sessionStorage.removeItem(Z1),c(null))},[t]);const f=x.useCallback(()=>l(!0),[]),m=x.useCallback(()=>l(!1),[]),h=x.useMemo(()=>({isOpen:a,open:f,close:m,joinPath:o,step:t,shouldShowResumeCTA:n&&t!==null&&t!=="completed"&&!a}),[a,f,m,o,t,n]);return u.jsx(Jj.Provider,{value:h,children:e})}function Wj(){const e=x.useContext(Jj);return e||{isOpen:!1,open:()=>{},close:()=>{},joinPath:null,step:null,shouldShowResumeCTA:!1}}const V1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Q1=Rk,QD=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return Q1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(h=>{const g=n==null?void 0:n[h],y=o==null?void 0:o[h];if(g===null)return null;const b=V1(g)||V1(y);return l[h][b]}),f=n&&Object.entries(n).reduce((h,g)=>{let[y,b]=g;return b===void 0||(h[y]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,g)=>{let{class:y,className:b,...S}=g;return Object.entries(S).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,y,b]:h},[]);return Q1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},GD=QD("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?iD:"button";return u.jsx(c,{className:_e(GD({variant:t,size:n,className:e})),ref:o,...l})});me.displayName="Button";const xt=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:_e("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));xt.displayName="Input";function KD(){const{isOpen:e,close:t,joinPath:n,step:a}=Wj(),{refreshMe:l,organizationId:o}=an(),[c,f]=x.useState([]);x.useEffect(()=>{e&&(async()=>{try{const b=await je.get("/me/organizations");f(b)}catch{}})()},[e]);const m=c.find(b=>b.id===o),h=((m==null?void 0:m.displayName)??"").replace(/'s Personal Team$/,"'s team"),g=n==="invite"&&h?`You've joined ${h}.`:"Welcome — let's get you set up.",y=a==="connect"&&n!=="invite";return u.jsx(Pt,{open:e,onOpenChange:b=>!b&&t(),children:u.jsxs(Rt,{children:[u.jsxs(Vt,{children:[u.jsx(Bt,{children:g}),u.jsx(yf,{children:a==="connect"?"Connect a computer, then create your first agent.":a==="create_agent"?"One more step: create your first agent.":"All set!"})]}),y&&u.jsx("p",{className:"text-label text-muted-foreground",style:{margin:0},children:"We've created your personal team. You can rename it, invite teammates, or join an existing team later."}),a==="connect"&&u.jsx(YD,{onAdvance:l}),a==="create_agent"&&u.jsx(XD,{onAdvance:l})]})})}function YD({onAdvance:e}){const[t,n]=x.useState(null),[a,l]=x.useState(!1);x.useEffect(()=>{let c=!1;return(async()=>{try{const f=await je.post("/connect-tokens",{});c||n(f.token)}catch{}})(),()=>{c=!0}},[]),x.useEffect(()=>{let c=!1;const m=setInterval(async()=>{c||await e()},3e3);return()=>{c=!0,clearInterval(m)}},[e]);const o=t?`npm install -g @agent-team-foundation/first-tree-hub
|
|
320
|
-
first-tree-hub connect ${t}`:"";return u.jsxs("div",{className:"space-y-3",style:{minWidth:0,maxWidth:"100%"},children:[u.jsx("div",{style:{width:"100%",overflow:"hidden",minWidth:0},children:u.jsx("pre",{className:"rounded-md bg-muted p-3 text-label font-mono",style:{whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",width:"100%",minWidth:0,boxSizing:"border-box",margin:0},children:o||"Generating token…"})}),u.jsx(me,{variant:"outline",size:"sm",disabled:!o,onClick:()=>{navigator.clipboard.writeText(o),l(!0),setTimeout(()=>l(!1),1500)},children:a?"Copied!":"Copy commands"}),u.jsx("p",{className:"text-label text-muted-foreground",children:"Waiting for your computer to check in…"})]})}function XD({onAdvance:e}){const[t,n]=x.useState(""),[a,l]=x.useState(!1),[o,c]=x.useState(null),f=async m=>{if(m.preventDefault(),!!t.trim()){l(!0),c(null);try{await je.post("/admin/agents",{name:t.trim(),type:"autonomous_agent",displayName:t.trim()}),await e()}catch(h){c(h instanceof Error?h.message:"Failed to create agent")}finally{l(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:f,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(xt,{id:"onboarding-agent-name","aria-label":"Agent name",value:t,onChange:m=>n(m.target.value),placeholder:"my-first-agent",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:a||!t.trim(),children:a?"Creating…":"Create agent"})]})}function JD(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function WD(){const[e,t]=x.useState(JD);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?u.jsx(ez,{className:"h-4 w-4"}):u.jsx(UR,{className:"h-4 w-4"})})}function eM(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function G1({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?u.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):u.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:u.jsx("span",{className:"text-subtitle font-semibold",children:eM(t)})})}function tM({action:e,onClose:t}){const n=e!==null;return u.jsx(Pt,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(Rt,{children:[u.jsxs(Vt,{children:[u.jsx(Bt,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(yf,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&u.jsx(rM,{onDone:t}),e==="join"&&u.jsx(aM,{onDone:t})]})})}function nM(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function rM({onDone:e}){const{adoptTokens:t}=an(),n=_n(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async g=>{g.preventDefault();const y=a.trim();if(y){m(!0),c(null);try{const b=await je.post("/me/organizations",{name:nM(y),displayName:y});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){c(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(xt,{id:"team-display-name","aria-label":"Team name",value:a,onChange:g=>l(g.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function aM({onDone:e}){const{adoptTokens:t}=an(),n=_n(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async g=>{if(g.preventDefault(),!!a.trim()){m(!0),c(null);try{const y=a.trim(),b=/\/invite\/([^/?#]+)/.exec(y),S=(b==null?void 0:b[1])??y,k=await je.post("/me/organizations/join",{token:S});await t(k.tokens),e(),n("/",{replace:!0})}catch(y){c(y instanceof Error?y.message:"Failed to join team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(xt,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:g=>l(g.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function iM(){var A;const{organizationId:e,user:t,adoptTokens:n,logout:a}=an(),l=_n(),[o,c]=x.useState([]),[f,m]=x.useState(!1),[h,g]=x.useState(null),y=x.useRef(null);x.useEffect(()=>{(async()=>{try{const O=await je.get("/me/organizations");c(O)}catch{}})()},[]),x.useEffect(()=>{const O=D=>{f&&y.current&&!y.current.contains(D.target)&&m(!1)},L=D=>{f&&D.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",O),window.addEventListener("keydown",L),()=>{window.removeEventListener("mousedown",O),window.removeEventListener("keydown",L)}},[f]);const b=(t==null?void 0:t.displayName)??"User",S=(t==null?void 0:t.username)??"",k=(t==null?void 0:t.avatarUrl)??null,j=async O=>{if(O===e){m(!1);return}try{const L=await je.post("/auth/switch-org",{organizationId:O});await n(L),m(!1),l("/",{replace:!0})}catch{}},E=()=>{m(!1),g("create")},C=()=>{m(!1),g("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:y,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${b}`,"aria-haspopup":"menu","aria-expanded":f,onClick:()=>m(O=>!O),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:f?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(G1,{src:k,name:b,size:28})}),f&&u.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[u.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx(G1,{src:k,name:b,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:b}),S&&S!==b&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",S]})]})]}),o.length>0&&u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Team"}),o.length===1?u.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:u.jsx(Na,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"truncate",children:(A=o[0])==null?void 0:A.displayName})]}):u.jsx("div",{children:o.map(O=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void j(O.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:O.id===e?u.jsx(Na,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"truncate",children:O.displayName})]},O.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:E,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(_a,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:C,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(dz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsxs("div",{className:"py-1",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),l("/settings")},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(YR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Settings"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),a()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(MR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})]})]})]}),u.jsx(tM,{action:h,onClose:()=>g(null)})]})}const K1=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],lM={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function sM(){const{role:e}=an(),t=e==="admin",[n,a]=x.useState(!1),l=t?[...K1,lM]:K1,o=Dn(),c=o.pathname==="/"||o.search.includes("a=");return x.useEffect(()=>{const f=m=>{(m.metaKey||m.ctrlKey)&&m.key.toLowerCase()==="k"&&(m.preventDefault(),a(h=>!h))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx(yl,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",u.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),u.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:l.map(f=>u.jsx(xk,{to:f.to,end:f.end,style:{pointerEvents:"auto"},className:({isActive:m})=>_e("inline-flex items-center transition-colors",m?"":"hover:text-[var(--fg)]"),children:({isActive:m})=>u.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:m?"var(--fg)":"var(--fg-3)",background:m?"var(--bg-hover)":"transparent"},children:[f.label,m&&u.jsx("span",{className:"kbd",children:f.kbd})]})},f.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6},children:[u.jsxs("button",{type:"button",onClick:()=>a(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:f=>{f.currentTarget.style.color="var(--fg)"},onMouseLeave:f=>{f.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(ff,{className:"h-4 w-4"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(qD,{}),u.jsx(WD,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(iM,{})]})]}),u.jsx(PD,{open:n,onOpenChange:a}),u.jsx(KD,{}),c?u.jsx(fg,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(fg,{})})})]})}function se(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.prototype,g=Object.keys(h);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Ns extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const tC={};function _i(e){return tC}function nC(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,l])=>t.indexOf(+a)===-1).map(([a,l])=>l)}function jg(e,t){return typeof t=="bigint"?t.toString():t}function vf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vy(e){return e==null}function by(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function oM(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,c=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const Y1=Symbol("evaluating");function ft(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Y1)return a===void 0&&(a=Y1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function El(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function X1(e){return JSON.stringify(e)}function uM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Eu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const cM=vf(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Vs(e){if(Eu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Eu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function aC(e){return Vs(e)?{...e}:Array.isArray(e)?[...e]:e}const dM=new Set(["string","number","symbol"]);function Qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Ae(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0: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 fM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const hM={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 mM(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 o=zi(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return El(this,"shape",c),c},checks:[]});return Oi(e,o)}function pM(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 o=zi(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return El(this,"shape",c),c},checks:[]});return Oi(e,o)}function gM(e,t){if(!Vs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=zi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return El(this,"shape",o),o}});return Oi(e,l)}function yM(e,t){if(!Vs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return El(this,"shape",a),a}});return Oi(e,n)}function vM(e,t){const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return El(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Oi(e,n)}function bM(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=zi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return El(this,"shape",m),m},checks:[]});return Oi(t,c)}function xM(e,t,n){const a=zi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const c in n){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(o[c]=new e({type:"nonoptional",innerType:l[c]}))}else for(const c in l)o[c]=new e({type:"nonoptional",innerType:l[c]});return El(this,"shape",o),o}});return Oi(t,a)}function ws(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function ks(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function kd(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ai(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const g=kd((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??kd((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??kd((m=n.customError)==null?void 0:m.call(n,e))??kd((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=g}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function xy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const iC=(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,jg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lC=se("$ZodError",iC),sC=se("$ZodError",iC,{Parent:Error});function SM(e,t=n=>n.message){const n={},a=[];for(const l of e.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):a.push(t(l));return{formErrors:a,fieldErrors:n}}function wM(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>a({issues:c}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let c=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const Sy=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new Ns;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ai(m,o,_i())));throw rC(f,l==null?void 0:l.callee),f}return c.value},wy=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ai(m,o,_i())));throw rC(f,l==null?void 0:l.callee),f}return c.value},bf=e=>(t,n,a)=>{const l=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new Ns;return o.issues.length?{success:!1,error:new(e??lC)(o.issues.map(c=>Ai(c,l,_i())))}:{success:!0,data:o.value}},kM=bf(sC),xf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(c=>Ai(c,l,_i())))}:{success:!0,data:o.value}},jM=xf(sC),CM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sy(e)(t,n,l)},EM=e=>(t,n,a)=>Sy(e)(t,n,a),NM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wy(e)(t,n,l)},_M=e=>async(t,n,a)=>wy(e)(t,n,a),AM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return bf(e)(t,n,l)},TM=e=>(t,n,a)=>bf(e)(t,n,a),RM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return xf(e)(t,n,l)},zM=e=>async(t,n,a)=>xf(e)(t,n,a),OM=/^[cC][^\s-]{8,}$/,DM=/^[0-9a-z]+$/,MM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,LM=/^[0-9a-vA-V]{20}$/,IM=/^[A-Za-z0-9]{27}$/,UM=/^[a-zA-Z0-9_-]{21}$/,PM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BM=/^([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})$/,J1=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)$/,$M=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,FM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qM(){return new RegExp(FM,"u")}const HM=/^(?:(?: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])$/,ZM=/^(([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}|:))$/,VM=/^((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])$/,QM=/^(([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])$/,GM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,oC=/^[A-Za-z0-9_-]*$/,KM=/^\+[1-9]\d{6,14}$/,uC="(?:(?:\\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])))",YM=new RegExp(`^${uC}$`);function cC(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 XM(e){return new RegExp(`^${cC(e)}$`)}function JM(e){const t=cC({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(`^${uC}T(?:${a})$`)}const WM=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},e4=/^-?\d+$/,dC=/^-?\d+(?:\.\d+)?$/,t4=/^(?:true|false)$/i,n4=/^[^A-Z]*$/,r4=/^[^a-z]*$/,Gn=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fC={number:"number",bigint:"bigint",object:"date"},hC=se("$ZodCheckLessThan",(e,t)=>{Gn.init(e,t);const n=fC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?l.maximum=t.value:l.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})}}),mC=se("$ZodCheckGreaterThan",(e,t)=>{Gn.init(e,t);const n=fC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.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})}}),a4=se("$ZodCheckMultipleOf",(e,t)=>{Gn.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):oM(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})}}),i4=se("$ZodCheckNumberFormat",(e,t)=>{var c;Gn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[l,o]=hM[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,n&&(m.pattern=e4)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,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}):f.issues.push({input:m,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}}m<l&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),l4=se("$ZodCheckMaxLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!vy(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const c=xy(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),s4=se("$ZodCheckMinLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!vy(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const c=xy(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),o4=se("$ZodCheckLengthEquals",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!vy(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const c=xy(l),f=o>t.length;a.issues.push({origin:c,...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})}}),Sf=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Gn.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),u4=se("$ZodCheckRegex",(e,t)=>{Sf.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})}}),c4=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=n4),Sf.init(e,t)}),d4=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=r4),Sf.init(e,t)}),f4=se("$ZodCheckIncludes",(e,t)=>{Gn.init(e,t);const n=Qs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),h4=se("$ZodCheckStartsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`^${Qs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.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})}}),m4=se("$ZodCheckEndsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`.*${Qs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.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})}}),p4=se("$ZodCheckOverwrite",(e,t)=>{Gn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class g4{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(`
|
|
321
|
-
`).filter(c=>c),l=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(l)).map(c=>" ".repeat(this.indent*2)+c);for(const c of o)this.content.push(c)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
|
|
322
|
-
`))}}const y4={major:4,minor:3,patch:6},zt=se("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=y4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let g=ws(f),y;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(g)continue;const S=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Ns;if(y||k instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(g||(g=ws(f,S)))});else{if(f.issues.length===S)continue;g||(g=ws(f,S))}}return y?y.then(()=>f):f},c=(f,m,h)=>{if(ws(f))return f.aborted=!0,f;const g=o(m,a,h);if(g instanceof Promise){if(h.async===!1)throw new Ns;return g.then(y=>e._zod.parse(y,h))}return e._zod.parse(g,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const g=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return g instanceof Promise?g.then(y=>c(y,f,m)):c(g,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Ns;return h.then(g=>o(g,a,m))}return o(h,a,m)}}ft(e,"~standard",()=>({validate:o=>{var c;try{const f=kM(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return jM(e,o).then(m=>{var h;return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),ky=se("$ZodString",(e,t)=>{var n;zt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??WM(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Tt=se("$ZodStringFormat",(e,t)=>{Sf.init(e,t),ky.init(e,t)}),v4=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=BM),Tt.init(e,t)}),b4=se("$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=J1(a))}else t.pattern??(t.pattern=J1());Tt.init(e,t)}),x4=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$M),Tt.init(e,t)}),S4=se("$ZodURL",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.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(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.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=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),w4=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qM()),Tt.init(e,t)}),k4=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=UM),Tt.init(e,t)}),j4=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=OM),Tt.init(e,t)}),C4=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=DM),Tt.init(e,t)}),E4=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=MM),Tt.init(e,t)}),N4=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=LM),Tt.init(e,t)}),_4=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=IM),Tt.init(e,t)}),A4=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=JM(t)),Tt.init(e,t)}),T4=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=YM),Tt.init(e,t)}),R4=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=XM(t)),Tt.init(e,t)}),z4=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=PM),Tt.init(e,t)}),O4=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=HM),Tt.init(e,t),e._zod.bag.format="ipv4"}),D4=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ZM),Tt.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})}}}),M4=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=VM),Tt.init(e,t)}),L4=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=QM),Tt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const c=Number(o);if(`${c}`!==o)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function pC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const I4=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=GM),Tt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{pC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function U4(e){if(!oC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return pC(n)}const P4=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=oC),Tt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{U4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),B4=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=KM),Tt.init(e,t)});function $4(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const F4=se("$ZodJWT",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{$4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),gC=se("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??dC,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),q4=se("$ZodNumberFormat",(e,t)=>{i4.init(e,t),gC.init(e,t)}),H4=se("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=t4,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),Z4=se("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),V4=se("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function W1(e,t,n){e.issues.length&&t.issues.push(...ks(n,e.issues)),t.value[n]=e.value}const Q4=se("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let c=0;c<l.length;c++){const f=l[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>W1(h,n,c))):W1(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function Gd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...ks(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function yC(e){var a,l,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=fM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function vC(e,t,n,a,l,o){const c=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,g=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(h==="never"){c.push(y);continue}const b=m.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(S=>Gd(S,n,y,t,g))):Gd(b,n,y,t,g)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const G4=se("$ZodObject",(e,t)=>{zt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=vf(()=>yC(t));ft(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const g=f[h]._zod;if(g.values){m[h]??(m[h]=new Set);for(const y of g.values)m[h].add(y)}}return m});const l=Eu,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const g=[],y=c.shape;for(const b of c.keys){const S=y[b],k=S._zod.optout==="optional",j=S._zod.run({value:h[b],issues:[]},m);j instanceof Promise?g.push(j.then(E=>Gd(E,f,b,h,k))):Gd(j,f,b,h,k)}return o?vC(g,h,f,m,a.value,e):g.length?Promise.all(g).then(()=>f):f}}),K4=se("$ZodObjectJIT",(e,t)=>{G4.init(e,t);const n=e._zod.parse,a=vf(()=>yC(t)),l=b=>{var O;const S=new g4(["shape","payload","ctx"]),k=a.value,j=L=>{const D=X1(L);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};S.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const L of k.keys)E[L]=`key_${C++}`;S.write("const newResult = {};");for(const L of k.keys){const D=E[L],z=X1(L),I=b[L],F=((O=I==null?void 0:I._zod)==null?void 0:O.optout)==="optional";S.write(`const ${D} = ${j(L)};`),F?S.write(`
|
|
323
|
-
if (${D}.issues.length) {
|
|
324
|
-
if (${z} in input) {
|
|
325
|
-
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
326
|
-
...iss,
|
|
327
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
328
|
-
})));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
if (${D}.value === undefined) {
|
|
333
|
-
if (${z} in input) {
|
|
334
|
-
newResult[${z}] = undefined;
|
|
335
|
-
}
|
|
336
|
-
} else {
|
|
337
|
-
newResult[${z}] = ${D}.value;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
`):S.write(`
|
|
341
|
-
if (${D}.issues.length) {
|
|
342
|
-
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
343
|
-
...iss,
|
|
344
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
345
|
-
})));
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
if (${D}.value === undefined) {
|
|
349
|
-
if (${z} in input) {
|
|
350
|
-
newResult[${z}] = undefined;
|
|
351
|
-
}
|
|
352
|
-
} else {
|
|
353
|
-
newResult[${z}] = ${D}.value;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
`)}S.write("payload.value = newResult;"),S.write("return payload;");const A=S.compile();return(L,D)=>A(b,L,D)};let o;const c=Eu,f=!tC.jitless,h=f&&cM.value,g=t.catchall;let y;e._zod.parse=(b,S)=>{y??(y=a.value);const k=b.value;return c(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),g?vC([],k,b,S,y,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function eS(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ws(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(c=>Ai(c,a,_i())))}),t)}const bC=se("$ZodUnion",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ft(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ft(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ft(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>by(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let c=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>eS(m,l,e,o)):eS(f,l,e,o)}}),Y4=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,bC.init(e,t);const n=e._zod.parse;ft(e._zod,"propValues",()=>{const l={};for(const o of t.options){const c=o._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(c)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=vf(()=>{var c;const l=t.options,o=new Map;for(const f of l){const m=(c=f._zod.propValues)==null?void 0:c[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const c=l.value;if(!Eu(c))return l.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),l;const f=a.value.get(c==null?void 0:c[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),l)}}),X4=se("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),c=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>tS(n,m,h)):tS(n,o,c)}});function Cg(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(Vs(e)&&Vs(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const c=Cg(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};l[o]=c.data}return{valid:!0,data:l}}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 l=e[a],o=t[a],c=Cg(l,o);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function tS(e,t,n){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ws(e))return e;const c=Cg(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const J4=se("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Vs(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const g=t.valueType._zod.run({value:l[h],issues:[]},a);g instanceof Promise?o.push(g.then(y=>{y.issues.length&&n.issues.push(...ks(h,y.issues)),n.value[h]=y.value})):(g.issues.length&&n.issues.push(...ks(h,g.issues)),n.value[h]=g.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&dC.test(f)&&m.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&&(m=y)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>Ai(y,a,_i())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:l[f],issues:[]},a);g instanceof Promise?o.push(g.then(y=>{y.issues.length&&n.issues.push(...ks(f,y.issues)),n.value[m.value]=y.value})):(g.issues.length&&n.issues.push(...ks(f,g.issues)),n.value[m.value]=g.value)}}return o.length?Promise.all(o).then(()=>n):n}}),W4=se("$ZodEnum",(e,t)=>{zt.init(e,t);const n=nC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>dM.has(typeof l)).map(l=>typeof l=="string"?Qs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return a.has(c)||l.issues.push({code:"invalid_value",values:n,input:c,inst:e}),l}}),e5=se("$ZodLiteral",(e,t)=>{if(zt.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"?Qs(a):a?Qs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),t5=se("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new eC(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(c=>(n.value=c,n));if(l instanceof Promise)throw new Ns;return n.value=l,n}});function nS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const xC=se("$ZodOptional",(e,t)=>{zt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${by(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>nS(o,n.value)):nS(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),n5=se("$ZodExactOptional",(e,t)=>{xC.init(e,t),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),r5=se("$ZodNullable",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${by(n.source)}|null)$`):void 0}),ft(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)}),a5=se("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ft(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 l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>rS(o,t)):rS(l,t)}});function rS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const i5=se("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ft(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))}),l5=se("$ZodNonOptional",(e,t)=>{zt.init(e,t),ft(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 l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>aS(o,e)):aS(l,e)}});function aS(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 s5=se("$ZodCatch",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>Ai(c,a,_i()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ai(o,a,_i()))},input:n.value}),n.issues=[]),n)}}),o5=se("$ZodPipe",(e,t)=>{zt.init(e,t),ft(e._zod,"values",()=>t.in._zod.values),ft(e._zod,"optin",()=>t.in._zod.optin),ft(e._zod,"optout",()=>t.out._zod.optout),ft(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(c=>jd(c,t.in,a)):jd(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>jd(o,t.out,a)):jd(l,t.out,a)}});function jd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const u5=se("$ZodReadonly",(e,t)=>{zt.init(e,t),ft(e._zod,"propValues",()=>t.innerType._zod.propValues),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ft(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(iS):iS(l)}});function iS(e){return e.value=Object.freeze(e.value),e}const c5=se("$ZodCustom",(e,t)=>{Gn.init(e,t),zt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>lS(o,n,a,e));lS(l,n,a,e)}});function lS(e,t,n,a){if(!e){const l={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(Nu(l))}}var sS;class d5{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 l={...a,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function f5(){return new d5}(sS=globalThis).__zod_globalRegistry??(sS.__zod_globalRegistry=f5());const du=globalThis.__zod_globalRegistry;function h5(e,t){return new e({type:"string",...Ae(t)})}function m5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(t)})}function oS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(t)})}function p5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(t)})}function g5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(t)})}function y5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(t)})}function v5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(t)})}function b5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(t)})}function x5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(t)})}function S5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(t)})}function w5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(t)})}function k5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(t)})}function j5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(t)})}function C5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(t)})}function E5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(t)})}function N5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(t)})}function _5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(t)})}function A5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(t)})}function T5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(t)})}function R5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(t)})}function z5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(t)})}function O5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(t)})}function D5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(t)})}function M5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(t)})}function L5(e,t){return new e({type:"string",format:"date",check:"string_format",...Ae(t)})}function I5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(t)})}function U5(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ae(t)})}function P5(e,t){return new e({type:"number",checks:[],...Ae(t)})}function B5(e,t){return new e({type:"number",coerce:!0,checks:[],...Ae(t)})}function $5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(t)})}function F5(e,t){return new e({type:"boolean",...Ae(t)})}function q5(e){return new e({type:"unknown"})}function H5(e,t){return new e({type:"never",...Ae(t)})}function uS(e,t){return new hC({check:"less_than",...Ae(t),value:e,inclusive:!1})}function yp(e,t){return new hC({check:"less_than",...Ae(t),value:e,inclusive:!0})}function cS(e,t){return new mC({check:"greater_than",...Ae(t),value:e,inclusive:!1})}function vp(e,t){return new mC({check:"greater_than",...Ae(t),value:e,inclusive:!0})}function dS(e,t){return new a4({check:"multiple_of",...Ae(t),value:e})}function SC(e,t){return new l4({check:"max_length",...Ae(t),maximum:e})}function Kd(e,t){return new s4({check:"min_length",...Ae(t),minimum:e})}function wC(e,t){return new o4({check:"length_equals",...Ae(t),length:e})}function Z5(e,t){return new u4({check:"string_format",format:"regex",...Ae(t),pattern:e})}function V5(e){return new c4({check:"string_format",format:"lowercase",...Ae(e)})}function Q5(e){return new d4({check:"string_format",format:"uppercase",...Ae(e)})}function G5(e,t){return new f4({check:"string_format",format:"includes",...Ae(t),includes:e})}function K5(e,t){return new h4({check:"string_format",format:"starts_with",...Ae(t),prefix:e})}function Y5(e,t){return new m4({check:"string_format",format:"ends_with",...Ae(t),suffix:e})}function no(e){return new p4({check:"overwrite",tx:e})}function X5(e){return no(t=>t.normalize(e))}function J5(){return no(e=>e.trim())}function W5(){return no(e=>e.toLowerCase())}function eL(){return no(e=>e.toUpperCase())}function tL(){return no(e=>uM(e))}function nL(e,t,n){return new e({type:"array",element:t,...Ae(n)})}function rL(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ae(n)})}function aL(e){const t=iL(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Nu(a,n.value,t._zod.def));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(Nu(l))}},e(n.value,n)));return t}function iL(e,t){const n=new Gn({check:"custom",...Ae(t)});return n._zod.check=e,n}function kC(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??du,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Jt(e,t,n={path:[],schemaPath:[]}){var g,y;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=(y=(g=e._zod).toJSONSchema)==null?void 0:y.call(g);if(f)c.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,b);else{const k=c.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const S=e._zod.parent;S&&(c.ref||(c.ref=S),Jt(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&Rn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function jC(e,t){var c,f,m,h;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 g of e.seen.entries()){const y=(c=e.metadataRegistry.get(g[0]))==null?void 0:c.id;if(y){const b=a.get(y);if(b&&b!==g[0])throw new Error(`Duplicate schema id "${y}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(y,g[0])}}const l=g=>{var j;const y=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(g[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const A=g[1].defId??g[1].schema.id??`schema${e.counter++}`;return g[1].defId=A,{defId:A,ref:`${C("__shared")}#/${y}/${A}`}}if(g[1]===n)return{ref:"#"};const S=`#/${y}/`,k=g[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:S+k}},o=g=>{if(g[1].schema.$ref)return;const y=g[1],{ref:b,defId:S}=l(g);y.def={...y.schema},S&&(y.defId=S);const k=y.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const g of e.seen.entries()){const y=g[1];if(y.cycle)throw new Error(`Cycle detected: #/${(f=y.cycle)==null?void 0:f.join("/")}/<root>
|
|
357
|
-
|
|
358
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const g of e.seen.entries()){const y=g[1];if(t===g[0]){o(g);continue}if(e.external){const S=(m=e.external.registry.get(g[0]))==null?void 0:m.id;if(t!==g[0]&&S){o(g);continue}}if((h=e.metadataRegistry.get(g[0]))==null?void 0:h.id){o(g);continue}if(y.cycle){o(g);continue}if(y.count>1&&e.reused==="ref"){o(g);continue}}}function CC(e,t){var c,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const g=e.seen.get(h);if(g.ref===null)return;const y=g.def??g.schema,b={...y},S=g.ref;if(g.ref=null,S){a(S);const j=e.seen.get(S),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(y.allOf=y.allOf??[],y.allOf.push(E)):Object.assign(y,E),Object.assign(y,b),h._zod.parent===S)for(const A in y)A==="$ref"||A==="allOf"||A in b||delete y[A];if(E.$ref&&j.def)for(const A in y)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(y[A])===JSON.stringify(j.def[A])&&delete y[A]}const k=h._zod.parent;if(k&&k!==S){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(y.$ref=j.schema.$ref,j.def))for(const E in y)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(y[E])===JSON.stringify(j.def[E])&&delete y[E]}e.override({zodSchema:h,jsonSchema:y,path:g.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const g=h[1];g.def&&g.defId&&(o[g.defId]=g.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yd(t,"input",e.processors),output:Yd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Rn(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 Rn(a.element,n);if(a.type==="set")return Rn(a.valueType,n);if(a.type==="lazy")return Rn(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 Rn(a.innerType,n);if(a.type==="intersection")return Rn(a.left,n)||Rn(a.right,n);if(a.type==="record"||a.type==="map")return Rn(a.keyType,n)||Rn(a.valueType,n);if(a.type==="pipe")return Rn(a.in,n)||Rn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(Rn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(Rn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(Rn(l,n))return!0;return!!(a.rest&&Rn(a.rest,n))}return!1}const lL=(e,t={})=>n=>{const a=kC({...n,processors:t});return Jt(e,a),jC(a,e),CC(a,e)},Yd=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=kC({...l??{},target:o,io:t,processors:n});return Jt(e,c),jC(c,e),CC(c,e)},sL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oL=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof c=="number"&&(l.maxLength=c),f&&(l.format=sL[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const g=[...m];g.length===1?l.pattern=g[0].source:g.length>1&&(l.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},uL=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=g,l.exclusiveMinimum=!0):l.exclusiveMinimum=g),typeof o=="number"&&(l.minimum=o,typeof g=="number"&&t.target!=="draft-04"&&(g>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof c=="number"&&(l.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},cL=(e,t,n,a)=>{n.type="boolean"},dL=(e,t,n,a)=>{n.not={}},fL=(e,t,n,a)=>{},hL=(e,t,n,a)=>{const l=e._zod.def,o=nC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},mL=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const c of l.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(c))}else o.push(c);if(o.length!==0)if(o.length===1){const c=o[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),o.every(c=>typeof c=="boolean")&&(n.type="boolean"),o.every(c=>c===null)&&(n.type="null"),n.enum=o},pL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yL=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(l.minItems=c),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Jt(o.element,t,{...a,path:[...a.path,"items"]})},vL=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const g in c)l.properties[g]=Jt(c[g],t,{...a,path:[...a.path,"properties",g]});const f=new Set(Object.keys(c)),m=new Set([...f].filter(g=>{const y=o.shape[g]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Jt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},bL=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>Jt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},xL=(e,t,n,a)=>{const l=e._zod.def,o=Jt(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=Jt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(c)?c.allOf:[c]];n.allOf=m},SL=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const g=Jt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const y of m)l.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Jt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Jt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const g=[...h].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(l.required=g)}},wL=(e,t,n,a)=>{const l=e._zod.def,o=Jt(l.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},kL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},jL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},CL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},EL=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let c;try{c=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},NL=(e,t,n,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Jt(o,t,a);const c=t.seen.get(e);c.ref=o},_L=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},EC=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},AL=se("ZodISODateTime",(e,t)=>{A4.init(e,t),Dt.init(e,t)});function TL(e){return M5(AL,e)}const RL=se("ZodISODate",(e,t)=>{T4.init(e,t),Dt.init(e,t)});function zL(e){return L5(RL,e)}const OL=se("ZodISOTime",(e,t)=>{R4.init(e,t),Dt.init(e,t)});function DL(e){return I5(OL,e)}const ML=se("ZodISODuration",(e,t)=>{z4.init(e,t),Dt.init(e,t)});function LL(e){return U5(ML,e)}const IL=(e,t)=>{lC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>wM(e,n)},flatten:{value:n=>SM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,jg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,jg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Nr=se("ZodError",IL,{Parent:Error}),UL=Sy(Nr),PL=wy(Nr),BL=bf(Nr),$L=xf(Nr),FL=CM(Nr),qL=EM(Nr),HL=NM(Nr),ZL=_M(Nr),VL=AM(Nr),QL=TM(Nr),GL=RM(Nr),KL=zM(Nr),Ot=se("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yd(e,"input"),output:Yd(e,"output")}}),e.toJSONSchema=lL(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(zi(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)=>Oi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>UL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>BL(e,n,a),e.parseAsync=async(n,a)=>PL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>$L(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>FL(e,n,a),e.decode=(n,a)=>qL(e,n,a),e.encodeAsync=async(n,a)=>HL(e,n,a),e.decodeAsync=async(n,a)=>ZL(e,n,a),e.safeEncode=(n,a)=>VL(e,n,a),e.safeDecode=(n,a)=>QL(e,n,a),e.safeEncodeAsync=async(n,a)=>GL(e,n,a),e.safeDecodeAsync=async(n,a)=>KL(e,n,a),e.refine=(n,a)=>e.check($I(n,a)),e.superRefine=n=>e.check(FI(n)),e.overwrite=n=>e.check(no(n)),e.optional=()=>mS(e),e.exactOptional=()=>_I(e),e.nullable=()=>pS(e),e.nullish=()=>mS(pS(e)),e.nonoptional=n=>DI(e,n),e.array=()=>Vn(e),e.or=n=>AC([e,n]),e.and=n=>kI(e,n),e.transform=n=>Ng(e,TC(n)),e.default=n=>RI(e,n),e.prefault=n=>OI(e,n),e.catch=n=>LI(e,n),e.pipe=n=>Ng(e,n),e.readonly=()=>PI(e),e.describe=n=>{const a=e.clone();return du.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=du.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return du.get(e);const a=e.clone();return du.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),NC=se("_ZodString",(e,t)=>{ky.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>oL(e,a,l);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(Z5(...a)),e.includes=(...a)=>e.check(G5(...a)),e.startsWith=(...a)=>e.check(K5(...a)),e.endsWith=(...a)=>e.check(Y5(...a)),e.min=(...a)=>e.check(Kd(...a)),e.max=(...a)=>e.check(SC(...a)),e.length=(...a)=>e.check(wC(...a)),e.nonempty=(...a)=>e.check(Kd(1,...a)),e.lowercase=a=>e.check(V5(a)),e.uppercase=a=>e.check(Q5(a)),e.trim=()=>e.check(J5()),e.normalize=(...a)=>e.check(X5(...a)),e.toLowerCase=()=>e.check(W5()),e.toUpperCase=()=>e.check(eL()),e.slugify=()=>e.check(tL())}),YL=se("ZodString",(e,t)=>{ky.init(e,t),NC.init(e,t),e.email=n=>e.check(m5(XL,n)),e.url=n=>e.check(b5(JL,n)),e.jwt=n=>e.check(D5(hI,n)),e.emoji=n=>e.check(x5(WL,n)),e.guid=n=>e.check(oS(fS,n)),e.uuid=n=>e.check(p5(Cd,n)),e.uuidv4=n=>e.check(g5(Cd,n)),e.uuidv6=n=>e.check(y5(Cd,n)),e.uuidv7=n=>e.check(v5(Cd,n)),e.nanoid=n=>e.check(S5(eI,n)),e.guid=n=>e.check(oS(fS,n)),e.cuid=n=>e.check(w5(tI,n)),e.cuid2=n=>e.check(k5(nI,n)),e.ulid=n=>e.check(j5(rI,n)),e.base64=n=>e.check(R5(cI,n)),e.base64url=n=>e.check(z5(dI,n)),e.xid=n=>e.check(C5(aI,n)),e.ksuid=n=>e.check(E5(iI,n)),e.ipv4=n=>e.check(N5(lI,n)),e.ipv6=n=>e.check(_5(sI,n)),e.cidrv4=n=>e.check(A5(oI,n)),e.cidrv6=n=>e.check(T5(uI,n)),e.e164=n=>e.check(O5(fI,n)),e.datetime=n=>e.check(TL(n)),e.date=n=>e.check(zL(n)),e.time=n=>e.check(DL(n)),e.duration=n=>e.check(LL(n))});function R(e){return h5(YL,e)}const Dt=se("ZodStringFormat",(e,t)=>{Tt.init(e,t),NC.init(e,t)}),XL=se("ZodEmail",(e,t)=>{x4.init(e,t),Dt.init(e,t)}),fS=se("ZodGUID",(e,t)=>{v4.init(e,t),Dt.init(e,t)}),Cd=se("ZodUUID",(e,t)=>{b4.init(e,t),Dt.init(e,t)}),JL=se("ZodURL",(e,t)=>{S4.init(e,t),Dt.init(e,t)}),WL=se("ZodEmoji",(e,t)=>{w4.init(e,t),Dt.init(e,t)}),eI=se("ZodNanoID",(e,t)=>{k4.init(e,t),Dt.init(e,t)}),tI=se("ZodCUID",(e,t)=>{j4.init(e,t),Dt.init(e,t)}),nI=se("ZodCUID2",(e,t)=>{C4.init(e,t),Dt.init(e,t)}),rI=se("ZodULID",(e,t)=>{E4.init(e,t),Dt.init(e,t)}),aI=se("ZodXID",(e,t)=>{N4.init(e,t),Dt.init(e,t)}),iI=se("ZodKSUID",(e,t)=>{_4.init(e,t),Dt.init(e,t)}),lI=se("ZodIPv4",(e,t)=>{O4.init(e,t),Dt.init(e,t)}),sI=se("ZodIPv6",(e,t)=>{D4.init(e,t),Dt.init(e,t)}),oI=se("ZodCIDRv4",(e,t)=>{M4.init(e,t),Dt.init(e,t)}),uI=se("ZodCIDRv6",(e,t)=>{L4.init(e,t),Dt.init(e,t)}),cI=se("ZodBase64",(e,t)=>{I4.init(e,t),Dt.init(e,t)}),dI=se("ZodBase64URL",(e,t)=>{P4.init(e,t),Dt.init(e,t)}),fI=se("ZodE164",(e,t)=>{B4.init(e,t),Dt.init(e,t)}),hI=se("ZodJWT",(e,t)=>{F4.init(e,t),Dt.init(e,t)}),jy=se("ZodNumber",(e,t)=>{gC.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>uL(e,a,l),e.gt=(a,l)=>e.check(cS(a,l)),e.gte=(a,l)=>e.check(vp(a,l)),e.min=(a,l)=>e.check(vp(a,l)),e.lt=(a,l)=>e.check(uS(a,l)),e.lte=(a,l)=>e.check(yp(a,l)),e.max=(a,l)=>e.check(yp(a,l)),e.int=a=>e.check(hS(a)),e.safe=a=>e.check(hS(a)),e.positive=a=>e.check(cS(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(uS(0,a)),e.nonpositive=a=>e.check(yp(0,a)),e.multipleOf=(a,l)=>e.check(dS(a,l)),e.step=(a,l)=>e.check(dS(a,l)),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 Ke(e){return P5(jy,e)}const mI=se("ZodNumberFormat",(e,t)=>{q4.init(e,t),jy.init(e,t)});function hS(e){return $5(mI,e)}const pI=se("ZodBoolean",(e,t)=>{H4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>cL(e,n,a)});function Ti(e){return F5(pI,e)}const gI=se("ZodUnknown",(e,t)=>{Z4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>fL()});function St(){return q5(gI)}const yI=se("ZodNever",(e,t)=>{V4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>dL(e,n,a)});function vI(e){return H5(yI,e)}const bI=se("ZodArray",(e,t)=>{Q4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>yL(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Kd(n,a)),e.nonempty=n=>e.check(Kd(1,n)),e.max=(n,a)=>e.check(SC(n,a)),e.length=(n,a)=>e.check(wC(n,a)),e.unwrap=()=>e.element});function Vn(e,t){return nL(bI,e,t)}const xI=se("ZodObject",(e,t)=>{K4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>vL(e,n,a,l),ft(e,"shape",()=>t.shape),e.keyof=()=>Qe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:vI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>gM(e,n),e.safeExtend=n=>yM(e,n),e.merge=n=>vM(e,n),e.pick=n=>mM(e,n),e.omit=n=>pM(e,n),e.partial=(...n)=>bM(RC,e,n[0]),e.required=(...n)=>xM(zC,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...Ae(t)};return new xI(n)}const _C=se("ZodUnion",(e,t)=>{bC.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>bL(e,n,a,l),e.options=t.options});function AC(e,t){return new _C({type:"union",options:e,...Ae(t)})}const SI=se("ZodDiscriminatedUnion",(e,t)=>{_C.init(e,t),Y4.init(e,t)});function Cy(e,t,n){return new SI({type:"union",options:t,discriminator:e,...Ae(n)})}const wI=se("ZodIntersection",(e,t)=>{X4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xL(e,n,a,l)});function kI(e,t){return new wI({type:"intersection",left:e,right:t})}const jI=se("ZodRecord",(e,t)=>{J4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>SL(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function $t(e,t,n){return new jI({type:"record",keyType:e,valueType:t,...Ae(n)})}const Eg=se("ZodEnum",(e,t)=>{W4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>hL(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const c of a)if(n.has(c))o[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Eg({...t,checks:[],...Ae(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const c of a)if(n.has(c))delete o[c];else throw new Error(`Key ${c} not found in enum`);return new Eg({...t,checks:[],...Ae(l),entries:o})}});function Qe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Eg({type:"enum",entries:n,...Ae(t)})}const CI=se("ZodLiteral",(e,t)=>{e5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>mL(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 bn(e,t){return new CI({type:"literal",values:Array.isArray(e)?e:[e],...Ae(t)})}const EI=se("ZodTransform",(e,t)=>{t5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>gL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new eC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Nu(o,n.value,t));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(Nu(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function TC(e){return new EI({type:"transform",transform:e})}const RC=se("ZodOptional",(e,t)=>{xC.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function mS(e){return new RC({type:"optional",innerType:e})}const NI=se("ZodExactOptional",(e,t)=>{n5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function _I(e){return new NI({type:"optional",innerType:e})}const AI=se("ZodNullable",(e,t)=>{r5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>wL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function pS(e){return new AI({type:"nullable",innerType:e})}const TI=se("ZodDefault",(e,t)=>{a5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function RI(e,t){return new TI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():aC(t)}})}const zI=se("ZodPrefault",(e,t)=>{i5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>CL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function OI(e,t){return new zI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():aC(t)}})}const zC=se("ZodNonOptional",(e,t)=>{l5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function DI(e,t){return new zC({type:"nonoptional",innerType:e,...Ae(t)})}const MI=se("ZodCatch",(e,t)=>{s5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EL(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function LI(e,t){return new MI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const II=se("ZodPipe",(e,t)=>{o5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>NL(e,n,a,l),e.in=t.in,e.out=t.out});function Ng(e,t){return new II({type:"pipe",in:e,out:t})}const UI=se("ZodReadonly",(e,t)=>{u5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>_L(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function PI(e){return new UI({type:"readonly",innerType:e})}const BI=se("ZodCustom",(e,t)=>{c5.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>pL(e,n)});function $I(e,t={}){return rL(BI,e,t)}function FI(e){return aL(e)}function qI(e,t){return Ng(TC(e),t)}const bp={custom:"custom"};function wf(e){return B5(jy,e)}const HI=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function ZI(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function VI(e,t){const n=ZI(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const l=new Set;for(const o of n.matchAll(HI)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const QI=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,gS="/";function OC(e){return!e||typeof e!="string"||e.length>256||!QI.test(e)?"/":e}const GI={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},DC=Qe(["feishu","slack","kael"]),MC=Qe(["active","inactive"]);de({platform:DC,agentId:R().min(1),credentials:$t(R(),St()),status:MC.default("active")});de({agentId:R().min(1).optional(),credentials:$t(R(),St()).optional(),status:MC.optional()});de({id:Ke(),platform:R(),agentId:R(),hasCredentials:Ti(),status:R(),createdAt:R(),updatedAt:R()});const KI=Qe(["code","reverse_token","oauth","manual"]);de({appId:R().min(1),appSecret:R().min(1)});de({platform:DC,externalUserId:R().min(1),agentId:R().min(1),boundVia:KI.default("manual"),displayName:R().max(200).optional()});de({id:Ke(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});de({feishuUserId:R().min(1),displayName:R().max(200).optional()});de({configId:Ke(),platform:R(),agentId:R(),appId:R(),connected:Ti(),lastActiveAt:R().nullable()});const LC=Qe(["online","offline"]),IC=Qe(["idle","working","blocked","error"]);Qe(["active","suspended","evicted"]);const YI=Qe(["active","suspended"]);de({chatId:R().min(1),state:YI});de({runtimeState:IC});de({agentId:R().min(1),runtimeType:R().max(50),runtimeVersion:R().max(50).optional()});Qe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);de({agentId:R(),status:LC,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:IC.nullable().optional(),activeSessions:Ke().int().nullable().optional(),totalSessions:Ke().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});de({total:Ke().int(),running:Ke().int(),byState:de({idle:Ke().int(),working:Ke().int(),blocked:Ke().int(),error:Ke().int()}),clients:Ke().int()});const Xd={CLAUDE_CODE:"claude-code",CODEX:"codex"},kf=Qe(["claude-code","codex"]),XI={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},jf=Qe(["human","personal_assistant","autonomous_agent"]),yS={PRIVATE:"private",ORGANIZATION:"organization"},Ey=Qe(["private","organization"]),JI=Qe(["admin-api","portal"]);Qe(["active","suspended"]);const _g=/^[a-z0-9][a-z0-9_-]{0,63}$/,js=64,WI=["admin","agent","first-tree","hub","me","null","system","undefined"],e6=new Set(WI);function Ag(e){return e6.has(e)}de({name:R().min(1).max(64).regex(_g,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Ag(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:jf,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().max(100).optional(),source:JI.optional(),visibility:Ey.optional(),metadata:$t(R(),St()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional(),runtimeProvider:kf.optional()});de({type:jf.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Ey.optional(),metadata:$t(R(),St()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});de({clientId:R().min(1).max(100),runtimeProvider:kf,force:Ti().optional()});de({uuid:R(),name:R().nullable(),organizationId:R(),type:jf,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Ey,metadata:$t(R(),St()),managerId:R().nullable(),clientId:R().nullable(),runtimeProvider:kf,presenceStatus:LC.optional(),createdAt:R(),updatedAt:R()});de({repo:R().nullable(),branch:R().nullable()});de({type:bn("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:jf,runtimeProvider:kf});const t6=32e3,Ny=/^[a-z0-9][a-z0-9_-]{0,63}$/i,n6=/^[A-Z][A-Z0-9_]*$/,r6=de({append:R().max(t6).default("")}),a6=de({name:R().regex(Ny,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:bn("stdio"),command:R().min(1),args:Vn(R()).optional()}),i6=de({name:R().regex(Ny,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:bn("http"),url:R().url(),headers:$t(R(),R()).optional()}),l6=de({name:R().regex(Ny,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:bn("sse"),url:R().url(),headers:$t(R(),R()).optional()}),s6=Cy("transport",[a6,i6,l6]),o6=de({key:R().regex(n6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Ti().default(!1)}),u6=de({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),Cf=de({prompt:r6.default({append:""}),model:R().default("opus"),mcpServers:Vn(s6).default([]),env:Vn(o6).default([]),gitRepos:Vn(u6).default([])}),c6=Cf.extend({kind:bn("claude-code")}),d6=Cf.extend({kind:bn("codex")}),f6=Cy("kind",[c6,d6]),h6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:bp.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:bp.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,c)=>{const f=o.localPath??Wd(o.url);f&&(l.has(f)&&t.addIssue({code:bp.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},UC=qI(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,f6).superRefine((e,t)=>{h6(e,t)}),m6=de({agentId:R(),version:Ke().int().positive(),payload:UC,updatedAt:R(),updatedBy:R()});de({expectedVersion:Ke().int().positive(),payload:Cf.partial()});de({payload:Cf.partial()});de({current:m6,next:UC,diff:Vn(de({path:R(),op:Qe(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const Jd="***";function Wd(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}de({username:R().min(1),password:R().min(1)});de({accessToken:R(),refreshToken:R()});de({refreshToken:R().min(1)});de({token:R().min(1)});de({token:R(),expiresIn:Ke(),command:R()});const p6=Qe(["direct","group","thread"]);de({type:p6,topic:R().max(500).optional(),participantIds:Vn(R()).min(1),metadata:$t(R(),St()).optional()});const PC=de({agentId:R(),role:R(),mode:R(),joinedAt:R()});PC.extend({name:R().nullable(),displayName:R(),type:R()});const g6=de({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:$t(R(),St()),createdAt:R(),updatedAt:R()});g6.extend({participants:Vn(PC)});de({topic:R().trim().max(500).nullable()});de({agentId:R().min(1),mode:Qe(["full","mention_only"]).default("full")});de({agentId:R().min(1)});const y6=Qe(["connected","disconnected"]);de({id:R(),userId:R().nullable(),status:y6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Ke().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:$t(R(),St()).nullable()});de({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional()});const v6=Qe(["ok","missing","unauthenticated","error"]),b6=Qe(["api_key","oauth","auth_json","none"]),x6=de({state:v6,available:Ti(),authenticated:Ti(),sdkVersion:R().nullable().optional(),authMethod:b6,error:R().nullable().optional(),detectedAt:R()}),S6=$t(R(),x6);de({capabilities:S6});de({limit:wf().int().min(1).max(100).default(20),cursor:R().optional()});const w6=["image/png","image/jpeg","image/gif","image/webp"],_y=Qe(w6);de({data:R().min(1),mimeType:_y,filename:R().min(1),size:Ke().int().nonnegative().optional(),imageId:R().uuid().optional()});de({imageId:R().uuid(),mimeType:_y,filename:R().min(1),size:Ke().int().nonnegative().optional()});de({type:bn("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:_y,filename:R().min(1),size:Ke().int().nonnegative().optional()});const Ay=Qe(["hub_ui","cli","feishu","github","api"]),BC=Qe(["text","markdown","card","reference","file","task"]);de({format:BC.default("text"),content:St(),metadata:$t(R(),St()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Ay.optional()});de({format:BC.default("text"),content:St(),metadata:$t(R(),St()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Ay.optional()});const k6=de({id:R(),chatId:R(),senderId:R(),format:R(),content:St(),metadata:$t(R(),St()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:Ay.nullable(),createdAt:R()}),j6=de({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),C6=Qe(["full","mention_only"]),E6=de({id:R(),senderId:R(),format:R(),content:St(),metadata:$t(R(),St()).default({}),createdAt:R()}),N6=k6.extend({configVersion:Ke().int().positive(),recipientMode:C6.default("full"),inReplyToSnapshot:j6.default(null),precedingMessages:Vn(E6).default([])});Qe(["pending","delivered","acked","failed"]);const _6=de({id:Ke(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Ke(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});_6.extend({message:N6});de({limit:wf().int().min(1).max(50).default(10)});const A6=7;de({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R()});de({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});de({token:R().min(1)});de({}).optional();Qe(["connect","create_agent","completed"]);de({id:R(),name:R(),displayName:R(),role:Qe(["admin","member"])});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});de({organizationId:R().min(1)});const T6={ADMIN:"admin",MEMBER:"member"},Ty=Qe(["admin","member"]),R6=de({id:R(),userId:R(),organizationId:R(),agentId:R(),role:Ty,createdAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),role:Ty.default("member")});de({role:Ty.optional(),displayName:R().min(1).max(200).optional()});R6.extend({username:R(),displayName:R(),password:R()});const z6=Qe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),$C=Qe(["high","medium","low"]);de({id:R(),organizationId:R(),type:z6,severity:$C,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Ti(),createdAt:R()});de({limit:wf().int().min(1).max(100).default(20),cursor:R().optional(),severity:$C.optional(),read:Qe(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});de({next:R().max(256).optional()});de({code:R().min(1),state:R().min(1)});de({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const FC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!FC.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Ke().int().min(0).default(0),maxMessagesPerMinute:Ke().int().min(0).default(0),features:$t(R(),St()).default({})});de({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!FC.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Ke().int().min(0).optional(),maxMessagesPerMinute:Ke().int().min(0).optional(),features:$t(R(),St()).optional()});de({id:R(),name:R(),displayName:R(),maxAgents:Ke(),maxMessagesPerMinute:Ke(),features:$t(R(),St()),createdAt:R(),updatedAt:R()});const O6=de({workingCount:Ke().int().nonnegative(),errorMask:Ti()}),D6=de({type:bn("pulse:tick"),organizationId:R(),agents:$t(R(),Vn(O6).length(32))}),M6=Qe(["tool_call","error","assistant_text","thinking","turn_end"]),qC=de({toolUseId:R(),name:R(),args:St(),status:Qe(["pending","ok","error"]),durationMs:Ke().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),HC=de({source:Qe(["sdk","runtime","tool"]),message:R().max(2e3)}),ZC=de({text:R().max(8e3)}),VC=de({}),QC=de({status:Qe(["success","error"])}),L6=Cy("kind",[de({kind:bn("tool_call"),payload:qC}),de({kind:bn("error"),payload:HC}),de({kind:bn("assistant_text"),payload:ZC}),de({kind:bn("thinking"),payload:VC}),de({kind:bn("turn_end"),payload:QC})]);de({id:R(),agentId:R(),chatId:R(),seq:Ke().int().positive(),kind:M6,payload:AC([qC,HC,ZC,VC,QC]),createdAt:R()});de({agentId:R(),chatId:R(),event:L6});de({agentId:R(),chatId:R()});de({type:bn("session:reconcile"),agentId:R().min(1),chatIds:Vn(R().min(1)).max(500)});de({type:bn("session:reconcile:result"),agentId:R().min(1),staleChatIds:Vn(R().min(1))});const I6=de({organizationId:R(),agentCount:Ke(),chatCount:Ke(),messageCount:Ke()});de({totalAgents:Ke(),totalChats:Ke(),totalMessages:Ke(),byOrganization:Vn(I6)});de({key:R(),value:St(),updatedAt:R()});$t(R(),St());const wi={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Bd={[wi.INBOX_TIMEOUT_SECONDS]:300,[wi.MAX_RETRY_COUNT]:3,[wi.POLLING_INTERVAL_SECONDS]:5,[wi.PRESENCE_CLEANUP_SECONDS]:60},_u=Qe(["pending","assigned","working","completed","failed","cancelled"]),vS=Qe(["agent","admin"]),U6=Qe(["assigned","status_changed","cancelled"]);de({taskId:R(),event:U6,title:R(),body:R().default(""),status:_u,fromStatus:_u.optional(),originRef:R().nullable().optional()});const P6=de({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:$t(R(),St()).optional()});P6.extend({organizationId:R().optional()});de({status:Qe(["working","completed","failed"]),result:R().optional()});de({assigneeAgentId:R().nullable().optional(),status:_u.optional(),result:R().optional()});de({chatId:R().min(1)});const B6=de({id:R(),organizationId:R(),title:R(),body:R(),status:_u,assigneeAgentId:R().nullable(),createdByType:vS,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:$t(R(),St()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:vS.nullable(),cancelledById:R().nullable()}),$6=de({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});B6.extend({chats:Vn($6)});de({status:_u.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:wf().int().min(1).max(100).default(20),cursor:R().optional()});const F6=Qe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);de({taskId:R(),signal:F6,reason:R()});const q6=Qe(["active","suspended"]);de({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:q6,createdAt:R(),updatedAt:R()});de({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});de({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});de({type:bn("auth"),token:R().min(1)});de({type:bn("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Ke().int().nonnegative()}).passthrough();const GC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function H6(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let a=0;a<32&&a<n.length;a++){const l=n[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const Z6=2e3,V6=3e4;let di=null,ef=!1,xp=0,mu=null;const Tg=new Set;let fu=null,Cs=0;function Q6(e){for(const t of Tg)try{t(e)}catch{}fu&&(e.type==="notification"?fu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(fu.invalidateQueries({queryKey:["activity"]}),fu.invalidateQueries({queryKey:["sessions"]})))}function KC(){const e=sy();if(!(e!=null&&e.accessToken))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,a=new WebSocket(n);di=a,a.onmessage=l=>{if(a===di)try{const o=JSON.parse(l.data);Q6(o)}catch{}},a.onopen=()=>{a===di&&(xp=0)},a.onclose=()=>{if(a!==di||(di=null,ef||Cs===0))return;xp++;const l=Math.min(Z6*2**(xp-1),V6);mu=setTimeout(()=>{mu=null,!ef&&Cs>0&&KC()},l)}}function G6(){ef=!0,mu&&(clearTimeout(mu),mu=null),di&&(di.close(1e3,"unmount"),di=null)}function YC(e){const{onMessage:t,enabled:n=!0}=e??{},a=Nn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{fu=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Tg.add(o),Cs++,Cs===1&&(ef=!1,KC()),()=>{Tg.delete(o),Cs--,Cs===0&&G6()}},[n])}const XC=x.createContext({aggregated:GC,agents:{},receivedAtMs:null,stale:!0});function K6({children:e}){const[t,n]=x.useState({aggregated:GC,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());YC({onMessage:c=>{const f=D6.safeParse(c);f.success&&n({aggregated:H6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const c=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return u.jsx(XC.Provider,{value:o,children:e})}function Y6(){return x.useContext(XC)}function Ef({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:_e("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),u.jsx("div",{style:{flex:1}}),n]})}function JC({className:e,style:t,...n}){return u.jsx("div",{className:_e("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function WC({active:e,onClick:t,children:n}){return u.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}const X6={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function xn({tone:e="neutral",className:t,style:n,...a}){const l=X6[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:_e("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}const vl=x.forwardRef(({className:e,...t},n)=>u.jsx("table",{ref:n,className:_e("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));vl.displayName="DenseTable";const bl=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));bl.displayName="DenseTableHeader";const xl=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));xl.displayName="DenseTableBody";const sr=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:_e("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));sr.displayName="DenseTableRow";const $e=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:_e("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));$e.displayName="DenseTableHead";const Ie=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:_e("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ie.displayName="DenseTableCell";const rn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));rn.displayName="Panel";const _r=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));_r.displayName="PanelHeader";const Ar=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Ar.displayName="PanelTitle";const Yr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:_e(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Yr.displayName="PanelBody";function Gs({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:_e("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[u.jsx("span",{children:e}),t]})}function Qu({className:e,style:t,...n}){return u.jsx("span",{className:_e("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Nf(){return je.get("/members")}function J6(e){return je.post("/members",e)}function W6(e,t){return je.patch(`/members/${encodeURIComponent(e)}`,t)}function eU(e){return je.delete(`/members/${encodeURIComponent(e)}`)}function Ry(){const{data:e}=qe({queryKey:["members","name-map"],queryFn:Nf,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function tU(){const e=_n(),t=Ry(),{data:n,isLoading:a,error:l}=qe({queryKey:["admin-all-agents"],queryFn:()=>TD({limit:100})});return u.jsxs("div",{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),u.jsxs(rn,{children:[u.jsxs(Gs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Agent name"}),u.jsx($e,{children:"Type"}),u.jsx($e,{children:"Visibility"}),u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Created"})]})}),u.jsx(xl,{children:n.items.map(o=>u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"font-medium",children:o.displayName})}),u.jsx(Ie,{children:o.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),u.jsx(Ie,{children:u.jsx(xn,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),u.jsx(Ie,{children:u.jsx(xn,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),u.jsx(Ie,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),u.jsx(Ie,{children:u.jsx(xn,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ci(o.createdAt)})]},o.uuid))})]})]})]})}const _f=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));_f.displayName="Card";const Af=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));Af.displayName="CardHeader";const Tf=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("text-subtitle leading-none",e),...t}));Tf.displayName="CardTitle";const zy=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("text-body text-muted-foreground",e),...t}));zy.displayName="CardDescription";const Rf=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));Rf.displayName="CardContent";const nU=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));nU.displayName="CardFooter";function rU(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const l=Math.ceil(a/(1440*60*1e3));return`expires ${l===1?"in less than a day":`in ${l} days`} · ${t.toLocaleDateString()}`}function aU(){const{organizationId:e}=an(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,c]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const g=await je.get(`/admin/organizations/${e}/invitations`);n(g)}catch(g){l(g instanceof Error?g.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const g=await je.post(`/admin/organizations/${e}/invitations/rotate`);n(g)}catch(g){l(g instanceof Error?g.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(_f,{children:[u.jsxs(Af,{children:[u.jsx(Tf,{children:"Invite link"}),u.jsxs(zy,{children:["Anyone with this link can join your team as a member. Links expire after ",A6," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(Rf,{className:"space-y-3",children:[a&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),u.jsx(me,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(me,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),u.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${rU(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}var iU="Label",eE=x.forwardRef((e,t)=>u.jsx(Ta.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));eE.displayName=iU;var lU=eE;const it=x.forwardRef(({className:e,...t},n)=>u.jsx(lU,{ref:n,className:_e("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));it.displayName="Label";const tE=Object.values(T6);function sU(e,t){const n=(e==null?void 0:e.trim())||t,a=n.split(/[\s._-]+/).filter(Boolean);if(a.length>=2){const l=a[0]??"",o=a[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function oU(){const e=Nn(),{memberId:t}=an(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[c,f]=x.useState(null),[m,h]=x.useState(null),{data:g,isLoading:y,error:b}=qe({queryKey:["members"],queryFn:Nf}),S=gt({mutationFn:()=>J6({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:A=>{e.invalidateQueries({queryKey:["members"]}),f(A.password)}}),k=gt({mutationFn:eU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(A){A.preventDefault(),S.mutate()}function C(A){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(A)}return u.jsxs(u.Fragment,{children:[u.jsxs(rn,{children:[u.jsxs(Gs,{right:u.jsxs(Pt,{open:n,onOpenChange:A=>A?a(!0):j(),children:[u.jsx(ND,{asChild:!0,children:u.jsxs(me,{size:"xs",className:"normal-case tracking-normal",children:[u.jsx(_a,{className:"h-3 w-3"}),"Add member"]})}),u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),u.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("code",{className:"flex-1 text-body mono",children:c}),u.jsx(me,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(oy,{className:"h-4 w-4"})})]}),u.jsx(Wt,{children:u.jsx(me,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:E,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"member-username",children:"Username"}),u.jsx(xt,{id:"member-username",type:"text",value:l.username,onChange:A=>o({...l,username:A.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"member-name",children:"Display Name"}),u.jsx(xt,{id:"member-name",value:l.displayName,onChange:A=>o({...l,displayName:A.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:l.role,onChange:A=>o({...l,role:A.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:tE.map(A=>u.jsx("option",{value:A,children:A},A))})]}),S.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),u.jsx(Wt,{children:u.jsx(me,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(g==null?void 0:g.length)??0]}),y?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(g==null?void 0:g.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{style:{width:30}}),u.jsx($e,{children:"Username"}),u.jsx($e,{children:"Name"}),u.jsx($e,{children:"Role"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:1}})]})}),u.jsx(xl,{children:g==null?void 0:g.map(A=>{const O=t===A.id;return u.jsxs(sr,{children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:sU(A.displayName,A.username)})}),u.jsxs(Ie,{children:[u.jsx("span",{className:"mono font-medium",children:A.username}),O&&u.jsx(Qu,{style:{marginLeft:6},children:"you"})]}),u.jsx(Ie,{style:{color:"var(--fg-2)"},children:A.displayName}),u.jsx(Ie,{children:u.jsx(xn,{tone:A.role==="admin"?"accent":"neutral",children:A.role})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ci(A.createdAt)}),u.jsx(Ie,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:A.id,username:A.username,displayName:A.displayName,role:A.role}),title:"Edit",children:u.jsx(qu,{className:"h-3.5 w-3.5"})}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(A.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})})]},A.id)})})]})]}),u.jsx(uU,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function uU({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,c]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),c(e.role),m(null))},[e]);const h=gt({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return a.trim()&&a!==e.displayName&&(b.displayName=a.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:W6(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function g(b){b.preventDefault(),h.mutate()}const y=e!==null;return u.jsx(Pt,{open:y,onOpenChange:b=>b?void 0:t(),children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:g,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{children:"Username"}),u.jsx(xt,{value:e.username,disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(xt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"edit-member-role",children:"Role"}),u.jsx("select",{id:"edit-member-role",value:o,onChange:b=>c(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:tE.map(b=>u.jsx("option",{value:b,children:b},b))}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function cU(){return je.get("/admin/system/config")}function dU(e){return je.patch("/admin/system/config",e)}function fU(e){return je.get(`/admin/organizations/${encodeURIComponent(e)}`)}function hU(e,t){return je.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function mU(){return je.post("/me/organizations/leave")}const pU="rename-hint:";function gU(){var C,A,O;const{organizationId:e}=an(),t=Nn(),n=qe({queryKey:["organization",e],queryFn:()=>e?fU(e):Promise.reject(new Error("no org")),enabled:!!e}),a=qe({queryKey:["members"],queryFn:Nf}),[l,o]=x.useState(""),[c,f]=x.useState(""),[m,h]=x.useState(!1);x.useEffect(()=>{n.data&&(o(n.data.displayName),f(n.data.name))},[n.data]);const g=gt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const L={},D=l.trim(),z=c.trim();return D&&D!==n.data.displayName&&(L.displayName=D),z&&z!==n.data.name&&(L.name=z),Object.keys(L).length===0?Promise.resolve(n.data):hU(e,L)},onSuccess:L=>{t.setQueryData(["organization",e],L),t.invalidateQueries({queryKey:["me-organizations"]}),h(!0),setTimeout(()=>h(!1),2e3)}}),y=L=>{L.preventDefault(),g.mutate()},b=`${pU}${e??"unknown"}:dismissed`,[S,k]=x.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(b)==="1"),j=()=>{window.localStorage.setItem(b,"1"),k(!0)},E=!S&&!!((C=n.data)!=null&&C.name)&&n.data.name.endsWith("-personal")&&(((A=a.data)==null?void 0:A.length)??0)>=2;return u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Team identity"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(me,{type:"submit",form:"team-identity-form",size:"xs",disabled:g.isPending||!n.data,children:[u.jsx(Na,{className:"h-3 w-3"}),g.isPending?"Saving…":"Save"]})]})]}),u.jsxs(Yr,{children:[E&&u.jsxs("div",{className:"flex items-start justify-between gap-3",style:{padding:"var(--sp-2_5) var(--sp-3)",marginBottom:"var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)"},children:[u.jsxs("div",{className:"text-label",style:{color:"var(--fg-2)"},children:["Heads up — this team is still using its auto-generated name (",u.jsx("span",{className:"mono",children:(O=n.data)==null?void 0:O.name}),"). Now that you have teammates, you might want to give it a friendlier name in the form below."]}),u.jsx("button",{type:"button","aria-label":"Dismiss rename hint",onClick:j,className:"shrink-0",style:{color:"var(--fg-3)",padding:2,background:"transparent",border:"none",cursor:"pointer"},children:u.jsx(ku,{className:"h-3.5 w-3.5"})})]}),n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx(bS,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:l,onChange:o}),u.jsx(bS,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:c,onChange:L=>f(L.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),g.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:g.error.message})]})]})]})}function bS({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]})}const nE=[{key:wi.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:wi.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:wi.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:wi.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],xS=nE.map(e=>e.key);function yU(){const e=Nn(),{data:t,isLoading:n}=qe({queryKey:["system-config"],queryFn:cU}),[a,l]=x.useState({}),[o,c]=x.useState(!1);x.useEffect(()=>{if(!t)return;const g={};for(const y of xS){const b=t[y]??Bd[y]??"";g[y]=String(b)}l(g)},[t]);const f=gt({mutationFn:()=>{const g={};for(const[y,b]of Object.entries(a)){const S=b.trim();if(S==="")g[y]=Bd[y]??0;else{const k=Number(S);g[y]=Number.isNaN(k)?S:k}}return dU(g)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}});function m(){const g={};for(const y of xS)g[y]=String(Bd[y]??"");l(g)}function h(g){g.preventDefault(),f.mutate()}return u.jsxs("div",{className:"space-y-4",children:[u.jsx(gU,{}),u.jsx("form",{onSubmit:h,children:u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"System configuration"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsx(me,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),u.jsxs(me,{type:"submit",size:"xs",disabled:f.isPending,children:[u.jsx(Na,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),u.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?u.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):nE.map(g=>u.jsx(vU,{field:g,value:a[g.key]??"",onChange:y=>l({...a,[g.key]:y})},g.key)),f.error instanceof Error&&u.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})]})}function vU({field:e,value:t,onChange:n}){const a=String(Bd[e.key]??"—");return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),u.jsxs(Qu,{style:{marginTop:4,display:"block"},children:["default"," ",u.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&u.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const SS=[{key:"members",label:"Members"},{key:"invite",label:"Invite link"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function bU(){const{role:e}=an(),t=Dn(),n=_n();if(e===null)return u.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return u.jsx(uf,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=SS.some(c=>c.key===a)?a:"members",o=c=>{n({hash:c},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Ef,{title:"Admin",subtitle:"Organization-wide controls"}),u.jsx(JC,{children:SS.map(c=>u.jsx(WC,{active:l===c.key,onClick:()=>o(c.key),children:c.label},c.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&u.jsx(oU,{}),l==="invite"&&u.jsx(aU,{}),l==="all-agents"&&u.jsx(tU,{}),l==="settings"&&u.jsx(yU,{})]})]})}function xU(e){return je.get(`/admin/agents/${e}/config`)}function SU(e,t){return je.patch(`/admin/agents/${e}/config`,t)}function wU(e,t){return je.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function kU(e){return je.get(`/admin/agents/${e}/client-status`)}function jU({className:e,style:t,...n}){return u.jsx("div",{className:_e("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function CU({onClick:e,children:t}){return u.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function EU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function NU({children:e,mono:t}){return u.jsx("span",{className:_e("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function Kr({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:_e("shrink-0",n),style:a,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?u.jsx("span",{className:_e("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:_e("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function _U(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ks({state:e,className:t}){const n=e!==null&&_U(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:_e("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(Kr,{state:n,size:7}),n]})}function Ed({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function AU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?u.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[u.jsxs("span",{children:["Runs on ",u.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),u.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function TU(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),c=t.displayName||t.name||t.uuid;return u.jsxs("section",{id:"ad-danger",style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[u.jsx(iz,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),u.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),u.jsxs("div",{children:[t.status==="active"?u.jsx(Sp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(Sp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(Sp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(me,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(Hs,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(RU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(zU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function Sp(e){return u.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),u.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),u.jsx("div",{children:e.action})]})}function RU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsxs(Bt,{children:['Suspend "',n,'"?']})}),u.jsx("div",{className:"space-y-3",children:u.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function zU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,c]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return u.jsx(Pt,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsxs(Bt,{children:['Delete "',n,'"?']})}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),u.jsx(xt,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const OU={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-success-soft text-success"},modified:{label:"changed",tone:"bg-warn-soft text-warn"},deleted:{label:"will be removed on save",tone:"bg-error-soft text-error"}};function Oy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=OU[e],f=e==="deleted";return u.jsxs("div",{className:_e("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),c.label&&u.jsx("span",{className:_e("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(me,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(sz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(qu,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(Hs,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function DU(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),c=e.items.filter(f=>f.status!=="deleted").length;return u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(_a,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Yr,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===Jd,g=m&&!h&&!!f.value.value,y=a.has(f.key);let b;return m?g&&y?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs(Oy,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:f.value.key}),u.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&u.jsx(_k,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>g&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:g?y?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":y?"Hide value":"Reveal value",disabled:!g,style:{padding:0,opacity:g?1:.4},children:y?u.jsx(jR,{className:"h-3.5 w-3.5"}):u.jsx(ER,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(MU,{open:!!t,onOpenChange:f=>!f&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:f=>{t.mode==="edit"?e.onUpdate(t.key,f):e.onAdd(f),n(null)}})]})}function MU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,g]=x.useState((n==null?void 0:n.sensitive)??!1),[y,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),g((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function S(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=Jd),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:S,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"env-key",children:"Key"}),u.jsx(xt,{id:"env-key",value:o,onChange:k=>c(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&u.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"env-value",children:"Value"}),u.jsx(xt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-body",children:[u.jsx("input",{type:"checkbox",checked:h,onChange:k=>g(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),y&&u.jsx("p",{className:"text-body text-destructive",children:y}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function LU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(_a,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Yr,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??Wd(l.value.url);return u.jsxs(Oy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&u.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),u.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&u.jsx(IU,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function IU({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,g]=x.useState((n==null?void 0:n.localPath)??""),[y,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),g((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function S(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||Wd(j);if(E&&a.has(E)){b(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(C)}return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:S,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"git-url",children:"URL"}),u.jsx(xt,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(xt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(xt,{id:"git-path",value:h,onChange:k=>g(k.target.value),placeholder:Wd(o)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),y&&u.jsx("p",{className:"text-body text-destructive",children:y}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function rE({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return u.jsx("span",{className:_e("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const g=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),y=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:_e("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:g??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:y},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:_e("inline-flex items-baseline gap-1.5",o),style:c,title:g??void 0,children:[h&&u.jsx("span",{style:{color:y},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function UU({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=yy(),o=Ry(),c=e.metadata,f=c==null?void 0:c.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],g=e.managerId?o(e.managerId):null,y=e.delegateMention?l(e.delegateMention):null;return u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Profile"}),e.status==="active"&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(Yr,{className:"text-body space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&u.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),y&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx(rE,{name:y.name,displayName:y.displayName})]})]})]}),u.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-foreground",children:g??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(xn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(xn,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>u.jsx(xn,{tone:"outline",children:b},b))})]})]})]}),u.jsx(PU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function PU({agent:e,open:t,onOpenChange:n,onSave:a}){var L;const{memberId:l,role:o}=an(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[g,y]=x.useState(e.visibility),[b,S]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),y(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===l,A=qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await Vu({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&E});async function O(D){D.preventDefault(),j(null);const z=c.trim();if(!z){j("Display name is required.");return}S(!0);try{const I={displayName:z,delegateMention:m||null};g!==e.visibility&&(I.visibility=g),await a(I),n(!1)}catch(I){j(I instanceof Error?I.message:String(I))}finally{S(!1)}}return u.jsx(Pt,{open:t,onOpenChange:n,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:O,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{children:"Agent name"}),u.jsx(xt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"id-display",children:"Display Name"}),u.jsx(xt,{id:"id-display",value:c,onChange:D=>f(D.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:g,onChange:D=>y(D.target.value),disabled:!C,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[u.jsx("option",{value:yS.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:yS.ORGANIZATION,children:"Organization — all members"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:C?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:m,onChange:D=>h(D.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"None"}),(L=A.data)==null?void 0:L.map(D=>u.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (@${D.name??D.uuid})`:D.name?`@${D.name}`:D.uuid},D.uuid))]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&u.jsx("p",{className:"text-body text-destructive",children:k}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function BU(e){return e==="working"?"accent":e==="error"?"error":"outline"}function $U(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(_a,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Yr,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return u.jsxs(Oy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:l.value.name}),u.jsx(xn,{tone:BU(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:FU(l.value)})]},l.key)})}),t&&u.jsx(qU,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function FU(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${n}`}return e.url}function qU({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,g]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[y,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[S,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),g((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function C(A){if(A.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const L=y.trim().split(/\s+/).filter(D=>D.length>0);O={name:f,transport:"stdio",command:h.trim(),...L.length?{args:L}:{}}}else{const L=S.trim();try{new URL(L)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:L}}l(O)}return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:A=>c(A.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"mcp-name",children:"Name"}),u.jsx(xt,{id:"mcp-name",value:f,onChange:A=>m(A.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"mcp-command",children:"Command"}),u.jsx(xt,{id:"mcp-command",value:h,onChange:A=>g(A.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(xt,{id:"mcp-args",value:y,onChange:A=>b(A.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"mcp-url",children:"URL"}),u.jsx(xt,{id:"mcp-url",value:S,onChange:A=>k(A.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const HU=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],ZU=[{value:"gpt-5.5",label:"gpt-5.5",hint:"latest"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5.4-mini",label:"gpt-5.4-mini",hint:"fastest"},{value:"gpt-5.3-codex",label:"gpt-5.3-codex",hint:"coding-specialized"},{value:"gpt-5.2",label:"gpt-5.2"}],VU={"claude-code":HU,codex:ZU},QU={"claude-code":"Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ~/.claude/settings.json model preference, then the CLI default.",codex:"Pick a Codex model. Slugs come from the Codex CLI bundled with @openai/codex-sdk; ChatGPT-account auth currently only accepts gpt-5.5, while API-key auth accepts the wider set. Applies to new sessions immediately; active sessions switch on their next message. Unset lets the codex CLI choose a model that matches the user's auth mode."},GU={value:"",label:"(unset — inherits local)"};function KU({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=VU[o],m=x.useMemo(()=>{const h=[GU,...f];return e!==""&&!f.some(g=>g.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(rn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["Model",c&&u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),c&&u.jsx(me,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(Yr,{className:"space-y-2",children:[u.jsx(YU,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:QU[o]})]})]})}function YU({items:e,value:t,onChange:n,disabled:a}){const[l,o]=x.useState(!1),[c,f]=x.useState(null),m=x.useRef(null),h=x.useRef(null),g=e.find(b=>b.value===t)??e[0],y=x.useCallback(()=>{const b=m.current;if(!b)return;const S=b.getBoundingClientRect();f({top:S.bottom+4,left:S.left,width:S.width})},[]);return x.useLayoutEffect(()=>{l&&y()},[l,y]),x.useEffect(()=>{if(!l)return;const b=j=>{var C,A;const E=j.target;(C=m.current)!=null&&C.contains(E)||(A=h.current)!=null&&A.contains(E)||o(!1)},S=j=>{var E;j.key==="Escape"&&(o(!1),(E=m.current)==null||E.focus())},k=()=>y();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",S),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",S),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,y]),u.jsxs("div",{className:"max-w-md",children:[u.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(b=>!b),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[u.jsx("span",{className:"truncate",style:{color:(g==null?void 0:g.value)===""?"var(--fg-3)":void 0},children:(g==null?void 0:g.label)??t}),u.jsx(Ek,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&fy.createPortal(u.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:c.top,left:c.left,width:c.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(b=>{const S=b.value===t;return u.jsxs("button",{type:"button",onClick:()=>{n(b.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:S?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(Na,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:S?"visible":"hidden",color:"var(--state-idle)"}}),u.jsx("span",{className:"flex-1 truncate",children:b.label}),b.hint&&u.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:b.hint})]},b.value||"__unset")})}),document.body)]})}function XU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,WU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eP={};function wS(e,t){return(eP.jsx?WU:JU).test(e)}const tP=/[ \t\n\f\r]/g;function nP(e){return typeof e=="object"?e.type==="text"?kS(e.value):!1:kS(e)}function kS(e){return e.replace(tP,"")===""}class Gu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Gu.prototype.normal={};Gu.prototype.property={};Gu.prototype.space=void 0;function aE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Gu(n,a,t)}function Rg(e){return e.toLowerCase()}class Kn{constructor(t,n){this.attribute=n,this.property=t}}Kn.prototype.attribute="";Kn.prototype.booleanish=!1;Kn.prototype.boolean=!1;Kn.prototype.commaOrSpaceSeparated=!1;Kn.prototype.commaSeparated=!1;Kn.prototype.defined=!1;Kn.prototype.mustUseProperty=!1;Kn.prototype.number=!1;Kn.prototype.overloadedBoolean=!1;Kn.prototype.property="";Kn.prototype.spaceSeparated=!1;Kn.prototype.space=void 0;let rP=0;const Ve=Nl(),Xt=Nl(),zg=Nl(),pe=Nl(),jt=Nl(),_s=Nl(),ar=Nl();function Nl(){return 2**++rP}const Og=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Xt,commaOrSpaceSeparated:ar,commaSeparated:_s,number:pe,overloadedBoolean:zg,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),wp=Object.keys(Og);class Dy extends Kn{constructor(t,n,a,l){let o=-1;if(super(t,n),jS(this,"space",l),typeof a=="number")for(;++o<wp.length;){const c=wp[o];jS(this,wp[o],(a&Og[c])===Og[c])}}}Dy.prototype.defined=!0;function jS(e,t,n){n&&(e[t]=n)}function ro(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new Dy(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Rg(a)]=a,n[Rg(o.attribute)]=a}return new Gu(t,n,e.space)}const iE=ro({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:Xt,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:Xt,ariaFlowTo:jt,ariaGrabbed:Xt,ariaHasPopup:null,ariaHidden:Xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:pe,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:jt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Xt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lE(e,t){return t in e?e[t]:t}function sE(e,t){return lE(e,t.toLowerCase())}const aP=ro({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_s,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:jt,autoFocus:Ve,autoPlay:Ve,blocking:jt,capture:null,charSet:null,checked:Ve,cite:null,className:jt,cols:pe,colSpan:null,content:null,contentEditable:Xt,controls:Ve,controlsList:jt,coords:pe|_s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:zg,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:jt,height:pe,hidden:zg,high:pe,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ve,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:pe,pattern:null,ping:jt,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:jt,required:Ve,reversed:Ve,rows:pe,rowSpan:pe,sandbox:jt,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Xt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Xt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:sE}),iP=ro({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:ar,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:jt,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:_s,g2:_s,glyphName:_s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:ar,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ar,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ar,rev:ar,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ar,requiredFeatures:ar,requiredFonts:ar,requiredFormats:ar,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:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:ar,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ar,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ar,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lE}),oE=ro({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()}}),uE=ro({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sE}),cE=ro({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lP={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"},sP=/[A-Z]/g,CS=/-[a-z]/g,oP=/^data[-\w.:]+$/i;function uP(e,t){const n=Rg(t);let a=t,l=Kn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(CS,dP);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!CS.test(o)){let c=o.replace(sP,cP);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Dy}return new l(a,t)}function cP(e){return"-"+e.toLowerCase()}function dP(e){return e.charAt(1).toUpperCase()}const fP=aE([iE,aP,oE,uE,cE],"html"),My=aE([iE,iP,oE,uE,cE],"svg");function hP(e){return e.join(" ").trim()}var gs={},kp,ES;function mP(){if(ES)return kp;ES=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
359
|
-
`,h="/",g="*",y="",b="comment",S="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var A=1,O=1;function L(fe){var ie=fe.match(t);ie&&(A+=ie.length);var Z=fe.lastIndexOf(m);O=~Z?fe.length-Z:O+fe.length}function D(){var fe={line:A,column:O};return function(ie){return ie.position=new z(fe),ee(),ie}}function z(fe){this.start=fe,this.end={line:A,column:O},this.source=C.source}z.prototype.content=E;function I(fe){var ie=new Error(C.source+":"+A+":"+O+": "+fe);if(ie.reason=fe,ie.filename=C.source,ie.line=A,ie.column=O,ie.source=E,!C.silent)throw ie}function F(fe){var ie=fe.exec(E);if(ie){var Z=ie[0];return L(Z),E=E.slice(Z.length),ie}}function ee(){F(n)}function H(fe){var ie;for(fe=fe||[];ie=ne();)ie!==!1&&fe.push(ie);return fe}function ne(){var fe=D();if(!(h!=E.charAt(0)||g!=E.charAt(1))){for(var ie=2;y!=E.charAt(ie)&&(g!=E.charAt(ie)||h!=E.charAt(ie+1));)++ie;if(ie+=2,y===E.charAt(ie-1))return I("End of comment missing");var Z=E.slice(2,ie-2);return O+=2,L(Z),E=E.slice(ie),O+=2,fe({type:b,comment:Z})}}function X(){var fe=D(),ie=F(a);if(ie){if(ne(),!F(l))return I("property missing ':'");var Z=F(o),ae=fe({type:S,property:j(ie[0].replace(e,y)),value:Z?j(Z[0].replace(e,y)):y});return F(c),ae}}function be(){var fe=[];H(fe);for(var ie;ie=X();)ie!==!1&&(fe.push(ie),H(fe));return fe}return ee(),be()}function j(E){return E?E.replace(f,y):y}return kp=k,kp}var NS;function pP(){if(NS)return gs;NS=1;var e=gs&&gs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=n;const t=e(mP());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:g}=m;f?l(h,g,m):g&&(o=o||{},o[h]=g)}),o}return gs}var iu={},_S;function gP(){if(_S)return iu;_S=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},m=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,c))};return iu.camelCase=m,iu}var lu,AS;function yP(){if(AS)return lu;AS=1;var e=lu&&lu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(pP()),n=gP();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,lu=a,lu}var vP=yP();const bP=lf(vP),dE=fE("end"),Ly=fE("start");function fE(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 xP(e){const t=Ly(e),n=dE(e);if(t&&n)return{start:t,end:n}}function pu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?TS(e.position):"start"in e||"end"in e?TS(e):"line"in e||"column"in e?Dg(e):""}function Dg(e){return RS(e&&e.line)+":"+RS(e&&e.column)}function TS(e){return Dg(e&&e.start)+"-"+Dg(e&&e.end)}function RS(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=pu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const Iy={}.hasOwnProperty,SP=new Map,wP=/[A-Z]/g,kP=new Set(["table","tbody","thead","tfoot","tr"]),jP=new Set(["td","th"]),hE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function CP(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=OP(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=zP(n,t.jsx,t.jsxs)}const l={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"?My:fP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=mE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function mE(e,t,n){if(t.type==="element")return EP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return NP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return AP(e,t,n);if(t.type==="mdxjsEsm")return _P(e,t);if(t.type==="root")return TP(e,t,n);if(t.type==="text")return RP(e,t)}function EP(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=My,e.schema=l),e.ancestors.push(t);const o=gE(e,t.tagName,!1),c=DP(e,t);let f=Py(e,t);return kP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!nP(m):!0})),pE(e,c,o,t),Uy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function NP(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)}Au(e,t.position)}function _P(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Au(e,t.position)}function AP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=My,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:gE(e,t.name,!0),c=MP(e,t),f=Py(e,t);return pE(e,c,o,t),Uy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function TP(e,t,n){const a={};return Uy(a,Py(e,t)),e.create(t,e.Fragment,a,n)}function RP(e,t){return t.value}function pE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Uy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function zP(e,t,n){return a;function a(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function OP(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=Ly(a);return t(l,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function DP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Iy.call(t.properties,l)){const o=LP(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&jP.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function MP(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Au(e,t.position);else{const l=a.name;let o;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,o=e.evaluater.evaluateExpression(f.expression)}else Au(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function Py(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:SP;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;c=m+"-"+h,l.set(m,h+1)}}const f=mE(e,o,c);f!==void 0&&n.push(f)}return n}function LP(e,t,n){const a=uP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?XU(n):hP(n)),a.property==="style"){let l=typeof n=="object"?n:IP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=UP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?lP[a.property]||a.property:a.attribute,n]}}function IP(e,t){try{return bP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new An("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=hE+"#cannot-parse-style-attribute",l}}function gE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=wS(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=wS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Iy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Au(e)}function Au(e,t){const n=new An("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=hE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function UP(e){const t={};let n;for(n in e)Iy.call(e,n)&&(t[PP(n)]=e[n]);return t}function PP(e){let t=e.replace(wP,BP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function BP(e){return"-"+e.toLowerCase()}const jp={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"]},$P={};function By(e,t){const n=$P,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return yE(e,a,l)}function yE(e,t,n){if(FP(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 zS(e.children,t,n)}return Array.isArray(e)?zS(e,t,n):""}function zS(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=yE(e[l],t,n);return a.join("")}function FP(e){return!!(e&&typeof e=="object")}const OS=document.createElement("i");function $y(e){const t="&"+e+";";OS.innerHTML=t;const n=OS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function or(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function jr(e,t){return e.length>0?(or(e,e.length,0,t),e):t}const DS={}.hasOwnProperty;function vE(e){const t={};let n=-1;for(;++n<e.length;)qP(t,e[n]);return t}function qP(e,t){let n;for(n in t){const l=(DS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){DS.call(l,c)||(l[c]=[]);const f=o[c];HP(l[c],Array.isArray(f)?f:f?[f]:[])}}}function HP(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);or(e,0,0,a)}function bE(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 Mr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const On=Di(/[A-Za-z]/),En=Di(/[\dA-Za-z]/),ZP=Di(/[#-'*+\--9=?A-Z^-~]/);function tf(e){return e!==null&&(e<32||e===127)}const Mg=Di(/\d/),VP=Di(/[\dA-Fa-f]/),QP=Di(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const zf=Di(new RegExp("\\p{P}|\\p{S}","u")),Sl=Di(/\s/);function Di(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ao(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&En(e.charCodeAt(n+1))&&En(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function st(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return We(m)?(e.enter(n),f(m)):t(m)}function f(m){return We(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const GP={tokenize:KP};function KP(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),st(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return ze(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const YP={tokenize:XP},MS={tokenize:JP};function XP(e){const t=this,n=[];let a=0,l,o,c;return f;function f(O){if(a<n.length){const L=n[a];return t.containerState=L[1],e.attempt(L[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const L=t.events.length;let D=L,z;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){z=t.events[D][1].end;break}C(a);let I=L;for(;I<t.events.length;)t.events[I][1].end={...z},I++;return or(t.events,D+1,0,t.events.slice(L)),t.events.length=I,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(MS,g,y)(O)}function g(O){return l&&A(),C(a),b(O)}function y(O){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(MS,S,k)(O)}function S(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&A(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return ze(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,L){const D=t.sliceStream(O);if(L&&D.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(D),t.parser.lazy[O.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<c&&(!l.events[z][1].end||l.events[z][1].end.offset>c))return;const I=t.events.length;let F=I,ee,H;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(ee){H=t.events[F][1].end;break}ee=!0}for(C(a),z=I;z<t.events.length;)t.events[z][1].end={...H},z++;or(t.events,F+1,0,t.events.slice(I)),t.events.length=z}}function C(O){let L=n.length;for(;L-- >O;){const D=n[L];t.containerState=D[1],D[0].exit.call(t,e)}n.length=O}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function JP(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ys(e){if(e===null||kt(e)||Sl(e))return 1;if(zf(e))return 2}function Of(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Lg={name:"attention",resolveAll:WP,tokenize:e9};function WP(e,t){let n=-1,a,l,o,c,f,m,h,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;m=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},b={...e[n][1].start};LS(y,-m),LS(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=jr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=jr(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=jr(h,Of(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=jr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=jr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,or(e,a-1,n-a+3,h),n=a+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function e9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Ys(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),g=Ys(m),y=!g||g===2&&l||n.includes(m),b=!l||l===2&&g||n.includes(a);return h._open=!!(o===42?y:y&&(l||!b)),h._close=!!(o===42?b:b&&(g||!y)),t(m)}}function LS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const t9={name:"autolink",tokenize:n9};function n9(e,t,n){let a=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(S){return On(S)?(e.consume(S),c):S===64?n(S):h(S)}function c(S){return S===43||S===45||S===46||En(S)?(a=1,f(S)):h(S)}function f(S){return S===58?(e.consume(S),a=0,m):(S===43||S===45||S===46||En(S))&&a++<32?(e.consume(S),f):(a=0,h(S))}function m(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):S===null||S===32||S===60||tf(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),g):ZP(S)?(e.consume(S),h):n(S)}function g(S){return En(S)?y(S):n(S)}function y(S){return S===46?(e.consume(S),a=0,g):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):b(S)}function b(S){if((S===45||En(S))&&a++<63){const k=S===45?b:y;return e.consume(S),k}return n(S)}}const Ku={partial:!0,tokenize:r9};function r9(e,t,n){return a;function a(o){return We(o)?st(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||ze(o)?t(o):n(o)}}const xE={continuation:{tokenize:i9},exit:l9,name:"blockQuote",tokenize:a9};function a9(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return We(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function i9(e,t,n){const a=this;return l;function l(c){return We(c)?st(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(xE,t,n)(c)}}function l9(e){e.exit("blockQuote")}const SE={name:"characterEscape",tokenize:s9};function s9(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return QP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const wE={name:"characterReference",tokenize:o9};function o9(e,t,n){const a=this;let l=0,o,c;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),m}function m(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=En,g(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=VP,g):(e.enter("characterReferenceValue"),o=7,c=Mg,g(y))}function g(y){if(y===59&&l){const b=e.exit("characterReferenceValue");return c===En&&!$y(a.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(y)&&l++<o?(e.consume(y),g):n(y)}}const IS={partial:!0,tokenize:c9},US={concrete:!0,name:"codeFenced",tokenize:u9};function u9(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,c=0,f;return m;function m(z){return h(z)}function h(z){const I=a.events[a.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(z)}function g(z){return z===f?(c++,e.consume(z),g):c<3?n(z):(e.exit("codeFencedFenceSequence"),We(z)?st(e,y,"whitespace")(z):y(z))}function y(z){return z===null||ze(z)?(e.exit("codeFencedFence"),a.interrupt?t(z):e.check(IS,j,L)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||ze(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(z)):We(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,S,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function S(z){return z===null||ze(z)?y(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||ze(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(z)):z===96&&z===f?n(z):(e.consume(z),k)}function j(z){return e.attempt(l,L,E)(z)}function E(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),C}function C(z){return o>0&&We(z)?st(e,A,"linePrefix",o+1)(z):A(z)}function A(z){return z===null||ze(z)?e.check(IS,j,L)(z):(e.enter("codeFlowValue"),O(z))}function O(z){return z===null||ze(z)?(e.exit("codeFlowValue"),A(z)):(e.consume(z),O)}function L(z){return e.exit("codeFenced"),t(z)}function D(z,I,F){let ee=0;return H;function H(ie){return z.enter("lineEnding"),z.consume(ie),z.exit("lineEnding"),ne}function ne(ie){return z.enter("codeFencedFence"),We(ie)?st(z,X,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):X(ie)}function X(ie){return ie===f?(z.enter("codeFencedFenceSequence"),be(ie)):F(ie)}function be(ie){return ie===f?(ee++,z.consume(ie),be):ee>=c?(z.exit("codeFencedFenceSequence"),We(ie)?st(z,fe,"whitespace")(ie):fe(ie)):F(ie)}function fe(ie){return ie===null||ze(ie)?(z.exit("codeFencedFence"),I(ie)):F(ie)}}}function c9(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Cp={name:"codeIndented",tokenize:f9},d9={partial:!0,tokenize:h9};function f9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),st(e,o,"linePrefix",5)(h)}function o(h){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):ze(h)?e.attempt(d9,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||ze(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function h9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):st(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):ze(c)?l(c):n(c)}}const m9={name:"codeText",previous:g9,resolve:p9,tokenize:y9};function p9(e){let t=e.length-4,n=3,a,l;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;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function g9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function y9(e,t,n){let a=0,l,o;return c;function c(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),m(y))}function m(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),m):y===96?(o=e.enter("codeTextSequence"),l=0,g(y)):ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||ze(y)?(e.exit("codeTextData"),m(y)):(e.consume(y),h)}function g(y){return y===96?(e.consume(y),l++,g):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(o.type="codeTextData",h(y))}}class v9{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 l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&su(this.left,a),o.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),su(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),su(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);su(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);su(this.left,n.reverse())}}}function su(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 kE(e){const t={};let n=-1,a,l,o,c,f,m,h;const g=new v9(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"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,b9(g,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=g.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...g.get(l)[1].start},f=g.slice(l,n),f.unshift(a),g.splice(l,n-l+1,f))}}return or(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function b9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let g,y,b=-1,S=n,k=0,j=0;const E=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(g=a.sliceStream(S),S.next||g.push(null),y&&c.defineSkip(S.start),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),S._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),y=S,S=S.next}for(S=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(c.events=[],S?(S._tokenizer=void 0,S.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),A=o.pop();m.push([A,A+C.length-1]),e.splice(A,2,C)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const x9={resolve:w9,tokenize:k9},S9={partial:!0,tokenize:j9};function w9(e){return kE(e),e}function k9(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):ze(f)?e.check(S9,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function j9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),st(e,o,"linePrefix")}function o(c){if(c===null||ze(c))return n(c);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(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function jE(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let g=0;return y;function y(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||tf(C)?n(C):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||ze(C)?n(C):(e.consume(C),C===92?k:S)}function k(C){return C===60||C===62||C===92?(e.consume(C),S):S(C)}function j(C){return!g&&(C===null||C===41||kt(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(C)):g<h&&C===40?(e.consume(C),g++,j):C===41?(e.consume(C),g--,j):C===null||C===32||C===40||tf(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function CE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(S){return e.enter(a),e.enter(l),e.consume(S),e.exit(l),e.enter(o),g}function g(S){return f>999||S===null||S===91||S===93&&!m||S===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):ze(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===null||S===91||S===93||ze(S)||f++>999?(e.exit("chunkString"),g(S)):(e.consume(S),m||(m=!We(S)),S===92?b:y)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,y):y(S)}}function EE(e,t,n,a,l,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),c=b===40?41:b,m):n(b)}function m(b){return b===c?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),m(c)):b===null?n(b):ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),st(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===c||b===null||ze(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?y:g)}function y(b){return b===c||b===92?(e.consume(b),g):g(b)}}function gu(e,t){let n;return a;function a(l){return ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):We(l)?st(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const C9={name:"definition",tokenize:N9},E9={partial:!0,tokenize:_9};function N9(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),c(S)}function c(S){return CE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=Mr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),m):n(S)}function m(S){return kt(S)?gu(e,h)(S):h(S)}function h(S){return jE(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function g(S){return e.attempt(E9,y,y)(S)}function y(S){return We(S)?st(e,b,"whitespace")(S):b(S)}function b(S){return S===null||ze(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function _9(e,t,n){return a;function a(f){return kt(f)?gu(e,l)(f):n(f)}function l(f){return EE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return We(f)?st(e,c,"whitespace")(f):c(f)}function c(f){return f===null||ze(f)?t(f):n(f)}}const A9={name:"hardBreakEscape",tokenize:T9};function T9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const R9={name:"headingAtx",resolve:z9,tokenize:O9};function z9(e,t){let n=e.length-2,a=3,l,o;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&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},or(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function O9(e,t,n){let a=0;return l;function l(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&a++<6?(e.consume(g),c):g===null||kt(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),m(g)):g===null||ze(g)?(e.exit("atxHeading"),t(g)):We(g)?st(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function m(g){return g===35?(e.consume(g),m):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||kt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const D9=["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"],PS=["pre","script","style","textarea"],M9={concrete:!0,name:"htmlFlow",resolveTo:U9,tokenize:P9},L9={partial:!0,tokenize:$9},I9={partial:!0,tokenize:B9};function U9(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 P9(e,t,n){const a=this;let l,o,c,f,m;return h;function h(_){return g(_)}function g(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),y}function y(_){return _===33?(e.consume(_),b):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),l=3,a.interrupt?t:T):On(_)?(e.consume(_),c=String.fromCharCode(_),E):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):On(_)?(e.consume(_),l=4,a.interrupt?t:T):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:T):n(_)}function k(_){const $="CDATA[";return _===$.charCodeAt(f++)?(e.consume(_),f===$.length?a.interrupt?t:X:k):n(_)}function j(_){return On(_)?(e.consume(_),c=String.fromCharCode(_),E):n(_)}function E(_){if(_===null||_===47||_===62||kt(_)){const $=_===47,J=c.toLowerCase();return!$&&!o&&PS.includes(J)?(l=1,a.interrupt?t(_):X(_)):D9.includes(c.toLowerCase())?(l=6,$?(e.consume(_),C):a.interrupt?t(_):X(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?A(_):O(_))}return _===45||En(_)?(e.consume(_),c+=String.fromCharCode(_),E):n(_)}function C(_){return _===62?(e.consume(_),a.interrupt?t:X):n(_)}function A(_){return We(_)?(e.consume(_),A):H(_)}function O(_){return _===47?(e.consume(_),H):_===58||_===95||On(_)?(e.consume(_),L):We(_)?(e.consume(_),O):H(_)}function L(_){return _===45||_===46||_===58||_===95||En(_)?(e.consume(_),L):D(_)}function D(_){return _===61?(e.consume(_),z):We(_)?(e.consume(_),D):O(_)}function z(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,I):We(_)?(e.consume(_),z):F(_)}function I(_){return _===m?(e.consume(_),m=null,ee):_===null||ze(_)?n(_):(e.consume(_),I)}function F(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||kt(_)?D(_):(e.consume(_),F)}function ee(_){return _===47||_===62||We(_)?O(_):n(_)}function H(_){return _===62?(e.consume(_),ne):n(_)}function ne(_){return _===null||ze(_)?X(_):We(_)?(e.consume(_),ne):n(_)}function X(_){return _===45&&l===2?(e.consume(_),Z):_===60&&l===1?(e.consume(_),ae):_===62&&l===4?(e.consume(_),P):_===63&&l===3?(e.consume(_),T):_===93&&l===5?(e.consume(_),he):ze(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(L9,B,be)(_)):_===null||ze(_)?(e.exit("htmlFlowData"),be(_)):(e.consume(_),X)}function be(_){return e.check(I9,fe,B)(_)}function fe(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ie}function ie(_){return _===null||ze(_)?be(_):(e.enter("htmlFlowData"),X(_))}function Z(_){return _===45?(e.consume(_),T):X(_)}function ae(_){return _===47?(e.consume(_),c="",K):X(_)}function K(_){if(_===62){const $=c.toLowerCase();return PS.includes($)?(e.consume(_),P):X(_)}return On(_)&&c.length<8?(e.consume(_),c+=String.fromCharCode(_),K):X(_)}function he(_){return _===93?(e.consume(_),T):X(_)}function T(_){return _===62?(e.consume(_),P):_===45&&l===2?(e.consume(_),T):X(_)}function P(_){return _===null||ze(_)?(e.exit("htmlFlowData"),B(_)):(e.consume(_),P)}function B(_){return e.exit("htmlFlow"),t(_)}}function B9(e,t,n){const a=this;return l;function l(c){return ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function $9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Ku,t,n)}}const F9={name:"htmlText",tokenize:q9};function q9(e,t,n){const a=this;let l,o,c;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),m}function m(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),D):T===63?(e.consume(T),O):On(T)?(e.consume(T),F):n(T)}function h(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),o=0,k):On(T)?(e.consume(T),A):n(T)}function g(T){return T===45?(e.consume(T),S):n(T)}function y(T){return T===null?n(T):T===45?(e.consume(T),b):ze(T)?(c=y,ae(T)):(e.consume(T),y)}function b(T){return T===45?(e.consume(T),S):y(T)}function S(T){return T===62?Z(T):T===45?b(T):y(T)}function k(T){const P="CDATA[";return T===P.charCodeAt(o++)?(e.consume(T),o===P.length?j:k):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),E):ze(T)?(c=j,ae(T)):(e.consume(T),j)}function E(T){return T===93?(e.consume(T),C):j(T)}function C(T){return T===62?Z(T):T===93?(e.consume(T),C):j(T)}function A(T){return T===null||T===62?Z(T):ze(T)?(c=A,ae(T)):(e.consume(T),A)}function O(T){return T===null?n(T):T===63?(e.consume(T),L):ze(T)?(c=O,ae(T)):(e.consume(T),O)}function L(T){return T===62?Z(T):O(T)}function D(T){return On(T)?(e.consume(T),z):n(T)}function z(T){return T===45||En(T)?(e.consume(T),z):I(T)}function I(T){return ze(T)?(c=I,ae(T)):We(T)?(e.consume(T),I):Z(T)}function F(T){return T===45||En(T)?(e.consume(T),F):T===47||T===62||kt(T)?ee(T):n(T)}function ee(T){return T===47?(e.consume(T),Z):T===58||T===95||On(T)?(e.consume(T),H):ze(T)?(c=ee,ae(T)):We(T)?(e.consume(T),ee):Z(T)}function H(T){return T===45||T===46||T===58||T===95||En(T)?(e.consume(T),H):ne(T)}function ne(T){return T===61?(e.consume(T),X):ze(T)?(c=ne,ae(T)):We(T)?(e.consume(T),ne):ee(T)}function X(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,be):ze(T)?(c=X,ae(T)):We(T)?(e.consume(T),X):(e.consume(T),fe)}function be(T){return T===l?(e.consume(T),l=void 0,ie):T===null?n(T):ze(T)?(c=be,ae(T)):(e.consume(T),be)}function fe(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||kt(T)?ee(T):(e.consume(T),fe)}function ie(T){return T===47||T===62||kt(T)?ee(T):n(T)}function Z(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function ae(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return We(T)?st(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):he(T)}function he(T){return e.enter("htmlTextData"),c(T)}}const Fy={name:"labelEnd",resolveAll:Q9,resolveTo:G9,tokenize:K9},H9={tokenize:Y9},Z9={tokenize:X9},V9={tokenize:J9};function Q9(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 l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&or(e,0,e.length,n),e}function G9(e,t){let n=e.length,a=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=jr(f,e.slice(o+1,o+a+3)),f=jr(f,[["enter",g,t]]),f=jr(f,Of(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=jr(f,[["exit",g,t],e[c-2],e[c-1],["exit",h,t]]),f=jr(f,e.slice(c+1)),f=jr(f,[["exit",m,t]]),or(e,o,e.length,f),e}function K9(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?y(b):(c=a.parser.defined.includes(Mr(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):n(b)}function m(b){return b===40?e.attempt(H9,g,c?g:y)(b):b===91?e.attempt(Z9,g,c?h:y)(b):c?g(b):y(b)}function h(b){return e.attempt(V9,g,y)(b)}function g(b){return t(b)}function y(b){return o._balanced=!0,n(b)}}function Y9(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),l}function l(y){return kt(y)?gu(e,o)(y):o(y)}function o(y){return y===41?g(y):jE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function c(y){return kt(y)?gu(e,m)(y):g(y)}function f(y){return n(y)}function m(y){return y===34||y===39||y===40?EE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function h(y){return kt(y)?gu(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 X9(e,t,n){const a=this;return l;function l(f){return CE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Mr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function J9(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const W9={name:"labelStartImage",resolveAll:Fy.resolveAll,tokenize:e8};function e8(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const t8={name:"labelStartLink",resolveAll:Fy.resolveAll,tokenize:n8};function n8(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Ep={name:"lineEnding",tokenize:r8};function r8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),st(e,t,"linePrefix")}}const $d={name:"thematicBreak",tokenize:a8};function a8(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||ze(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),We(h)?st(e,f,"whitespace")(h):f(h))}}const qn={continuation:{tokenize:o8},exit:c8,name:"list",tokenize:s8},i8={partial:!0,tokenize:d8},l8={partial:!0,tokenize:u8};function s8(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(S){const k=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:Mg(S)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check($d,n,h)(S):h(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(S)}return n(S)}function m(S){return Mg(S)&&++c<10?(e.consume(S),m):(!a.interrupt||c<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),h(S)):n(S)}function h(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(Ku,a.interrupt?n:g,e.attempt(i8,b,y))}function g(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function y(S){return We(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):n(S)}function b(S){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(S)}}function o8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Ku,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,st(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!We(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(l8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,st(e,e.attempt(qn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function u8(e,t,n){const a=this;return st(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function c8(e){e.exit(this.containerState.type)}function d8(e,t,n){const a=this;return st(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!We(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const BS={name:"setextUnderline",resolveTo:f8,tokenize:h8};function f8(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function h8(e,t,n){const a=this;let l;return o;function o(h){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"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),We(h)?st(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const m8={tokenize:p8};function p8(e){const t=this,n=e.attempt(Ku,a,e.attempt(this.parser.constructs.flowInitial,l,st(e,e.attempt(this.parser.constructs.flow,l,e.attempt(x9,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const g8={resolveAll:_E()},y8=NE("string"),v8=NE("text");function NE(e){return{resolveAll:_E(e==="text"?b8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(g){return h(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),m}function m(g){return h(g)?(n.exit("data"),o(g)):(n.consume(g),m)}function h(g){if(g===null)return!0;const y=l[g];let b=-1;if(y)for(;++b<y.length;){const S=y[b];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function _E(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function b8(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],l=t.sliceStream(a);let o=l.length,c=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const x8={42:qn,43:qn,45:qn,48:qn,49:qn,50:qn,51:qn,52:qn,53:qn,54:qn,55:qn,56:qn,57:qn,62:xE},S8={91:C9},w8={[-2]:Cp,[-1]:Cp,32:Cp},k8={35:R9,42:$d,45:[BS,$d],60:M9,61:BS,95:$d,96:US,126:US},j8={38:wE,92:SE},C8={[-5]:Ep,[-4]:Ep,[-3]:Ep,33:W9,38:wE,42:Lg,60:[t9,F9],91:t8,92:[A9,SE],93:Fy,95:Lg,96:m9},E8={null:[Lg,g8]},N8={null:[42,95]},_8={null:[]},A8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:N8,contentInitial:S8,disable:_8,document:x8,flow:k8,flowInitial:w8,insideSpan:E8,string:j8,text:C8},Symbol.toStringTag,{value:"Module"}));function T8(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 l={},o=[];let c=[],f=[];const m={attempt:I(D),check:I(z),consume:A,enter:O,exit:L,interrupt:I(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:y};let g=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function y(ne){return c=jr(c,ne),E(),c[c.length-1]!==null?[]:(F(t,0),h.events=Of(o,h.events,h),h.events)}function b(ne,X){return z8(S(ne),X)}function S(ne){return R8(c,ne)}function k(){const{_bufferIndex:ne,_index:X,line:be,column:fe,offset:ie}=a;return{_bufferIndex:ne,_index:X,line:be,column:fe,offset:ie}}function j(ne){l[ne.line]=ne.column,H()}function E(){let ne;for(;a._index<c.length;){const X=c[a._index];if(typeof X=="string")for(ne=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ne&&a._bufferIndex<X.length;)C(X.charCodeAt(a._bufferIndex));else C(X)}}function C(ne){g=g(ne)}function A(ne){ze(ne)?(a.line++,a.column=1,a.offset+=ne===-3?2:1,H()):ne!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ne}function O(ne,X){const be=X||{};return be.type=ne,be.start=k(),h.events.push(["enter",be,h]),f.push(be),be}function L(ne){const X=f.pop();return X.end=k(),h.events.push(["exit",X,h]),X}function D(ne,X){F(ne,X.from)}function z(ne,X){X.restore()}function I(ne,X){return be;function be(fe,ie,Z){let ae,K,he,T;return Array.isArray(fe)?B(fe):"tokenize"in fe?B([fe]):P(fe);function P(ue){return xe;function xe(Le){const Se=Le!==null&&ue[Le],Ct=Le!==null&&ue.null,te=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return B(te)(Le)}}function B(ue){return ae=ue,K=0,ue.length===0?Z:_(ue[K])}function _(ue){return xe;function xe(Le){return T=ee(),he=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?J():ue.tokenize.call(X?Object.assign(Object.create(h),X):h,m,$,J)(Le)}}function $(ue){return ne(he,T),ie}function J(ue){return T.restore(),++K<ae.length?_(ae[K]):Z}}}function F(ne,X){ne.resolveAll&&!o.includes(ne)&&o.push(ne),ne.resolve&&or(h.events,X,h.events.length-X,ne.resolve(h.events.slice(X),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function ee(){const ne=k(),X=h.previous,be=h.currentConstruct,fe=h.events.length,ie=Array.from(f);return{from:fe,restore:Z};function Z(){a=ne,h.previous=X,h.currentConstruct=be,h.events.length=fe,f=ie,H()}}function H(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function R8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function z8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
360
|
-
`;break}case-3:{c=`\r
|
|
361
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function O8(e){const a={constructs:vE([A8,...(e||{}).extensions||[]]),content:l(GP),defined:[],document:l(YP),flow:l(m8),lazy:{},string:l(y8),text:l(v8)};return a;function l(o){return c;function c(f){return T8(a,o,f)}}}function D8(e){for(;!kE(e););return e}const $S=/[\0\t\n\r]/g;function M8(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,g,y,b,S;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),y=0,t="",n&&(o.charCodeAt(0)===65279&&y++,n=void 0);y<o.length;){if($S.lastIndex=y,h=$S.exec(o),b=h&&h.index!==void 0?h.index:o.length,S=o.charCodeAt(b),!h){t=o.slice(y);break}if(S===10&&y===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),y<b&&(m.push(o.slice(y,b)),e+=b-y),S){case 0:{m.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,m.push(-2);e++<g;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}y=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const L8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function I8(e){return e.replace(L8,U8)}function U8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return bE(n.slice(o?2:1),o?16:10)}return $y(n)||e}const AE={}.hasOwnProperty;function P8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),B8(n)(D8(O8(n).document().write(M8()(e,t,!0))))}function B8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Oa),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:o(Ft),blockQuote:o(Ct),characterEscape:ee,characterReference:ee,codeFenced:o(te),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(te,c),codeText:o(Te,c),codeTextData:ee,data:ee,codeFlowValue:ee,definition:o(Ue),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Fe),hardBreakEscape:o(un),hardBreakTrailing:o(un),htmlFlow:o(za,c),htmlFlowData:ee,htmlText:o(za,c),htmlTextData:ee,image:o(_l),label:c,link:o(Oa),listItem:o(Jr),listItemValue:b,listOrdered:o(Da,y),listUnordered:o(Da),paragraph:o(io),reference:_,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Ft),strong:o(lo),thematicBreak:o(so)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:Se,autolinkProtocol:Le,blockQuote:m(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ue,characterReference:xe,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:H,codeIndented:m(C),codeText:m(ie),codeTextData:H,data:H,definition:m(),definitionDestinationString:L,definitionLabelString:A,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(X),hardBreakTrailing:m(X),htmlFlow:m(be),htmlFlowData:H,htmlText:m(fe),htmlTextData:H,image:m(ae),label:he,labelText:K,lineEnding:ne,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:$,resourceDestinationString:T,resourceTitleString:P,resource:B,setextHeading:m(F),setextHeadingLineSequence:I,setextHeadingText:z,strong:m(),thematicBreak:m()}};TE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let ye={type:"root",children:[]};const Me={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:g,data:n},Pe=[];let nt=-1;for(;++nt<le.length;)if(le[nt][1].type==="listOrdered"||le[nt][1].type==="listUnordered")if(le[nt][0]==="enter")Pe.push(nt);else{const dn=Pe.pop();nt=l(le,dn,nt)}for(nt=-1;++nt<le.length;){const dn=t[le[nt][0]];AE.call(dn,le[nt][1].type)&&dn[le[nt][1].type].call(Object.assign({sliceSerialize:le[nt][2].sliceSerialize},Me),le[nt][1])}if(Me.tokenStack.length>0){const dn=Me.tokenStack[Me.tokenStack.length-1];(dn[1]||FS).call(Me,void 0,dn[0])}for(ye.position={start:oi(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:oi(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)ye=t.transforms[nt](ye)||ye;return ye}function l(le,ye,Me){let Pe=ye-1,nt=-1,dn=!1,cr,en,qt,fn;for(;++Pe<=Me;){const dt=le[Pe];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?nt++:nt--,fn=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(cr&&!fn&&!nt&&!qt&&(qt=Pe),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!nt&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||nt===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(cr){let Tr=Pe;for(en=void 0;Tr--;){const Mn=le[Tr];if(Mn[1].type==="lineEnding"||Mn[1].type==="lineEndingBlank"){if(Mn[0]==="exit")continue;en&&(le[en][1].type="lineEndingBlank",dn=!0),Mn[1].type="lineEnding",en=Tr}else if(!(Mn[1].type==="linePrefix"||Mn[1].type==="blockQuotePrefix"||Mn[1].type==="blockQuotePrefixWhitespace"||Mn[1].type==="blockQuoteMarker"||Mn[1].type==="listItemIndent"))break}qt&&(!en||qt<en)&&(cr._spread=!0),cr.end=Object.assign({},en?le[en][1].start:dt[1].end),le.splice(en||Pe,0,["exit",cr,dt[2]]),Pe++,Me++}if(dt[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};cr=Tr,le.splice(Pe,0,["enter",Tr,dt[2]]),Pe++,Me++,qt=void 0,fn=!0}}}return le[ye][1]._spread=dn,Me}function o(le,ye){return Me;function Me(Pe){f.call(this,le(Pe),Pe),ye&&ye.call(this,Pe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(le,ye,Me){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Me||void 0]),le.position={start:oi(ye.start),end:void 0}}function m(le){return ye;function ye(Me){le&&le.call(this,Me),h.call(this,Me)}}function h(le,ye){const Me=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==le.type&&(ye?ye.call(this,le,Pe[0]):(Pe[1]||FS).call(this,le,Pe[0]));else throw new Error("Cannot close `"+le.type+"` ("+pu({start:le.start,end:le.end})+"): it’s not open");Me.position.end=oi(le.end)}function g(){return By(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(le){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function S(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=le}function k(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=le}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/(\r?\n|\r)$/g,"")}function A(le){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Mr(this.sliceSerialize(le)).toLowerCase()}function O(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function L(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function D(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Me=this.sliceSerialize(le).length;ye.depth=Me}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function I(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(le){const Me=this.stack[this.stack.length-1].children;let Pe=Me[Me.length-1];(!Pe||Pe.type!=="text")&&(Pe=cn(),Pe.position={start:oi(le.start),end:void 0},Me.push(Pe)),this.stack.push(Pe)}function H(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=oi(le.end)}function ne(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=ye.children[ye.children.length-1];Me.position.end=oi(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(ee.call(this,le),H.call(this,le))}function X(){this.data.atHardBreak=!0}function be(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function fe(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function ie(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function Z(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function ae(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function K(le){const ye=this.sliceSerialize(le),Me=this.stack[this.stack.length-2];Me.label=I8(ye),Me.identifier=Mr(ye).toLowerCase()}function he(){const le=this.stack[this.stack.length-1],ye=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Pe=le.children;Me.children=Pe}else Me.alt=ye}function T(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function P(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function B(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function $(le){const ye=this.resume(),Me=this.stack[this.stack.length-1];Me.label=ye,Me.identifier=Mr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function J(le){this.data.characterReferenceType=le.type}function ue(le){const ye=this.sliceSerialize(le),Me=this.data.characterReferenceType;let Pe;Me?(Pe=bE(ye,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=$y(ye);const nt=this.stack[this.stack.length-1];nt.value+=Pe}function xe(le){const ye=this.stack.pop();ye.position.end=oi(le.end)}function Le(le){H.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function Se(le){H.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function Ct(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function Ft(){return{type:"heading",depth:0,children:[]}}function un(){return{type:"break"}}function za(){return{type:"html",value:""}}function _l(){return{type:"image",title:null,url:"",alt:null}}function Oa(){return{type:"link",title:null,url:"",children:[]}}function Da(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Jr(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function io(){return{type:"paragraph",children:[]}}function lo(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function so(){return{type:"thematicBreak"}}}function oi(e){return{line:e.line,column:e.column,offset:e.offset}}function TE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?TE(e,a):$8(e,a)}}function $8(e,t){let n;for(n in t)if(AE.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 FS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pu({start:t.start,end:t.end})+") is still open")}function F8(e){const t=this;t.parser=n;function n(a){return P8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function q8(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 H8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
362
|
-
`}]}function Z8(e,t){const n=t.value?t.value+`
|
|
363
|
-
`:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function V8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G8(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=ao(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function K8(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 Y8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function RE(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 l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function X8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return RE(e,t);const l={src:ao(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function J8(e,t){const n={src:ao(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 W8(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 eB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return RE(e,t);const l={href:ao(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function tB(e,t){const n={href:ao(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 nB(e,t,n){const a=e.all(t),l=n?rB(n):zE(t),o={},c=[];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:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(l||f!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
|
|
364
|
-
`}),g.type==="element"&&g.tagName==="p"&&!l?c.push(...g.children):c.push(g)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
365
|
-
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function rB(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=zE(n[a])}return t}function zE(e){const t=e.spread;return t??e.children.length>1}function aB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function iB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function sB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Ly(t.children[1]),m=dE(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function uB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const y=t.children[m],b={},S=c?c[m]:void 0;S&&(b.align=S);let k={type:"element",tagName:o,properties:b,children:[]};y&&(k.children=e.all(y),e.patch(y,k),k=e.applyData(y,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function cB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const qS=9,HS=32;function dB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(ZS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(ZS(t.slice(l),l>0,!1)),o.join("")}function ZS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===qS||o===HS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===qS||o===HS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function fB(e,t){const n={type:"text",value:dB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function hB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const mB={blockquote:q8,break:H8,code:Z8,delete:V8,emphasis:Q8,footnoteReference:G8,heading:K8,html:Y8,imageReference:X8,image:J8,inlineCode:W8,linkReference:eB,link:tB,listItem:nB,list:aB,paragraph:iB,root:lB,strong:sB,table:oB,tableCell:cB,tableRow:uB,text:fB,thematicBreak:hB,toml:Nd,yaml:Nd,definition:Nd,footnoteDefinition:Nd};function Nd(){}const OE=-1,Df=0,yu=1,nf=2,qy=3,Hy=4,Zy=5,Vy=6,DE=7,ME=8,VS=typeof self=="object"?self:globalThis,pB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case Df:case OE:return n(c,l);case yu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case nf:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case qy:return n(new Date(c),l);case Hy:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case Zy:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case Vy:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case DE:{const{name:f,message:m}=c;return n(new VS[f](m),l)}case ME:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new VS[o](c),l)};return a},QS=e=>pB(new Map,e)(0),ys="",{toString:gB}={},{keys:yB}=Object,ou=e=>{const t=typeof e;if(t!=="object"||!e)return[Df,t];const n=gB.call(e).slice(8,-1);switch(n){case"Array":return[yu,ys];case"Object":return[nf,ys];case"Date":return[qy,ys];case"RegExp":return[Hy,ys];case"Map":return[Zy,ys];case"Set":return[Vy,ys];case"DataView":return[yu,n]}return n.includes("Array")?[yu,n]:n.includes("Error")?[DE,n]:[nf,n]},_d=([e,t])=>e===Df&&(t==="function"||t==="symbol"),vB=(e,t,n,a)=>{const l=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=ou(c);switch(f){case Df:{let g=c;switch(m){case"bigint":f=ME,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);g=null;break;case"undefined":return l([OE],c)}return l([f,g],c)}case yu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const g=[],y=l([f,g],c);for(const b of c)g.push(o(b));return y}case nf:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const g=[],y=l([f,g],c);for(const b of yB(c))(e||!_d(ou(c[b])))&&g.push([o(b),o(c[b])]);return y}case qy:return l([f,c.toISOString()],c);case Hy:{const{source:g,flags:y}=c;return l([f,{source:g,flags:y}],c)}case Zy:{const g=[],y=l([f,g],c);for(const[b,S]of c)(e||!(_d(ou(b))||_d(ou(S))))&&g.push([o(b),o(S)]);return y}case Vy:{const g=[],y=l([f,g],c);for(const b of c)(e||!_d(ou(b)))&&g.push(o(b));return y}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},GS=(e,{json:t,lossy:n}={})=>{const a=[];return vB(!(t||n),!!t,new Map,a)(e),a},rf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?QS(GS(e,t)):structuredClone(e):(e,t)=>QS(GS(e,t));function bB(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 xB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function SB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||bB,a=e.options.footnoteBackLabel||xB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const g=e.all(h),y=String(h.identifier).toUpperCase(),b=ao(y.toLowerCase());let S=0;const k=[],j=e.footnoteCounts.get(y);for(;j!==void 0&&++S<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,S);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,S),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else g.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(g,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...rf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
366
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
367
|
-
`}]}}const Mf=(function(e){if(e==null)return CB;if(typeof e=="function")return Lf(e);if(typeof e=="object")return Array.isArray(e)?wB(e):kB(e);if(typeof e=="string")return jB(e);throw new Error("Expected function, string, or object as test")});function wB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Mf(e[n]);return Lf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function kB(e){const t=e;return Lf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function jB(e){return Lf(t);function t(n){return n&&n.type===e}}function Lf(e){return t;function t(n,a,l){return!!(EB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function CB(){return!0}function EB(e){return e!==null&&typeof e=="object"&&"type"in e}const LE=[],NB=!0,Ig=!1,_B="skip";function IE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Mf(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,g){const y=m&&typeof m=="object"?m:{};if(typeof y.type=="string"){const S=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=LE,k,j,E;if((!t||o(m,h,g[g.length-1]||void 0))&&(S=AB(n(m,g)),S[0]===Ig))return S;if("children"in m&&m.children){const C=m;if(C.children&&S[0]!==_B)for(j=(a?C.children.length:-1)+c,E=g.concat(C);j>-1&&j<C.children.length;){const A=C.children[j];if(k=f(A,j,E)(),k[0]===Ig)return k;j=typeof k[1]=="number"?k[1]:j+c}}return S}}}function AB(e){return Array.isArray(e)?e:typeof e=="number"?[NB,e]:e==null?LE:[e]}function Qy(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),IE(e,o,f,l);function f(m,h){const g=h[h.length-1],y=g?g.children.indexOf(m):void 0;return c(m,y,g)}}const Ug={}.hasOwnProperty,TB={};function RB(e,t){const n=t||TB,a=new Map,l=new Map,o=new Map,c={...mB,...n.handlers},f={all:h,applyData:OB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:zB,wrap:MB};return Qy(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:l,b=String(g.identifier).toUpperCase();y.has(b)||y.set(b,g)}}),f;function m(g,y){const b=g.type,S=f.handlers[b];if(Ug.call(f.handlers,b)&&S)return S(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in g){const{children:j,...E}=g,C=rf(E);return C.children=f.all(g),C}return rf(g)}return(f.options.unknownHandler||DB)(f,g,y)}function h(g){const y=[];if("children"in g){const b=g.children;let S=-1;for(;++S<b.length;){const k=f.one(b[S],g);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=KS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=KS(j.value))}Array.isArray(k)?y.push(...k):y.push(k)}}}return y}}function zB(e,t){e.position&&(t.position=xP(e))}function OB(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,rf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function DB(e,t){const n=t.data||{},a="value"in t&&!(Ug.call(n,"hProperties")||Ug.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 MB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
368
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
369
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
370
|
-
`}),n}function KS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function YS(e,t){const n=RB(e,t),a=n.one(e,void 0),l=SB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
371
|
-
`},l),o}function LB(e,t){return e&&"run"in e?async function(n,a){const l=YS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return YS(n,{file:a,...e||t})}}function XS(e){if(e)throw e}var Np,JS;function IB(){if(JS)return Np;JS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!y)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},c=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(a)return a(h,g).value}else return;return h[g]};return Np=function m(){var h,g,y,b,S,k,j=arguments[0],E=1,C=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(g in h)y=f(j,g),b=f(h,g),j!==b&&(A&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=y&&l(y)?y:[]):k=y&&o(y)?y:{},c(j,{name:g,newValue:m(A,k,b)})):typeof b<"u"&&c(j,{name:g,newValue:b}));return j},Np}var UB=IB();const _p=lf(UB);function Pg(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 PB(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...h){const g=e[++o];let y=-1;if(m){c(m);return}for(;++y<l.length;)(h[y]===null||h[y]===void 0)&&(h[y]=l[y]);l=h,g?BB(g,f)(...h):c(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function BB(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}catch(h){const g=h;if(f&&n)throw g;return l(g)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Fr={basename:$B,dirname:FB,extname:qB,join:HB,sep:"/"};function $B(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function FB(e){if(Yu(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 qB(e){Yu(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function HB(...e){let t=-1,n;for(;++t<e.length;)Yu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ZB(n)}function ZB(e){Yu(e);const t=e.codePointAt(0)===47;let n=VB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function VB(e,t){let n="",a=0,l=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function Yu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QB={cwd:GB};function GB(){return"/"}function Bg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function KB(e){if(typeof e=="string")e=new URL(e);else if(!Bg(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 YB(e)}function YB(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 l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Ap=["history","path","basename","stem","extname","dirname"];class UE{constructor(t){let n;t?Bg(t)?n={path:t}:typeof t=="string"||XB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":QB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ap.length;){const o=Ap[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Ap.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Fr.basename(this.path):void 0}set basename(t){Rp(t,"basename"),Tp(t,"basename"),this.path=Fr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Fr.dirname(this.path):void 0}set dirname(t){WS(this.basename,"dirname"),this.path=Fr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Fr.extname(this.path):void 0}set extname(t){if(Tp(t,"extname"),WS(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=Fr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bg(t)&&(t=KB(t)),Rp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Fr.basename(this.path,this.extname):void 0}set stem(t){Rp(t,"stem"),Tp(t,"stem"),this.path=Fr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new An(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Tp(e,t){if(e&&e.includes(Fr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Fr.sep+"`")}function Rp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function WS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function XB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JB=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),WB={}.hasOwnProperty;class Gy extends JB{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=PB()}copy(){const t=new Gy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(_p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Dp("data",this.frozen),this.namespace[t]=n,this):WB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Dp("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 l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ad(t),a=this.parser||this.Parser;return zp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zp("process",this.parser||this.Parser),Op("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=Ad(t),m=a.parse(f);a.run(m,f,function(g,y,b){if(g||!y||!b)return h(g);const S=y,k=a.stringify(S,b);n$(k)?b.value=k:b.result=k,h(g,b)});function h(g,y){g||!y?c(g):o?o(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),zp("processSync",this.parser||this.Parser),Op("processSync",this.compiler||this.Compiler),this.process(t,l),tw("processSync","process",n),a;function l(o,c){n=!0,XS(o),a=c}}run(t,n,a){ew(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const m=Ad(n);l.run(t,m,h);function h(g,y,b){const S=y||t;g?f(g):c?c(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),tw("runSync","run",a),l;function o(c,f){XS(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Ad(n),l=this.compiler||this.Compiler;return Op("stringify",l),ew(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Dp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...y]=h;m(g,y)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(l.settings=_p(!0,l.settings,h.settings))}function f(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const y=h[g];o(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,g){let y=-1,b=-1;for(;++y<a.length;)if(a[y][0]===h){b=y;break}if(b===-1)a.push([h,...g]);else if(g.length>0){let[S,...k]=g;const j=a[b][1];Pg(j)&&Pg(S)&&(S=_p(!0,j,S)),a[b]=[h,S,...k]}}}}const e$=new Gy().freeze();function zp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Op(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Dp(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 ew(e){if(!Pg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ad(e){return t$(e)?e:new UE(e)}function t$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function n$(e){return typeof e=="string"||r$(e)}function r$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const a$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nw=[],rw={allowDangerousHtml:!0},i$=/^(https?|ircs?|mailto|xmpp)$/i,l$=[{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 s$(e){const t=o$(e),n=u$(e);return c$(t.runSync(t.parse(n),n),e)}function o$(e){const t=e.rehypePlugins||nw,n=e.remarkPlugins||nw,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rw}:rw;return e$().use(F8).use(n).use(LB,a).use(t)}function u$(e){const t=e.children||"",n=new UE;return typeof t=="string"&&(n.value=t),n}function c$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||d$;for(const g of l$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+a$+g.id,void 0);return Qy(e,h),CP(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(g,y,b){if(g.type==="raw"&&b&&typeof y=="number")return c?b.children.splice(y,1):b.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let S;for(S in jp)if(Object.hasOwn(jp,S)&&Object.hasOwn(g.properties,S)){const k=g.properties[S],j=jp[S];(j===null||j.includes(g.tagName))&&(g.properties[S]=m(String(k||""),S,g))}}if(g.type==="element"){let S=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!S&&a&&typeof y=="number"&&(S=!a(g,y,b)),S&&b&&typeof y=="number")return f&&g.children?b.children.splice(y,1,...g.children):b.children.splice(y,1),y}}}function d$(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||i$.test(e.slice(0,t))?e:""}function f$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function PE(e,t,n){const l=Mf((n||{}).ignore||[]),o=h$(t);let c=-1;for(;++c<o.length;)IE(e,"text",f);function f(h,g){let y=-1,b;for(;++y<g.length;){const S=g[y],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return m(h,g)}function m(h,g){const y=g[g.length-1],b=o[c][0],S=o[c][1];let k=0;const E=y.children.indexOf(h);let C=!1,A=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const L=O.index,D={index:O.index,input:O.input,stack:[...g,h]};let z=S(...O,D);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=L+1:(k!==L&&A.push({type:"text",value:h.value.slice(k,L)}),Array.isArray(z)?A.push(...z):z&&A.push(z),k=L+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),y.children.splice(E,1,...A)):A=[h],E+A.length}}function h$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([m$(l[0]),p$(l[1])])}return t}function m$(e){return typeof e=="string"?new RegExp(f$(e),"g"):e}function p$(e){return typeof e=="function"?e:function(){return e}}function g$(e){PE(e,[/\r?\n|\r/g,y$])}function y$(){return{type:"break"}}function v$(){return function(e){g$(e)}}function aw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}const Mp="phrasing",Lp=["autolink","link","image","label"];function b$(){return{transforms:[E$],enter:{literalAutolink:S$,literalAutolinkEmail:Ip,literalAutolinkHttp:Ip,literalAutolinkWww:Ip},exit:{literalAutolink:C$,literalAutolinkEmail:j$,literalAutolinkHttp:w$,literalAutolinkWww:k$}}}function x$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Lp},{character:":",before:"[ps]",after:"\\/",inConstruct:Mp,notInConstruct:Lp}]}}function S$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ip(e){this.config.enter.autolinkProtocol.call(this,e)}function w$(e){this.config.exit.autolinkProtocol.call(this,e)}function k$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function j$(e){this.config.exit.autolinkEmail.call(this,e)}function C$(e){this.exit(e)}function E$(e){PE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,N$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_$]],{ignore:["link","linkReference"]})}function N$(e,t,n,a,l){let o="";if(!BE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!A$(n)))return!1;const c=T$(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function _$(e,t,n,a){return!BE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function A$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function T$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=aw(e,"(");let o=aw(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function BE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Sl(n)||zf(n))&&(!t||n!==47)}$E.peek=P$;function R$(){this.buffer()}function z$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function O$(){this.buffer()}function D$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function M$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L$(e){this.exit(e)}function I$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function U$(e){this.exit(e)}function P$(){return"["}function $E(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function B$(){return{enter:{gfmFootnoteCallString:R$,gfmFootnoteCall:z$,gfmFootnoteDefinitionLabelString:O$,gfmFootnoteDefinition:D$},exit:{gfmFootnoteCallString:M$,gfmFootnoteCall:L$,gfmFootnoteDefinitionLabelString:I$,gfmFootnoteDefinition:U$}}}function $$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$E},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),g=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),g(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
372
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?FE:F$))),h(),m}}function F$(e,t,n){return t===0?e:FE(e,t,n)}function FE(e,t,n){return(n?"":" ")+e}const q$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qE.peek=G$;function H$(){return{canContainEols:["delete"],enter:{strikethrough:V$},exit:{strikethrough:Q$}}}function Z$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:q$}],handlers:{delete:qE}}}function V$(e){this.enter({type:"delete",children:[]},e)}function Q$(e){this.exit(e)}function qE(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function G$(){return"~"}function K$(e){return e.length}function Y$(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||K$,o=[],c=[],f=[],m=[];let h=0,g=-1;for(;++g<e.length;){const j=[],E=[];let C=-1;for(e[g].length>h&&(h=e[g].length);++C<e[g].length;){const A=X$(e[g][C]);if(n.alignDelimiters!==!1){const O=l(A);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(A)}c[g]=j,f[g]=E}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<h;)o[y]=iw(a[y]);else{const j=iw(a);for(;++y<h;)o[y]=j}y=-1;const b=[],S=[];for(;++y<h;){const j=o[y];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[y]-E.length-C.length);const O=E+"-".repeat(A)+C;n.alignDelimiters!==!1&&(A=E.length+A+C.length,A>m[y]&&(m[y]=A),S[y]=A),b[y]=O}c.splice(1,0,b),f.splice(1,0,S),g=-1;const k=[];for(;++g<c.length;){const j=c[g],E=f[g];y=-1;const C=[];for(;++y<h;){const A=j[y]||"";let O="",L="";if(n.alignDelimiters!==!1){const D=m[y]-(E[y]||0),z=o[y];z===114?O=" ".repeat(D):z===99?D%2?(O=" ".repeat(D/2+.5),L=" ".repeat(D/2-.5)):(O=" ".repeat(D/2),L=O):L=" ".repeat(D)}n.delimiterStart!==!1&&!y&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||y)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(A),n.alignDelimiters!==!1&&C.push(L),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||y!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
373
|
-
`)}function X$(e){return e==null?"":String(e)}function iw(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function J$(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),W$);return l(),c}function W$(e,t,n){return">"+(n?"":" ")+e}function eF(e,t){return lw(e,t.inConstruct,!0)&&!lw(e,t.notInConstruct,!1)}function lw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function sw(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
374
|
-
`&&eF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
375
|
-
`}function tF(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function nF(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rF(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function aF(e,t,n,a){const l=rF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(nF(e,n)){const y=n.enter("codeIndented"),b=n.indentLines(o,iF);return y(),b}const f=n.createTracker(a),m=l.repeat(Math.max(tF(o,l)+1,3)),h=n.enter("codeFenced");let g=f.move(m);if(e.lang){const y=n.enter(`codeFencedLang${c}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=n.enter(`codeFencedMeta${c}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
|
|
376
|
-
`,encode:["`"],...f.current()})),y()}return g+=f.move(`
|
|
377
|
-
`),o&&(g+=f.move(o+`
|
|
378
|
-
`)),g+=f.move(m),h(),g}function iF(e,t,n){return(n?"":" ")+e}function Ky(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function lF(e,t,n,a){const l=Ky(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
379
|
-
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),c(),h}function sF(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Tu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function af(e,t,n){const a=Ys(e),l=Ys(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}HE.peek=oF;function HE(e,t,n,a){const l=sF(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),g=af(a.before.charCodeAt(a.before.length-1),h,l);g.inside&&(m=Tu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),b=af(a.after.charCodeAt(0),y,l);b.inside&&(m=m.slice(0,-1)+Tu(y));const S=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+m+S}function oF(e,t,n){return n.options.emphasis||"*"}function uF(e,t){let n=!1;return Qy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Ig}),!!((!e.depth||e.depth<3)&&By(e)&&(t.options.setext||n))}function cF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(uF(e,n)){const g=n.enter("headingSetext"),y=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
380
|
-
`,after:`
|
|
381
|
-
`});return y(),g(),b+`
|
|
382
|
-
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
383
|
-
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
384
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=Tu(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}ZE.peek=dF;function ZE(e){return e.value||""}function dF(){return"<"}VE.peek=fF;function VE(e,t,n,a){const l=Ky(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),c(),h}function fF(){return"!"}QE.peek=hF;function QE(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const y=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=g,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function hF(){return"!"}GE.peek=mF;function GE(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function mF(){return"`"}function KE(e,t){const n=By(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}YE.peek=pF;function YE(e,t,n,a){const l=Ky(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(KE(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let y=c.move("<");return y+=c.move(n.containerPhrasing(e,{before:y,after:">",...c.current()})),y+=c.move(">"),f(),n.stack=g,y}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(n.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),m()),h+=c.move(")"),f(),h}function pF(e,t,n){return KE(e,n)?"<":"["}XE.peek=gF;function XE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const y=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=g,o(),l==="full"||!h||h!==y?m+=f.move(y+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function gF(){return"["}function Yy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yF(e){const t=Yy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function vF(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function JE(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function bF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?vF(n):Yy(n);const f=e.ordered?c==="."?")":".":yF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),JE(n)===c&&g){let y=-1;for(;++y<e.children.length;){const b=e.children[y];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),h}function xF(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function SF(e,t,n,a){const l=xF(n);let o=n.bulletCurrent||Yy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),g);return m(),h;function g(y,b,S){return b?(S?"":" ".repeat(c))+y:(S?o:o+" ".repeat(c-o.length))+y}}function wF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const kF=Mf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function jF(e,t,n,a){return(e.children.some(function(c){return kF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function CF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}WE.peek=EF;function WE(e,t,n,a){const l=CF(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),g=af(a.before.charCodeAt(a.before.length-1),h,l);g.inside&&(m=Tu(h)+m.slice(1));const y=m.charCodeAt(m.length-1),b=af(a.after.charCodeAt(0),y,l);b.inside&&(m=m.slice(0,-1)+Tu(y));const S=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},f+m+S}function EF(e,t,n){return n.options.strong||"*"}function NF(e,t,n,a){return n.safe(e.value,a)}function _F(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function AF(e,t,n){const a=(JE(n)+(n.options.ruleSpaces?" ":"")).repeat(_F(n));return n.options.ruleSpaces?a.slice(0,-1):a}const eN={blockquote:J$,break:sw,code:aF,definition:lF,emphasis:HE,hardBreak:sw,heading:cF,html:ZE,image:VE,imageReference:QE,inlineCode:GE,link:YE,linkReference:XE,list:bF,listItem:SF,paragraph:wF,root:jF,strong:WE,text:NF,thematicBreak:AF};function TF(){return{enter:{table:RF,tableData:ow,tableHeader:ow,tableRow:OF},exit:{codeText:DF,table:zF,tableData:Up,tableHeader:Up,tableRow:Up}}}function RF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function zF(e){this.exit(e),this.data.inTable=void 0}function OF(e){this.enter({type:"tableRow",children:[]},e)}function Up(e){this.exit(e)}function ow(e){this.enter({type:"tableCell",children:[]},e)}function DF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,MF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function MF(e,t){return t==="|"?t:e}function LF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
385
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:m,tableRow:f}};function c(S,k,j,E){return h(g(S,j,E),S.align)}function f(S,k,j,E){const C=y(S,j,E),A=h([C]);return A.slice(0,A.indexOf(`
|
|
386
|
-
`))}function m(S,k,j,E){const C=j.enter("tableCell"),A=j.enter("phrasing"),O=j.containerPhrasing(S,{...E,before:o,after:o});return A(),C(),O}function h(S,k){return Y$(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function g(S,k,j){const E=S.children;let C=-1;const A=[],O=k.enter("table");for(;++C<E.length;)A[C]=y(E[C],k,j);return O(),A}function y(S,k,j){const E=S.children;let C=-1;const A=[],O=k.enter("tableRow");for(;++C<E.length;)A[C]=m(E[C],S,k,j);return O(),A}function b(S,k,j){let E=eN.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function IF(){return{exit:{taskListCheckValueChecked:uw,taskListCheckValueUnchecked:uw,paragraph:PF}}}function UF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BF}}}function uw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function PF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function BF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=eN.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(g){return g+c}}function $F(){return[b$(),B$(),H$(),TF(),IF()]}function FF(e){return{extensions:[x$(),$$(e),Z$(),LF(e),UF()]}}const qF={tokenize:KF,partial:!0},tN={tokenize:YF,partial:!0},nN={tokenize:XF,partial:!0},rN={tokenize:JF,partial:!0},HF={tokenize:WF,partial:!0},aN={name:"wwwAutolink",tokenize:QF,previous:lN},iN={name:"protocolAutolink",tokenize:GF,previous:sN},Ra={name:"emailAutolink",tokenize:VF,previous:oN},Xr={};function ZF(){return{text:Xr}}let rl=48;for(;rl<123;)Xr[rl]=Ra,rl++,rl===58?rl=65:rl===91&&(rl=97);Xr[43]=Ra;Xr[45]=Ra;Xr[46]=Ra;Xr[95]=Ra;Xr[72]=[Ra,iN];Xr[104]=[Ra,iN];Xr[87]=[Ra,aN];Xr[119]=[Ra,aN];function VF(e,t,n){const a=this;let l,o;return c;function c(y){return!$g(y)||!oN.call(a,a.previous)||Xy(a.events)?n(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return $g(y)?(e.consume(y),f):y===64?(e.consume(y),m):n(y)}function m(y){return y===46?e.check(HF,g,h)(y):y===45||y===95||En(y)?(o=!0,e.consume(y),m):g(y)}function h(y){return e.consume(y),l=!0,m}function g(y){return o&&l&&On(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):n(y)}}function QF(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!lN.call(a,a.previous)||Xy(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qF,e.attempt(tN,e.attempt(nN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function GF(e,t,n){const a=this;let l="",o=!1;return c;function c(y){return(y===72||y===104)&&sN.call(a,a.previous)&&!Xy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(y),e.consume(y),f):n(y)}function f(y){if(On(y)&&l.length<5)return l+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(y),m}return n(y)}function m(y){return y===47?(e.consume(y),o?h:(o=!0,m)):n(y)}function h(y){return y===null||tf(y)||kt(y)||Sl(y)||zf(y)?n(y):e.attempt(tN,e.attempt(nN,g),n)(y)}function g(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function KF(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function YF(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(rN,m,f)(h):h===null||kt(h)||Sl(h)||h!==45&&zf(h)?m(h):(o=!0,e.consume(h),c)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),c}function m(h){return l||a||!o?n(h):t(h)}}function XF(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(rN,t,o)(c):c===null||kt(c)||Sl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function JF(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||kt(f)||Sl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||kt(f)||Sl(f)?t(f):a(f)}function o(f){return On(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):On(f)?(e.consume(f),c):n(f)}}function WF(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return En(o)?n(o):t(o)}}function lN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kt(e)}function sN(e){return!On(e)}function oN(e){return!(e===47||$g(e))}function $g(e){return e===43||e===45||e===46||e===95||En(e)}function Xy(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const eq={tokenize:oq,partial:!0};function tq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iq,continuation:{tokenize:lq},exit:sq}},text:{91:{name:"gfmFootnoteCall",tokenize:aq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nq,resolveTo:rq}}}}function nq(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!c||!c._balanced)return n(m);const h=Mr(a.sliceSerialize({start:c.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function rq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function aq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),m}function m(y){return y!==94?n(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(y){if(o>999||y===93&&!c||y===null||y===91||kt(y))return n(y);if(y===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Mr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(y)}return kt(y)||(c=!0),o++,e.consume(y),y===92?g:h}function g(y){return y===91||y===92||y===93?(e.consume(y),o++,h):h(y)}}function iq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(k)}function g(k){if(c>999||k===93&&!f||k===null||k===91||kt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Mr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return kt(k)||(f=!0),c++,e.consume(k),k===92?y:g}function y(k){return k===91||k===92||k===93?(e.consume(k),c++,g):g(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),st(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function lq(e,t,n){return e.check(Ku,t,e.attempt(eq,t,n))}function sq(e){e.exit("gfmFootnoteDefinition")}function oq(e,t,n){const a=this;return st(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function uq(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},y={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",g,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",y,f]],S=f.parser.constructs.insideSpan.null;S&&or(b,b.length,0,Of(S,c.slice(h+1,m),f)),or(b,b.length,0,[["exit",y,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",g,f]]),or(c,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,f,m){const h=this.previous,g=this.events;let y=0;return b;function b(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const j=Ys(h);if(k===126)return y>1?m(k):(c.consume(k),y++,S);if(y<2&&!n)return m(k);const E=c.exit("strikethroughSequenceTemporary"),C=Ys(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class cq{constructor(){this.map=[]}add(t,n,a){dq(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function dq(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function fq(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function hq(){return{flow:{null:{name:"table",tokenize:mq,resolveAll:pq}}}}function mq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(H){let ne=a.events.length-1;for(;ne>-1;){const fe=a.events[ne][1].type;if(fe==="lineEnding"||fe==="linePrefix")ne--;else break}const X=ne>-1?a.events[ne][1].type:null,be=X==="tableHead"||X==="tableRow"?z:m;return be===z&&a.parser.lazy[a.now().line]?n(H):be(H)}function m(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(H){return H===124||(c=!0,o+=1),g(H)}function g(H){return H===null?n(H):ze(H)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),S):n(H):We(H)?st(e,g,"whitespace")(H):(o+=1,c&&(c=!1,l+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),y(H)))}function y(H){return H===null||H===124||kt(H)?(e.exit("data"),g(H)):(e.consume(H),H===92?b:y)}function b(H){return H===92||H===124?(e.consume(H),y):y(H)}function S(H){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(H):(e.enter("tableDelimiterRow"),c=!1,We(H)?st(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):k(H))}function k(H){return H===45||H===58?E(H):H===124?(c=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),j):D(H)}function j(H){return We(H)?st(e,E,"whitespace")(H):E(H)}function E(H){return H===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),C):H===45?(o+=1,C(H)):H===null||ze(H)?L(H):D(H)}function C(H){return H===45?(e.enter("tableDelimiterFiller"),A(H)):D(H)}function A(H){return H===45?(e.consume(H),A):H===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(H))}function O(H){return We(H)?st(e,L,"whitespace")(H):L(H)}function L(H){return H===124?k(H):H===null||ze(H)?!c||l!==o?D(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):D(H)}function D(H){return n(H)}function z(H){return e.enter("tableRow"),I(H)}function I(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),I):H===null||ze(H)?(e.exit("tableRow"),t(H)):We(H)?st(e,I,"whitespace")(H):(e.enter("data"),F(H))}function F(H){return H===null||H===124||kt(H)?(e.exit("data"),I(H)):(e.consume(H),H===92?ee:F)}function ee(H){return H===92||H===124?(e.consume(H),F):F(H)}}function pq(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,g,y;const b=new cq;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(cw(b,t,m,h,g),g=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,y=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",g,t]])),l=k.type==="tableDelimiterRow"?2:g?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],y=Td(b,t,o,l,void 0,y),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],y=Td(b,t,o,l,void 0,y)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],y=Td(b,t,o,l,n,y)):c[1]!==0&&(y=Td(b,t,c,l,n,y)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&cw(b,t,m,h,g),b.consume(t.events),n=-1;++n<t.events.length;){const S=t.events[n];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=fq(t.events,n))}return e}function Td(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},Ss(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=Ss(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=Ss(t.events,n[2]),g=Ss(t.events,n[3]),y={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",y,t]]),a!==2){const b=t.events[n[2]],S=t.events[n[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",y,t]])}return l!==void 0&&(o.end=Object.assign({},Ss(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function cw(e,t,n,a,l){const o=[],c=Ss(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function Ss(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const gq={name:"tasklistCheck",tokenize:vq};function yq(){return{text:{91:gq}}}function vq(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return kt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return ze(m)?t(m):We(m)?e.check({tokenize:bq},t,n)(m):n(m)}}function bq(e,t,n){return st(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function xq(e){return vE([ZF(),tq(),uq(e),hq(),yq()])}const Sq={};function wq(e){const t=this,n=e||Sq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(xq(n)),o.push($F()),c.push(FF(n))}function uN({children:e,className:t}){return u.jsx("div",{className:_e("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:u.jsx(s$,{remarkPlugins:[wq,v$],children:e})})}function kq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,c]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),u.jsxs(rn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(_r,{children:[u.jsxs(Ar,{children:["System prompt append",m&&u.jsx(jq,{})]}),!o&&!l&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(qu,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(Yr,{children:o?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(me,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):u.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?u.jsx(uN,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function jq(){return u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const cN={"claude-code":"Claude Code",codex:"Codex"},Cq=[Xd.CLAUDE_CODE,Xd.CODEX];function Eq({open:e,onOpenChange:t,agent:n}){const a=Nn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[g,y]=x.useState(!1),S=qe({queryKey:["clients-rebind"],queryFn:Zs,enabled:e}).data??[],k=yA({queries:S.map(F=>({queryKey:["client-capabilities",F.id],queryFn:()=>Vk(F.id),enabled:e}))}),j=x.useMemo(()=>{const F=new Map;return k.forEach((ee,H)=>{const ne=S[H];if(!ne)return;const X=ee.data;X!=null&&X.capabilities&&F.set(ne.id,X.capabilities)}),F},[k,S]);x.useEffect(()=>{e||(f(l),h(o),y(!1))},[e,l,o]);const E=c?j.get(c)??null:null,C=(E==null?void 0:E[m])??null,A=!C||C.state==="missing"||C.state==="error",O=!!c&&(c!==l||m!==o)&&(!A||g),L=m!==o,D=c!==l,z=gt({mutationFn:()=>{if(!c)throw new Error("clientId required");return OD(n.uuid,{clientId:c,runtimeProvider:m,force:A&&g?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),I=z.error instanceof Fu||z.error instanceof Error?z.error.message:null;return u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Re-bind agent"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",u.jsx("span",{className:"mono",children:_q(l,S,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:F=>f(F.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:S.map(F=>u.jsx("option",{value:F.id,children:Nq(F)},F.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:Cq.map(F=>{const ee=(E==null?void 0:E[F])??null,H=!!ee&&ee.state!=="missing",ne=m===F;return u.jsxs("label",{className:ne?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":H?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:ne,onChange:()=>h(F),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:cN[F]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:Tq(ee,F)})]})]},F)})})]}),(D||L)&&u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),L&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),A&&u.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[u.jsx("input",{type:"checkbox",checked:g,onChange:F=>y(F.target.checked),className:"mt-0.5"}),u.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),I&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:I})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",onClick:()=>t(!1),disabled:z.isPending,children:"Cancel"}),u.jsx(me,{onClick:()=>z.mutate(),disabled:!O||z.isPending,children:z.isPending?"Re-binding…":"Re-bind"})]})]})})}function Nq(e){return`${e.hostname??e.id} · ${e.status}`}function _q(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${cN[n]}`}const Aq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function Tq(e,t){if(!e)return"Not reported on this computer.";switch(e.state){case"ok":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, authenticated.`;case"unauthenticated":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, not authenticated. ${Aq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const Rq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function zq(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(Kr,{state:"blocked",size:8}),u.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>u.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:Rq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&u.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[u.jsx(Na,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&u.jsx(me,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(me,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(me,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(zR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function vu(e){return`agent-cfg-${e}`}function uu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:_e("space-y-3",o),...c,children:[u.jsxs("div",{className:"flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),u.jsx("div",{className:"space-y-3",children:l})]})}function Oq(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const Dq={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Re-bind via the agent's settings to switch computer or runtime."},codex:{name:"Codex",caption:"OpenAI's Codex CLI runtime. Re-bind via the agent's settings to switch computer or runtime."}};function Mq(e){const t=Dq[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(Lq,{name:t.name,caption:t.caption,locked:!0}),u.jsx(Iq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function Lq({name:e,caption:t,locked:n}){return u.jsxs(rn,{children:[u.jsx(_r,{children:u.jsxs(Ar,{children:["Where it runs",n&&u.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(_k,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(Yr,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(Ak,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),u.jsx("span",{className:"font-medium",children:e})]}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function Iq(e){const t=!!e.computerLabel;return u.jsxs(rn,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(gg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(gg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(Yr,{className:"text-body",children:t?u.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function Uq(e){return e.isUnclaimed?"Saving: configuration stored; will apply when a computer claims this agent.":e.isOffline?"Saving: configuration stored; will apply when the computer reconnects.":e.activeSessions>0?`Saving: new chats use this immediately; ${e.activeSessions} active chat${e.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function Pq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function Bq(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Pp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function dw(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:Bq(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Bp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=Pq(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:dw(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:dw(f)}}),remove:a=>t(l=>{const c=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:c}}),undo:a=>t(l=>{const c=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:c}})}}function $q(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Pp(e.payload.mcpServers,"mcp"),env:Pp(e.payload.env,"env"),git:Pp(e.payload.gitRepos,"git")}}function Fq(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n($q(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",c=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],L=F=>F.reduce((ee,H)=>H.status==="unchanged"?ee:ee+1,0),D=L(a.mcp),z=L(a.env),I=L(a.git);return c&&O.push("prompt"),f&&O.push("model"),D>0&&O.push("mcp"),z>0&&O.push("env"),I>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:c?1:0,model:f?1:0,mcp:D,env:z,git:I}}},[a,c,f]),h=x.useCallback(O=>{n(L=>L&&O(L))},[]),g=x.useCallback(O=>h(L=>({...L,promptAppend:O})),[h]),y=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(L=>({...L,model:O})),[h]),S=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>Bp("mcp",h),[h]),j=x.useMemo(()=>Bp("env",h),[h]),E=x.useMemo(()=>Bp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),A=x.useCallback(()=>{if(!t||!e)return{};const O={};c&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const L=m.counts.mcp>0,D=m.counts.env>0,z=m.counts.git>0;return L&&(O.mcpServers=t.mcp.filter(I=>I.status!=="deleted").map(I=>I.value)),D&&(O.env=t.env.filter(I=>I.status!=="deleted").map(I=>{const F=I.value;return F.sensitive&&F.value===Jd?{key:F.key,value:Jd,sensitive:!0}:F})),z&&(O.gitRepos=t.git.filter(I=>I.status!=="deleted").map(I=>I.value)),O},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:g,revertPrompt:y,setModel:b,revertModel:S,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:C,buildPayloadPatch:A}}const jn={overview:"ad-overview",setup:"ad-setup",prompt:vu("prompt"),tools:vu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function qq(e){const t=[{key:"overview",label:"Profile",anchor:jn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:jn.setup},{key:"prompt",label:"Prompt",anchor:jn.prompt},{key:"tools",label:"Tools",anchor:jn.tools},{key:"advanced",label:"Advanced",anchor:jn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:jn.danger,divider:!0,danger:!0}),t}function Hq(){var fn,dt,Tr,Mn,Xu,Mi,Li,Ii,Ir,Ui,Ma,Ju;const t=hk().uuid??"",n=_n(),a=Nn(),l=qe({queryKey:["agent",t],queryFn:()=>Vj(t),enabled:!!t}),o=qe({queryKey:["agent-config",t],queryFn:()=>xU(t),enabled:!!t&&((fn=l.data)==null?void 0:fn.type)!=="human"}),c=qe({queryKey:["agent-client-status",t],queryFn:()=>kU(t),enabled:!!t&&((dt=l.data)==null?void 0:dt.type)!=="human"}),f=qe({queryKey:["agent-sessions-active",t],queryFn:()=>to(t,{state:"active"}),enabled:!!t&&((Tr=l.data)==null?void 0:Tr.type)!=="human"}),m=qe({queryKey:["clients"],queryFn:Zs,enabled:!!t&&((Mn=l.data)==null?void 0:Mn.type)!=="human",refetchInterval:3e4}),h=Fq(o.data),[g,y]=x.useState(null),[b,S]=x.useState(null),[k,j]=x.useState(!1),E=gt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const ve=h.buildPayloadPatch();return SU(t,{expectedVersion:o.data.version,payload:ve})},onSuccess:ve=>{a.setQueryData(["agent-config",t],ve),y(null),S(null),j(!0)},onError:ve=>{if(j(!1),ve instanceof Fu&&ve.status===409){S("Someone else saved a newer version while you were editing."),y(null);return}y(ve instanceof Error?ve.message:String(ve))}});x.useEffect(()=>{if(!k)return;const ve=setTimeout(()=>j(!1),2500);return()=>clearTimeout(ve)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{S(null),y(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),A=x.useCallback(ve=>{const Ye=document.getElementById(ve);Ye&&Ye.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=gt({mutationFn:ve=>H1(t,ve),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),L=gt({mutationFn:()=>MD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),D=gt({mutationFn:()=>LD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),z=gt({mutationFn:()=>DD(t),onSuccess:()=>n("/agents")}),I=gt({mutationFn:()=>ID(t)}),[F,ee]=x.useState(!1),[H,ne]=x.useState(""),[X,be]=x.useState(null),[fe,ie]=x.useState(!1),Z=qe({queryKey:["clients"],queryFn:Zs,enabled:F}),ae=gt({mutationFn:ve=>H1(t,{clientId:ve}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),ee(!1),ne(""),be(null)},onError:ve=>be(ve instanceof Error?ve.message:String(ve))}),[K,he]=x.useState(!1),[T,P]=x.useState(null),B=gt({mutationFn:()=>wU(t,h.buildPayloadPatch()),onSuccess:ve=>{const Ye=ve.diff.length?ve.diff.map(hn=>`${hn.op} ${hn.path}`).join(`
|
|
387
|
-
`):"(no changes)";P(Ye)},onError:ve=>P(`Dry run failed: ${ve instanceof Error?ve.message:String(ve)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const ve=Ye=>{Ye.preventDefault(),Ye.returnValue=""};return window.addEventListener("beforeunload",ve),()=>window.removeEventListener("beforeunload",ve)},[h.summary.anyDirty]);const _=((Xu=l.data)==null?void 0:Xu.type)==="human",$=x.useMemo(()=>qq(_),[_]),J=x.useRef(null),[ue,xe]=x.useState(!1);x.useEffect(()=>{if(_)return;const ve=J.current;if(!ve||typeof IntersectionObserver>"u")return;const Ye=new IntersectionObserver(hn=>{const Wr=hn[0];Wr&&xe(!Wr.isIntersecting&&Wr.boundingClientRect.top<0)},{threshold:0});return Ye.observe(ve),()=>Ye.disconnect()},[_]);const[Le,Se]=x.useState(jn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const ve=[];for(const Ye of $){const hn=document.getElementById(Ye.anchor);if(!hn)continue;const Wr=new IntersectionObserver(oo=>{for(const Wu of oo)Wu.isIntersecting&&Se(Ye.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});Wr.observe(hn),ve.push(Wr)}return()=>{for(const Ye of ve)Ye.disconnect()}},[$]);const Ct=x.useMemo(()=>{const ve=new Set;for(const Ye of h.summary.dirtySections)Ye==="prompt"&&ve.add(jn.prompt),Ye==="model"&&ve.add(jn.setup),Ye==="mcp"&&ve.add(jn.tools),(Ye==="env"||Ye==="git")&&ve.add(jn.advanced);return ve},[h.summary.dirtySections]);if(l.isLoading)return u.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:u.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return u.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const te=l.data;if(!te)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Te=te.type==="human",Ue=c.data,Fe=((Mi=f.data)==null?void 0:Mi.length)??0,Ft=!Te&&!(Ue!=null&&Ue.clientId),un=!Te&&Ue?!Ue.online&&!!Ue.clientId:!1,za=te,_l=za.runtimeState??null,Oa=za.runtimeType??null,Da=za.totalSessions??null,Jr=te.uuid.slice(0,8),io=Uq({activeSessions:Fe,isUnclaimed:Ft,isOffline:un}),lo=h.draft.mcp.filter(ve=>ve.status!=="deleted"),cn=h.draft.env.filter(ve=>ve.status!=="deleted"),so=h.draft.git.filter(ve=>ve.status!=="deleted"),le=ve=>new Set(lo.filter(Ye=>Ye.key!==ve).map(Ye=>Ye.value.name.toLowerCase())),ye=ve=>new Set(cn.filter(Ye=>Ye.key!==ve).map(Ye=>Ye.value.key)),Me=ve=>new Set(so.filter(Ye=>Ye.key!==ve).map(Ye=>{const{value:hn}=Ye;return hn.localPath?hn.localPath:((hn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Pe={sessions:Da??"—",active:Fe,runtime:Oa??(Te?"human":"—"),model:((Ii=(Li=o.data)==null?void 0:Li.payload.model)==null?void 0:Ii.trim())||"—"},nt=(Ue==null?void 0:Ue.clientId)??null,dn=nt?((Ir=m.data)==null?void 0:Ir.find(ve=>ve.id===nt))??null:null,cr=nt?(dn==null?void 0:dn.hostname)??nt:null,en=te.runtimeProvider??"claude-code",qt=en==="codex"?"Codex":"Claude Code";return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:[u.jsx(Qu,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),$.map(ve=>u.jsxs("div",{children:[ve.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(Zq,{label:ve.label,active:Le===ve.anchor,danger:ve.danger??!1,dirty:Ct.has(ve.anchor),onClick:()=>A(ve.anchor)})]},ve.key))]}),u.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[u.jsxs(jU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(CU,{onClick:()=>n("/agents"),children:"Agents"}),u.jsx(EU,{}),u.jsx(NU,{mono:!0,children:te.name??Jr})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(yl,{width:18,height:20,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-title",title:`agt_${Jr}`,children:te.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",te.name??Jr]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(xn,{tone:te.type==="autonomous_agent"?"accent":"neutral",children:te.type}),te.visibility&&u.jsx(xn,{tone:te.visibility==="organization"?"accent":"outline",children:te.visibility}),(Ue==null?void 0:Ue.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",Ci(Ue.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Ks,{state:_l}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${te.uuid}`),children:[u.jsx(uy,{className:"h-3 w-3"})," Open chat"]}),!Te&&te.status==="active"&&u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>{I.reset(),I.mutate()},disabled:I.isPending,children:[u.jsx(Ak,{className:"h-3 w-3"}),I.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(Ed,{label:"sessions",value:Pe.sessions}),u.jsx(Ed,{label:"active",value:Pe.active,accent:typeof Pe.active=="number"&&Pe.active>0?"var(--accent)":void 0}),u.jsx(Ed,{label:"runtime",value:Pe.runtime}),u.jsx(Ed,{label:"model",value:Pe.model})]})]}),u.jsx("div",{ref:J,"aria-hidden":!0,style:{height:0}}),!Te&&u.jsx(AU,{runtimeLabel:qt,computerLabel:cr,visible:ue}),u.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[(I.data||I.error)&&u.jsx(Xq,{result:I.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>I.reset()}),u.jsx(uu,{anchorId:jn.overview,title:"Profile",right:u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>n(`/settings?agent=${te.uuid}`),title:"Manage platform bindings in Settings",children:[u.jsx(gg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(UU,{agent:te,onSave:async ve=>{await O.mutateAsync(ve)}})}),!Te&&u.jsxs(u.Fragment,{children:[u.jsxs(uu,{anchorId:jn.setup,title:"Setup",caption:((Ui=o.data)==null?void 0:Ui.version)!=null?u.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&u.jsx(Mq,{runtimeProvider:en,computerLabel:cr,canBindComputer:Ft&&te.status==="active",bindComputerPending:ae.isPending,onBindComputer:()=>ee(!0),onRebind:te.clientId?()=>ie(!0):void 0,modelSlot:u.jsx(KU,{value:h.draft.model,baseline:((Ma=o.data)==null?void 0:Ma.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:te.status!=="active",provider:en})})]}),u.jsx(uu,{anchorId:jn.prompt,title:"Prompt",children:o.data?u.jsx(kq,{value:h.draft.promptAppend,baseline:((Ju=o.data)==null?void 0:Ju.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:te.status!=="active"}):null}),u.jsx(uu,{anchorId:jn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx($U,{items:h.draft.mcp,otherNames:le,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:te.status!=="active"}):null}),u.jsx(uu,{anchorId:jn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{id:vu("env"),children:u.jsx(DU,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:te.status!=="active"})}),u.jsx("div",{id:vu("git"),children:u.jsx(LU,{items:h.draft.git,otherPaths:Me,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:te.status!=="active"})}),T&&u.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:T}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.jsx("button",{type:"button",onClick:()=>B.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:B.isPending,children:B.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),u.jsx(Oq,{}),u.jsx(TU,{agent:te,suspendPending:L.isPending,reactivatePending:D.isPending,deletePending:z.isPending,onSuspend:()=>L.mutate(),onReactivate:()=>D.mutate(),onDelete:()=>z.mutate()})]}),!Te&&u.jsx(zq,{summary:h.summary,saveHint:io,conflictMessage:b,errorMessage:g,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&he(!0)},onReloadRemote:C,onJumpTo:ve=>A(vu(ve))})]}),u.jsx(Vq,{open:K,onOpenChange:he,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),y(null),S(null),he(!1)}}),u.jsx(Pt,{open:F,onOpenChange:ve=>{ee(ve),ve||(ne(""),be(null),ae.reset())},children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),Z.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):u.jsx(Qq,{clients:Z.data??[],selected:H,onSelect:ne}),X&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:X})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",onClick:()=>ee(!1),children:"Cancel"}),u.jsx(me,{disabled:!H||ae.isPending,onClick:()=>{be(null),ae.mutate(H)},children:ae.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Eq,{open:fe,onOpenChange:ie,agent:te})]})}function Zq({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:_e("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex-1 truncate",children:e}),a&&u.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&u.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function Vq(e){return u.jsx(Pt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function Qq({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?u.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",u.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):u.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,c=l.status==="online"||l.status==="active";return u.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("button",{type:"button",onClick:()=>n(l.id),className:_e("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:_e("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),u.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const Gq={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},Kq={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},Yq={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function Xq({result:e,onDismiss:t}){const n=Kq[e.status],a=Yq[e.status],l=e.connection;return u.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(xn,{tone:a,children:Gq[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[u.jsx("div",{children:l.runtimeState&&u.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?u.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):u.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&u.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),u.jsx(me,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function Jq(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Wq({agent:e,open:t,onClose:n,onBound:a}){var y;const[l,o]=x.useState(!1),c=qe({queryKey:["connect-token",e.uuid],queryFn:()=>Qk(),enabled:t,staleTime:6e4}),f=qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Vj(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((y=c.data)==null?void 0:y.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${Jq(e.name)} --agent-id ${e.uuid} && `+m:m;function g(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return u.jsx(Pt,{open:t,onOpenChange:b=>!b&&n(),children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),u.jsx(me,{variant:"outline",size:"icon",className:"shrink-0",onClick:g,disabled:!h,children:l?u.jsx(Na,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(oy,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[u.jsx(Kr,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),u.jsx(Wt,{children:u.jsx(me,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const $p=200;function e7(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const a of e){const l=a.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function fw(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,js)}function t7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,js)}function n7(e){switch(e){case"taken":return"That agent name is already in use in this organization. Pick a different one.";case"reserved":return"That agent name is reserved — pick a different one.";case"invalid":return"Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_)."}}function r7({open:e,onOpenChange:t,onCreated:n}){const a=Nn(),[l,o]=x.useState(""),[c,f]=x.useState(""),[m,h]=x.useState(!1),[g,y]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[E,C]=x.useState(null),[A,O]=x.useState(!1),[L,D]=x.useState({}),[z,I]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),y("claude-code"),S("form"),j([]),C(null),O(!1),D({}),I({status:"idle"}))},[e]),x.useEffect(()=>{m||f(fw(l))},[l,m]);const F=x.useRef(0);x.useEffect(()=>{if(!e||!c){I({status:"idle"});return}if(!_g.test(c)){I({status:"bad",reason:"invalid"});return}if(Ag(c)){I({status:"bad",reason:"reserved"});return}const K=++F.current;I({status:"checking"});const he=window.setTimeout(()=>{zD(c).then(T=>{K===F.current&&(T.available?I({status:"ok"}):I({status:"bad",reason:T.reason}))}).catch(()=>{K===F.current&&I({status:"idle"})})},300);return()=>window.clearTimeout(he)},[c,e]);const ee=gt({mutationFn:async K=>{const he=l.trim()||c.trim()||"Untitled assistant";return RD({name:c||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId,runtimeProvider:g})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,g)}}),H=x.useMemo(()=>{const K=ee.error;if(!K)return{};if(K instanceof Fu){const he=e7(K.issues);return Object.keys(he).length>0?he:K.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:K.message}}return K instanceof Error?{_root:K.message}:{}},[ee.error]),ne=z.status==="bad"?n7(z.reason):void 0,X={...ne?{name:ne}:{},...H,...L};function be(){const K={};return c?c.length>js?K.name=`Agent name must be at most ${js} characters (got ${c.length}).`:_g.test(c)?Ag(c)&&(K.name="That agent name is reserved — pick a different one."):K.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":l.trim().length>0&&(K.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),l.length>$p&&(K.displayName=`Display name must be at most ${$p} characters (got ${l.length}).`),K}async function fe(K){var T,P;K.preventDefault();const he=be();if(D(he),!(Object.keys(he).length>0)&&z.status!=="bad"){O(!0);try{const _=(await Zs()).filter(J=>J.status==="connected");if(_.length===0){ee.mutate({clientId:void 0});return}if(_.length===1){ee.mutate({clientId:(T=_[0])==null?void 0:T.id});return}const $=[..._].sort((J,ue)=>ue.lastSeenAt.localeCompare(J.lastSeenAt));j($),C(((P=$[0])==null?void 0:P.id)??null),S("pick-computer")}catch{ee.mutate({clientId:void 0})}finally{O(!1)}}}function ie(){E&&ee.mutate({clientId:E})}const Z=z.status==="bad",ae=l.trim().length>0&&!Z&&!ee.isPending&&!A;return b==="pick-computer"?u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:l||c})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=E===K.id;return u.jsxs("label",{className:he?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"target-computer",checked:he,onChange:()=>C(K.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),X.clientId&&u.jsx("p",{className:"text-body text-destructive",children:X.clientId}),X._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:X._root})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",onClick:()=>S("form"),disabled:ee.isPending,children:"Back"}),u.jsx(me,{onClick:ie,disabled:!E||ee.isPending,children:ee.isPending?"Creating…":"Create"})]})]})}):u.jsx(Pt,{open:e,onOpenChange:t,children:u.jsxs(Rt,{className:"max-w-lg",children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"New Agent"})}),u.jsxs("form",{onSubmit:fe,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(xt,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),L.displayName&&D(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:$p,"aria-invalid":X.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),u.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),X.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:X.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"new-agent-name",children:"Agent name"}),u.jsxs("div",{className:"flex items-stretch",children:[u.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),u.jsx(xt,{id:"new-agent-name",value:c,onChange:K=>{const he=t7(K.target.value);f(he),h(!0),L.name&&D(T=>({...T,name:void 0}))},onBlur:K=>{const he=fw(K.target.value);he!==c&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:js,"aria-invalid":X.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),u.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",js," characters. Permanent after creation."]}),c&&!X.name&&z.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:z.status==="ok"?"var(--state-idle)":z.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[z.status==="checking"&&"Checking availability…",z.status==="ok"&&"Available."]}),X.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:X.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:g==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:g==="claude-code",onChange:()=>y("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),u.jsxs("label",{className:g==="codex"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:g==="codex",onChange:()=>y("codex"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Codex"}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",u.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),X._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:X._root}),u.jsx(Wt,{children:u.jsx(me,{type:"submit",disabled:!ae,children:A?"Checking computers…":ee.isPending?"Creating…":"Create"})})]})]})})}function hu({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:_e("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...c,children:[l,t!==void 0&&u.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const a7=Object.values(XI);function hw(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function i7(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function vs(e,t,n){var l;let a=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&a++;return a}function l7(){const e=_n(),{memberId:t}=an(),[n,a]=x.useState(),[l,o]=x.useState(""),[c,f]=x.useState(!1),[m,h]=x.useState(null),[g,y]=x.useState("all"),[b,S]=x.useState(""),k=Cl(),j=yy(),E=Ry(),{data:C,isLoading:A,error:O}=qe({queryKey:["agents",n,l],queryFn:()=>Vu({limit:100,cursor:n,type:l||void 0})}),{data:L}=qe({queryKey:["activity"],queryFn:Hu,refetchInterval:1e4}),D=x.useMemo(()=>{const K=new Map;for(const he of(L==null?void 0:L.agents)??[])K.set(he.agentId,he);return K},[L==null?void 0:L.agents]),{myAgents:z,teamAgents:I}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const T of C.items)t&&T.managerId===t?K.push(T):he.push(T);return{myAgents:hw(K),teamAgents:hw(he)}},[C,t]),F=(C==null?void 0:C.items.length)??0,ee=z.length,H=I.length,ne=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var he;return((he=D.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[C==null?void 0:C.items,D]),X=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var T;const he=(T=D.get(K.uuid))==null?void 0:T.runtimeState;return he==="blocked"||he==="error"}).length,[C==null?void 0:C.items,D]);function be(K){var T;const he=(T=D.get(K.uuid))==null?void 0:T.runtimeState;return g==="mine"?t!=null&&K.managerId===t:g==="running"?he==="working":g==="attn"?he==="blocked"||he==="error":!0}function fe(K){if(!b.trim())return!0;const he=b.toLowerCase(),T=K.delegateMention?k(K.delegateMention):"",P=E(K.managerId);return(K.name??"").toLowerCase().includes(he)||K.displayName.toLowerCase().includes(he)||T.toLowerCase().includes(he)||P.toLowerCase().includes(he)}const ie=z.filter(K=>be(K)&&fe(K)),Z=I.filter(K=>be(K)&&fe(K));function ae(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"||he==="codex"){h(K);return}e(`/?a=${K.uuid}`)}return u.jsxs("div",{className:"-m-6",children:[u.jsx(Ef,{title:"Agents",subtitle:F>0?u.jsxs(u.Fragment,{children:[F," total · ",ee," mine · ",H," team"]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>f(!0),children:[u.jsx(_a,{className:"h-3 w-3"}),"New agent"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("div",{className:"relative",style:{width:240},children:[u.jsx(ff,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),u.jsx("input",{value:b,onChange:K=>S(K.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(hu,{active:g==="all",count:F,onClick:()=>y("all"),children:"all"}),u.jsx(hu,{active:g==="mine",count:ee,onClick:()=>y("mine"),children:"mine"}),u.jsx(hu,{active:g==="running",count:ne,onClick:()=>y("running"),children:"running"}),u.jsx(hu,{active:g==="attn",count:X,warn:!0,onClick:()=>y("attn"),children:"attn"})]}),u.jsx("div",{style:{flex:1}}),u.jsxs("select",{value:l,onChange:K=>{o(K.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[u.jsx("option",{value:"",children:"all types"}),a7.map(K=>u.jsx("option",{value:K,children:K},K))]})]}),A?u.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):O?u.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",O instanceof Error?O.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsx(mw,{title:`My agents · ${ie.length}`,agents:ie,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:z.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:u.jsx(pw,{items:[{state:"working",count:vs(z,D,"working")},{state:"blocked",count:vs(z,D,"blocked")},{state:"error",count:vs(z,D,"error")}]}),className:"mb-4"}),I.length>0&&u.jsx(mw,{title:`Team agents · ${Z.length}`,agents:Z,runtimeMap:D,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:u.jsx(pw,{items:[{state:"working",count:vs(I,D,"working")},{state:"blocked",count:vs(I,D,"blocked")},{state:"error",count:vs(I,D,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&u.jsx("div",{className:"flex justify-end mt-4",children:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),u.jsx(r7,{open:c,onOpenChange:f,onCreated:ae}),m&&u.jsx(Wq,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function mw({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:c,breakdown:f,className:m,showOwner:h}){return u.jsxs(rn,{className:m,children:[u.jsx(Gs,{right:f,children:e}),t.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:c}):u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Agent name"}),u.jsx($e,{children:"Type"}),u.jsx($e,{children:"Delegate"}),h&&u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"Runtime"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Created"})]})}),u.jsx(xl,{children:t.map(g=>u.jsx(s7,{agent:g,runtime:i7(g,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},g.uuid))})]})]})}function pw({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:u.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>u.jsxs("span",{className:"inline-flex items-center",children:[a>0&&u.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),u.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[u.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function s7({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:c}=t,f=c==="idle"||c==="working"||c==="blocked"||c==="error"||c==="offline",m=e.delegateMention?n(e.delegateMention):null;return u.jsxs(sr,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"font-medium",children:e.displayName})}),u.jsx(Ie,{children:e.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ie,{children:u.jsx(xn,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),u.jsx(Ie,{children:e.delegateMention?u.jsx(rE,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):u.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&u.jsx(Ie,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),u.jsx(Ie,{children:c&&f?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(Kr,{state:c,size:7}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:c})]}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ie,{children:u.jsx(xn,{tone:e.status==="active"?"accent":"outline",children:e.status})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ci(e.createdAt)})]})}function o7(){const{data:e}=qe({queryKey:["members","user-name-map"],queryFn:Nf,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function u7(){const[e,t]=x.useState(null),[n,a]=x.useState(!1),l=gt({mutationFn:Qk,onSuccess:c=>{t(c),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return u.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[u.jsx(nz,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?u.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",u.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),u.jsxs(me,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?u.jsx(Na,{className:"h-3 w-3"}):u.jsx(oy,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),u.jsx(me,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function c7(){const e=Nn(),t=Cl(),n=o7(),{role:a}=an(),l=a==="admin",[o,c]=x.useState(null),[f,m]=x.useState(null),[h,g]=x.useState(null),[y,b]=x.useState(null),{data:S}=qe({queryKey:["clients"],queryFn:Zs,refetchInterval:1e4}),{data:k}=qe({queryKey:["activity"],queryFn:Hu,refetchInterval:1e4}),j=gt({mutationFn:iO,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=gt({mutationFn:aO,onSuccess:()=>{g(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:D=>{D instanceof Fu?b(D.message):b(D instanceof Error?D.message:String(D))}}),C=x.useMemo(()=>{const D=new Map;for(const z of(k==null?void 0:k.agents)??[]){if(!z.clientId)continue;const I=D.get(z.clientId)??[];I.push(z),D.set(z.clientId,I)}return D},[k==null?void 0:k.agents]),A=D=>C.get(D)??[],O=(S??[]).filter(D=>D.status==="connected").length,L=(S??[]).reduce((D,z)=>D+z.agentCount,0);return u.jsxs("div",{className:"-m-6",children:[u.jsx(Ef,{title:"Computers",subtitle:S&&S.length>0?u.jsxs(u.Fragment,{children:[S.length," total · ",O," connected · ",L," agents bound"]}):null}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(u7,{}),h&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),A(h.id).length>0&&u.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[u.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-body space-y-0.5",children:A(h.id).map(D=>u.jsx("li",{className:"font-medium",children:t(D.agentId)},D.agentId))})]}),y&&u.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:y}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>{g(null),b(null)},children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:A(f.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):A(f.id).map(D=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:t(D.agentId)}),u.jsx(Ks,{state:D.runtimeState})]},D.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!S||S.length===0?u.jsx(rn,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):u.jsxs(rn,{children:[u.jsxs(Gs,{right:u.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",S.length]}),u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{style:{width:16}}),u.jsx($e,{children:"Hostname"}),l&&u.jsx($e,{children:"Owner"}),u.jsx($e,{children:"OS"}),u.jsx($e,{children:"SDK"}),u.jsx($e,{children:"Agents"}),u.jsx($e,{children:"Connected"}),u.jsx($e,{children:"Status"}),u.jsx($e,{})]})}),u.jsx(xl,{children:S.map(D=>{const z=o===D.id,I=A(D.id);return u.jsx(g7,{client:D,boundAgents:I,isExpanded:z,agentName:t,showOwner:l,ownerName:n,onToggle:()=>c(z?null:D.id),onDisconnect:()=>m(D),onRetire:()=>{b(null),g(D)}},D.id)})})]})]})]})]})}const d7={"claude-code":"Claude Code",codex:"Codex"},f7=[Xd.CLAUDE_CODE,Xd.CODEX],gw={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},h7={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function m7({clientId:e,enabled:t}){const{data:n,isLoading:a}=qe({queryKey:["client-capabilities",e],queryFn:()=>Vk(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Qu,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):u.jsx("div",{className:"flex flex-col gap-1",children:f7.map(o=>u.jsx(p7,{provider:o,entry:l?l[o]??null:null},o))})]})}function p7({provider:e,entry:t}){const n=d7[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",gw[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",h7[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",gw[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function g7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:c,onDisconnect:f,onRetire:m}){const h=l?9:8,g=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(sr,{interactive:!0,selected:n,onClick:c,children:[u.jsx(Ie,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Ek,{className:"h-3.5 w-3.5"}):u.jsx(SR,{className:"h-3.5 w-3.5"})})}),u.jsx(Ie,{className:"font-medium",children:e.hostname??"—"}),l&&u.jsx(Ie,{style:{color:"var(--fg-2)"},children:o(e.userId)}),u.jsx(Ie,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(Ie,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(Ie,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Ci(e.connectedAt):"—"}),u.jsx(Ie,{children:u.jsx(Ks,{state:g})}),u.jsx(Ie,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-1 justify-end",children:[u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",onClick:y=>{y.stopPropagation(),f()},children:[u.jsx(uz,{className:"h-3 w-3"})," Disconnect"]}),u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:y=>{y.stopPropagation(),m()},children:[u.jsx(Hs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(Ie,{}),u.jsxs(Ie,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(m7,{clientId:e.id,enabled:n}),u.jsxs(Qu,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):u.jsx("div",{className:"flex flex-col gap-1",children:t.map(y=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(y.agentId)}),u.jsx(Ks,{state:y.runtimeState}),y.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[y.activeSessions," / ",y.totalSessions??0," sessions"]})]},y.agentId))})]})]})]})}function y7(){const{token:e}=hk(),t=_n(),{isAuthenticated:n,adoptTokens:a}=an(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1);if(x.useEffect(()=>{e&&(async()=>{try{const b=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!b.ok){const S=await b.json().catch(()=>({}));f(S.error??"This invitation is no longer valid");return}o(await b.json())}catch{f("Network error while loading invitation")}})()},[e]),!e)return u.jsx(Fp,{children:"Bad invitation URL"});if(c)return u.jsx(Fp,{children:c});if(!l)return u.jsx(Fp,{children:"Loading…"});const g=async()=>{if(e){h(!0);try{const b=await je.post("/me/organizations/join",{token:e});await a(b.tokens),Xj("invite"),t("/",{replace:!0})}catch(b){f(b instanceof Error?b.message:"Failed to join team")}finally{h(!1)}}},y=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`;return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsxs(_f,{className:"w-full max-w-md",children:[u.jsxs(Af,{className:"text-center",children:[u.jsxs(Tf,{className:"text-title",children:["Join ",l.organizationDisplayName]}),u.jsxs(zy,{children:["You've been invited as a ",l.role,".",u.jsx("br",{}),u.jsxs("span",{className:"text-muted-foreground",children:["team: ",l.organizationName]})]})]}),u.jsx(Rf,{className:"space-y-4",children:n?u.jsx(me,{className:"w-full",disabled:m,onClick:g,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:y,children:[u.jsx(Nk,{className:"h-4 w-4"}),"Continue with GitHub to join"]})})})]})})}function Fp({children:e}){return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:e})}function v7(e){if(typeof e!="object"||e===null||!("from"in e))return null;const t=e.from;if(typeof t!="object"||t===null||!("pathname"in t)||typeof t.pathname!="string"||t.pathname==="/login")return null;const n="search"in t&&typeof t.search=="string"?t.search:"",a="hash"in t&&typeof t.hash=="string"?t.hash:"",l=`${t.pathname}${n}${a}`,o=OC(l);return o===gS&&l!==gS?null:o}function b7(){const{isAuthenticated:e}=an(),t=Dn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=v7(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?u.jsx(uf,{to:a,replace:!0}):u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(iy,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(hR,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:u.jsxs(_f,{className:"w-full max-w-sm",children:[u.jsxs(Af,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(yl,{width:28,height:32})}),u.jsxs(Tf,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(Rf,{className:"space-y-4",children:[u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Nk,{className:"h-4 w-4"}),"Continue with GitHub"]})}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[u.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),u.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(mz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function x7(){const e=_n(),{adoptTokens:t}=an(),[n,a]=x.useState(null);return x.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),c=o.get("access"),f=o.get("refresh"),m=OC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Xj(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}function S7(){return je.get("/admin/adapter-mappings")}function w7(e){return je.post("/admin/adapter-mappings",e)}function k7(e){return je.delete(`/admin/adapter-mappings/${e}`)}function j7(){return je.get("/admin/adapters/status")}function C7(){return je.get("/admin/adapters")}function E7(e){return je.post("/admin/adapters",e)}function N7(e,t){return je.patch(`/admin/adapters/${e}`,t)}function _7(e){return je.delete(`/admin/adapters/${e}`)}const A7=Object.values(GI),yw={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function vw(e){const[t,n]=x.useState(yw),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...yw,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),l(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.preventDefault(),l(""),e.kind==="user"){if(!t.externalUserId)return;e.onSubmit({kind:"user-create",draft:{platform:t.platform,externalUserId:t.externalUserId,displayName:t.displayName||null}});return}if(t.platform==="feishu"){if(!e.editingId&&(!t.feishuAppId||!t.feishuAppSecret)){l("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){l("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){l("Credentials are required");return}if(h)try{JSON.parse(h)}catch{l("Invalid JSON");return}}const m=T7(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const c=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return u.jsx(Pt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:A7.map(f=>u.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(xt,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(xt,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):u.jsxs(u.Fragment,{children:[t.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(it,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(it,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(it,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(it,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(xt,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(it,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(it,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function T7(e){if(e.platform==="feishu")return!e.feishuAppId&&!e.feishuAppSecret||!e.feishuAppId||!e.feishuAppSecret?null:{app_id:e.feishuAppId,app_secret:e.feishuAppSecret};if(e.platform==="kael")return!e.kaelUserId&&!e.kaelProjectId||!e.kaelUserId||!e.kaelProjectId?null:{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId};const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function R7(){var _;const e=_n(),t=Nn(),[n,a]=df(),l=n.get("agent"),o=Cl(),c=qe({queryKey:["adapters"],queryFn:C7}),f=qe({queryKey:["adapter-mappings"],queryFn:S7}),m=qe({queryKey:["adapter-statuses"],queryFn:j7,refetchInterval:15e3}),g=((_=qe({queryKey:["agents","name-map"],queryFn:()=>Vu({limit:100}),staleTime:3e4}).data)==null?void 0:_.items)??[],y=x.useMemo(()=>{const $=new Map;for(const J of m.data??[])$.set(J.configId,J);return $},[m.data]),b=x.useMemo(()=>{const $=c.data??[];return l?$.filter(J=>J.agentId===l):$},[c.data,l]),S=x.useMemo(()=>{const $=f.data??[];return l?$.filter(J=>J.agentId===l):$},[f.data,l]),k=b.reduce(($,J)=>{var ue;return $+((ue=y.get(J.id))!=null&&ue.connected?1:0)},0),j=b.length-k,E=c.isLoading||f.isLoading,[C,A]=x.useState(null),[O,L]=x.useState(""),[D,z]=x.useState(null),[I,F]=x.useState(null),[ee,H]=x.useState(null),[ne,X]=x.useState(null),be=gt({mutationFn:$=>E7({platform:$.platform,agentId:$.agentId,credentials:$.credentials,status:$.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),fe=gt({mutationFn:$=>{const J={status:$.status};return $.credentials&&(J.credentials=$.credentials),N7($.id,J)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),ie=gt({mutationFn:_7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=gt({mutationFn:$=>w7({platform:$.platform,externalUserId:$.externalUserId,agentId:$.agentId,boundVia:"manual",displayName:$.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),F(null)}}),ae=gt({mutationFn:k7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function K($){if(l){$==="bot"?z({agentId:l,editingId:null}):F({agentId:l});return}L(""),A({kind:$})}function he(){!C||!O||(C.kind==="bot"?z({agentId:O,editingId:null}):F({agentId:O}),A(null))}function T($){if(D){if($.kind==="bot-create")be.mutate({agentId:D.agentId,platform:$.draft.platform,status:$.draft.status,credentials:$.draft.credentials});else if($.kind==="bot-update"){if(!D.editingId)return;fe.mutate({id:D.editingId,status:$.status,credentials:$.credentials})}}}function P($){!I||$.kind!=="user-create"||Z.mutate({agentId:I.agentId,platform:$.draft.platform,externalUserId:$.draft.externalUserId,displayName:$.draft.displayName})}const B=l?g.find($=>$.uuid===l):null;return u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&u.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[u.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),u.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(B==null?void 0:B.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const $=new URLSearchParams(n);$.delete("agent"),a($,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:u.jsx(ku,{className:"h-3 w-3"})})]})]}),u.jsxs(rn,{className:"mb-3.5",children:[u.jsxs(Gs,{right:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[u.jsx(Kr,{state:"idle",size:6})," ",k," online"]}),u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(Kr,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>K("bot"),children:[u.jsx(_a,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?u.jsx(Rd,{children:"Loading…"}):b.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Agent"}),u.jsx($e,{children:"Platform"}),u.jsx($e,{children:"Status"}),u.jsx($e,{children:"Connection"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:96,textAlign:"right"}})]})}),u.jsx(xl,{children:b.map($=>{var ue;const J=((ue=y.get($.id))==null?void 0:ue.connected)??!1;return u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${$.agentId}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono font-medium",children:o($.agentId)})}),u.jsx(Ie,{children:u.jsx(xn,{children:$.platform})}),u.jsx(Ie,{children:u.jsx(xn,{tone:$.status==="active"?"accent":"outline",children:$.status})}),u.jsx(Ie,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(Kr,{state:J?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:J?"Online":"Offline"})]})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ci($.createdAt)}),u.jsxs(Ie,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[u.jsx(me,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>z({agentId:$.agentId,editingId:$.id,initialPlatform:z7($.platform),initialStatus:O7($.status)}),children:"Edit"}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>H($.id),disabled:ie.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})]})]},$.id)})})]}):u.jsx(Rd,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(rn,{children:[u.jsxs(Gs,{right:u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>K("user"),children:[u.jsx(_a,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",S.length]}),E?u.jsx(Rd,{children:"Loading…"}):S.length?u.jsxs(vl,{children:[u.jsx(bl,{children:u.jsxs(sr,{children:[u.jsx($e,{children:"Agent"}),u.jsx($e,{children:"Platform"}),u.jsx($e,{children:"External user ID"}),u.jsx($e,{children:"Display name"}),u.jsx($e,{children:"Bound via"}),u.jsx($e,{children:"Created"}),u.jsx($e,{style:{width:32}})]})}),u.jsx(xl,{children:S.map($=>u.jsxs(sr,{interactive:!0,onClick:()=>e(`/agents/${$.agentId}`),children:[u.jsx(Ie,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o($.agentId)})}),u.jsx(Ie,{children:u.jsx(xn,{children:$.platform})}),u.jsx(Ie,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:$.externalUserId})}),u.jsx(Ie,{style:{color:"var(--fg-2)"},children:$.displayName??"—"}),u.jsx(Ie,{children:u.jsx(xn,{tone:"outline",children:$.boundVia??"—"})}),u.jsx(Ie,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Ci($.createdAt)}),u.jsx(Ie,{onClick:J=>J.stopPropagation(),children:u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>X($.id),disabled:ae.isPending,title:"Delete",children:u.jsx(Hs,{className:"h-3.5 w-3.5"})})})]},$.id))})]}):u.jsx(Rd,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(D7,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:g,agentId:O,onAgentChange:L,onCancel:()=>A(null),onConfirm:he}),u.jsx(vw,{open:D!=null,kind:"bot",editingId:(D==null?void 0:D.editingId)??null,initialPlatform:D==null?void 0:D.initialPlatform,initialStatus:D==null?void 0:D.initialStatus,agentLabel:D?o(D.agentId):"",pending:be.isPending||fe.isPending,errorMessage:(be.error??fe.error)instanceof Error?(be.error??fe.error).message:null,onOpenChange:$=>{$||(z(null),be.reset(),fe.reset())},onSubmit:T}),u.jsx(vw,{open:I!=null,kind:"user",editingId:null,agentLabel:I?o(I.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:$=>{$||(F(null),Z.reset())},onSubmit:P}),u.jsx(bw,{open:ee!=null,onOpenChange:$=>!$&&H(null),title:"Remove this bot binding?",description:"The bot will stop routing to this agent and any platform credentials stored here will be dropped.",confirmLabel:"Remove binding",pending:ie.isPending,onConfirm:()=>{ee!=null&&(ie.mutate(ee),H(null))}}),u.jsx(bw,{open:ne!=null,onOpenChange:$=>!$&&X(null),title:"Remove this binding?",description:"The external user will stop routing to this agent. You can add the mapping again later.",confirmLabel:"Remove binding",pending:ae.isPending,onConfirm:()=>{ne!=null&&(ae.mutate(ne),X(null))}})]})}function z7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function O7(e){return e==="inactive"?"inactive":"active"}function Rd({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function D7(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return u.jsx(Pt,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),u.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>u.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(me,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function bw(e){return u.jsx(Pt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function M7(){const{organizationId:e,adoptTokens:t,logout:n}=an(),[a,l]=x.useState([]),[o,c]=x.useState(!1),[f,m]=x.useState(!1),[h,g]=x.useState(null);x.useEffect(()=>{(async()=>{try{const k=await je.get("/me/organizations");l(k)}catch{}})()},[]);const y=a.find(k=>k.id===e),b=(y==null?void 0:y.displayName)??"this team",S=async()=>{m(!0),g(null);try{await mU();const j=(await je.get("/me/organizations").catch(()=>[])).find(E=>E.id!==e);if(j){const E=await je.post("/auth/switch-org",{organizationId:j.id});await t(E)}else n()}catch(k){g(k instanceof Error?k.message:"Failed to leave team"),m(!1)}};return u.jsxs(u.Fragment,{children:[u.jsxs(rn,{children:[u.jsx(_r,{children:u.jsx(Ar,{children:"Membership"})}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-4) var(--sp-4)"},children:[u.jsxs("div",{className:"text-body",style:{color:"var(--fg)"},children:["You're a member of ",u.jsx("span",{className:"font-medium",children:b}),"."]}),u.jsx("div",{className:"text-label text-muted-foreground",style:{marginTop:4},children:"Leaving removes your access immediately. Your agents stay in the team for history; you can re-join later if an admin shares an invite link."}),u.jsx("div",{style:{marginTop:"var(--sp-3)"},children:u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>c(!0),disabled:f,children:f?"Leaving…":"Leave team"})}),h&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h})]})]}),u.jsx(Pt,{open:o,onOpenChange:k=>!f&&c(k),children:u.jsxs(Rt,{children:[u.jsxs(Vt,{children:[u.jsxs(Bt,{children:["Leave ",b,"?"]}),u.jsx(yf,{children:"You'll lose access to this team's agents and chats. Your historical messages stay, but you won't be able to read or send new ones until an admin re-invites you."})]}),u.jsxs(Wt,{children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:f,children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>void S(),disabled:f,children:f?"Leaving…":"Leave team"})]})]})})]})}const xw=[{key:"bindings",label:"Bindings"},{key:"membership",label:"Membership"}];function L7(){const e=Dn(),t=_n(),n=e.hash.replace("#",""),a=xw.some(o=>o.key===n)?n:"bindings",l=o=>{t({hash:o},{replace:!0})};return u.jsxs("div",{className:"-m-6",children:[u.jsx(Ef,{title:"Settings",subtitle:"Per-member controls"}),u.jsx(JC,{children:xw.map(o=>u.jsx(WC,{active:a===o.key,onClick:()=>l(o.key),children:o.label},o.key))}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[a==="bindings"&&u.jsx(R7,{}),a==="membership"&&u.jsx(M7,{})]})]})}function I7(e){return je.get(`/admin/chats/${encodeURIComponent(e)}`)}function U7(e,t){return je.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function Sw(e,t){return je.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function P7(e,t){return je.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function B7(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const l=a.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},a.onerror=()=>n(a.error??new Error("FileReader error")),a.readAsDataURL(e)})}function $7(e){return je.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function F7(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const a=n.toString();return je.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const q7="first-tree-hub-images",H7=1,Xs="images";let zd=null;function dN(){return zd||(zd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(q7,H7);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Xs)||n.createObjectStore(Xs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),zd)}async function Z7(e){const t=await dN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Xs,"readwrite"),o=l.objectStore(Xs),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function V7(e){const t=await dN();return t?new Promise(n=>{const o=t.transaction(Xs,"readonly").objectStore(Xs).get(e);o.onsuccess=()=>{const c=o.result;if(!c){n(null);return}n({base64:c.base64,mimeType:c.mimeType})},o.onerror=()=>n(null)}):null}function Q7(e,t){if(t<=0||t>e.length)return null;let n=t-1;for(;n>=0;){const l=e[n];if(l===void 0)return null;if(l==="@")break;if(!/[A-Za-z0-9_-]/.test(l))return null;n--}if(n<0||e[n]!=="@")return null;if(n>0){const l=e[n-1];if(l!==void 0&&/[A-Za-z0-9_.@-]/.test(l))return null}const a=e.slice(n+1,t).toLowerCase();return{triggerIndex:n,query:a}}function G7(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let c=1/0;l.startsWith(t)?c=0:o.startsWith(t)?c=1:o.includes(t)&&(c=2),c!==1/0&&n.push({c:a,score:c})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function K7(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${c}${m}`,g=l.length+c.length+(f?1:0);return{text:h,cursor:g}}function Y7({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,c]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:Q7(e,t),[e,t,l]),g=x.useMemo(()=>h?G7(n,h.query):[],[h,n]),y=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[y]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,S=h!==null&&g.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const A=K7(e,h,t,C);A&&a(A)}return{trigger:S?h:null,results:S?g:[],highlightIndex:o,handleKey:C=>{if(!S||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),c(A=>g.length===0?0:(A+1)%g.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),c(A=>g.length===0?0:(A-1+g.length)%g.length),!0;if(C.key==="Enter"||C.key==="Tab"){const A=g[o]??g[0];return A?(C.preventDefault(),j(A),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function X7({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=x.useRef(null);return x.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:u.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:_e("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,right:0,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return u.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:g=>{g.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--accent-dim)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function fN(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function J7(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const n=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),a=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=ww(l.payload);if(!o)continue;const c=a.get(o)??-1;l.seq>c&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=ww(l.payload);return o?a.get(o)===l.seq:!0})}function ww(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function If(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(c=>c.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function hN(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function W7(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function kw(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function eH({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function tH({agentId:e,chatId:t,session:n}){const a=Nn(),[,l]=df(),[o,c]=x.useState(!1),[f,m]=x.useState(null),h=Gk(e,t),g=Zd(e),y=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(g,C=>C&&C.map(A=>A.chatId===t?{...A,state:E}:A))},b=gt({mutationFn:()=>cO(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:g});const E=a.getQueryData(h),C=a.getQueryData(g);return y("suspended"),{previousSession:E,previousList:C}},onError:(E,C,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(g,A.previousList)},onSuccess:E=>{y(E.state)}}),S=gt({mutationFn:()=>dO(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:g});const E=a.getQueryData(h),C=a.getQueryData(g);return a.setQueryData(g,A=>A&&A.filter(O=>O.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(g,A.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,A)=>{if(E.state!=="evicted"){A!=null&&A.previousList&&a.setQueryData(g,A.previousList),y(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),c(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&u.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[u.jsx(FR,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&u.jsxs("button",{type:"button",onClick:()=>{m(null),c(!0)},disabled:S.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[u.jsx(JR,{className:"h-3 w-3"})," Terminate"]})]}),u.jsx(nH,{open:o,onOpenChange:E=>{S.isPending||c(E),E||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function nH(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:c,onConfirm:f}=e;function m(g){g.preventDefault(),o||f()}const h=l.slice(0,8);return u.jsx(Pt,{open:t,onOpenChange:n,children:u.jsxs(Rt,{children:[u.jsx(Vt,{children:u.jsx(Bt,{children:"Terminate session?"})}),u.jsxs("form",{onSubmit:m,className:"space-y-4",children:[u.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),u.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[u.jsxs("span",{children:["chat: ",u.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&u.jsxs("span",{children:["last activity: ",hN(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&u.jsxs("span",{children:["messages: ",a.messageCount]})]}),c&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:c}),u.jsxs(Wt,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function rH({event:e}){const t=lO(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[a?u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):u.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),u.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?kw(t.args):void 0,children:[u.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?u.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",kw(t.args),")"]}):null,t.durationMs!==void 0&&!a?u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",W7(t.durationMs)]}):null]})]})}function aH({event:e,agentNameFn:t,agentId:n}){const a=oO(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[u.jsx(mN,{name:l,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:If(e.createdAt)}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function iH({event:e}){return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:If(e.createdAt)})]})}function lH({event:e}){const t=sO(e.payload),n=If(e.createdAt);return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[u.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),u.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function mN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return u.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:u.jsx(yl,{width:9,height:10,style:{color:"var(--accent)"}})})}function sH({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[u.jsx(mN,{name:a,isSelf:l}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:If(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(eH,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&oH(e.content)?u.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&uH(e.content)?u.jsx(cH,{content:e.content}):e.format==="text"?u.jsx(uN,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):u.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function oH(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.data=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function uH(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.imageId=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")&&typeof t.filename=="string"}function cH({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return V7(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?u.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function dH({agentId:e,chatId:t}){var Ct;const n=Nn(),a=Cl(),l=yy(),{agentId:o}=an(),[c,f]=x.useState(""),[m,h]=x.useState(0),[g,y]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),A=x.useRef(null),O=x.useRef(!1);x.useEffect(()=>{O.current=!1},[t]);const{data:L}=qe({queryKey:["chat-messages",t],queryFn:()=>F7(t,{limit:50}),refetchInterval:5e3}),{data:D}=qe({queryKey:["session-events",e,t],queryFn:()=>uO(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:z}=qe({queryKey:Gk(e,t),queryFn:()=>to(e).then(te=>te.find(Te=>Te.chatId===t)??null),refetchInterval:5e3}),{data:I}=qe({queryKey:["chat-detail",t],queryFn:()=>I7(t),enabled:!!t}),F=gt({mutationFn:te=>Sw(t,te),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Zd(e)})}}),ee=x.useCallback(te=>{const Ue=te.filter(un=>un.type.startsWith("image/"));if(Ue.length===0)return;const Fe=Ue.find(un=>un.size>5242880);if(Fe){j(`Image too large (${(Fe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Ft=Ue.map(un=>({id:crypto.randomUUID(),file:un,previewUrl:URL.createObjectURL(un)}));y(un=>[...un,...Ft]),j(null)},[]),H=x.useCallback(te=>{y(Te=>{const Ue=Te.find(Fe=>Fe.id===te);return Ue&&URL.revokeObjectURL(Ue.previewUrl),Te.filter(Fe=>Fe.id!==te)})},[]),ne=async()=>{const te=c.trim(),Te=g;if(!(!te&&Te.length===0)&&!b&&!($&&J.length===0)){if(Te.length>0){S(!0),j(null);try{for(const Ue of Te){const Fe=await B7(Ue.file),Ft=crypto.randomUUID();await Z7({imageId:Ft,base64:Fe,mimeType:Ue.file.type}),await P7(t,{data:Fe,mimeType:Ue.file.type,filename:Ue.file.name,size:Ue.file.size,imageId:Ft}),URL.revokeObjectURL(Ue.previewUrl)}y([]),te&&await Sw(t,te),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Zd(e)})}catch(Ue){j(Ue instanceof Error?Ue.message:"Failed to send image")}finally{S(!1)}return}F.mutate(te)}},[X,be]=x.useState(!1),[fe,ie]=x.useState(""),Z=x.useRef(null);x.useEffect(()=>{var te;X&&((te=Z.current)==null||te.focus())},[X]);const ae=gt({mutationFn:te=>U7(t,te),onSuccess:()=>{be(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),K=()=>{const te=fe.trim();ae.mutate(te.length>0?te:null)},he=x.useMemo(()=>{const te=(L==null?void 0:L.items)??[],Te=J7((D==null?void 0:D.items)??[]),Ue=[...te.map(Fe=>({kind:"message",at:Fe.createdAt,key:`m-${Fe.id}`,data:Fe})),...Te.map(Fe=>({kind:"event",at:Fe.createdAt,key:`e-${Fe.id}`,data:Fe}))];return Ue.sort((Fe,Ft)=>Fe.at.localeCompare(Ft.at)),Ue},[L,D]),T=he.length;x.useEffect(()=>{var te;T>0&&((te=A.current)==null||te.scrollIntoView({behavior:"smooth"}))},[T]);const P=I!=null&&I.participants?I.participants.map(te=>{const Te=a(te.agentId);return`@${Te.length>20?`${Te.slice(0,17)}…`:Te}`}).join(" "):`@${a(e)}`,B=a(e),_=x.useMemo(()=>{var Ue;const te=((Ue=I==null?void 0:I.participants)==null?void 0:Ue.map(Fe=>Fe.agentId))??[e],Te=[];for(const Fe of te){if(Fe===o)continue;const Ft=l(Fe);!Ft||!Ft.name||Te.push({agentId:Fe,name:Ft.name,displayName:Ft.displayName})}return Te},[I==null?void 0:I.participants,e,l,o]),$=x.useMemo(()=>{if(!I)return!1;if(I.type==="group")return!0;const te=I.participants.some(Te=>Te.agentId===o);return I.type==="direct"&&!te&&I.participants.length>=2},[I,o]),J=x.useMemo(()=>{if(!$)return[];const te=_.map(Te=>({agentId:Te.agentId,name:Te.name}));return VI(c,te)},[c,_,$]),ue=Y7({value:c,cursor:m,candidates:_,disabled:F.isPending||b,onSelect:te=>{f(te.text),h(te.cursor),requestAnimationFrame(()=>{const Te=C.current;Te&&(Te.focus(),Te.setSelectionRange(te.cursor,te.cursor))})}}),xe=(z==null?void 0:z.runtimeState)??"idle",Le=fN((z==null?void 0:z.runtimeState)??null,e?"connected":null),Se=(z==null?void 0:z.messageCount)??((Ct=L==null?void 0:L.items)==null?void 0:Ct.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(Kr,{state:Le,size:8}),X?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:Z,value:fe,onChange:te=>ie(te.target.value),onKeyDown:te=>{te.key==="Enter"?(te.preventDefault(),K()):te.key==="Escape"&&(te.preventDefault(),be(!1))},disabled:ae.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),u.jsx("button",{type:"button",onClick:K,disabled:ae.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(Na,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>be(!1),disabled:ae.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(ku,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(I==null?void 0:I.topic)||(z==null?void 0:z.summary)||`Chat · ${t.slice(0,8)}`}),u.jsx("button",{type:"button",onClick:()=>{ie((I==null?void 0:I.topic)??""),be(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:te=>te.currentTarget.style.color="var(--fg-2)",onMouseLeave:te=>te.currentTarget.style.color="var(--fg-4)",children:u.jsx(qu,{className:"h-3 w-3"})})]}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),u.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:P}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",hN((z==null?void 0:z.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Se," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:Le==="error"?"var(--state-error)":"var(--fg-2)"},children:xe})]})]})]}),u.jsx(tH,{agentId:e,chatId:t,session:z??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[T===0&&u.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[u.jsx(uy,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:he.map(te=>{if(te.kind==="event"){const Te=te.data;switch(Te.kind){case"tool_call":return u.jsx(rH,{event:Te},te.key);case"assistant_text":return u.jsx(aH,{event:Te,agentId:e,agentNameFn:a},te.key);case"thinking":return u.jsx(iH,{event:Te},te.key);case"error":return u.jsx(lH,{event:Te},te.key);default:return null}}return u.jsx(sH,{msg:te.data,myAgentId:o,agentNameFn:a},te.key)})}),u.jsx("div",{ref:A})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:te=>te.preventDefault(),onDrop:te=>{te.preventDefault(),ee(Array.from(te.dataTransfer.files))},children:[g.length>0&&u.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:g.map(te=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:te.previewUrl,alt:te.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>H(te.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:u.jsx(ku,{className:"h-2 w-2"})})]},te.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(X7,{trigger:ue.trigger,results:ue.results,highlightIndex:ue.highlightIndex,anchorRef:C,onPick:ue.pick}),u.jsx("textarea",{ref:C,value:c,onChange:te=>{f(te.target.value),h(te.target.selectionStart??te.target.value.length)},onSelect:te=>{h(te.currentTarget.selectionStart??c.length)},onFocus:()=>{$&&(O.current||c.length>0||_.length===0||(O.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const te=C.current;te&&te.setSelectionRange(1,1)})))},onPaste:te=>{const Te=Array.from(te.clipboardData.files);Te.length>0&&(te.preventDefault(),ee(Te))},placeholder:$?"Type @ to pick a recipient, then your message":`Message @${B} · / for commands · @ to mention`,rows:2,onKeyDown:te=>{ue.handleKey(te)||te.key==="Enter"&&!te.shiftKey&&(te.preventDefault(),ne())},disabled:F.isPending||b,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[u.jsx("button",{type:"button",onClick:()=>{var te;return(te=E.current)==null?void 0:te.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(BR,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:te=>{te.target.files&&(ee(Array.from(te.target.files)),te.target.value="")}}),u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:ne,disabled:F.isPending||b||!c.trim()&&g.length===0||$&&J.length===0,title:$&&J.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:_e("inline-flex items-center transition-colors text-label font-semibold",(F.isPending||b||!c.trim()&&g.length===0||$&&J.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[u.jsx(GR,{className:"h-3 w-3"})," Send"]})]})]})]}),(F.isError||k)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(F.error instanceof Error?F.error.message:"Failed to send")})]})]})}function fH(){const{shouldShowResumeCTA:e,open:t,step:n}=Wj();if(e){const a=n==="connect"?"Connect your computer to create your first agent.":n==="create_agent"?"Create your first agent to start collaborating.":"Finish setup to start collaborating.";return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(yl,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"No agents yet"}),u.jsx("div",{className:"text-body text-muted-foreground mb-4",children:a}),u.jsx(me,{onClick:t,children:"Resume setup"})]})})}return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(yl,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),u.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function hH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(dH,{agentId:e,chatId:t}):u.jsx(fH,{})}function pN(){const{data:e}=qe({queryKey:["clients"],queryFn:Zs,staleTime:1e4,refetchInterval:1e4});return x.useMemo(()=>{const t=e??[],n=new Map;for(const a of t)n.set(a.id,a);return{resolve:a=>a?n.get(a)??null:null,clients:t,connectedClients:t.filter(a=>a.status==="connected")}},[e])}function Fg({children:e}){return u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function gN({children:e}){return u.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Qr({label:e,children:t}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function jw(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function Cw(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<24?`${a}h ${n%60}m`:`${Math.floor(a/24)}d ${a%24}h`}function qp({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[u.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function mH({notifications:e,agentId:t}){const[,n]=df(),a=Nn(),l=gt({mutationFn:o=>Qj(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>u.jsx(Gj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function yN({agentId:e}){var h;const t=Cl(),{resolve:n}=pN(),{data:a}=qe({queryKey:["activity"],queryFn:Hu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(g=>g.agentId===e),o=n(l==null?void 0:l.clientId),{data:c}=qe({queryKey:["notifications","agent",e],queryFn:()=>kg({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(yl,{width:14,height:16,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),u.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),u.jsx(Ks,{state:m})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(qp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(qp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(qp,{label:"uptime",value:Cw((o==null?void 0:o.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx(Fg,{children:"Computer · runtime"}),u.jsxs(gN,{children:[u.jsx(Qr,{label:"host",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),u.jsx(Qr,{label:"os",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),u.jsx(Qr,{label:"runtime",children:u.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),u.jsx(Qr,{label:"sdk",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),u.jsx(Qr,{label:"connected",children:u.jsx("span",{className:"mono text-label",children:Cw((o==null?void 0:o.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),u.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[u.jsx(Fg,{children:"Notifications"}),!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):u.jsx(mH,{notifications:c.items,agentId:e})]})]})}function pH({agentId:e,chatId:t}){const{data:n}=qe({queryKey:["session",e,t],queryFn:()=>to(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx(Fg,{children:"Session"}),u.jsxs(gN,{children:[u.jsx(Qr,{label:"state",children:u.jsx(Ks,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),u.jsx(Qr,{label:"chat",children:u.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),u.jsx(Qr,{label:"started",children:jw((n==null?void 0:n.startedAt)??null)}),u.jsx(Qr,{label:"last",children:jw((n==null?void 0:n.lastActivityAt)??null)}),u.jsx(Qr,{label:"messages",children:u.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),u.jsx(yN,{agentId:e})]})}function gH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(pH,{agentId:e,chatId:t}):e?u.jsx(yN,{agentId:e}):null}const yH=32;function vH({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return u.jsx("div",{className:_e("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:yH}).map((l,o)=>{const c=e[o]??{workingCount:0,errorMask:!1},f=c.workingCount===0?.08:c.workingCount/a,m=.25+f*.7,h=c.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const bH={error:0,blocked:1,working:2,idle:3};function xH(e,t){return t?e?bH[e]??4:4:5}function SH(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function wH({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=Cl(),{resolve:o}=pN(),c=Y6(),[f,m]=x.useState(""),[h,g]=x.useState("all"),{data:y}=qe({queryKey:["activity"],queryFn:Hu,refetchInterval:1e4}),{data:b}=qe({queryKey:e?Zd(e):["agent-sessions",null],queryFn:()=>e?to(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),S=gt({mutationFn:D=>$7(D),onSuccess:(D,z)=>{a(z,D.id)}}),{humans:k,agents:j,totalAll:E}=x.useMemo(()=>{const D=(y==null?void 0:y.agents)??[],z=f.trim().toLowerCase(),I=D.filter(ne=>{var fe;if(!SH(ne,h))return!1;if(!z)return!0;const X=l(ne.agentId).toLowerCase(),be=ne.clientId?(((fe=o(ne.clientId))==null?void 0:fe.hostname)??"").toLowerCase():"";return X.includes(z)||be.includes(z)||ne.agentId.toLowerCase().includes(z)}),F=ne=>xH(ne.runtimeState,ne.clientId),ee=[],H=[];for(const ne of I)(ne.type==="human"?ee:H).push(ne);return ee.sort((ne,X)=>F(ne)-F(X)),H.sort((ne,X)=>F(ne)-F(X)),{humans:ee,agents:H,totalAll:D.length}},[y,f,h,l,o]),C=x.useMemo(()=>{const D=(y==null?void 0:y.agents)??[];return{working:D.filter(z=>z.runtimeState==="working").length,blocked:D.filter(z=>z.runtimeState==="blocked").length,error:D.filter(z=>z.runtimeState==="error").length}},[y]),A=[{value:"all",label:"all",count:E},{value:"active",label:"active",count:C.working},{value:"attn",label:"attn",count:C.blocked+C.error,warn:C.blocked+C.error>0}],O=D=>{var ne;const z=e===D.agentId,I=fN(D.runtimeState,D.clientId),F=D.clientId?((ne=o(D.clientId))==null?void 0:ne.hostname)??D.clientId.slice(0,8):null,ee=D.activeSessions??0,H=D.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>n(z?null:D.agentId),className:_e("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:z?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${z?"var(--accent)":"transparent"}`},children:[u.jsx(Kr,{state:I,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(D.agentId)}),D.type==="human"&&u.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),u.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:I==="offline"?"disconnected":F||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:H>0&&u.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[ee,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",H]})]})})]}),z&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!b||b.length===0)&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),b==null?void 0:b.filter(X=>X.state!=="evicted").map(X=>{const be=X.state==="active"?"working":"idle";return u.jsxs("button",{type:"button",onClick:()=>a(D.agentId,X.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===X.chatId?"var(--bg-hover)":"transparent",color:X.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:fe=>{t!==X.chatId&&(fe.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:fe=>{t!==X.chatId&&(fe.currentTarget.style.background="transparent")},children:[u.jsx(Kr,{state:be,size:6}),u.jsx("span",{className:"truncate text-body",style:{color:X.topic||X.summary?"var(--fg-2)":"var(--fg-4)"},children:X.topic||X.summary||`Chat · ${X.chatId.slice(0,8)}`})]},X.chatId)}),u.jsxs("button",{type:"button",onClick:()=>S.mutate(D.agentId),disabled:S.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:X=>{X.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:X=>{X.currentTarget.style.background="transparent"},children:[u.jsx(_a,{className:"h-3 w-3"}),"New chat"]})]})]},D.agentId)},L=k.length+j.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[E," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(ff,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:f,onChange:D=>m(D.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:A.map(D=>u.jsx(hu,{active:h===D.value,count:D.count,warn:D.warn,onClick:()=>g(D.value),children:D.label},D.value))})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[u.jsx(kH,{}),"5m"]}),u.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:c.stale?"stale":"live"})]}),u.jsx(vH,{aggregated:c.aggregated,stale:c.stale}),u.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[C.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[C.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[C.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[L===0&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:f||h!=="all"?"No matches":"No agents"}),j.length>0&&u.jsxs("div",{children:[u.jsx(Ew,{label:"Agents",count:j.length}),j.map(O)]}),k.length>0&&u.jsxs("div",{children:[u.jsx(Ew,{label:"Humans",count:k.length}),k.map(O)]})]})]})}function Ew({label:e,count:t}){return u.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function kH(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function jH(){const[e,t]=df(),n=e.get("a"),a=e.get("c");YC();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:c}=qe({queryKey:["agent-sessions",n],queryFn:()=>n?to(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!c||c.length===0)return;const f=[...c].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,a,c,t]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(wH,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(hH,{selectedAgentId:n,selectedChatId:a})}),n&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(gH,{selectedAgentId:n,selectedChatId:a})})]})}const CH=new fA({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function EH(){return u.jsx(hA,{client:CH,children:u.jsx(eR,{children:u.jsx(FT,{children:u.jsxs(yT,{children:[u.jsx(rr,{path:"/login",element:u.jsx(b7,{})}),u.jsx(rr,{path:"/signup",element:u.jsx(uf,{to:"/login",replace:!0})}),u.jsx(rr,{path:"/auth/github/complete",element:u.jsx(x7,{})}),u.jsx(rr,{path:"/invite/:token",element:u.jsx(y7,{})}),u.jsx(rr,{element:u.jsx(lR,{}),children:u.jsxs(rr,{element:u.jsx(K6,{children:u.jsx(VD,{children:u.jsx(sM,{})})}),children:[u.jsx(rr,{index:!0,element:u.jsx(jH,{})}),u.jsx(rr,{path:"agents",element:u.jsx(l7,{})}),u.jsx(rr,{path:"agents/:uuid",element:u.jsx(Hq,{})}),u.jsx(rr,{path:"clients",element:u.jsx(c7,{})}),u.jsx(rr,{path:"settings",element:u.jsx(L7,{})}),u.jsx(rr,{path:"admin",element:u.jsx(bU,{})})]})})]})})})})}const vN=document.getElementById("root");if(!vN)throw new Error("Root element not found");B2.createRoot(vN).render(u.jsx(x.StrictMode,{children:u.jsx(EH,{})}));export{yl as F,iy as L,lt as c,u as j,x as r};
|