@agent-team-foundation/first-tree-hub 0.10.14 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-B2x4TTyJ.mjs → bootstrap-DUeYbwm-.mjs} +60 -4
- package/dist/cli/index.mjs +6 -6
- package/dist/{dist-D6AOiyNg.mjs → dist-BoHl9HwW.mjs} +66 -2
- package/dist/drizzle/0030_chat_first_workspace.sql +129 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/{feishu-DQ1l18Ah.mjs → feishu-Dxk6ArOK.mjs} +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{invitation-CBnQyB7o-Bulf3Sl7.mjs → invitation-CBnQyB7o-TmnIj3kx.mjs} +1 -1
- package/dist/{saas-connect-DWcxHtjX.mjs → saas-connect-DLSyrQcC.mjs} +1394 -395
- package/dist/web/assets/index-BxGzfDTS.js +383 -0
- package/dist/web/assets/{index-BQda2sqe.js → index-COflQOwF.js} +1 -1
- package/dist/web/assets/{index-CKoTjI0J.css → index-DDqPt6PI.css} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-C7yW7sWI.js +0 -388
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
var X0=e=>{throw TypeError(e)};var Gm=(e,t,n)=>t.has(e)||X0("Cannot "+n);var M=(e,t,n)=>(Gm(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?X0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,a)=>(Gm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(Gm(e,t,"access private method"),n);var gd=(e,t,n,a)=>({set _(l){pe(e,t,l,n)},get _(){return M(e,t,a)}});function _2(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 df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},nu={};/**
|
|
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 J0;function T2(){if(J0)return nu;J0=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 nu.Fragment=t,nu.jsx=n,nu.jsxs=n,nu}var W0;function A2(){return W0||(W0=1,Ym.exports=T2()),Ym.exports}var u=A2(),Xm={exports:{}},$e={};/**
|
|
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 e1;function R2(){if(e1)return $e;e1=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"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function w(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function E(I,B,T){this.props=I,this.context=B,this.refs=C,this.updater=T||k}E.prototype.isReactComponent={},E.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,B,"setState")},E.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function A(){}A.prototype=E.prototype;function z(I,B,T){this.props=I,this.context=B,this.refs=C,this.updater=T||k}var U=z.prototype=new A;U.constructor=z,j(U,E.prototype),U.isPureReactComponent=!0;var D=Array.isArray;function O(){}var P={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function V(I,B,T){var q=T.ref;return{$$typeof:e,type:I,key:B,ref:q!==void 0?q:null,props:T}}function F(I,B){return V(I.type,B,I.props)}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ee(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(T){return B[T]})}var we=/\/+/g;function se(I,B){return typeof I=="object"&&I!==null&&I.key!=null?ee(""+I.key):B.toString(36)}function re(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(O,O):(I.status="pending",I.then(function(B){I.status==="pending"&&(I.status="fulfilled",I.value=B)},function(B){I.status==="pending"&&(I.status="rejected",I.reason=B)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function Z(I,B,T,q,Y){var ue=typeof I;(ue==="undefined"||ue==="boolean")&&(I=null);var ve=!1;if(I===null)ve=!0;else switch(ue){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(I.$$typeof){case e:case t:ve=!0;break;case y:return ve=I._init,Z(ve(I._payload),B,T,q,Y)}}if(ve)return Y=Y(I),ve=q===""?"."+se(I,0):q,D(Y)?(T="",ve!=null&&(T=ve.replace(we,"$&/")+"/"),Z(Y,B,T,"",function(Ge){return Ge})):Y!=null&&(X(Y)&&(Y=F(Y,T+(Y.key==null||I&&I.key===Y.key?"":(""+Y.key).replace(we,"$&/")+"/")+ve)),B.push(Y)),1;ve=0;var be=q===""?".":q+":";if(D(I))for(var fe=0;fe<I.length;fe++)q=I[fe],ue=be+se(q,fe),ve+=Z(q,B,T,ue,Y);else if(fe=w(I),typeof fe=="function")for(I=fe.call(I),fe=0;!(q=I.next()).done;)q=q.value,ue=be+se(q,fe++),ve+=Z(q,B,T,ue,Y);else if(ue==="object"){if(typeof I.then=="function")return Z(re(I),B,T,q,Y);throw B=String(I),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ve}function te(I,B,T){if(I==null)return I;var q=[],Y=0;return Z(I,q,"","",function(ue){return B.call(T,ue,Y++)}),q}function ye(I){if(I._status===-1){var B=I._result;B=B(),B.then(function(T){(I._status===0||I._status===-1)&&(I._status=1,I._result=T)},function(T){(I._status===0||I._status===-1)&&(I._status=2,I._result=T)}),I._status===-1&&(I._status=0,I._result=B)}if(I._status===1)return I._result.default;throw I._result}var Ae=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},_={map:te,forEach:function(I,B,T){te(I,function(){B.apply(this,arguments)},T)},count:function(I){var B=0;return te(I,function(){B++}),B},toArray:function(I){return te(I,function(B){return B})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return $e.Activity=g,$e.Children=_,$e.Component=E,$e.Fragment=n,$e.Profiler=l,$e.PureComponent=z,$e.StrictMode=a,$e.Suspense=m,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,$e.__COMPILER_RUNTIME={__proto__:null,c:function(I){return P.H.useMemoCache(I)}},$e.cache=function(I){return function(){return I.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(I,B,T){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var q=j({},I.props),Y=I.key;if(B!=null)for(ue in B.key!==void 0&&(Y=""+B.key),B)!L.call(B,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&B.ref===void 0||(q[ue]=B[ue]);var ue=arguments.length-2;if(ue===1)q.children=T;else if(1<ue){for(var ve=Array(ue),be=0;be<ue;be++)ve[be]=arguments[be+2];q.children=ve}return V(I.type,Y,q)},$e.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:o,_context:I},I},$e.createElement=function(I,B,T){var q,Y={},ue=null;if(B!=null)for(q in B.key!==void 0&&(ue=""+B.key),B)L.call(B,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(Y[q]=B[q]);var ve=arguments.length-2;if(ve===1)Y.children=T;else if(1<ve){for(var be=Array(ve),fe=0;fe<ve;fe++)be[fe]=arguments[fe+2];Y.children=be}if(I&&I.defaultProps)for(q in ve=I.defaultProps,ve)Y[q]===void 0&&(Y[q]=ve[q]);return V(I,ue,Y)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(I){return{$$typeof:f,render:I}},$e.isValidElement=X,$e.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:ye}},$e.memo=function(I,B){return{$$typeof:h,type:I,compare:B===void 0?null:B}},$e.startTransition=function(I){var B=P.T,T={};P.T=T;try{var q=I(),Y=P.S;Y!==null&&Y(T,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(O,Ae)}catch(ue){Ae(ue)}finally{B!==null&&T.types!==null&&(B.types=T.types),P.T=B}},$e.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},$e.use=function(I){return P.H.use(I)},$e.useActionState=function(I,B,T){return P.H.useActionState(I,B,T)},$e.useCallback=function(I,B){return P.H.useCallback(I,B)},$e.useContext=function(I){return P.H.useContext(I)},$e.useDebugValue=function(){},$e.useDeferredValue=function(I,B){return P.H.useDeferredValue(I,B)},$e.useEffect=function(I,B){return P.H.useEffect(I,B)},$e.useEffectEvent=function(I){return P.H.useEffectEvent(I)},$e.useId=function(){return P.H.useId()},$e.useImperativeHandle=function(I,B,T){return P.H.useImperativeHandle(I,B,T)},$e.useInsertionEffect=function(I,B){return P.H.useInsertionEffect(I,B)},$e.useLayoutEffect=function(I,B){return P.H.useLayoutEffect(I,B)},$e.useMemo=function(I,B){return P.H.useMemo(I,B)},$e.useOptimistic=function(I,B){return P.H.useOptimistic(I,B)},$e.useReducer=function(I,B,T){return P.H.useReducer(I,B,T)},$e.useRef=function(I){return P.H.useRef(I)},$e.useState=function(I){return P.H.useState(I)},$e.useSyncExternalStore=function(I,B,T){return P.H.useSyncExternalStore(I,B,T)},$e.useTransition=function(){return P.H.useTransition()},$e.version="19.2.4",$e}var t1;function Qg(){return t1||(t1=1,Xm.exports=R2()),Xm.exports}var x=Qg();const z2=df(x),Kg=_2({__proto__:null,default:z2},[x]);var Jm={exports:{}},ru={},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 n1;function O2(){return n1||(n1=1,(function(e){function t(Z,te){var ye=Z.length;Z.push(te);e:for(;0<ye;){var Ae=ye-1>>>1,_=Z[Ae];if(0<l(_,te))Z[Ae]=te,Z[ye]=_,ye=Ae;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var te=Z[0],ye=Z.pop();if(ye!==te){Z[0]=ye;e:for(var Ae=0,_=Z.length,I=_>>>1;Ae<I;){var B=2*(Ae+1)-1,T=Z[B],q=B+1,Y=Z[q];if(0>l(T,ye))q<_&&0>l(Y,T)?(Z[Ae]=Y,Z[q]=ye,Ae=q):(Z[Ae]=T,Z[B]=ye,Ae=B);else if(q<_&&0>l(Y,ye))Z[Ae]=Y,Z[q]=ye,Ae=q;else break e}}return te}function l(Z,te){var ye=Z.sortIndex-te.sortIndex;return ye!==0?ye:Z.id-te.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=[],y=1,g=null,b=3,w=!1,k=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function U(Z){for(var te=n(h);te!==null;){if(te.callback===null)a(h);else if(te.startTime<=Z)a(h),te.sortIndex=te.expirationTime,t(m,te);else break;te=n(h)}}function D(Z){if(j=!1,U(Z),!k)if(n(m)!==null)k=!0,O||(O=!0,ee());else{var te=n(h);te!==null&&re(D,te.startTime-Z)}}var O=!1,P=-1,L=5,V=-1;function F(){return C?!0:!(e.unstable_now()-V<L)}function X(){if(C=!1,O){var Z=e.unstable_now();V=Z;var te=!0;try{e:{k=!1,j&&(j=!1,A(P),P=-1),w=!0;var ye=b;try{t:{for(U(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&F());){var Ae=g.callback;if(typeof Ae=="function"){g.callback=null,b=g.priorityLevel;var _=Ae(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof _=="function"){g.callback=_,U(Z),te=!0;break t}g===n(m)&&a(m),U(Z)}else a(m);g=n(m)}if(g!==null)te=!0;else{var I=n(h);I!==null&&re(D,I.startTime-Z),te=!1}}break e}finally{g=null,b=ye,w=!1}te=void 0}}finally{te?ee():O=!1}}}var ee;if(typeof z=="function")ee=function(){z(X)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,se=we.port2;we.port1.onmessage=X,ee=function(){se.postMessage(null)}}else ee=function(){E(X,0)};function re(Z,te){P=E(function(){Z(e.unstable_now())},te)}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"):L=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 te=3;break;default:te=b}var ye=b;b=te;try{return Z()}finally{b=ye}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ye=b;b=Z;try{return te()}finally{b=ye}},e.unstable_scheduleCallback=function(Z,te,ye){var Ae=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?Ae+ye:Ae):ye=Ae,Z){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ye+_,Z={id:y++,callback:te,priorityLevel:Z,startTime:ye,expirationTime:_,sortIndex:-1},ye>Ae?(Z.sortIndex=ye,t(h,Z),n(m)===null&&Z===n(h)&&(j?(A(P),P=-1):j=!0,re(D,ye-Ae))):(Z.sortIndex=_,t(m,Z),k||w||(k=!0,O||(O=!0,ee()))),Z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(Z){var te=b;return function(){var ye=b;b=te;try{return Z.apply(this,arguments)}finally{b=ye}}}})(ep)),ep}var r1;function D2(){return r1||(r1=1,Wm.exports=O2()),Wm.exports}var tp={exports:{}},Sn={};/**
|
|
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 a1;function M2(){if(a1)return Sn;a1=1;var e=Qg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}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,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}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 Sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Sn.createPortal=function(m,h){var y=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,y)},Sn.flushSync=function(m){var h=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=y,a.d.f()}},Sn.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))},Sn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Sn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Sn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:y,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)},Sn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);a.d.L(m,y,{crossOrigin:g,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})}},Sn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},Sn.requestFormReset=function(m){a.d.r(m)},Sn.unstable_batchedUpdates=function(m,h){return m(h)},Sn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},Sn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Sn.version="19.2.4",Sn}var i1;function FS(){if(i1)return tp.exports;i1=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=M2(),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 l1;function I2(){if(l1)return ru;l1=1;var e=D2(),t=Qg(),n=FS();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 S=!1,N=p.child;N;){if(N===s){S=!0,s=p,d=v;break}if(N===d){S=!0,d=p,s=v;break}N=N.sibling}if(!S){for(N=v.child;N;){if(N===s){S=!0,s=v,d=p;break}if(N===d){S=!0,d=v,s=p;break}N=N.sibling}if(!S)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 y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),z=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function ee(r){return r===null||typeof r!="object"?null:(r=X&&r[X]||r["@@iterator"],typeof r=="function"?r:null)}var we=Symbol.for("react.client.reference");function se(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===we?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case z:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case U:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case P:return i=r.displayName||null,i!==null?i:se(r.type)||"Memo";case L:i=r._payload,r=r._init;try{return se(r(i))}catch{}}return null}var re=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Ae=[],_=-1;function I(r){return{current:r}}function B(r){0>_||(r.current=Ae[_],Ae[_]=null,_--)}function T(r,i){_++,Ae[_]=r.current,r.current=i}var q=I(null),Y=I(null),ue=I(null),ve=I(null);function be(r,i){switch(T(ue,i),T(Y,r),T(q,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?x0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=x0(i),r=w0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(q),T(q,r)}function fe(){B(q),B(Y),B(ue)}function Ge(r){r.memoizedState!==null&&T(ve,r);var i=q.current,s=w0(i,r.type);i!==s&&(T(Y,r),T(q,s))}function Ie(r){Y.current===r&&(B(q),B(Y)),ve.current===r&&(B(ve),Jo._currentValue=ye)}var ne,je;function Le(r){if(ne===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ne=i&&i[1]||"",je=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ne+r+je}var Pe=!1;function It(r,i){if(!r||Pe)return"";Pe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(W){var J=W}Reflect.construct(r,[],de)}else{try{de.call()}catch(W){J=W}r.call(de.prototype)}}else{try{throw Error()}catch(W){J=W}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(W){if(W&&J&&typeof W.stack=="string")return[W.stack,J.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(),S=v[0],N=v[1];if(S&&N){var $=S.split(`
|
|
44
|
-
`),G=N.split(`
|
|
45
|
-
`);for(p=d=0;d<$.length&&!$[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===$.length||p===G.length)for(d=$.length-1,p=G.length-1;1<=d&&0<=p&&$[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if($[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||$[d]!==G[p]){var ae=`
|
|
46
|
-
`+$[d].replace(" at new "," at ");return r.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",r.displayName)),ae}while(1<=d&&0<=p);break}}}finally{Pe=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Le(s):""}function dn(r,i){switch(r.tag){case 26:case 27:case 5:return Le(r.type);case 16:return Le("Lazy");case 13:return r.child!==i&&i!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return It(r.type,!1);case 11:return It(r.type.render,!1);case 1:return It(r.type,!0);case 31:return Le("Activity");default:return""}}function El(r){try{var i="",s=null;do i+=dn(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
-
Error generating stack: `+d.message+`
|
|
48
|
-
`+d.stack}}var Ma=Object.prototype.hasOwnProperty,Ia=e.unstable_scheduleCallback,Jr=e.unstable_cancelCallback,oo=e.unstable_shouldYield,uo=e.unstable_requestPaint,fn=e.unstable_now,co=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,Be=e.unstable_LowPriority,at=e.unstable_IdlePriority,hn=e.log,cr=e.unstable_setDisableYieldValue,tn=null,qt=null;function mn(r){if(typeof hn=="function"&&cr(r),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(tn,r)}catch{}}var ht=Math.clz32?Math.clz32:tc,Tr=Math.log,Dn=Math.LN2;function tc(r){return r>>>=0,r===0?32:31-(Tr(r)/Dn|0)|0}var Ii=256,Li=262144,Ui=4194304;function Ur(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 Pi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Ur(d):(S&=N,S!==0?p=Ur(S):s||(s=N&~r,s!==0&&(p=Ur(s))))):(N=d&~v,N!==0?p=Ur(N):S!==0?p=Ur(S):s||(s=d&~r,s!==0&&(p=Ur(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 La(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function nc(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 xe(){var r=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),r}function Xe(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function pn(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 S=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,$=r.expirationTimes,G=r.hiddenUpdates;for(s=S&~s;0<s;){var ae=31-ht(s),de=1<<ae;N[ae]=0,$[ae]=-1;var J=G[ae];if(J!==null)for(G[ae]=null,ae=0;ae<J.length;ae++){var W=J[ae];W!==null&&(W.lane&=-536870913)}s&=~de}d!==0&&fo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function fo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ht(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function rc(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-ht(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function av(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 iv(){var r=te.p;return r!==0?r:(r=window.event,r===void 0?32:H0(r.type))}function lv(r,i){var s=te.p;try{return te.p=r,i()}finally{te.p=s}}var Ua=Math.random().toString(36).slice(2),gn="__reactFiber$"+Ua,Mn="__reactProps$"+Ua,Nl="__reactContainer$"+Ua,Bf="__reactEvents$"+Ua,yN="__reactListeners$"+Ua,vN="__reactHandles$"+Ua,sv="__reactResources$"+Ua,ho="__reactMarker$"+Ua;function $f(r){delete r[gn],delete r[Mn],delete r[Bf],delete r[yN],delete r[vN]}function _l(r){var i=r[gn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Nl]||s[gn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=_0(r);r!==null;){if(s=r[gn])return s;r=_0(r)}return i}r=s,s=r.parentNode}return null}function Tl(r){if(r=r[gn]||r[Nl]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function mo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Al(r){var i=r[sv];return i||(i=r[sv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function on(r){r[ho]=!0}var ov=new Set,uv={};function Bi(r,i){Rl(r,i),Rl(r+"Capture",i)}function Rl(r,i){for(uv[r]=i,r=0;r<i.length;r++)ov.add(i[r])}var bN=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]*$"),cv={},dv={};function xN(r){return Ma.call(dv,r)?!0:Ma.call(cv,r)?!1:bN.test(r)?dv[r]=!0:(cv[r]=!0,!1)}function ac(r,i,s){if(xN(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 ic(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 fv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function wN(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(S){s=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Ff(r){if(!r._valueTracker){var i=fv(r)?"checked":"value";r._valueTracker=wN(r,i,""+r[i])}}function hv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=fv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function lc(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 SN=/[\n"\\]/g;function fr(r){return r.replace(SN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function qf(r,i,s,d,p,v,S,N){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+dr(i)):r.value!==""+dr(i)&&(r.value=""+dr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Hf(r,S,dr(i)):s!=null?Hf(r,S,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 mv(r,i,s,d,p,v,S,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,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Ff(r)}function Hf(r,i,s){i==="number"&&lc(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function zl(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 pv(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 gv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(re(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 Ol(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var kN=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 yv(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||kN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function vv(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&&yv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&yv(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 jN=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"]]),CN=/^[\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 sc(r){return CN.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 Dl=null,Ml=null;function bv(r){var i=Tl(r);if(i&&(r=i.stateNode)){var s=r[Mn]||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[Mn]||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&&hv(d)}break e;case"textarea":pv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&zl(r,!!s.multiple,i,!1)}}}var Kf=!1;function xv(r,i,s){if(Kf)return r(i,s);Kf=!0;try{var d=r(i);return d}finally{if(Kf=!1,(Dl!==null||Ml!==null)&&(Kc(),Dl&&(i=Dl,r=Ml,Ml=Dl=null,bv(i),r)))for(i=0;i<r.length;i++)bv(r[i])}}function po(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Mn]||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"),Gf=!1;if(na)try{var go={};Object.defineProperty(go,"passive",{get:function(){Gf=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{Gf=!1}var Pa=null,Yf=null,oc=null;function wv(){if(oc)return oc;var r,i=Yf,s=i.length,d,p="value"in Pa?Pa.value:Pa.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return oc=p.slice(r,1<d?1-d:void 0)}function uc(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 cc(){return!0}function Sv(){return!1}function In(r){function i(s,d,p,v,S){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=S,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)?cc:Sv,this.isPropagationStopped=Sv,this}return g(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=cc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=cc)},persist:function(){},isPersistent:cc}),i}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dc=In($i),yo=g({},$i,{view:0,detail:0}),EN=In(yo),Xf,Jf,vo,fc=g({},yo,{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!==vo&&(vo&&r.type==="mousemove"?(Xf=r.screenX-vo.screenX,Jf=r.screenY-vo.screenY):Jf=Xf=0,vo=r),Xf)},movementY:function(r){return"movementY"in r?r.movementY:Jf}}),kv=In(fc),NN=g({},fc,{dataTransfer:0}),_N=In(NN),TN=g({},yo,{relatedTarget:0}),Wf=In(TN),AN=g({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),RN=In(AN),zN=g({},$i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ON=In(zN),DN=g({},$i,{data:0}),jv=In(DN),MN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IN={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"},LN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=LN[r])?!!i[r]:!1}function eh(){return UN}var PN=g({},yo,{key:function(r){if(r.key){var i=MN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=uc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?IN[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"?uc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?uc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),BN=In(PN),$N=g({},fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cv=In($N),FN=g({},yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eh}),qN=In(FN),HN=g({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),ZN=In(HN),VN=g({},fc,{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}),QN=In(VN),KN=g({},$i,{newState:0,oldState:0}),GN=In(KN),YN=[9,13,27,32],th=na&&"CompositionEvent"in window,bo=null;na&&"documentMode"in document&&(bo=document.documentMode);var XN=na&&"TextEvent"in window&&!bo,Ev=na&&(!th||bo&&8<bo&&11>=bo),Nv=" ",_v=!1;function Tv(r,i){switch(r){case"keyup":return YN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Av(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Il=!1;function JN(r,i){switch(r){case"compositionend":return Av(i);case"keypress":return i.which!==32?null:(_v=!0,Nv);case"textInput":return r=i.data,r===Nv&&_v?null:r;default:return null}}function WN(r,i){if(Il)return r==="compositionend"||!th&&Tv(r,i)?(r=wv(),oc=Yf=Pa=null,Il=!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 Ev&&i.locale!=="ko"?null:i.data;default:return null}}var e_={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 Rv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!e_[r.type]:i==="textarea"}function zv(r,i,s,d){Dl?Ml?Ml.push(d):Ml=[d]:Dl=d,i=td(i,"onChange"),0<i.length&&(s=new dc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var xo=null,wo=null;function t_(r){m0(r,0)}function hc(r){var i=mo(r);if(hv(i))return r}function Ov(r,i){if(r==="change")return i}var Dv=!1;if(na){var nh;if(na){var rh="oninput"in document;if(!rh){var Mv=document.createElement("div");Mv.setAttribute("oninput","return;"),rh=typeof Mv.oninput=="function"}nh=rh}else nh=!1;Dv=nh&&(!document.documentMode||9<document.documentMode)}function Iv(){xo&&(xo.detachEvent("onpropertychange",Lv),wo=xo=null)}function Lv(r){if(r.propertyName==="value"&&hc(wo)){var i=[];zv(i,wo,r,Qf(r)),xv(t_,i)}}function n_(r,i,s){r==="focusin"?(Iv(),xo=i,wo=s,xo.attachEvent("onpropertychange",Lv)):r==="focusout"&&Iv()}function r_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return hc(wo)}function a_(r,i){if(r==="click")return hc(i)}function i_(r,i){if(r==="input"||r==="change")return hc(i)}function l_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Xn=typeof Object.is=="function"?Object.is:l_;function So(r,i){if(Xn(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(!Ma.call(i,p)||!Xn(r[p],i[p]))return!1}return!0}function Uv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Pv(r,i){var s=Uv(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=Uv(s)}}function Bv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Bv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function $v(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=lc(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=lc(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 s_=na&&"documentMode"in document&&11>=document.documentMode,Ll=null,ih=null,ko=null,lh=!1;function Fv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;lh||Ll==null||Ll!==lc(d)||(d=Ll,"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}),ko&&So(ko,d)||(ko=d,d=td(ih,"onSelect"),0<d.length&&(i=new dc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Ll)))}function Fi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Ul={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},sh={},qv={};na&&(qv=document.createElement("div").style,"AnimationEvent"in window||(delete Ul.animationend.animation,delete Ul.animationiteration.animation,delete Ul.animationstart.animation),"TransitionEvent"in window||delete Ul.transitionend.transition);function qi(r){if(sh[r])return sh[r];if(!Ul[r])return r;var i=Ul[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in qv)return sh[r]=i[s];return r}var Hv=qi("animationend"),Zv=qi("animationiteration"),Vv=qi("animationstart"),o_=qi("transitionrun"),u_=qi("transitionstart"),c_=qi("transitioncancel"),Qv=qi("transitionend"),Kv=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 Ar(r,i){Kv.set(r,i),Bi(i,[r])}var mc=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=[],Pl=0,uh=0;function pc(){for(var r=Pl,i=uh=Pl=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 S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}v!==0&&Gv(s,p,v)}}function gc(r,i,s,d){hr[Pl++]=r,hr[Pl++]=i,hr[Pl++]=s,hr[Pl++]=d,uh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function ch(r,i,s,d){return gc(r,i,s,d),yc(r)}function Hi(r,i){return gc(r,null,null,i),yc(r)}function Gv(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-ht(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function yc(r){if(50<Zo)throw Zo=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 Bl={};function d_(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 Jn(r,i,s,d){return new d_(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=Jn(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 Yv(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 vc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")dh(r)&&(S=1);else if(typeof r=="string")S=g2(r,s,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case V:return r=Jn(31,s,i,p),r.elementType=V,r.lanes=v,r;case j:return Zi(s.children,p,v,i);case C:S=8,p|=24;break;case E:return r=Jn(12,s,i,p|2),r.elementType=E,r.lanes=v,r;case D:return r=Jn(13,s,i,p),r.elementType=D,r.lanes=v,r;case O:return r=Jn(19,s,i,p),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:S=10;break e;case A:S=9;break e;case U:S=11;break e;case P:S=14;break e;case L:S=16,d=null;break e}S=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Jn(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Zi(r,i,s,d){return r=Jn(7,r,d,i),r.lanes=s,r}function fh(r,i,s){return r=Jn(6,r,null,i),r.lanes=s,r}function Xv(r){var i=Jn(18,null,null,0);return i.stateNode=r,i}function hh(r,i,s){return i=Jn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Jv=new WeakMap;function mr(r,i){if(typeof r=="object"&&r!==null){var s=Jv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:El(i)},Jv.set(r,i),i)}return{value:r,source:i,stack:El(i)}}var $l=[],Fl=0,bc=null,jo=0,pr=[],gr=0,Ba=null,Pr=1,Br="";function aa(r,i){$l[Fl++]=jo,$l[Fl++]=bc,bc=r,jo=i}function Wv(r,i,s){pr[gr++]=Pr,pr[gr++]=Br,pr[gr++]=Ba,Ba=r;var d=Pr;r=Br;var p=32-ht(d)-1;d&=~(1<<p),s+=1;var v=32-ht(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,Pr=1<<32-ht(i)+p|s<<p|d,Br=v+r}else Pr=1<<v|s<<p|d,Br=r}function mh(r){r.return!==null&&(aa(r,1),Wv(r,1,0))}function ph(r){for(;r===bc;)bc=$l[--Fl],$l[Fl]=null,jo=$l[--Fl],$l[Fl]=null;for(;r===Ba;)Ba=pr[--gr],pr[gr]=null,Br=pr[--gr],pr[gr]=null,Pr=pr[--gr],pr[gr]=null}function eb(r,i){pr[gr++]=Pr,pr[gr++]=Br,pr[gr++]=Ba,Pr=i.id,Br=i.overflow,Ba=r}var yn=null,Et=null,it=!1,$a=null,yr=!1,gh=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(mr(i,r)),gh}function tb(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[gn]=r,i[Mn]=d,s){case"dialog":We("cancel",i),We("close",i);break;case"iframe":case"object":case"embed":We("load",i);break;case"video":case"audio":for(s=0;s<Qo.length;s++)We(Qo[s],i);break;case"source":We("error",i);break;case"img":case"image":case"link":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"input":We("invalid",i),mv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":We("invalid",i);break;case"textarea":We("invalid",i),gv(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||v0(i.textContent,s)?(d.popover!=null&&(We("beforetoggle",i),We("toggle",i)),d.onScroll!=null&&We("scroll",i),d.onScrollEnd!=null&&We("scrollend",i),d.onClick!=null&&(i.onclick=ta),i=!0):i=!1,i||Fa(r,!0)}function nb(r){for(yn=r.return;yn;)switch(yn.tag){case 5:case 31:case 13:yr=!1;return;case 27:case 3:yr=!0;return;default:yn=yn.return}}function ql(r){if(r!==yn)return!1;if(!it)return nb(r),it=!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&&Fa(r),nb(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=N0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=N0(r)}else i===27?(i=Et,ni(r.type)?(r=Pm,Pm=null,Et=r):Et=i):Et=yn?br(r.stateNode.nextSibling):null;return!0}function Vi(){Et=yn=null,it=!1}function yh(){var r=$a;return r!==null&&(Bn===null?Bn=r:Bn.push.apply(Bn,r),$a=null),r}function Co(r){$a===null?$a=[r]:$a.push(r)}var vh=I(null),Qi=null,ia=null;function qa(r,i,s){T(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 S=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var $=0;$<i.length;$++)if(N.context===i[$]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),bh(v.return,s,r),d||(S=null);break e}v=N.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=s,v=S.alternate,v!==null&&(v.lanes|=s),bh(S,s,r),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===r){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Hl(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 S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var N=p.type;Xn(p.pendingProps.value,S.value)||(r!==null?r.push(N):r=[N])}}else if(p===ve.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Jo):r=[Jo])}p=p.return}r!==null&&xh(i,r,s,d),i.flags|=262144}function xc(r){for(r=r.firstContext;r!==null;){if(!Xn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ki(r){Qi=r,ia=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function vn(r){return rb(Qi,r)}function wc(r,i){return Qi===null&&Ki(r),rb(r,i)}function rb(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 f_=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()})}},h_=e.unstable_scheduleCallback,m_=e.unstable_NormalPriority,Qt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wh(){return{controller:new f_,data:new Map,refCount:0}}function Eo(r){r.refCount--,r.refCount===0&&h_(m_,function(){r.controller.abort()})}var No=null,Sh=0,Zl=0,Vl=null;function p_(r,i){if(No===null){var s=No=[];Sh=0,Zl=Cm(),Vl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return Sh++,i.then(ab,ab),i}function ab(){if(--Sh===0&&No!==null){Vl!==null&&(Vl.status="fulfilled");var r=No;No=null,Zl=0,Vl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function g_(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 ib=Z.S;Z.S=function(r,i){Fx=fn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&p_(r,i),ib!==null&&ib(r,i)};var Gi=I(null);function kh(){var r=Gi.current;return r!==null?r:St.pooledCache}function Sc(r,i){i===null?T(Gi,Gi.current):T(Gi,i.pool)}function lb(){var r=kh();return r===null?null:{parent:Qt._currentValue,pool:r}}var Ql=Error(a(460)),jh=Error(a(474)),kc=Error(a(542)),jc={then:function(){}};function sb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ob(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,cb(r),r;default:if(typeof i.status=="string")i.then(ta,ta);else{if(r=St,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,cb(r),r}throw Xi=i,Ql}}function Yi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Xi=s,Ql):s}}var Xi=null;function ub(){if(Xi===null)throw Error(a(459));var r=Xi;return Xi=null,r}function cb(r){if(r===Ql||r===kc)throw Error(a(483))}var Kl=null,_o=0;function Cc(r){var i=_o;return _o+=1,Kl===null&&(Kl=[]),ob(Kl,r,i)}function To(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Ec(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 db(r){function i(Q,H){if(r){var K=Q.deletions;K===null?(Q.deletions=[H],Q.flags|=16):K.push(H)}}function s(Q,H){if(!r)return null;for(;H!==null;)i(Q,H),H=H.sibling;return null}function d(Q){for(var H=new Map;Q!==null;)Q.key!==null?H.set(Q.key,Q):H.set(Q.index,Q),Q=Q.sibling;return H}function p(Q,H){return Q=ra(Q,H),Q.index=0,Q.sibling=null,Q}function v(Q,H,K){return Q.index=K,r?(K=Q.alternate,K!==null?(K=K.index,K<H?(Q.flags|=67108866,H):K):(Q.flags|=67108866,H)):(Q.flags|=1048576,H)}function S(Q){return r&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,H,K,oe){return H===null||H.tag!==6?(H=fh(K,Q.mode,oe),H.return=Q,H):(H=p(H,K),H.return=Q,H)}function $(Q,H,K,oe){var ze=K.type;return ze===j?ae(Q,H,K.props.children,oe,K.key):H!==null&&(H.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===L&&Yi(ze)===H.type)?(H=p(H,K.props),To(H,K),H.return=Q,H):(H=vc(K.type,K.key,K.props,null,Q.mode,oe),To(H,K),H.return=Q,H)}function G(Q,H,K,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=hh(K,Q.mode,oe),H.return=Q,H):(H=p(H,K.children||[]),H.return=Q,H)}function ae(Q,H,K,oe,ze){return H===null||H.tag!==7?(H=Zi(K,Q.mode,oe,ze),H.return=Q,H):(H=p(H,K),H.return=Q,H)}function de(Q,H,K){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=fh(""+H,Q.mode,K),H.return=Q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return K=vc(H.type,H.key,H.props,null,Q.mode,K),To(K,H),K.return=Q,K;case k:return H=hh(H,Q.mode,K),H.return=Q,H;case L:return H=Yi(H),de(Q,H,K)}if(re(H)||ee(H))return H=Zi(H,Q.mode,K,null),H.return=Q,H;if(typeof H.then=="function")return de(Q,Cc(H),K);if(H.$$typeof===z)return de(Q,wc(Q,H),K);Ec(Q,H)}return null}function J(Q,H,K,oe){var ze=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ze!==null?null:N(Q,H,""+K,oe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===ze?$(Q,H,K,oe):null;case k:return K.key===ze?G(Q,H,K,oe):null;case L:return K=Yi(K),J(Q,H,K,oe)}if(re(K)||ee(K))return ze!==null?null:ae(Q,H,K,oe,null);if(typeof K.then=="function")return J(Q,H,Cc(K),oe);if(K.$$typeof===z)return J(Q,H,wc(Q,K),oe);Ec(Q,K)}return null}function W(Q,H,K,oe,ze){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Q=Q.get(K)||null,N(H,Q,""+oe,ze);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:return Q=Q.get(oe.key===null?K:oe.key)||null,$(H,Q,oe,ze);case k:return Q=Q.get(oe.key===null?K:oe.key)||null,G(H,Q,oe,ze);case L:return oe=Yi(oe),W(Q,H,K,oe,ze)}if(re(oe)||ee(oe))return Q=Q.get(K)||null,ae(H,Q,oe,ze,null);if(typeof oe.then=="function")return W(Q,H,K,Cc(oe),ze);if(oe.$$typeof===z)return W(Q,H,K,wc(H,oe),ze);Ec(H,oe)}return null}function ke(Q,H,K,oe){for(var ze=null,ut=null,_e=H,Ze=H=0,nt=null;_e!==null&&Ze<K.length;Ze++){_e.index>Ze?(nt=_e,_e=null):nt=_e.sibling;var ct=J(Q,_e,K[Ze],oe);if(ct===null){_e===null&&(_e=nt);break}r&&_e&&ct.alternate===null&&i(Q,_e),H=v(ct,H,Ze),ut===null?ze=ct:ut.sibling=ct,ut=ct,_e=nt}if(Ze===K.length)return s(Q,_e),it&&aa(Q,Ze),ze;if(_e===null){for(;Ze<K.length;Ze++)_e=de(Q,K[Ze],oe),_e!==null&&(H=v(_e,H,Ze),ut===null?ze=_e:ut.sibling=_e,ut=_e);return it&&aa(Q,Ze),ze}for(_e=d(_e);Ze<K.length;Ze++)nt=W(_e,Q,Ze,K[Ze],oe),nt!==null&&(r&&nt.alternate!==null&&_e.delete(nt.key===null?Ze:nt.key),H=v(nt,H,Ze),ut===null?ze=nt:ut.sibling=nt,ut=nt);return r&&_e.forEach(function(si){return i(Q,si)}),it&&aa(Q,Ze),ze}function De(Q,H,K,oe){if(K==null)throw Error(a(151));for(var ze=null,ut=null,_e=H,Ze=H=0,nt=null,ct=K.next();_e!==null&&!ct.done;Ze++,ct=K.next()){_e.index>Ze?(nt=_e,_e=null):nt=_e.sibling;var si=J(Q,_e,ct.value,oe);if(si===null){_e===null&&(_e=nt);break}r&&_e&&si.alternate===null&&i(Q,_e),H=v(si,H,Ze),ut===null?ze=si:ut.sibling=si,ut=si,_e=nt}if(ct.done)return s(Q,_e),it&&aa(Q,Ze),ze;if(_e===null){for(;!ct.done;Ze++,ct=K.next())ct=de(Q,ct.value,oe),ct!==null&&(H=v(ct,H,Ze),ut===null?ze=ct:ut.sibling=ct,ut=ct);return it&&aa(Q,Ze),ze}for(_e=d(_e);!ct.done;Ze++,ct=K.next())ct=W(_e,Q,Ze,ct.value,oe),ct!==null&&(r&&ct.alternate!==null&&_e.delete(ct.key===null?Ze:ct.key),H=v(ct,H,Ze),ut===null?ze=ct:ut.sibling=ct,ut=ct);return r&&_e.forEach(function(N2){return i(Q,N2)}),it&&aa(Q,Ze),ze}function xt(Q,H,K,oe){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var ze=K.key;H!==null;){if(H.key===ze){if(ze=K.type,ze===j){if(H.tag===7){s(Q,H.sibling),oe=p(H,K.props.children),oe.return=Q,Q=oe;break e}}else if(H.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===L&&Yi(ze)===H.type){s(Q,H.sibling),oe=p(H,K.props),To(oe,K),oe.return=Q,Q=oe;break e}s(Q,H);break}else i(Q,H);H=H.sibling}K.type===j?(oe=Zi(K.props.children,Q.mode,oe,K.key),oe.return=Q,Q=oe):(oe=vc(K.type,K.key,K.props,null,Q.mode,oe),To(oe,K),oe.return=Q,Q=oe)}return S(Q);case k:e:{for(ze=K.key;H!==null;){if(H.key===ze)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){s(Q,H.sibling),oe=p(H,K.children||[]),oe.return=Q,Q=oe;break e}else{s(Q,H);break}else i(Q,H);H=H.sibling}oe=hh(K,Q.mode,oe),oe.return=Q,Q=oe}return S(Q);case L:return K=Yi(K),xt(Q,H,K,oe)}if(re(K))return ke(Q,H,K,oe);if(ee(K)){if(ze=ee(K),typeof ze!="function")throw Error(a(150));return K=ze.call(K),De(Q,H,K,oe)}if(typeof K.then=="function")return xt(Q,H,Cc(K),oe);if(K.$$typeof===z)return xt(Q,H,wc(Q,K),oe);Ec(Q,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,H!==null&&H.tag===6?(s(Q,H.sibling),oe=p(H,K),oe.return=Q,Q=oe):(s(Q,H),oe=fh(K,Q.mode,oe),oe.return=Q,Q=oe),S(Q)):s(Q,H)}return function(Q,H,K,oe){try{_o=0;var ze=xt(Q,H,K,oe);return Kl=null,ze}catch(_e){if(_e===Ql||_e===kc)throw _e;var ut=Jn(29,_e,null,Q.mode);return ut.lanes=oe,ut.return=Q,ut}finally{}}}var Ji=db(!0),fb=db(!1),Ha=!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 Za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Va(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ft&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=yc(r),Gv(r,null,s),i}return gc(r,d,i,s),yc(r)}function Ao(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,rc(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 S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=S:v=v.next=S,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 Ro(){if(_h){var r=Vl;if(r!==null)throw r}}function zo(r,i,s,d){_h=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var $=N,G=$.next;$.next=null,S===null?v=G:S.next=G,S=$;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,N=ae.lastBaseUpdate,N!==S&&(N===null?ae.firstBaseUpdate=G:N.next=G,ae.lastBaseUpdate=$))}if(v!==null){var de=p.baseState;S=0,ae=G=$=null,N=v;do{var J=N.lane&-536870913,W=J!==N.lane;if(W?(tt&J)===J:(d&J)===J){J!==0&&J===Zl&&(_h=!0),ae!==null&&(ae=ae.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ke=r,De=N;J=i;var xt=s;switch(De.tag){case 1:if(ke=De.payload,typeof ke=="function"){de=ke.call(xt,de,J);break e}de=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=De.payload,J=typeof ke=="function"?ke.call(xt,de,J):ke,J==null)break e;de=g({},de,J);break e;case 2:Ha=!0}}J=N.callback,J!==null&&(r.flags|=64,W&&(r.flags|=8192),W=p.callbacks,W===null?p.callbacks=[J]:W.push(J))}else W={lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ae===null?(G=ae=W,$=de):ae=ae.next=W,S|=J;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);ae===null&&($=de),p.baseState=$,p.firstBaseUpdate=G,p.lastBaseUpdate=ae,v===null&&(p.shared.lanes=0),Xa|=S,r.lanes=S,r.memoizedState=de}}function hb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function mb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)hb(s[r],i)}var Gl=I(null),Nc=I(0);function pb(r,i){r=pa,T(Nc,r),T(Gl,i),pa=r|i.baseLanes}function Th(){T(Nc,pa),T(Gl,Gl.current)}function Ah(){pa=Nc.current,B(Gl),B(Nc)}var Wn=I(null),vr=null;function Qa(r){var i=r.alternate;T(Ht,Ht.current&1),T(Wn,r),vr===null&&(i===null||Gl.current!==null||i.memoizedState!==null)&&(vr=r)}function Rh(r){T(Ht,Ht.current),T(Wn,r),vr===null&&(vr=r)}function gb(r){r.tag===22?(T(Ht,Ht.current),T(Wn,r),vr===null&&(vr=r)):Ka()}function Ka(){T(Ht,Ht.current),T(Wn,Wn.current)}function er(r){B(Wn),vr===r&&(vr=null),B(Ht)}var Ht=I(0);function _c(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Lm(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,vt=null,Kt=null,Tc=!1,Yl=!1,Wi=!1,Ac=0,Oo=0,Xl=null,y_=0;function Lt(){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(!Xn(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?Wb:Kh,Wi=!1,v=s(d,p),Wi=!1,Yl&&(v=vb(i,s,d,p)),yb(r),v}function yb(r){Z.H=Io;var i=vt!==null&&vt.next!==null;if(sa=0,Kt=vt=He=null,Tc=!1,Oo=0,Xl=null,i)throw Error(a(300));r===null||Gt||(r=r.dependencies,r!==null&&xc(r)&&(Gt=!0))}function vb(r,i,s,d){He=r;var p=0;do{if(Yl&&(Xl=null),Oo=0,Yl=!1,25<=p)throw Error(a(301));if(p+=1,Kt=vt=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=ex,v=i(s,d)}while(Yl);return v}function v_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Do(i):i,r=r.useState()[0],(vt!==null?vt.memoizedState:null)!==r&&(He.flags|=1024),i}function Dh(){var r=Ac!==0;return Ac=0,r}function Mh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Ih(r){if(Tc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Tc=!1}sa=0,Kt=vt=He=null,Yl=!1,Oo=Ac=0,Xl=null}function Tn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?He.memoizedState=Kt=r:Kt=Kt.next=r,Kt}function Zt(){if(vt===null){var r=He.alternate;r=r!==null?r.memoizedState:null}else r=vt.next;var i=Kt===null?He.memoizedState:Kt.next;if(i!==null)Kt=i,vt=r;else{if(r===null)throw He.alternate===null?Error(a(467)):Error(a(310));vt=r,r={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Kt===null?He.memoizedState=Kt=r:Kt=Kt.next=r}return Kt}function Rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(r){var i=Oo;return Oo+=1,Xl===null&&(Xl=[]),r=ob(Xl,r,i),i=He,(Kt===null?i.memoizedState:Kt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Wb:Kh),r}function zc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Do(r);if(r.$$typeof===z)return vn(r)}throw Error(a(438,String(r)))}function Lh(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=Rc(),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]=F;return i.index++,s}function oa(r,i){return typeof i=="function"?i(r):i}function Oc(r){var i=Zt();return Uh(i,vt,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 S=p.next;p.next=v.next,v.next=S}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=S=null,$=null,G=i,ae=!1;do{var de=G.lane&-536870913;if(de!==G.lane?(tt&de)===de:(sa&de)===de){var J=G.revertLane;if(J===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),de===Zl&&(ae=!0);else if((sa&J)===J){G=G.next,J===Zl&&(ae=!0);continue}else de={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},$===null?(N=$=de,S=v):$=$.next=de,He.lanes|=J,Xa|=J;de=G.action,Wi&&s(v,de),v=G.hasEagerState?G.eagerState:s(v,de)}else J={lane:de,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},$===null?(N=$=J,S=v):$=$.next=J,He.lanes|=de,Xa|=de;G=G.next}while(G!==null&&G!==i);if($===null?S=v:$.next=N,!Xn(v,r.memoizedState)&&(Gt=!0,ae&&(s=Vl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=$,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 S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);Xn(v,i.memoizedState)||(Gt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function bb(r,i,s){var d=He,p=Zt(),v=it;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!Xn((vt||p).memoizedState,s);if(S&&(p.memoizedState=s,Gt=!0),p=p.queue,Fh(Sb.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Kt!==null&&Kt.memoizedState.tag&1){if(d.flags|=2048,Jl(9,{destroy:void 0},wb.bind(null,d,p,s,i),null),St===null)throw Error(a(349));v||(sa&127)!==0||xb(d,i,s)}return s}function xb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=He.updateQueue,i===null?(i=Rc(),He.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function wb(r,i,s,d){i.value=s,i.getSnapshot=d,kb(i)&&jb(r)}function Sb(r,i,s){return s(function(){kb(i)&&jb(r)})}function kb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Xn(r,s)}catch{return!0}}function jb(r){var i=Hi(r,2);i!==null&&$n(i,r,2)}function Bh(r){var i=Tn();if(typeof r=="function"){var s=r;if(r=s(),Wi){mn(!0);try{s()}finally{mn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},i}function Cb(r,i,s,d){return r.baseState=s,Uh(r,vt,typeof d=="function"?d:oa)}function b_(r,i,s,d,p){if(Ic(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(S){v.listeners.push(S)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,Eb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Eb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,S={};Z.T=S;try{var N=s(p,d),$=Z.S;$!==null&&$(S,N),Nb(r,i,N)}catch(G){$h(r,i,G)}finally{v!==null&&S.types!==null&&(v.types=S.types),Z.T=v}}else try{v=s(p,d),Nb(r,i,v)}catch(G){$h(r,i,G)}}function Nb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){_b(r,i,d)},function(d){return $h(r,i,d)}):_b(r,i,s)}function _b(r,i,s){i.status="fulfilled",i.value=s,Tb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Eb(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,Tb(i),i=i.next;while(i!==d)}r.action=null}function Tb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Ab(r,i){return i}function Rb(r,i){if(it){var s=St.formState;if(s!==null){e:{var d=He;if(it){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}}Fa(d)}d=!1}d&&(i=s[0])}}return s=Tn(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ab,lastRenderedState:i},s.queue=d,s=Yb.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=b_.bind(null,He,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function zb(r){var i=Zt();return Ob(i,vt,r)}function Ob(r,i,s){if(i=Uh(r,i,Ab)[0],r=Oc(oa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Do(i)}catch(S){throw S===Ql?kc:S}else d=i;i=Zt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(He.flags|=2048,Jl(9,{destroy:void 0},x_.bind(null,p,s),null)),[d,v,r]}function x_(r,i){r.action=i}function Db(r){var i=Zt(),s=vt;if(s!==null)return Ob(i,s,r);Zt(),i=i.memoizedState,s=Zt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Jl(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=He.updateQueue,i===null&&(i=Rc(),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 Mb(){return Zt().memoizedState}function Dc(r,i,s,d){var p=Tn();He.flags|=r,p.memoizedState=Jl(1|i,{destroy:void 0},s,d===void 0?null:d)}function Mc(r,i,s,d){var p=Zt();d=d===void 0?null:d;var v=p.memoizedState.inst;vt!==null&&d!==null&&zh(d,vt.memoizedState.deps)?p.memoizedState=Jl(i,v,s,d):(He.flags|=r,p.memoizedState=Jl(1|i,v,s,d))}function Ib(r,i){Dc(8390656,8,r,i)}function Fh(r,i){Mc(2048,8,r,i)}function w_(r){He.flags|=4;var i=He.updateQueue;if(i===null)i=Rc(),He.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Lb(r){var i=Zt().memoizedState;return w_({ref:i,nextImpl:r}),function(){if((ft&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Ub(r,i){return Mc(4,2,r,i)}function Pb(r,i){return Mc(4,4,r,i)}function Bb(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 $b(r,i,s){s=s!=null?s.concat([r]):null,Mc(4,4,Bb.bind(null,i,r),s)}function qh(){}function Fb(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 qb(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(),Wi){mn(!0);try{r()}finally{mn(!1)}}return s.memoizedState=[d,i],d}function Hh(r,i,s){return s===void 0||(sa&1073741824)!==0&&(tt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Hx(),He.lanes|=r,Xa|=r,s)}function Hb(r,i,s,d){return Xn(s,i)?s:Gl.current!==null?(r=Hh(r,s,d),Xn(r,i)||(Gt=!0),r):(sa&42)===0||(sa&1073741824)!==0&&(tt&261930)===0?(Gt=!0,r.memoizedState=s):(r=Hx(),He.lanes|=r,Xa|=r,i)}function Zb(r,i,s,d,p){var v=te.p;te.p=v!==0&&8>v?v:8;var S=Z.T,N={};Z.T=N,Qh(r,!1,i,s);try{var $=p(),G=Z.S;if(G!==null&&G(N,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=g_($,d);Mo(r,i,ae,rr(r))}else Mo(r,i,d,rr(r))}catch(de){Mo(r,i,{then:function(){},status:"rejected",reason:de},rr())}finally{te.p=v,S!==null&&N.types!==null&&(S.types=N.types),Z.T=S}}function S_(){}function Zh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=Vb(r).queue;Zb(r,p,i,ye,s===null?S_:function(){return Qb(r),s(d)})}function Vb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:ye},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 Qb(r){var i=Vb(r);i.next===null&&(i=r.alternate.memoizedState),Mo(r,i.next.queue,{},rr())}function Vh(){return vn(Jo)}function Kb(){return Zt().memoizedState}function Gb(){return Zt().memoizedState}function k_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=rr();r=Za(s);var d=Va(i,r,s);d!==null&&($n(d,i,s),Ao(d,i,s)),i={cache:wh()},r.payload=i;return}i=i.return}}function j_(r,i,s){var d=rr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ic(r)?Xb(i,s):(s=ch(r,i,s,d),s!==null&&($n(s,r,d),Jb(s,i,d)))}function Yb(r,i,s){var d=rr();Mo(r,i,s,d)}function Mo(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ic(r))Xb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,N=v(S,s);if(p.hasEagerState=!0,p.eagerState=N,Xn(N,S))return gc(r,i,p,0),St===null&&pc(),!1}catch{}finally{}if(s=ch(r,i,p,d),s!==null)return $n(s,r,d),Jb(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},Ic(r)){if(i)throw Error(a(479))}else i=ch(r,s,d,2),i!==null&&$n(i,r,2)}function Ic(r){var i=r.alternate;return r===He||i!==null&&i===He}function Xb(r,i){Yl=Tc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Jb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,rc(r,s)}}var Io={readContext:vn,use:zc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};Io.useEffectEvent=Lt;var Wb={readContext:vn,use:zc,useCallback:function(r,i){return Tn().memoizedState=[r,i===void 0?null:i],r},useContext:vn,useEffect:Ib,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Dc(4194308,4,Bb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Dc(4194308,4,r,i)},useInsertionEffect:function(r,i){Dc(4,2,r,i)},useMemo:function(r,i){var s=Tn();i=i===void 0?null:i;var d=r();if(Wi){mn(!0);try{r()}finally{mn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=Tn();if(s!==void 0){var p=s(i);if(Wi){mn(!0);try{s(i)}finally{mn(!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=j_.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=Yb.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=Zb.bind(null,He,r.queue,!0,!1),Tn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=He,p=Tn();if(it){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),St===null)throw Error(a(349));(tt&127)!==0||xb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Ib(Sb.bind(null,d,v,r),[r]),d.flags|=2048,Jl(9,{destroy:void 0},wb.bind(null,d,v,s,i),null),s},useId:function(){var r=Tn(),i=St.identifierPrefix;if(it){var s=Br,d=Pr;s=(d&~(1<<32-ht(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ac++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=y_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Vh,useFormState:Rb,useActionState:Rb,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:Lh,useCacheRefresh:function(){return Tn().memoizedState=k_.bind(null,He)},useEffectEvent:function(r){var i=Tn(),s={impl:r};return i.memoizedState=s,function(){if((ft&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Kh={readContext:vn,use:zc,useCallback:Fb,useContext:vn,useEffect:Fh,useImperativeHandle:$b,useInsertionEffect:Ub,useLayoutEffect:Pb,useMemo:qb,useReducer:Oc,useRef:Mb,useState:function(){return Oc(oa)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return Hb(s,vt.memoizedState,r,i)},useTransition:function(){var r=Oc(oa)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:bb,useId:Kb,useHostTransitionStatus:Vh,useFormState:zb,useActionState:zb,useOptimistic:function(r,i){var s=Zt();return Cb(s,vt,r,i)},useMemoCache:Lh,useCacheRefresh:Gb};Kh.useEffectEvent=Lb;var ex={readContext:vn,use:zc,useCallback:Fb,useContext:vn,useEffect:Fh,useImperativeHandle:$b,useInsertionEffect:Ub,useLayoutEffect:Pb,useMemo:qb,useReducer:Ph,useRef:Mb,useState:function(){return Ph(oa)},useDebugValue:qh,useDeferredValue:function(r,i){var s=Zt();return vt===null?Hh(s,r,i):Hb(s,vt.memoizedState,r,i)},useTransition:function(){var r=Ph(oa)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:Do(r),i]},useSyncExternalStore:bb,useId:Kb,useHostTransitionStatus:Vh,useFormState:Db,useActionState:Db,useOptimistic:function(r,i){var s=Zt();return vt!==null?Cb(s,vt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Lh,useCacheRefresh:Gb};ex.useEffectEvent=Lb;function Gh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Yh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=rr(),p=Za(d);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&($n(i,r,d),Ao(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=rr(),p=Za(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&($n(i,r,d),Ao(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=rr(),d=Za(s);d.tag=2,i!=null&&(d.callback=i),i=Va(r,d,s),i!==null&&($n(i,r,s),Ao(i,r,s))}};function tx(r,i,s,d,p,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!So(s,d)||!So(p,v):!0}function nx(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 el(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=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function rx(r){mc(r)}function ax(r){console.error(r)}function ix(r){mc(r)}function Lc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function lx(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=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){Lc(r,i)},s}function sx(r){return r=Za(r),r.tag=3,r}function ox(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(){lx(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){lx(i,s,d),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function C_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Hl(i,s,p,!0),s=Wn.current,s!==null){switch(s.tag){case 31:case 13:return vr===null?Gc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===jc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),Sm(r,d,p)),!1;case 22:return s.flags|=65536,d===jc?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)),Sm(r,d,p)),!1}throw Error(a(435,s.tag))}return Sm(r,d,p),Gc(),!1}if(it)return i=Wn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==gh&&(r=Error(a(422),{cause:d}),Co(mr(r,s)))):(d!==gh&&(i=Error(a(423),{cause:d}),Co(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),Ut!==4&&(Ut=2)),!1;var v=Error(a(520),{cause:d});if(v=mr(v,s),Ho===null?Ho=[v]:Ho.push(v),Ut!==4&&(Ut=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"&&(Ja===null||!Ja.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=sx(p),ox(p,r,s,d),Nh(s,p),!1}s=s.return}while(s!==null);return!1}var Jh=Error(a(461)),Gt=!1;function bn(r,i,s,d){i.child=r===null?fb(i,null,s,d):Ji(i,r.child,s,d)}function ux(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var N in d)N!=="ref"&&(S[N]=d[N])}else S=d;return Ki(i),d=Oh(r,i,s,S,v,p),N=Dh(),r!==null&&!Gt?(Mh(r,i,p),ua(r,i,p)):(it&&N&&mh(i),i.flags|=1,bn(r,i,d,p),i.child)}function cx(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,dx(r,i,v,d,p)):(r=vc(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 S=v.memoizedProps;if(s=s.compare,s=s!==null?s:So,s(S,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 dx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(So(v,d)&&r.ref===i.ref)if(Gt=!1,i.pendingProps=d=v,lm(r,p))(r.flags&131072)!==0&&(Gt=!0);else return i.lanes=r.lanes,ua(r,i,p)}return Wh(r,i,s,d,p)}function fx(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 hx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Sc(i,v!==null?v.cachePool:null),v!==null?pb(i,v):Th(),gb(i);else return d=i.lanes=536870912,hx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(Sc(i,v.cachePool),pb(i,v),Ka(),i.memoizedState=null):(r!==null&&Sc(i,null),Th(),Ka());return bn(r,i,p,s),i.child}function Lo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function hx(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&&Sc(i,null),Th(),gb(i),r!==null&&Hl(r,i,d,!0),i.childLanes=p,null}function Uc(r,i){return i=Bc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function mx(r,i,s){return Ji(i,r.child,null,s),r=Uc(i,i.pendingProps),r.flags|=2,er(i),i.memoizedState=null,r}function E_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(it){if(d.mode==="hidden")return r=Uc(i,d),i.lanes=536870912,Lo(null,r);if(Rh(i),(r=Et)?(r=E0(r,yr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Pr,overflow:Br}:null,retryLane:536870912,hydrationErrors:null},s=Xv(r),s.return=i,i.child=s,yn=i,Et=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return Uc(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(Rh(i),p)if(i.flags&256)i.flags&=-257,i=mx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Gt||Hl(r,i,s,!1),p=(s&r.childLanes)!==0,Gt||p){if(d=St,d!==null&&(S=av(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,Hi(r,S),$n(d,r,S),Jh;Gc(),i=mx(r,i,s)}else r=v.treeContext,Et=br(S.nextSibling),yn=i,it=!0,$a=null,yr=!1,r!==null&&eb(i,r),i=Uc(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 Pc(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 Ki(i),s=Oh(r,i,s,d,void 0,p),d=Dh(),r!==null&&!Gt?(Mh(r,i,p),ua(r,i,p)):(it&&d&&mh(i),i.flags|=1,bn(r,i,s,p),i.child)}function px(r,i,s,d,p,v){return Ki(i),i.updateQueue=null,s=vb(i,d,s,p),yb(r),d=Dh(),r!==null&&!Gt?(Mh(r,i,v),ua(r,i,v)):(it&&d&&mh(i),i.flags|=1,bn(r,i,s,v),i.child)}function gx(r,i,s,d,p){if(Ki(i),i.stateNode===null){var v=Bl,S=s.contextType;typeof S=="object"&&S!==null&&(v=vn(S)),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),S=s.contextType,v.context=typeof S=="object"&&S!==null?vn(S):Bl,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Gh(i,s,S,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Yh.enqueueReplaceState(v,v.state,null),zo(i,d,v,p),Ro(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,$=el(s,N);v.props=$;var G=v.context,ae=s.contextType;S=Bl,typeof ae=="object"&&ae!==null&&(S=vn(ae));var de=s.getDerivedStateFromProps;ae=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ae||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==S)&&nx(i,v,d,S),Ha=!1;var J=i.memoizedState;v.state=J,zo(i,d,v,p),Ro(),G=i.memoizedState,N||J!==G||Ha?(typeof de=="function"&&(Gh(i,s,de,d),G=i.memoizedState),($=Ha||tx(i,s,$,d,J,G,S))?(ae||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=S,d=$):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Eh(r,i),S=i.memoizedProps,ae=el(s,S),v.props=ae,de=i.pendingProps,J=v.context,G=s.contextType,$=Bl,typeof G=="object"&&G!==null&&($=vn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==de||J!==$)&&nx(i,v,d,$),Ha=!1,J=i.memoizedState,v.state=J,zo(i,d,v,p),Ro();var W=i.memoizedState;S!==de||J!==W||Ha||r!==null&&r.dependencies!==null&&xc(r.dependencies)?(typeof N=="function"&&(Gh(i,s,N,d),W=i.memoizedState),(ae=Ha||tx(i,s,ae,d,J,W,$)||r!==null&&r.dependencies!==null&&xc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,W,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,W,$)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=W),v.props=d,v.state=W,v.context=$,d=ae):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Pc(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=Ji(i,r.child,null,p),i.child=Ji(i,null,s,p)):bn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ua(r,i,p),r}function yx(r,i,s,d){return Vi(),i.flags|=256,bn(r,i,s,d),i.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(r){return{baseLanes:r,cachePool:lb()}}function nm(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=nr),r}function vx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(Ht.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(it){if(p?Qa(i):Ka(),(r=Et)?(r=E0(r,yr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Pr,overflow:Br}:null,retryLane:536870912,hydrationErrors:null},s=Xv(r),s.return=i,i.child=s,yn=i,Et=null)):r=null,r===null)throw Fa(i);return Um(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(Ka(),p=i.mode,N=Bc({mode:"hidden",children:N},p),d=Zi(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,S,s),i.memoizedState=em,Lo(null,d)):(Qa(i),rm(i,N))}var $=r.memoizedState;if($!==null&&(N=$.dehydrated,N!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=am(r,i,s)):i.memoizedState!==null?(Ka(),i.child=r.child,i.flags|=128,i=null):(Ka(),N=d.fallback,p=i.mode,d=Bc({mode:"visible",children:d.children},p),N=Zi(N,p,s,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Ji(i,r.child,null,s),d=i.child,d.memoizedState=tm(s),d.childLanes=nm(r,S,s),i.memoizedState=em,i=Lo(null,d));else if(Qa(i),Um(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var G=S.dgst;S=G,d=Error(a(419)),d.stack="",d.digest=S,Co({value:d,source:null,stack:null}),i=am(r,i,s)}else if(Gt||Hl(r,i,s,!1),S=(s&r.childLanes)!==0,Gt||S){if(S=St,S!==null&&(d=av(S,s),d!==0&&d!==$.retryLane))throw $.retryLane=d,Hi(r,d),$n(S,r,d),Jh;Lm(N)||Gc(),i=am(r,i,s)}else Lm(N)?(i.flags|=192,i.child=r.child,i=null):(r=$.treeContext,Et=br(N.nextSibling),yn=i,it=!0,$a=null,yr=!1,r!==null&&eb(i,r),i=rm(i,d.children),i.flags|=4096);return i}return p?(Ka(),N=d.fallback,p=i.mode,$=r.child,G=$.sibling,d=ra($,{mode:"hidden",children:d.children}),d.subtreeFlags=$.subtreeFlags&65011712,G!==null?N=ra(G,N):(N=Zi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,Lo(null,d),d=i.child,N=r.child.memoizedState,N===null?N=tm(s):(p=N.cachePool,p!==null?($=Qt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=lb(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=nm(r,S,s),i.memoizedState=em,Lo(r.child,d)):(Qa(i),s=r.child,r=s.sibling,s=ra(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=s,i.memoizedState=null,s)}function rm(r,i){return i=Bc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Bc(r,i){return r=Jn(22,r,null,i),r.lanes=0,r}function am(r,i,s){return Ji(i,r.child,null,s),r=rm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function bx(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 S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=s,S.tailMode=p,S.treeForkCount=v)}function xx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=Ht.current,N=(S&2)!==0;if(N?(S=S&1|2,i.flags|=128):S&=1,T(Ht,S),bn(r,i,d,s),d=it?jo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&bx(r,s,i);else if(r.tag===19)bx(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&&_c(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&&_c(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),Xa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Hl(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&&xc(r)))}function N_(r,i,s){switch(i.tag){case 3:be(i,i.stateNode.containerInfo),qa(i,Qt,r.memoizedState.cache),Vi();break;case 27:case 5:Ge(i);break;case 4:be(i,i.stateNode.containerInfo);break;case 10:qa(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?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?vx(r,i,s):(Qa(i),r=ua(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Hl(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return xx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(Ht,Ht.current),d)break;return null;case 22:return i.lanes=0,fx(r,i,s,i.pendingProps);case 24:qa(i,Qt,r.memoizedState.cache)}return ua(r,i,s)}function wx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Gt=!0;else{if(!lm(r,s)&&(i.flags&128)===0)return Gt=!1,N_(r,i,s);Gt=(r.flags&131072)!==0}else Gt=!1,it&&(i.flags&1048576)!==0&&Wv(i,jo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Yi(i.elementType),i.type=r,typeof r=="function")dh(r)?(d=el(r,d),i.tag=1,i=gx(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===U){i.tag=11,i=ux(null,i,r,d,s);break e}else if(p===P){i.tag=14,i=cx(null,i,r,d,s);break e}}throw i=se(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=el(d,i.pendingProps),gx(r,i,d,p,s);case 3:e:{if(be(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Eh(r,i),zo(i,d,null,s);var S=i.memoizedState;if(d=S.cache,qa(i,Qt,d),d!==v.cache&&xh(i,[Qt],s,!0),Ro(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=yx(r,i,d,s);break e}else if(d!==p){p=mr(Error(a(424)),i),Co(p),i=yx(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),yn=i,it=!0,$a=null,yr=!0,s=fb(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Vi(),d===p){i=ua(r,i,s);break e}bn(r,i,d,s)}i=i.child}return i;case 26:return Pc(r,i),r===null?(s=z0(i.type,null,i.pendingProps,null))?i.memoizedState=s:it||(s=i.type,r=i.pendingProps,d=nd(ue.current).createElement(s),d[gn]=i,d[Mn]=r,xn(d,s,r),on(d),i.stateNode=d):i.memoizedState=z0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ge(i),r===null&&it&&(d=i.stateNode=T0(i.type,i.pendingProps,ue.current),yn=i,yr=!0,p=Et,ni(i.type)?(Pm=p,Et=br(d.firstChild)):Et=p),bn(r,i,i.pendingProps.children,s),Pc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&it&&((p=d=Et)&&(d=r2(d,i.type,i.pendingProps,yr),d!==null?(i.stateNode=d,yn=i,Et=br(d.firstChild),yr=!1,p=!0):p=!1),p||Fa(i)),Ge(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Dm(p,v)?d=null:S!==null&&Dm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Oh(r,i,v_,null,null,s),Jo._currentValue=p),Pc(r,i),bn(r,i,d,s),i.child;case 6:return r===null&&it&&((r=s=Et)&&(s=a2(s,i.pendingProps,yr),s!==null?(i.stateNode=s,yn=i,Et=null,r=!0):r=!1),r||Fa(i)),null;case 13:return vx(r,i,s);case 4:return be(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Ji(i,null,d,s):bn(r,i,d,s),i.child;case 11:return ux(r,i,i.type,i.pendingProps,s);case 7:return bn(r,i,i.pendingProps,s),i.child;case 8:return bn(r,i,i.pendingProps.children,s),i.child;case 12:return bn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,qa(i,i.type,d.value),bn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Ki(i),p=vn(p),d=d(p),i.flags|=1,bn(r,i,d,s),i.child;case 14:return cx(r,i,i.type,i.pendingProps,s);case 15:return dx(r,i,i.type,i.pendingProps,s);case 19:return xx(r,i,s);case 31:return E_(r,i,s);case 22:return fx(r,i,s,i.pendingProps);case 24:return Ki(i),d=vn(Qt),r===null?(p=kh(),p===null&&(p=St,v=wh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Ch(i),qa(i,Qt,p)):((r.lanes&s)!==0&&(Eh(r,i),zo(i,null,null,s),Ro()),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),qa(i,Qt,d)):(d=v.cache,qa(i,Qt,d),d!==p.cache&&xh(i,[Qt],s,!0))),bn(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(Kx())r.flags|=8192;else throw Xi=jc,jh}else r.flags&=-16777217}function Sx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!L0(i))if(Kx())r.flags|=8192;else throw Xi=jc,jh}function $c(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?xe():536870912,r.lanes|=i,ns|=i)}function Uo(r,i){if(!it)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 __(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),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(ql(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),Sx(i,v)):(Nt(i),sm(i,p,null,d,s))):v?v!==r.memoizedState?(ca(i),Nt(i),Sx(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(Ie(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=q.current,ql(i)?tb(i):(r=T0(p,d,s),i.stateNode=r,ca(i))}return Nt(i),null;case 5:if(Ie(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=q.current,ql(i))tb(i);else{var S=nd(ue.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}v[gn]=i,v[Mn]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(xn(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,ql(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=yn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[gn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||v0(r.nodeValue,s)),r||Fa(i,!0)}else r=nd(r).createTextNode(d),r[gn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=ql(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[gn]=i}else Vi(),(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?(er(i),i):(er(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=ql(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[gn]=i}else Vi(),(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?(er(i),i):(er(i),null)}return er(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),$c(i,i.updateQueue),Nt(i),null);case 4:return fe(),r===null&&Tm(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)Uo(d,!1);else{if(Ut!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=_c(r),v!==null){for(i.flags|=128,Uo(d,!1),r=v.updateQueue,i.updateQueue=r,$c(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Yv(s,r),s=s.sibling;return T(Ht,Ht.current&1|2),it&&aa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&fn()>Vc&&(i.flags|=128,p=!0,Uo(d,!1),i.lanes=4194304)}else{if(!p)if(r=_c(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,$c(i,r),Uo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!it)return Nt(i),null}else 2*fn()-d.renderingStartTime>Vc&&s!==536870912&&(i.flags|=128,p=!0,Uo(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=fn(),r.sibling=null,s=Ht.current,T(Ht,p?s&1|2:s&1),it&&aa(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return er(i),Ah(),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&&$c(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 T_(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),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Ie(i),null;case 31:if(i.memoizedState!==null){if(er(i),i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(er(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(Ht),null;case 4:return fe(),null;case 10:return la(i.type),null;case 22:case 23:return er(i),Ah(),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 kx(r,i){switch(ph(i),i.tag){case 3:la(Qt),fe();break;case 26:case 27:case 5:Ie(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&er(i);break;case 13:er(i);break;case 19:B(Ht);break;case 10:la(i.type);break;case 22:case 23:er(i),Ah(),r!==null&&B(Gi);break;case 24:la(Qt)}}function Po(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,S=s.inst;d=v(),S.destroy=d}s=s.next}while(s!==p)}}catch(N){yt(i,i.return,N)}}function Ga(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 S=d.inst,N=S.destroy;if(N!==void 0){S.destroy=void 0,p=i;var $=s,G=N;try{G()}catch(ae){yt(p,$,ae)}}}d=d.next}while(d!==v)}}catch(ae){yt(i,i.return,ae)}}function jx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{mb(i,s)}catch(d){yt(r,r.return,d)}}}function Cx(r,i,s){s.props=el(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){yt(r,i,d)}}function Bo(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){yt(r,i,p)}}function $r(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){yt(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){yt(r,i,p)}else s.current=null}function Ex(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){yt(r,r.return,p)}}function om(r,i,s){try{var d=r.stateNode;X_(d,r.type,s,i),d[Mn]=i}catch(p){yt(r,r.return,p)}}function Nx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function um(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Nx(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&&ni(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&&ni(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 Fc(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&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Fc(r,i,s),r=r.sibling;r!==null;)Fc(r,i,s),r=r.sibling}function _x(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);xn(i,d,s),i[gn]=r,i[Mn]=s}catch(v){yt(r,r.return,v)}}var da=!1,Yt=!1,dm=!1,Tx=typeof WeakSet=="function"?WeakSet:Set,un=null;function A_(r,i){if(r=r.containerInfo,zm=ud,r=$v(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 S=0,N=-1,$=-1,G=0,ae=0,de=r,J=null;t:for(;;){for(var W;de!==s||p!==0&&de.nodeType!==3||(N=S+p),de!==v||d!==0&&de.nodeType!==3||($=S+d),de.nodeType===3&&(S+=de.nodeValue.length),(W=de.firstChild)!==null;)J=de,de=W;for(;;){if(de===r)break t;if(J===s&&++G===p&&(N=S),J===v&&++ae===d&&($=S),(W=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=W}s=N===-1||$===-1?null:{start:N,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(Om={focusedElem:r,selectionRange:s},ud=!1,un=i;un!==null;)if(i=un,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,un=r;else for(;un!==null;){switch(i=un,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=el(s.type,p);r=d.getSnapshotBeforeUpdate(ke,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(De){yt(s,s.return,De)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Im(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Im(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,un=r;break}un=i.return}}function Ax(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ha(r,s),d&4&&Po(5,s);break;case 1:if(ha(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){yt(s,s.return,S)}else{var p=el(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){yt(s,s.return,S)}}d&64&&jx(s),d&512&&Bo(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{mb(r,i)}catch(S){yt(s,s.return,S)}}break;case 27:i===null&&d&4&&_x(s);case 26:case 5:ha(r,s),i===null&&d&4&&Ex(s),d&512&&Bo(s,s.return);break;case 12:ha(r,s);break;case 31:ha(r,s),d&4&&Ox(r,s);break;case 13:ha(r,s),d&4&&Dx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=P_.bind(null,s),i2(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 Rx(r){var i=r.alternate;i!==null&&(r.alternate=null,Rx(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 Tt=null,Ln=!1;function fa(r,i,s){for(s=s.child;s!==null;)zx(r,i,s),s=s.sibling}function zx(r,i,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(tn,s)}catch{}switch(s.tag){case 26:Yt||$r(s,i),fa(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Yt||$r(s,i);var d=Tt,p=Ln;ni(s.type)&&(Tt=s.stateNode,Ln=!1),fa(r,i,s),Go(s.stateNode),Tt=d,Ln=p;break;case 5:Yt||$r(s,i);case 6:if(d=Tt,p=Ln,Tt=null,fa(r,i,s),Tt=d,Ln=p,Tt!==null)if(Ln)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(s.stateNode)}catch(v){yt(s,i,v)}else try{Tt.removeChild(s.stateNode)}catch(v){yt(s,i,v)}break;case 18:Tt!==null&&(Ln?(r=Tt,j0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),cs(r)):j0(Tt,s.stateNode));break;case 4:d=Tt,p=Ln,Tt=s.stateNode.containerInfo,Ln=!0,fa(r,i,s),Tt=d,Ln=p;break;case 0:case 11:case 14:case 15:Ga(2,s,i),Yt||Ga(4,s,i),fa(r,i,s);break;case 1:Yt||($r(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Cx(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 Ox(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{cs(r)}catch(s){yt(i,i.return,s)}}}function Dx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{cs(r)}catch(s){yt(i,i.return,s)}}function R_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Tx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Tx),i;default:throw Error(a(435,r.tag))}}function qc(r,i){var s=R_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=B_.bind(null,r,d);d.then(p,p)}})}function Un(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,S=i,N=S;e:for(;N!==null;){switch(N.tag){case 27:if(ni(N.type)){Tt=N.stateNode,Ln=!1;break e}break;case 5:Tt=N.stateNode,Ln=!1;break e;case 3:case 4:Tt=N.stateNode.containerInfo,Ln=!0;break e}N=N.return}if(Tt===null)throw Error(a(160));zx(v,S,p),Tt=null,Ln=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Mx(i,r),i=i.sibling}var Rr=null;function Mx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Un(i,r),Pn(r),d&4&&(Ga(3,r,r.return),Po(3,r),Ga(5,r,r.return));break;case 1:Un(i,r),Pn(r),d&512&&(Yt||s===null||$r(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=Rr;if(Un(i,r),Pn(r),d&512&&(Yt||s===null||$r(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[ho]||v[gn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),xn(v,d,s),v[gn]=r,on(v),d=v;break e;case"link":var S=M0("link","href",p).get(d+(s.href||""));if(S){for(var N=0;N<S.length;N++)if(v=S[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)){S.splice(N,1);break t}}v=p.createElement(d),xn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=M0("meta","content",p).get(d+(s.content||""))){for(N=0;N<S.length;N++)if(v=S[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)){S.splice(N,1);break t}}v=p.createElement(d),xn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[gn]=r,on(v),d=v}r.stateNode=d}else I0(p,r.type,r.stateNode);else r.stateNode=D0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?I0(p,r.type,r.stateNode):D0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&om(r,r.memoizedProps,s.memoizedProps)}break;case 27:Un(i,r),Pn(r),d&512&&(Yt||s===null||$r(s,s.return)),s!==null&&d&4&&om(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Un(i,r),Pn(r),d&512&&(Yt||s===null||$r(s,s.return)),r.flags&32){p=r.stateNode;try{Ol(p,"")}catch(ke){yt(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(Un(i,r),Pn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(ke){yt(r,r.return,ke)}}break;case 3:if(id=null,p=Rr,Rr=rd(i.containerInfo),Un(i,r),Rr=p,Pn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{cs(i.containerInfo)}catch(ke){yt(r,r.return,ke)}dm&&(dm=!1,Ix(r));break;case 4:d=Rr,Rr=rd(r.stateNode.containerInfo),Un(i,r),Pn(r),Rr=d;break;case 12:Un(i,r),Pn(r);break;case 31:Un(i,r),Pn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,qc(r,d)));break;case 13:Un(i,r),Pn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Zc=fn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,qc(r,d)));break;case 22:p=r.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,G=da,ae=Yt;if(da=G||p,Yt=ae||$,Un(i,r),Yt=ae,da=G,Pn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||$||da||Yt||tl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){$=s=i;try{if(v=$.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=$.stateNode;var de=$.memoizedProps.style,J=de!=null&&de.hasOwnProperty("display")?de.display:null;N.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ke){yt($,$.return,ke)}}}else if(i.tag===6){if(s===null){$=i;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(ke){yt($,$.return,ke)}}}else if(i.tag===18){if(s===null){$=i;try{var W=$.stateNode;p?C0(W,!0):C0($.stateNode,!1)}catch(ke){yt($,$.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,qc(r,s))));break;case 19:Un(i,r),Pn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,qc(r,d)));break;case 30:break;case 21:break;default:Un(i,r),Pn(r)}}function Pn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Nx(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);Fc(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(Ol(S,""),s.flags&=-33);var N=um(r);Fc(r,N,S);break;case 3:case 4:var $=s.stateNode.containerInfo,G=um(r);cm(r,G,$);break;default:throw Error(a(161))}}catch(ae){yt(r,r.return,ae)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ix(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ix(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;)Ax(r,i.alternate,i),i=i.sibling}function tl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ga(4,i,i.return),tl(i);break;case 1:$r(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Cx(i,i.return,s),tl(i);break;case 27:Go(i.stateNode);case 26:case 5:$r(i,i.return),tl(i);break;case 22:i.memoizedState===null&&tl(i);break;case 30:tl(i);break;default:tl(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,S=v.flags;switch(v.tag){case 0:case 11:case 15:ma(p,v,s),Po(4,v);break;case 1:if(ma(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){yt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var N=d.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)hb($[p],N)}catch(G){yt(d,d.return,G)}}s&&S&64&&jx(v),Bo(v,v.return);break;case 27:_x(v);case 26:case 5:ma(p,v,s),s&&d===null&&S&4&&Ex(v),Bo(v,v.return);break;case 12:ma(p,v,s);break;case 31:ma(p,v,s),s&&S&4&&Ox(p,v);break;case 13:ma(p,v,s),s&&S&4&&Dx(p,v);break;case 22:v.memoizedState===null&&ma(p,v,s),Bo(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&&Eo(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&&Eo(r))}function zr(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Lx(r,i,s,d),i=i.sibling}function Lx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:zr(r,i,s,d),p&2048&&Po(9,i);break;case 1:zr(r,i,s,d);break;case 3:zr(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&&Eo(r)));break;case 12:if(p&2048){zr(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,N=v.onPostCommit;typeof N=="function"&&N(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){yt(i,i.return,$)}}else zr(r,i,s,d);break;case 31:zr(r,i,s,d);break;case 13:zr(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?zr(r,i,s,d):$o(r,i):v._visibility&2?zr(r,i,s,d):(v._visibility|=2,Wl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&fm(S,i);break;case 24:zr(r,i,s,d),p&2048&&hm(i.alternate,i);break;default:zr(r,i,s,d)}}function Wl(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,N=s,$=d,G=S.flags;switch(S.tag){case 0:case 11:case 15:Wl(v,S,N,$,p),Po(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?Wl(v,S,N,$,p):$o(v,S):(ae._visibility|=2,Wl(v,S,N,$,p)),p&&G&2048&&fm(S.alternate,S);break;case 24:Wl(v,S,N,$,p),p&&G&2048&&hm(S.alternate,S);break;default:Wl(v,S,N,$,p)}i=i.sibling}}function $o(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:$o(s,d),p&2048&&fm(d.alternate,d);break;case 24:$o(s,d),p&2048&&hm(d.alternate,d);break;default:$o(s,d)}i=i.sibling}}var Fo=8192;function es(r,i,s){if(r.subtreeFlags&Fo)for(r=r.child;r!==null;)Ux(r,i,s),r=r.sibling}function Ux(r,i,s){switch(r.tag){case 26:es(r,i,s),r.flags&Fo&&r.memoizedState!==null&&y2(s,Rr,r.memoizedState,r.memoizedProps);break;case 5:es(r,i,s);break;case 3:case 4:var d=Rr;Rr=rd(r.stateNode.containerInfo),es(r,i,s),Rr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Fo,Fo=16777216,es(r,i,s),Fo=d):es(r,i,s));break;default:es(r,i,s)}}function Px(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 qo(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];un=d,$x(d,r)}Px(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Bx(r),r=r.sibling}function Bx(r){switch(r.tag){case 0:case 11:case 15:qo(r),r.flags&2048&&Ga(9,r,r.return);break;case 3:qo(r);break;case 12:qo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Hc(r)):qo(r);break;default:qo(r)}}function Hc(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];un=d,$x(d,r)}Px(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ga(8,i,i.return),Hc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Hc(i));break;default:Hc(i)}r=r.sibling}}function $x(r,i){for(;un!==null;){var s=un;switch(s.tag){case 0:case 11:case 15:Ga(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:Eo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,un=d;else e:for(s=r;un!==null;){d=un;var p=d.sibling,v=d.return;if(Rx(d),d===s){un=null;break e}if(p!==null){p.return=v,un=p;break e}un=v}}}var z_={getCacheForType:function(r){var i=vn(Qt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return vn(Qt).controller.signal}},O_=typeof WeakMap=="function"?WeakMap:Map,ft=0,St=null,Je=null,tt=0,gt=0,tr=null,Ya=!1,ts=!1,mm=!1,pa=0,Ut=0,Xa=0,nl=0,pm=0,nr=0,ns=0,Ho=null,Bn=null,gm=!1,Zc=0,Fx=0,Vc=1/0,Qc=null,Ja=null,nn=0,Wa=null,rs=null,ga=0,ym=0,vm=null,qx=null,Zo=0,bm=null;function rr(){return(ft&2)!==0&&tt!==0?tt&-tt:Z.T!==null?Cm():iv()}function Hx(){if(nr===0)if((tt&536870912)===0||it){var r=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),nr=r}else nr=536870912;return r=Wn.current,r!==null&&(r.flags|=32),nr}function $n(r,i,s){(r===St&&(gt===2||gt===9)||r.cancelPendingCommit!==null)&&(as(r,0),ei(r,tt,nr,!1)),pn(r,s),((ft&2)===0||r!==St)&&(r===St&&((ft&2)===0&&(nl|=s),Ut===4&&ei(r,tt,nr,!1)),Fr(r))}function Zx(r,i,s){if((ft&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||La(r,i),p=d?I_(r,i):wm(r,i,!0),v=d;do{if(p===0){ts&&!d&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!D_(s)){p=wm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var N=r;p=Ho;var $=N.current.memoizedState.isDehydrated;if($&&(as(N,S).flags|=256),S=wm(N,S,!1),S!==2){if(mm&&!$){N.errorRecoveryDisabledLanes|=v,nl|=v,p=4;break e}v=Bn,Bn=p,v!==null&&(Bn===null?Bn=v:Bn.push.apply(Bn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){as(r,0),ei(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:ei(d,i,nr,!Ya);break e;case 2:Bn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Zc+300-fn(),10<p)){if(ei(d,i,nr,!Ya),Pi(d,0,!0)!==0)break e;ga=i,d.timeoutHandle=S0(Vx.bind(null,d,s,Bn,Qc,gm,i,nr,nl,ns,Ya,v,"Throttled",-0,0),p);break e}Vx(d,s,Bn,Qc,gm,i,nr,nl,ns,Ya,v,null,-0,0)}}break}while(!0);Fr(r)}function Vx(r,i,s,d,p,v,S,N,$,G,ae,de,J,W){if(r.timeoutHandle=-1,de=i.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ta},Ux(i,v,de);var ke=(v&62914560)===v?Zc-fn():(v&4194048)===v?Fx-fn():0;if(ke=v2(de,ke),ke!==null){ga=v,r.cancelPendingCommit=ke(e0.bind(null,r,i,v,s,d,p,S,N,$,ae,de,null,J,W)),ei(r,v,S,!G);return}}e0(r,i,v,s,d,p,S,N,$)}function D_(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(!Xn(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 ei(r,i,s,d){i&=~pm,i&=~nl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-ht(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&fo(r,s,i)}function Kc(){return(ft&6)===0?(Vo(0),!1):!0}function xm(){if(Je!==null){if(gt===0)var r=Je.return;else r=Je,ia=Qi=null,Ih(r),Kl=null,_o=0,r=Je;for(;r!==null;)kx(r.alternate,r),r=r.return;Je=null}}function as(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,e2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ga=0,xm(),St=r,Je=s=ra(r.current,null),tt=i,gt=0,tr=null,Ya=!1,ts=La(r,i),mm=!1,ns=nr=pm=nl=Xa=Ut=0,Bn=Ho=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-ht(d),v=1<<p;i|=r[p],d&=~v}return pa=i,pc(),s}function Qx(r,i){He=null,Z.H=Io,i===Ql||i===kc?(i=ub(),gt=3):i===jh?(i=ub(),gt=4):gt=i===Jh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,tr=i,Je===null&&(Ut=1,Lc(r,mr(i,r.current)))}function Kx(){var r=Wn.current;return r===null?!0:(tt&4194048)===tt?vr===null:(tt&62914560)===tt||(tt&536870912)!==0?r===vr:!1}function Gx(){var r=Z.H;return Z.H=Io,r===null?Io:r}function Yx(){var r=Z.A;return Z.A=z_,r}function Gc(){Ut=4,Ya||(tt&4194048)!==tt&&Wn.current!==null||(ts=!0),(Xa&134217727)===0&&(nl&134217727)===0||St===null||ei(St,tt,nr,!1)}function wm(r,i,s){var d=ft;ft|=2;var p=Gx(),v=Yx();(St!==r||tt!==i)&&(Qc=null,as(r,i)),i=!1;var S=Ut;e:do try{if(gt!==0&&Je!==null){var N=Je,$=tr;switch(gt){case 8:xm(),S=6;break e;case 3:case 2:case 9:case 6:Wn.current===null&&(i=!0);var G=gt;if(gt=0,tr=null,is(r,N,$,G),s&&ts){S=0;break e}break;default:G=gt,gt=0,tr=null,is(r,N,$,G)}}M_(),S=Ut;break}catch(ae){Qx(r,ae)}while(!0);return i&&r.shellSuspendCounter++,ia=Qi=null,ft=d,Z.H=p,Z.A=v,Je===null&&(St=null,tt=0,pc()),S}function M_(){for(;Je!==null;)Xx(Je)}function I_(r,i){var s=ft;ft|=2;var d=Gx(),p=Yx();St!==r||tt!==i?(Qc=null,Vc=fn()+500,as(r,i)):ts=La(r,i);e:do try{if(gt!==0&&Je!==null){i=Je;var v=tr;t:switch(gt){case 1:gt=0,tr=null,is(r,i,v,1);break;case 2:case 9:if(sb(v)){gt=0,tr=null,Jx(i);break}i=function(){gt!==2&>!==9||St!==r||(gt=7),Fr(r)},v.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:sb(v)?(gt=0,tr=null,Jx(i)):(gt=0,tr=null,is(r,i,v,7));break;case 5:var S=null;switch(Je.tag){case 26:S=Je.memoizedState;case 5:case 27:var N=Je;if(S?L0(S):N.stateNode.complete){gt=0,tr=null;var $=N.sibling;if($!==null)Je=$;else{var G=N.return;G!==null?(Je=G,Yc(G)):Je=null}break t}}gt=0,tr=null,is(r,i,v,5);break;case 6:gt=0,tr=null,is(r,i,v,6);break;case 8:xm(),Ut=6;break e;default:throw Error(a(462))}}L_();break}catch(ae){Qx(r,ae)}while(!0);return ia=Qi=null,Z.H=d,Z.A=p,ft=s,Je!==null?0:(St=null,tt=0,pc(),Ut)}function L_(){for(;Je!==null&&!oo();)Xx(Je)}function Xx(r){var i=wx(r.alternate,r,pa);r.memoizedProps=r.pendingProps,i===null?Yc(r):Je=i}function Jx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=px(s,i,i.pendingProps,i.type,void 0,tt);break;case 11:i=px(s,i,i.pendingProps,i.type.render,i.ref,tt);break;case 5:Ih(i);default:kx(s,i),i=Je=Yv(i,pa),i=wx(s,i,pa)}r.memoizedProps=r.pendingProps,i===null?Yc(r):Je=i}function is(r,i,s,d){ia=Qi=null,Ih(i),Kl=null,_o=0;var p=i.return;try{if(C_(r,p,i,s,tt)){Ut=1,Lc(r,mr(s,r.current)),Je=null;return}}catch(v){if(p!==null)throw Je=p,v;Ut=1,Lc(r,mr(s,r.current)),Je=null;return}i.flags&32768?(it||d===1?r=!0:ts||(tt&536870912)!==0?r=!1:(Ya=r=!0,(d===2||d===9||d===3||d===6)&&(d=Wn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Wx(i,r)):Yc(i)}function Yc(r){var i=r;do{if((i.flags&32768)!==0){Wx(i,Ya);return}r=i.return;var s=__(i.alternate,i,pa);if(s!==null){Je=s;return}if(i=i.sibling,i!==null){Je=i;return}Je=i=r}while(i!==null);Ut===0&&(Ut=5)}function Wx(r,i){do{var s=T_(r.alternate,r);if(s!==null){s.flags&=32767,Je=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Je=r;return}Je=r=s}while(r!==null);Ut=6,Je=null}function e0(r,i,s,d,p,v,S,N,$){r.cancelPendingCommit=null;do Xc();while(nn!==0);if((ft&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,S,N,$),r===St&&(Je=St=null,tt=0),rs=i,Wa=r,ga=s,ym=v,vm=p,qx=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,$_(Ue,function(){return i0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=te.p,te.p=2,S=ft,ft|=4;try{A_(r,i,s)}finally{ft=S,te.p=p,Z.T=d}}nn=1,t0(),n0(),r0()}}function t0(){if(nn===1){nn=0;var r=Wa,i=rs,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=te.p;te.p=2;var p=ft;ft|=4;try{Mx(i,r);var v=Om,S=$v(r.containerInfo),N=v.focusedElem,$=v.selectionRange;if(S!==N&&N&&N.ownerDocument&&Bv(N.ownerDocument.documentElement,N)){if($!==null&&ah(N)){var G=$.start,ae=$.end;if(ae===void 0&&(ae=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(ae,N.value.length);else{var de=N.ownerDocument||document,J=de&&de.defaultView||window;if(J.getSelection){var W=J.getSelection(),ke=N.textContent.length,De=Math.min($.start,ke),xt=$.end===void 0?De:Math.min($.end,ke);!W.extend&&De>xt&&(S=xt,xt=De,De=S);var Q=Pv(N,De),H=Pv(N,xt);if(Q&&H&&(W.rangeCount!==1||W.anchorNode!==Q.node||W.anchorOffset!==Q.offset||W.focusNode!==H.node||W.focusOffset!==H.offset)){var K=de.createRange();K.setStart(Q.node,Q.offset),W.removeAllRanges(),De>xt?(W.addRange(K),W.extend(H.node,H.offset)):(K.setEnd(H.node,H.offset),W.addRange(K))}}}}for(de=[],W=N;W=W.parentNode;)W.nodeType===1&&de.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<de.length;N++){var oe=de[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}ud=!!zm,Om=zm=null}finally{ft=p,te.p=d,Z.T=s}}r.current=i,nn=2}}function n0(){if(nn===2){nn=0;var r=Wa,i=rs,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=te.p;te.p=2;var p=ft;ft|=4;try{Ax(r,i.alternate,i)}finally{ft=p,te.p=d,Z.T=s}}nn=3}}function r0(){if(nn===4||nn===3){nn=0,uo();var r=Wa,i=rs,s=ga,d=qx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?nn=5:(nn=0,rs=Wa=null,a0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),Pf(s),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(tn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=te.p,te.p=2,Z.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var N=d[S];v(N.value,{componentStack:N.stack})}}finally{Z.T=i,te.p=p}}(ga&3)!==0&&Xc(),Fr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===bm?Zo++:(Zo=0,bm=r):Zo=0,Vo(0)}}function a0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Eo(i)))}function Xc(){return t0(),n0(),r0(),i0()}function i0(){if(nn!==5)return!1;var r=Wa,i=ym;ym=0;var s=Pf(ga),d=Z.T,p=te.p;try{te.p=32>s?32:s,Z.T=null,s=vm,vm=null;var v=Wa,S=ga;if(nn=0,rs=Wa=null,ga=0,(ft&6)!==0)throw Error(a(331));var N=ft;if(ft|=4,Bx(v.current),Lx(v,v.current,S,s),ft=N,Vo(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(tn,v)}catch{}return!0}finally{te.p=p,Z.T=d,a0(r,i)}}function l0(r,i,s){i=mr(s,i),i=Xh(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(pn(r,2),Fr(r))}function yt(r,i,s){if(r.tag===3)l0(r,r,s);else for(;i!==null;){if(i.tag===3){l0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ja===null||!Ja.has(d))){r=mr(s,r),s=sx(2),d=Va(i,s,2),d!==null&&(ox(s,d,i,r),pn(d,2),Fr(d));break}}i=i.return}}function Sm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new O_;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=U_.bind(null,r,i,s),i.then(r,r))}function U_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,St===r&&(tt&s)===s&&(Ut===4||Ut===3&&(tt&62914560)===tt&&300>fn()-Zc?(ft&2)===0&&as(r,0):pm|=s,ns===tt&&(ns=0)),Fr(r)}function s0(r,i){i===0&&(i=xe()),r=Hi(r,i),r!==null&&(pn(r,i),Fr(r))}function P_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),s0(r,s)}function B_(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),s0(r,s)}function $_(r,i){return Ia(r,i)}var Jc=null,ls=null,km=!1,Wc=!1,jm=!1,ti=0;function Fr(r){r!==ls&&r.next===null&&(ls===null?Jc=ls=r:ls=ls.next=r),Wc=!0,km||(km=!0,q_())}function Vo(r,i){if(!jm&&Wc){jm=!0;do for(var s=!1,d=Jc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-ht(42|r)+1)-1,v&=p&~(S&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,d0(d,v))}else v=tt,v=Pi(d,d===St?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||La(d,v)||(s=!0,d0(d,v));d=d.next}while(s);jm=!1}}function F_(){o0()}function o0(){Wc=km=!1;var r=0;ti!==0&&W_()&&(r=ti);for(var i=fn(),s=null,d=Jc;d!==null;){var p=d.next,v=u0(d,i);v===0?(d.next=null,s===null?Jc=p:s.next=p,p===null&&(ls=s)):(s=d,(r!==0||(v&3)!==0)&&(Wc=!0)),d=p}nn!==0&&nn!==5||Vo(r),ti!==0&&(ti=0)}function u0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-ht(v),N=1<<S,$=p[S];$===-1?((N&s)===0||(N&d)!==0)&&(p[S]=nc(N,i)):$<=i&&(r.expiredLanes|=N),v&=~N}if(i=St,s=tt,s=Pi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(gt===2||gt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Jr(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||La(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&Jr(d),Pf(s)){case 2:case 8:s=ge;break;case 32:s=Ue;break;case 268435456:s=at;break;default:s=Ue}return d=c0.bind(null,r),s=Ia(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Jr(d),r.callbackPriority=2,r.callbackNode=null,2}function c0(r,i){if(nn!==0&&nn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Xc()&&r.callbackNode!==s)return null;var d=tt;return d=Pi(r,r===St?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Zx(r,d,i),u0(r,fn()),r.callbackNode!=null&&r.callbackNode===s?c0.bind(null,r):null)}function d0(r,i){if(Xc())return null;Zx(r,i,!0)}function q_(){t2(function(){(ft&6)!==0?Ia(ie,F_):o0()})}function Cm(){if(ti===0){var r=Zl;r===0&&(r=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),ti=r}return ti}function f0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:sc(""+r)}function h0(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 H_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=f0((p[Mn]||null).action),S=d.submitter;S&&(i=(i=S[Mn]||null)?f0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var N=new dc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ti!==0){var $=S?h0(p,S):new FormData(p);Zh(s,{pending:!0,data:$,method:p.method,action:v},null,$)}}else typeof v=="function"&&(N.preventDefault(),$=S?h0(p,S):new FormData(p),Zh(s,{pending:!0,data:$,method:p.method,action:v},v,$))},currentTarget:p}]})}}for(var Em=0;Em<oh.length;Em++){var Nm=oh[Em],Z_=Nm.toLowerCase(),V_=Nm[0].toUpperCase()+Nm.slice(1);Ar(Z_,"on"+V_)}Ar(Hv,"onAnimationEnd"),Ar(Zv,"onAnimationIteration"),Ar(Vv,"onAnimationStart"),Ar("dblclick","onDoubleClick"),Ar("focusin","onFocus"),Ar("focusout","onBlur"),Ar(o_,"onTransitionRun"),Ar(u_,"onTransitionStart"),Ar(c_,"onTransitionCancel"),Ar(Qv,"onTransitionEnd"),Rl("onMouseEnter",["mouseout","mouseover"]),Rl("onMouseLeave",["mouseout","mouseover"]),Rl("onPointerEnter",["pointerout","pointerover"]),Rl("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function m0(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 S=d.length-1;0<=S;S--){var N=d[S],$=N.instance,G=N.currentTarget;if(N=N.listener,$!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ae){mc(ae)}p.currentTarget=null,v=$}else for(S=0;S<d.length;S++){if(N=d[S],$=N.instance,G=N.currentTarget,N=N.listener,$!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ae){mc(ae)}p.currentTarget=null,v=$}}}}function We(r,i){var s=i[Bf];s===void 0&&(s=i[Bf]=new Set);var d=r+"__bubble";s.has(d)||(p0(i,r,2,!1),s.add(d))}function _m(r,i,s){var d=0;i&&(d|=4),p0(s,r,d,i)}var ed="_reactListening"+Math.random().toString(36).slice(2);function Tm(r){if(!r[ed]){r[ed]=!0,ov.forEach(function(s){s!=="selectionchange"&&(Q_.has(s)||_m(s,!1,r),_m(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[ed]||(i[ed]=!0,_m("selectionchange",!1,i))}}function p0(r,i,s,d){switch(H0(i)){case 2:var p=w2;break;case 8:p=S2;break;default:p=Hm}s=p.bind(null,i,s,r),p=void 0,!Gf||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 Am(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var N=d.stateNode.containerInfo;if(N===p)break;if(S===4)for(S=d.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;N!==null;){if(S=_l(N),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){d=v=S;continue e}N=N.parentNode}}d=d.return}xv(function(){var G=v,ae=Qf(s),de=[];e:{var J=Kv.get(r);if(J!==void 0){var W=dc,ke=r;switch(r){case"keypress":if(uc(s)===0)break e;case"keydown":case"keyup":W=BN;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=kv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=_N;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=qN;break;case Hv:case Zv:case Vv:W=RN;break;case Qv:W=ZN;break;case"scroll":case"scrollend":W=EN;break;case"wheel":W=QN;break;case"copy":case"cut":case"paste":W=ON;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Cv;break;case"toggle":case"beforetoggle":W=GN}var De=(i&4)!==0,xt=!De&&(r==="scroll"||r==="scrollend"),Q=De?J!==null?J+"Capture":null:J;De=[];for(var H=G,K;H!==null;){var oe=H;if(K=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||K===null||Q===null||(oe=po(H,Q),oe!=null&&De.push(Ko(H,oe,K))),xt)break;H=H.return}0<De.length&&(J=new W(J,ke,null,s,ae),de.push({event:J,listeners:De}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",W=r==="mouseout"||r==="pointerout",J&&s!==Vf&&(ke=s.relatedTarget||s.fromElement)&&(_l(ke)||ke[Nl]))break e;if((W||J)&&(J=ae.window===ae?ae:(J=ae.ownerDocument)?J.defaultView||J.parentWindow:window,W?(ke=s.relatedTarget||s.toElement,W=G,ke=ke?_l(ke):null,ke!==null&&(xt=o(ke),De=ke.tag,ke!==xt||De!==5&&De!==27&&De!==6)&&(ke=null)):(W=null,ke=G),W!==ke)){if(De=kv,oe="onMouseLeave",Q="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(De=Cv,oe="onPointerLeave",Q="onPointerEnter",H="pointer"),xt=W==null?J:mo(W),K=ke==null?J:mo(ke),J=new De(oe,H+"leave",W,s,ae),J.target=xt,J.relatedTarget=K,oe=null,_l(ae)===G&&(De=new De(Q,H+"enter",ke,s,ae),De.target=K,De.relatedTarget=xt,oe=De),xt=oe,W&&ke)t:{for(De=K_,Q=W,H=ke,K=0,oe=Q;oe;oe=De(oe))K++;oe=0;for(var ze=H;ze;ze=De(ze))oe++;for(;0<K-oe;)Q=De(Q),K--;for(;0<oe-K;)H=De(H),oe--;for(;K--;){if(Q===H||H!==null&&Q===H.alternate){De=Q;break t}Q=De(Q),H=De(H)}De=null}else De=null;W!==null&&g0(de,J,W,De,!1),ke!==null&&xt!==null&&g0(de,xt,ke,De,!0)}}e:{if(J=G?mo(G):window,W=J.nodeName&&J.nodeName.toLowerCase(),W==="select"||W==="input"&&J.type==="file")var ut=Ov;else if(Rv(J))if(Dv)ut=i_;else{ut=r_;var _e=n_}else W=J.nodeName,!W||W.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?G&&Zf(G.elementType)&&(ut=Ov):ut=a_;if(ut&&(ut=ut(r,G))){zv(de,ut,s,ae);break e}_e&&_e(r,J,G),r==="focusout"&&G&&J.type==="number"&&G.memoizedProps.value!=null&&Hf(J,"number",J.value)}switch(_e=G?mo(G):window,r){case"focusin":(Rv(_e)||_e.contentEditable==="true")&&(Ll=_e,ih=G,ko=null);break;case"focusout":ko=ih=Ll=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,Fv(de,s,ae);break;case"selectionchange":if(s_)break;case"keydown":case"keyup":Fv(de,s,ae)}var Ze;if(th)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Il?Tv(r,s)&&(nt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(nt="onCompositionStart");nt&&(Ev&&s.locale!=="ko"&&(Il||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Il&&(Ze=wv()):(Pa=ae,Yf="value"in Pa?Pa.value:Pa.textContent,Il=!0)),_e=td(G,nt),0<_e.length&&(nt=new jv(nt,r,null,s,ae),de.push({event:nt,listeners:_e}),Ze?nt.data=Ze:(Ze=Av(s),Ze!==null&&(nt.data=Ze)))),(Ze=XN?JN(r,s):WN(r,s))&&(nt=td(G,"onBeforeInput"),0<nt.length&&(_e=new jv("onBeforeInput","beforeinput",null,s,ae),de.push({event:_e,listeners:nt}),_e.data=Ze)),H_(de,r,G,s,ae)}m0(de,i)})}function Ko(r,i,s){return{instance:r,listener:i,currentTarget:s}}function td(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=po(r,s),p!=null&&d.unshift(Ko(r,p,v)),p=po(r,i),p!=null&&d.push(Ko(r,p,v))),r.tag===3)return d;r=r.return}return[]}function K_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function g0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var N=s,$=N.alternate,G=N.stateNode;if(N=N.tag,$!==null&&$===d)break;N!==5&&N!==26&&N!==27||G===null||($=G,p?(G=po(s,v),G!=null&&S.unshift(Ko(s,G,$))):p||(G=po(s,v),G!=null&&S.push(Ko(s,G,$)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var G_=/\r\n?/g,Y_=/\u0000|\uFFFD/g;function y0(r){return(typeof r=="string"?r:""+r).replace(G_,`
|
|
49
|
-
`).replace(Y_,"")}function v0(r,i){return i=y0(i),y0(r)===i}function bt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ol(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ol(r,""+d);break;case"className":ic(r,"class",d);break;case"tabIndex":ic(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ic(r,s,d);break;case"style":vv(r,d,v);break;case"data":if(i!=="object"){ic(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=sc(""+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"&&bt(r,i,"name",p.name,p,null),bt(r,i,"formEncType",p.formEncType,p,null),bt(r,i,"formMethod",p.formMethod,p,null),bt(r,i,"formTarget",p.formTarget,p,null)):(bt(r,i,"encType",p.encType,p,null),bt(r,i,"method",p.method,p,null),bt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=sc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=ta);break;case"onScroll":d!=null&&We("scroll",r);break;case"onScrollEnd":d!=null&&We("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=sc(""+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":We("beforetoggle",r),We("toggle",r),ac(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":ac(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=jN.get(s)||s,ac(r,s,d))}}function Rm(r,i,s,d,p,v){switch(s){case"style":vv(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"?Ol(r,d):(typeof d=="number"||typeof d=="bigint")&&Ol(r,""+d);break;case"onScroll":d!=null&&We("scroll",r);break;case"onScrollEnd":d!=null&&We("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(!uv.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[Mn]||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,""):ac(r,s,d)}}}function xn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",r),We("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var S=s[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,v,S,s,null)}}p&&bt(r,i,"srcSet",s.srcSet,s,null),d&&bt(r,i,"src",s.src,s,null);return;case"input":We("invalid",r);var N=v=S=p=null,$=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var ae=s[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":S=ae;break;case"checked":$=ae;break;case"defaultChecked":G=ae;break;case"value":v=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:bt(r,i,d,ae,s,null)}}mv(r,v,N,$,G,S,p,!1);return;case"select":We("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":S=N;break;case"multiple":d=N;default:bt(r,i,p,N,s,null)}i=v,s=S,r.multiple=!!d,i!=null?zl(r,!!d,i,!1):s!=null&&zl(r,!!d,s,!0);return;case"textarea":We("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(N=s[S],N!=null))switch(S){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:bt(r,i,S,N,s,null)}gv(r,d,p,v);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(d=s[$],d!=null))switch($){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:bt(r,i,$,d,s,null)}return;case"dialog":We("beforetoggle",r),We("toggle",r),We("cancel",r),We("close",r);break;case"iframe":case"object":We("load",r);break;case"video":case"audio":for(d=0;d<Qo.length;d++)We(Qo[d],r);break;case"image":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"embed":case"source":case"link":We("error",r),We("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:bt(r,i,G,d,s,null)}return;default:if(Zf(i)){for(ae in s)s.hasOwnProperty(ae)&&(d=s[ae],d!==void 0&&Rm(r,i,ae,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&bt(r,i,N,d,s,null))}function X_(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,S=null,N=null,$=null,G=null,ae=null;for(W in s){var de=s[W];if(s.hasOwnProperty(W)&&de!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":$=de;default:d.hasOwnProperty(W)||bt(r,i,W,null,d,de)}}for(var J in d){var W=d[J];if(de=s[J],d.hasOwnProperty(J)&&(W!=null||de!=null))switch(J){case"type":v=W;break;case"name":p=W;break;case"checked":G=W;break;case"defaultChecked":ae=W;break;case"value":S=W;break;case"defaultValue":N=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:W!==de&&bt(r,i,J,W,d,de)}}qf(r,S,N,$,G,ae,v,p);return;case"select":W=S=N=J=null;for(v in s)if($=s[v],s.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":W=$;default:d.hasOwnProperty(v)||bt(r,i,v,null,d,$)}for(p in d)if(v=d[p],$=s[p],d.hasOwnProperty(p)&&(v!=null||$!=null))switch(p){case"value":J=v;break;case"defaultValue":N=v;break;case"multiple":S=v;default:v!==$&&bt(r,i,p,v,d,$)}i=N,s=S,d=W,J!=null?zl(r,!!s,J,!1):!!d!=!!s&&(i!=null?zl(r,!!s,i,!0):zl(r,!!s,s?[]:"",!1));return;case"textarea":W=J=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:bt(r,i,N,null,d,p)}for(S in d)if(p=d[S],v=s[S],d.hasOwnProperty(S)&&(p!=null||v!=null))switch(S){case"value":J=p;break;case"defaultValue":W=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&bt(r,i,S,p,d,v)}pv(r,J,W);return;case"option":for(var ke in s)if(J=s[ke],s.hasOwnProperty(ke)&&J!=null&&!d.hasOwnProperty(ke))switch(ke){case"selected":r.selected=!1;break;default:bt(r,i,ke,null,d,J)}for($ in d)if(J=d[$],W=s[$],d.hasOwnProperty($)&&J!==W&&(J!=null||W!=null))switch($){case"selected":r.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:bt(r,i,$,J,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 De in s)J=s[De],s.hasOwnProperty(De)&&J!=null&&!d.hasOwnProperty(De)&&bt(r,i,De,null,d,J);for(G in d)if(J=d[G],W=s[G],d.hasOwnProperty(G)&&J!==W&&(J!=null||W!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:bt(r,i,G,J,d,W)}return;default:if(Zf(i)){for(var xt in s)J=s[xt],s.hasOwnProperty(xt)&&J!==void 0&&!d.hasOwnProperty(xt)&&Rm(r,i,xt,void 0,d,J);for(ae in d)J=d[ae],W=s[ae],!d.hasOwnProperty(ae)||J===W||J===void 0&&W===void 0||Rm(r,i,ae,J,d,W);return}}for(var Q in s)J=s[Q],s.hasOwnProperty(Q)&&J!=null&&!d.hasOwnProperty(Q)&&bt(r,i,Q,null,d,J);for(de in d)J=d[de],W=s[de],!d.hasOwnProperty(de)||J===W||J==null&&W==null||bt(r,i,de,J,d,W)}function b0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function J_(){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,S=p.initiatorType,N=p.duration;if(v&&N&&b0(S)){for(S=0,N=p.responseEnd,d+=1;d<s.length;d++){var $=s[d],G=$.startTime;if(G>N)break;var ae=$.transferSize,de=$.initiatorType;ae&&b0(de)&&($=$.responseEnd,S+=ae*($<N?1:(N-G)/($-G)))}if(--d,i+=8*(v+S)/(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 nd(r){return r.nodeType===9?r:r.ownerDocument}function x0(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 w0(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 W_(){var r=window.event;return r&&r.type==="popstate"?r===Mm?!1:(Mm=r,!0):(Mm=null,!1)}var S0=typeof setTimeout=="function"?setTimeout:void 0,e2=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,t2=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(r){return k0.resolve(null).then(r).catch(n2)}:S0;function n2(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function j0(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),cs(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Go(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Go(s);for(var v=s.firstChild;v;){var S=v.nextSibling,N=v.nodeName;v[ho]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Go(r.ownerDocument.body);s=p}while(s);cs(i)}function C0(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 Im(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":Im(s),$f(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function r2(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[ho])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 a2(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 E0(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 Lm(r){return r.data==="$?"||r.data==="$~"}function Um(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function i2(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 N0(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 _0(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 T0(r,i,s){switch(i=nd(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 Go(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);$f(r)}var xr=new Map,A0=new Set;function rd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ya=te.d;te.d={f:l2,r:s2,D:o2,C:u2,L:c2,m:d2,X:h2,S:f2,M:m2};function l2(){var r=ya.f(),i=Kc();return r||i}function s2(r){var i=Tl(r);i!==null&&i.tag===5&&i.type==="form"?Qb(i):ya.r(r)}var ss=typeof document>"u"?null:document;function R0(r,i,s){var d=ss;if(d&&typeof i=="string"&&i){var p=fr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),A0.has(p)||(A0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),xn(i,"link",r),on(i),d.head.appendChild(i)))}}function o2(r){ya.D(r),R0("dns-prefetch",r,null)}function u2(r,i){ya.C(r,i),R0("preconnect",r,i)}function c2(r,i,s){ya.L(r,i,s);var d=ss;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=os(r);break;case"script":v=us(r)}xr.has(v)||(r=g({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(Yo(v))||i==="script"&&d.querySelector(Xo(v))||(i=d.createElement("link"),xn(i,"link",r),on(i),d.head.appendChild(i)))}}function d2(r,i){ya.m(r,i);var s=ss;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=us(r)}if(!xr.has(v)&&(r=g({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(Xo(v)))return}d=s.createElement("link"),xn(d,"link",r),on(d),s.head.appendChild(d)}}}function f2(r,i,s){ya.S(r,i,s);var d=ss;if(d&&r){var p=Al(d).hoistableStyles,v=os(r);i=i||"default";var S=p.get(v);if(!S){var N={loading:0,preload:null};if(S=d.querySelector(Yo(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=xr.get(v))&&Bm(r,s);var $=S=d.createElement("link");on($),xn($,"link",r),$._p=new Promise(function(G,ae){$.onload=G,$.onerror=ae}),$.addEventListener("load",function(){N.loading|=1}),$.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ad(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:N},p.set(v,S)}}}function h2(r,i){ya.X(r,i);var s=ss;if(s&&r){var d=Al(s).hoistableScripts,p=us(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),on(v),xn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function m2(r,i){ya.M(r,i);var s=ss;if(s&&r){var d=Al(s).hoistableScripts,p=us(r),v=d.get(p);v||(v=s.querySelector(Xo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=xr.get(p))&&$m(r,i),v=s.createElement("script"),on(v),xn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function z0(r,i,s,d){var p=(p=ue.current)?rd(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=os(s.href),s=Al(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=os(s.href);var v=Al(p).hoistableStyles,S=v.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=p.querySelector(Yo(r)))&&!v._p&&(S.instance=v,S.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||p2(p,r,s,S.state))),i&&d===null)throw Error(a(528,""));return S}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=us(s),s=Al(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 os(r){return'href="'+fr(r)+'"'}function Yo(r){return'link[rel="stylesheet"]['+r+"]"}function O0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function p2(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}),xn(i,"link",s),on(i),r.head.appendChild(i))}function us(r){return'[src="'+fr(r)+'"]'}function Xo(r){return"script[async]"+r}function D0(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,on(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),on(d),xn(d,"style",p),ad(d,s.precedence,r),i.instance=d;case"stylesheet":p=os(s.href);var v=r.querySelector(Yo(p));if(v)return i.state.loading|=4,i.instance=v,on(v),v;d=O0(s),(p=xr.get(p))&&Bm(d,p),v=(r.ownerDocument||r).createElement("link"),on(v);var S=v;return S._p=new Promise(function(N,$){S.onload=N,S.onerror=$}),xn(v,"link",d),i.state.loading|=4,ad(v,s.precedence,r),i.instance=v;case"script":return v=us(s.src),(p=r.querySelector(Xo(v)))?(i.instance=p,on(p),p):(d=s,(p=xr.get(v))&&(d=g({},s),$m(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),on(p),xn(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,ad(d,s.precedence,r));return i.instance}function ad(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,S=0;S<d.length;S++){var N=d[S];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 id=null;function M0(r,i,s){if(id===null){var d=new Map,p=id=new Map;p.set(s,d)}else p=id,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[ho]||v[gn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var N=d.get(S);N?N.push(v):d.set(S,[v])}}return d}function I0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function g2(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 L0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function y2(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=os(d.href),v=i.querySelector(Yo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ld.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,on(v);return}v=i.ownerDocument||i,d=O0(d),(p=xr.get(p))&&Bm(d,p),v=v.createElement("link"),on(v);var S=v;S._p=new Promise(function(N,$){S.onload=N,S.onerror=$}),xn(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=ld.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Fm=0;function v2(r,i){return r.stylesheets&&r.count===0&&od(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&od(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Fm===0&&(Fm=62500*J_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&od(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 ld(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)od(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var sd=null;function od(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,sd=new Map,i.forEach(b2,r),sd=null,ld.call(r))}function b2(r,i){if(!(i.state.loading&4)){var s=sd.get(r);if(s)var d=s.get(null);else{s=new Map,sd.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var S=p[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),d=S)}d&&s.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),v=s.get(S)||d,v===d&&s.set(null,p),s.set(S,p),this.count++,d=ld.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 Jo={$$typeof:z,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function x2(r,i,s,d,p,v,S,N,$){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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function U0(r,i,s,d,p,v,S,N,$,G,ae,de){return r=new x2(r,i,s,S,$,G,ae,de,N),i=1,v===!0&&(i|=24),v=Jn(3,null,null,i),r.current=v,v.stateNode=r,i=wh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Ch(v),r}function P0(r){return r?(r=Bl,r):Bl}function B0(r,i,s,d,p,v){p=P0(p),d.context===null?d.context=p:d.pendingContext=p,d=Za(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Va(r,d,i),s!==null&&($n(s,r,i),Ao(s,r,i))}function $0(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){$0(r,i),(r=r.alternate)&&$0(r,i)}function F0(r){if(r.tag===13||r.tag===31){var i=Hi(r,67108864);i!==null&&$n(i,r,67108864),qm(r,67108864)}}function q0(r){if(r.tag===13||r.tag===31){var i=rr();i=Uf(i);var s=Hi(r,i);s!==null&&$n(s,r,i),qm(r,i)}}var ud=!0;function w2(r,i,s,d){var p=Z.T;Z.T=null;var v=te.p;try{te.p=2,Hm(r,i,s,d)}finally{te.p=v,Z.T=p}}function S2(r,i,s,d){var p=Z.T;Z.T=null;var v=te.p;try{te.p=8,Hm(r,i,s,d)}finally{te.p=v,Z.T=p}}function Hm(r,i,s,d){if(ud){var p=Zm(d);if(p===null)Am(r,i,d,cd,s),Z0(r,d);else if(j2(p,r,i,s,d))d.stopPropagation();else if(Z0(r,d),i&4&&-1<k2.indexOf(r)){for(;p!==null;){var v=Tl(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var S=Ur(v.pendingLanes);if(S!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var $=1<<31-ht(S);N.entanglements[1]|=$,S&=~$}Fr(v),(ft&6)===0&&(Vc=fn()+500,Vo(0))}}break;case 31:case 13:N=Hi(v,2),N!==null&&$n(N,v,2),Kc(),qm(v,2)}if(v=Zm(d),v===null&&Am(r,i,d,cd,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Am(r,i,d,null,s)}}function Zm(r){return r=Qf(r),Vm(r)}var cd=null;function Vm(r){if(cd=null,r=_l(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 cd=r,null}function H0(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(co()){case ie:return 2;case ge:return 8;case Ue:case Be:return 32;case at:return 268435456;default:return 32}default:return 32}}var Qm=!1,ri=null,ai=null,ii=null,Wo=new Map,eu=new Map,li=[],k2="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 Z0(r,i){switch(r){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":Wo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":eu.delete(i.pointerId)}}function tu(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=Tl(i),i!==null&&F0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function j2(r,i,s,d,p){switch(i){case"focusin":return ri=tu(ri,r,i,s,d,p),!0;case"dragenter":return ai=tu(ai,r,i,s,d,p),!0;case"mouseover":return ii=tu(ii,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Wo.set(v,tu(Wo.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,eu.set(v,tu(eu.get(v)||null,r,i,s,d,p)),!0}return!1}function V0(r){var i=_l(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,lv(r.priority,function(){q0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,lv(r.priority,function(){q0(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 dd(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=Tl(s),i!==null&&F0(i),r.blockedOn=s,!1;i.shift()}return!0}function Q0(r,i,s){dd(r)&&s.delete(i)}function C2(){Qm=!1,ri!==null&&dd(ri)&&(ri=null),ai!==null&&dd(ai)&&(ai=null),ii!==null&&dd(ii)&&(ii=null),Wo.forEach(Q0),eu.forEach(Q0)}function fd(r,i){r.blockedOn===i&&(r.blockedOn=null,Qm||(Qm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,C2)))}var hd=null;function K0(r){hd!==r&&(hd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hd===r&&(hd=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=Tl(s);v!==null&&(r.splice(i,3),i-=3,Zh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function cs(r){function i($){return fd($,r)}ri!==null&&fd(ri,r),ai!==null&&fd(ai,r),ii!==null&&fd(ii,r),Wo.forEach(i),eu.forEach(i);for(var s=0;s<li.length;s++){var d=li[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)V0(s),s.blockedOn===null&&li.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],S=p[Mn]||null;if(typeof v=="function")S||K0(s);else if(S){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[Mn]||null)N=S.formAction;else if(Vm(p)!==null)continue}else N=S.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),K0(s)}}}function G0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return p=S})},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 Km(r){this._internalRoot=r}md.prototype.render=Km.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=rr();B0(s,d,r,i,null,null)},md.prototype.unmount=Km.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;B0(r.current,2,null,r,null,null),Kc(),i[Nl]=null}};function md(r){this._internalRoot=r}md.prototype.unstable_scheduleHydration=function(r){if(r){var i=iv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<li.length&&i!==0&&i<li[s].priority;s++);li.splice(s,0,r),s===0&&V0(r)}};var Y0=t.version;if(Y0!=="19.2.4")throw Error(a(527,Y0,"19.2.4"));te.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?y(r):null,r=r===null?null:r.stateNode,r};var E2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{tn=pd.inject(E2),qt=pd}catch{}}return ru.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=rx,v=ax,S=ix;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&&(S=i.onRecoverableError)),i=U0(r,1,!1,null,null,s,d,null,p,v,S,G0),r[Nl]=i.current,Tm(r),new Km(i)},ru.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=rx,S=ax,N=ix,$=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&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&($=s.formState)),i=U0(r,1,!0,i,s??null,d,p,$,v,S,N,G0),i.context=P0(null),s=i.current,d=rr(),d=Uf(d),p=Za(d),p.callback=null,Va(s,p,d),s=d,i.current.lanes=s,pn(i,s),Fr(i),r[Nl]=i.current,Tm(r),new md(i)},ru.version="19.2.4",ru}var s1;function L2(){if(s1)return Jm.exports;s1=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=I2(),Jm.exports}var U2=L2(),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(){}},ll,mi,Es,AS,P2=(AS=class extends wl{constructor(){super();Se(this,ll);Se(this,mi);Se(this,Es);pe(this,Es,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,mi)||this.setEventListener(M(this,Es))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,mi))==null||t.call(this),pe(this,mi,void 0))}setEventListener(t){var n;pe(this,Es,t),(n=M(this,mi))==null||n.call(this),pe(this,mi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){M(this,ll)!==t&&(pe(this,ll,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,ll)=="boolean"?M(this,ll):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ll=new WeakMap,mi=new WeakMap,Es=new WeakMap,AS),Gg=new P2,B2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pi,Vg,RS,$2=(RS=class{constructor(){Se(this,pi,B2);Se(this,Vg,!1)}setTimeoutProvider(e){pe(this,pi,e)}setTimeout(e,t){return M(this,pi).setTimeout(e,t)}clearTimeout(e){M(this,pi).clearTimeout(e)}setInterval(e,t){return M(this,pi).setInterval(e,t)}clearInterval(e){M(this,pi).clearInterval(e)}},pi=new WeakMap,Vg=new WeakMap,RS),il=new $2;function F2(e){setTimeout(e,0)}var q2=typeof window>"u"||"Deno"in globalThis;function Cn(){}function H2(e,t){return typeof e=="function"?e(t):e}function Hp(e){return typeof e=="number"&&e>=0&&e!==1/0}function qS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function o1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Yg(c,t.options))return!1}else if(!Su(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 u1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pl(t.options.mutationKey)!==pl(o))return!1}else if(!Su(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Yg(e,t){return((t==null?void 0:t.queryKeyHashFn)||pl)(e)}function pl(e){return JSON.stringify(e,(t,n)=>Zp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function Su(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Su(e[n],t[n])):!1}var Z2=Object.prototype.hasOwnProperty;function Xg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=c1(e)&&c1(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 y=0;y<f;y++){const g=a?y:c[y],b=e[g],w=t[g];if(b===w){m[g]=b,(a?y<o:Z2.call(e,g))&&h++;continue}if(b===null||w===null||typeof b!="object"||typeof w!="object"){m[g]=w;continue}const k=Xg(b,w,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function ku(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 c1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zp(e){if(!d1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!d1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function d1(e){return Object.prototype.toString.call(e)==="[object Object]"}function V2(e){return new Promise(t=>{il.setTimeout(t,e)})}function Vp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Xg(e,t):t}function Q2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function K2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Jg=Symbol();function HS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Jg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wg(e,t){return typeof e=="function"?e(...t):!!e}function G2(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 ju=(()=>{let e=()=>q2;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 Y2=F2;function X2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=Y2;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 Bt=X2(),Ns,gi,_s,zS,J2=(zS=class extends wl{constructor(){super();Se(this,Ns,!0);Se(this,gi);Se(this,_s);pe(this,_s,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,gi)||this.setEventListener(M(this,_s))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,gi))==null||t.call(this),pe(this,gi,void 0))}setEventListener(t){var n;pe(this,_s,t),(n=M(this,gi))==null||n.call(this),pe(this,gi,t(this.setOnline.bind(this)))}setOnline(t){M(this,Ns)!==t&&(pe(this,Ns,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return M(this,Ns)}},Ns=new WeakMap,gi=new WeakMap,_s=new WeakMap,zS),Vd=new J2;function W2(e){return Math.min(1e3*2**e,3e4)}function ZS(e){return(e??"online")==="online"?Vd.isOnline():!0}var Kp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function VS(e){let t=!1,n=0,a;const l=Qp(),o=()=>l.status!=="pending",c=j=>{var C;if(!o()){const E=new Kp(j);b(E),(C=e.onCancel)==null||C.call(e,E)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>Gg.isFocused()&&(e.networkMode==="always"||Vd.isOnline())&&e.canRun(),y=()=>ZS(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},w=()=>new Promise(j=>{var C;a=E=>{(o()||h())&&j(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const C=n===0?e.initialPromise:void 0;try{j=C??e.fn()}catch(E){j=Promise.reject(E)}Promise.resolve(j).then(g).catch(E=>{var O;if(o())return;const A=e.retry??(ju.isServer()?0:3),z=e.retryDelay??W2,U=typeof z=="function"?z(n,E):z,D=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,E);if(t||!D){b(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),V2(U).then(()=>h()?void 0:w()).then(()=>{t?b(E):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var sl,OS,QS=(OS=class{constructor(){Se(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hp(this.gcTime)&&pe(this,sl,il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ju.isServer()?1/0:300*1e3))}clearGcTimeout(){M(this,sl)&&(il.clearTimeout(M(this,sl)),pe(this,sl,void 0))}},sl=new WeakMap,OS),ol,Ts,wr,ul,cn,Ou,cl,sr,KS,ba,DS,eT=(DS=class extends QS{constructor(t){super();Se(this,sr);Se(this,ol);Se(this,Ts);Se(this,wr);Se(this,ul);Se(this,cn);Se(this,Ou);Se(this,cl);pe(this,cl,!1),pe(this,Ou,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,ul,t.client),pe(this,wr,M(this,ul).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,ol,h1(this.options)),this.state=t.state??M(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,cn))==null?void 0:t.promise}setOptions(t){if(this.options={...M(this,Ou),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=h1(this.options);n.data!==void 0&&(this.setState(f1(n.data,n.dataUpdatedAt)),pe(this,ol,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,wr).remove(this)}setData(t,n){const a=Vp(this.state.data,t,this.options);return Me(this,sr,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){Me(this,sr,ba).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=M(this,cn))==null?void 0:a.promise;return(l=M(this,cn))==null||l.cancel(t),n?n.then(Cn).catch(Cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return M(this,ol)}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===Jg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ci(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:!qS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,cn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,cn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,wr).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,cn)&&(M(this,cl)||Me(this,sr,KS).call(this)?M(this,cn).cancel({revert:!0}):M(this,cn).cancelRetry()),this.scheduleGc()),M(this,wr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,sr,ba).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,w,k,j,C,E,A,z;if(this.state.fetchStatus!=="idle"&&((m=M(this,cn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,cn))return M(this,cn).continueRetry(),M(this,cn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const U=this.observers.find(D=>D.options.queryFn);U&&this.setOptions(U.options)}const a=new AbortController,l=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(pe(this,cl,!0),a.signal)})},o=()=>{const U=HS(this.options,n),O=(()=>{const P={client:M(this,ul),queryKey:this.queryKey,meta:this.meta};return l(P),P})();return pe(this,cl,!1),this.options.persister?this.options.persister(U,O,this):U(O)},f=(()=>{const U={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,ul),state:this.state,fetchFn:o};return l(U),U})();(h=this.options.behavior)==null||h.onFetch(f,this),pe(this,Ts,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Me(this,sr,ba).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),pe(this,cn,VS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:U=>{U instanceof Kp&&U.revert&&this.setState({...M(this,Ts),fetchStatus:"idle"}),a.abort()},onFail:(U,D)=>{Me(this,sr,ba).call(this,{type:"failed",failureCount:U,error:D})},onPause:()=>{Me(this,sr,ba).call(this,{type:"pause"})},onContinue:()=>{Me(this,sr,ba).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const U=await M(this,cn).start();if(U===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(U),(w=(b=M(this,wr).config).onSuccess)==null||w.call(b,U,this),(j=(k=M(this,wr).config).onSettled)==null||j.call(k,U,this.state.error,this),U}catch(U){if(U instanceof Kp){if(U.silent)return M(this,cn).promise;if(U.revert){if(this.state.data===void 0)throw U;return this.state.data}}throw Me(this,sr,ba).call(this,{type:"error",error:U}),(E=(C=M(this,wr).config).onError)==null||E.call(C,U,this),(z=(A=M(this,wr).config).onSettled)==null||z.call(A,this.state.data,U,this),U}finally{this.scheduleGc()}}},ol=new WeakMap,Ts=new WeakMap,wr=new WeakMap,ul=new WeakMap,cn=new WeakMap,Ou=new WeakMap,cl=new WeakMap,sr=new WeakSet,KS=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,...GS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...f1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return pe(this,Ts,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),Bt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),M(this,wr).notify({query:this,type:"updated",action:t})})},DS);function GS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function f1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h1(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 qn,lt,Du,Rn,dl,As,xa,yi,Mu,Rs,zs,fl,hl,vi,Os,pt,mu,Gp,Yp,Xp,Jp,Wp,eg,tg,YS,MS,ey=(MS=class extends wl{constructor(t,n){super();Se(this,pt);Se(this,qn);Se(this,lt);Se(this,Du);Se(this,Rn);Se(this,dl);Se(this,As);Se(this,xa);Se(this,yi);Se(this,Mu);Se(this,Rs);Se(this,zs);Se(this,fl);Se(this,hl);Se(this,vi);Se(this,Os,new Set);this.options=n,pe(this,qn,t),pe(this,yi,null),pe(this,xa,Qp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,lt).addObserver(this),m1(M(this,lt),this.options)?Me(this,pt,mu).call(this):this.updateResult(),Me(this,pt,Jp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ng(M(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ng(M(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Me(this,pt,Wp).call(this),Me(this,pt,eg).call(this),M(this,lt).removeObserver(this)}setOptions(t){const n=this.options,a=M(this,lt);if(this.options=M(this,qn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,M(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Me(this,pt,tg).call(this),M(this,lt).setOptions(this.options),n._defaulted&&!ku(this.options,n)&&M(this,qn).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,lt),observer:this});const l=this.hasListeners();l&&p1(M(this,lt),a,this.options,n)&&Me(this,pt,mu).call(this),this.updateResult(),l&&(M(this,lt)!==a||kr(this.options.enabled,M(this,lt))!==kr(n.enabled,M(this,lt))||Ci(this.options.staleTime,M(this,lt))!==Ci(n.staleTime,M(this,lt)))&&Me(this,pt,Gp).call(this);const o=Me(this,pt,Yp).call(this);l&&(M(this,lt)!==a||kr(this.options.enabled,M(this,lt))!==kr(n.enabled,M(this,lt))||o!==M(this,vi))&&Me(this,pt,Xp).call(this,o)}getOptimisticResult(t){const n=M(this,qn).getQueryCache().build(M(this,qn),t),a=this.createResult(n,t);return nT(this,a)&&(pe(this,Rn,a),pe(this,As,this.options),pe(this,dl,M(this,lt).state)),a}getCurrentResult(){return M(this,Rn)}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,Os).add(t)}getCurrentQuery(){return M(this,lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=M(this,qn).defaultQueryOptions(t),a=M(this,qn).getQueryCache().build(M(this,qn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Me(this,pt,mu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,Rn)))}createResult(t,n){var V;const a=M(this,lt),l=this.options,o=M(this,Rn),c=M(this,dl),f=M(this,As),h=t!==a?t.state:M(this,Du),{state:y}=t;let g={...y},b=!1,w;if(n._optimisticResults){const F=this.hasListeners(),X=!F&&m1(t,n),ee=F&&p1(t,a,n,l);(X||ee)&&(g={...g,...GS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:C}=g;w=g.data;let E=!1;if(n.placeholderData!==void 0&&w===void 0&&C==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((V=M(this,zs))==null?void 0:V.state.data,M(this,zs)):n.placeholderData,F!==void 0&&(C="success",w=Vp(o==null?void 0:o.data,F,n),b=!0)}if(n.select&&w!==void 0&&!E)if(o&&w===(c==null?void 0:c.data)&&n.select===M(this,Mu))w=M(this,Rs);else try{pe(this,Mu,n.select),w=n.select(w),w=Vp(o==null?void 0:o.data,w,n),pe(this,Rs,w),pe(this,yi,null)}catch(F){pe(this,yi,F)}M(this,yi)&&(k=M(this,yi),w=M(this,Rs),j=Date.now(),C="error");const A=g.fetchStatus==="fetching",z=C==="pending",U=C==="error",D=z&&A,O=w!==void 0,L={status:C,fetchStatus:g.fetchStatus,isPending:z,isSuccess:C==="success",isError:U,isInitialLoading:D,isLoading:D,data:w,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!z,isLoadingError:U&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:U&&O,isStale:ty(t,n),refetch:this.refetch,promise:M(this,xa),isEnabled:kr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=L.data!==void 0,X=L.status==="error"&&!F,ee=re=>{X?re.reject(L.error):F&&re.resolve(L.data)},we=()=>{const re=pe(this,xa,L.promise=Qp());ee(re)},se=M(this,xa);switch(se.status){case"pending":t.queryHash===a.queryHash&&ee(se);break;case"fulfilled":(X||L.data!==se.value)&&we();break;case"rejected":(!X||L.error!==se.reason)&&we();break}}return L}updateResult(){const t=M(this,Rn),n=this.createResult(M(this,lt),this.options);if(pe(this,dl,M(this,lt).state),pe(this,As,this.options),M(this,dl).data!==void 0&&pe(this,zs,M(this,lt)),ku(n,t))return;pe(this,Rn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!M(this,Os).size)return!0;const c=new Set(o??M(this,Os));return this.options.throwOnError&&c.add("error"),Object.keys(M(this,Rn)).some(f=>{const m=f;return M(this,Rn)[m]!==t[m]&&c.has(m)})};Me(this,pt,YS).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Me(this,pt,Jp).call(this)}},qn=new WeakMap,lt=new WeakMap,Du=new WeakMap,Rn=new WeakMap,dl=new WeakMap,As=new WeakMap,xa=new WeakMap,yi=new WeakMap,Mu=new WeakMap,Rs=new WeakMap,zs=new WeakMap,fl=new WeakMap,hl=new WeakMap,vi=new WeakMap,Os=new WeakMap,pt=new WeakSet,mu=function(t){Me(this,pt,tg).call(this);let n=M(this,lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Cn)),n},Gp=function(){Me(this,pt,Wp).call(this);const t=Ci(this.options.staleTime,M(this,lt));if(ju.isServer()||M(this,Rn).isStale||!Hp(t))return;const a=qS(M(this,Rn).dataUpdatedAt,t)+1;pe(this,fl,il.setTimeout(()=>{M(this,Rn).isStale||this.updateResult()},a))},Yp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,lt)):this.options.refetchInterval)??!1},Xp=function(t){Me(this,pt,eg).call(this),pe(this,vi,t),!(ju.isServer()||kr(this.options.enabled,M(this,lt))===!1||!Hp(M(this,vi))||M(this,vi)===0)&&pe(this,hl,il.setInterval(()=>{(this.options.refetchIntervalInBackground||Gg.isFocused())&&Me(this,pt,mu).call(this)},M(this,vi)))},Jp=function(){Me(this,pt,Gp).call(this),Me(this,pt,Xp).call(this,Me(this,pt,Yp).call(this))},Wp=function(){M(this,fl)&&(il.clearTimeout(M(this,fl)),pe(this,fl,void 0))},eg=function(){M(this,hl)&&(il.clearInterval(M(this,hl)),pe(this,hl,void 0))},tg=function(){const t=M(this,qn).getQueryCache().build(M(this,qn),this.options);if(t===M(this,lt))return;const n=M(this,lt);pe(this,lt,t),pe(this,Du,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},YS=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(M(this,Rn))}),M(this,qn).getQueryCache().notify({query:M(this,lt),type:"observerResultsUpdated"})})},MS);function tT(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function m1(e,t){return tT(e,t)||e.state.data!==void 0&&ng(e,t,t.refetchOnMount)}function ng(e,t,n){if(kr(t.enabled,e)!==!1&&Ci(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&ty(e,t)}return!1}function p1(e,t,n,a){return(e!==t||kr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ty(e,n)}function ty(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function nT(e,t){return!ku(e.getCurrentResult(),t)}function g1(e){return{onFetch:(t,n)=>{var y,g,b,w,k;const a=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const C=z=>{G2(z,()=>t.signal,()=>j=!0)},E=HS(t.options,t.fetchOptions),A=async(z,U,D)=>{if(j)return Promise.reject();if(U==null&&z.pages.length)return Promise.resolve(z);const P=(()=>{const X={client:t.client,queryKey:t.queryKey,pageParam:U,direction:D?"backward":"forward",meta:t.options.meta};return C(X),X})(),L=await E(P),{maxPages:V}=t.options,F=D?K2:Q2;return{pages:F(z.pages,L,V),pageParams:F(z.pageParams,U,V)}};if(l&&o.length){const z=l==="backward",U=z?rT:y1,D={pages:o,pageParams:c},O=U(a,D);f=await A(D,O,z)}else{const z=e??o.length;do{const U=m===0?c[0]??a.initialPageParam:y1(a,f);if(m>0&&U==null)break;f=await A(f,U),m++}while(m<z)}return f};t.options.persister?t.fetchFn=()=>{var j,C;return(C=(j=t.options).persister)==null?void 0:C.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function y1(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 rT(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 Iu,Hr,kn,ml,Zr,di,IS,aT=(IS=class extends QS{constructor(t){super();Se(this,Zr);Se(this,Iu);Se(this,Hr);Se(this,kn);Se(this,ml);pe(this,Iu,t.client),this.mutationId=t.mutationId,pe(this,kn,t.mutationCache),pe(this,Hr,[]),this.state=t.state||XS(),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,Hr).includes(t)||(M(this,Hr).push(t),this.clearGcTimeout(),M(this,kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Hr,M(this,Hr).filter(n=>n!==t)),this.scheduleGc(),M(this,kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,Hr).length||(this.state.status==="pending"?this.scheduleGc():M(this,kn).remove(this))}continue(){var t;return((t=M(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,w,k,j,C,E,A,z,U,D,O,P;const n=()=>{Me(this,Zr,di).call(this,{type:"continue"})},a={client:M(this,Iu),meta:this.options.meta,mutationKey:this.options.mutationKey};pe(this,ml,VS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(L,V)=>{Me(this,Zr,di).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{Me(this,Zr,di).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,ml).canStart();try{if(l)n();else{Me(this,Zr,di).call(this,{type:"pending",variables:t,isPaused:o}),M(this,kn).config.onMutate&&await M(this,kn).config.onMutate(t,this,a);const V=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));V!==this.state.context&&Me(this,Zr,di).call(this,{type:"pending",context:V,variables:t,isPaused:o})}const L=await M(this,ml).start();return await((h=(m=M(this,kn).config).onSuccess)==null?void 0:h.call(m,L,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,L,t,this.state.context,a)),await((w=(b=M(this,kn).config).onSettled)==null?void 0:w.call(b,L,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,L,null,t,this.state.context,a)),Me(this,Zr,di).call(this,{type:"success",data:L}),L}catch(L){try{await((E=(C=M(this,kn).config).onError)==null?void 0:E.call(C,L,t,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((z=(A=this.options).onError)==null?void 0:z.call(A,L,t,this.state.context,a))}catch(V){Promise.reject(V)}try{await((D=(U=M(this,kn).config).onSettled)==null?void 0:D.call(U,void 0,L,this.state.variables,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((P=(O=this.options).onSettled)==null?void 0:P.call(O,void 0,L,t,this.state.context,a))}catch(V){Promise.reject(V)}throw Me(this,Zr,di).call(this,{type:"error",error:L}),L}finally{M(this,kn).runNext(this)}}},Iu=new WeakMap,Hr=new WeakMap,kn=new WeakMap,ml=new WeakMap,Zr=new WeakSet,di=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),Bt.batch(()=>{M(this,Hr).forEach(a=>{a.onMutationUpdate(t)}),M(this,kn).notify({mutation:this,type:"updated",action:t})})},IS);function XS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wa,Or,Lu,LS,iT=(LS=class extends wl{constructor(t={}){super();Se(this,wa);Se(this,Or);Se(this,Lu);this.config=t,pe(this,wa,new Set),pe(this,Or,new Map),pe(this,Lu,0)}build(t,n,a){const l=new aT({client:t,mutationCache:this,mutationId:++gd(this,Lu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){M(this,wa).add(t);const n=yd(t);if(typeof n=="string"){const a=M(this,Or).get(n);a?a.push(t):M(this,Or).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,wa).delete(t)){const n=yd(t);if(typeof n=="string"){const a=M(this,Or).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,Or).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=yd(t);if(typeof n=="string"){const a=M(this,Or).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=yd(t);if(typeof n=="string"){const l=(a=M(this,Or).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(){Bt.batch(()=>{M(this,wa).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,wa).clear(),M(this,Or).clear()})}getAll(){return Array.from(M(this,wa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>u1(n,a))}findAll(t={}){return this.getAll().filter(n=>u1(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Cn))))}},wa=new WeakMap,Or=new WeakMap,Lu=new WeakMap,LS);function yd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Sa,bi,Hn,ka,Ca,Ld,rg,US,lT=(US=class extends wl{constructor(n,a){super();Se(this,Ca);Se(this,Sa);Se(this,bi);Se(this,Hn);Se(this,ka);pe(this,Sa,n),this.setOptions(a),this.bindMethods(),Me(this,Ca,Ld).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,Sa).defaultMutationOptions(n),ku(this.options,a)||M(this,Sa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,Hn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&pl(a.mutationKey)!==pl(this.options.mutationKey)?this.reset():((l=M(this,Hn))==null?void 0:l.state.status)==="pending"&&M(this,Hn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=M(this,Hn))==null||n.removeObserver(this)}onMutationUpdate(n){Me(this,Ca,Ld).call(this),Me(this,Ca,rg).call(this,n)}getCurrentResult(){return M(this,bi)}reset(){var n;(n=M(this,Hn))==null||n.removeObserver(this),pe(this,Hn,void 0),Me(this,Ca,Ld).call(this),Me(this,Ca,rg).call(this)}mutate(n,a){var l;return pe(this,ka,a),(l=M(this,Hn))==null||l.removeObserver(this),pe(this,Hn,M(this,Sa).getMutationCache().build(M(this,Sa),this.options)),M(this,Hn).addObserver(this),M(this,Hn).execute(n)}},Sa=new WeakMap,bi=new WeakMap,Hn=new WeakMap,ka=new WeakMap,Ca=new WeakSet,Ld=function(){var a;const n=((a=M(this,Hn))==null?void 0:a.state)??XS();pe(this,bi,{...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){Bt.batch(()=>{var a,l,o,c,f,m,h,y;if(M(this,ka)&&this.hasListeners()){const g=M(this,bi).variables,b=M(this,bi).context,w={client:M(this,Sa),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,g,b,w)}catch(k){Promise.reject(k)}try{(c=(o=M(this,ka)).onSettled)==null||c.call(o,n.data,null,g,b,w)}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,g,b,w)}catch(k){Promise.reject(k)}try{(y=(h=M(this,ka)).onSettled)==null||y.call(h,void 0,n.error,g,b,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(M(this,bi))})})},US);function v1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function sT(e,t,n){const a=e.slice(0);return a[t]=n,a}var Ds,ir,Ms,Is,Sr,xi,Uu,Pu,Bu,$u,wn,ag,ig,lg,sg,og,PS,oT=(PS=class extends wl{constructor(t,n,a){super();Se(this,wn);Se(this,Ds);Se(this,ir);Se(this,Ms);Se(this,Is);Se(this,Sr);Se(this,xi);Se(this,Uu);Se(this,Pu);Se(this,Bu);Se(this,$u,[]);pe(this,Ds,t),pe(this,Is,a),pe(this,Ms,[]),pe(this,Sr,[]),pe(this,ir,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&M(this,Sr).forEach(t=>{t.subscribe(n=>{Me(this,wn,sg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,M(this,Sr).forEach(t=>{t.destroy()})}setQueries(t,n){pe(this,Ms,t),pe(this,Is,n),Bt.batch(()=>{const a=M(this,Sr),l=Me(this,wn,lg).call(this,M(this,Ms));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,b)=>g!==a[b]),h=f||m,y=h?!0:c.some((g,b)=>{const w=M(this,ir)[b];return!w||!ku(g,w)});!h&&!y||(h&&(pe(this,$u,l),pe(this,Sr,o)),pe(this,ir,c),this.hasListeners()&&(h&&(v1(a,o).forEach(g=>{g.destroy()}),v1(o,a).forEach(g=>{g.subscribe(b=>{Me(this,wn,sg).call(this,g,b)})})),Me(this,wn,og).call(this)))})}getCurrentResult(){return M(this,ir)}getQueries(){return M(this,Sr).map(t=>t.getCurrentQuery())}getObservers(){return M(this,Sr)}getOptimisticResult(t,n){const a=Me(this,wn,lg).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>Me(this,wn,ig).call(this,c??l,n,o),()=>Me(this,wn,ag).call(this,l,a)]}},Ds=new WeakMap,ir=new WeakMap,Ms=new WeakMap,Is=new WeakMap,Sr=new WeakMap,xi=new WeakMap,Uu=new WeakMap,Pu=new WeakMap,Bu=new WeakMap,$u=new WeakMap,wn=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,Bu),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!M(this,xi)||M(this,ir)!==M(this,Pu)||o||n!==M(this,Uu))&&(pe(this,Uu,n),pe(this,Pu,M(this,ir)),a!==void 0&&pe(this,Bu,a),pe(this,xi,Xg(M(this,xi),n(t)))),M(this,xi)}return t},lg=function(t){const n=new Map;M(this,Sr).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,Ds).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new ey(M(this,Ds),o);a.push({defaultedQueryOptions:o,observer:f})}),a},sg=function(t,n){const a=M(this,Sr).indexOf(t);a!==-1&&(pe(this,ir,sT(M(this,ir),a,n)),Me(this,wn,og).call(this))},og=function(){var t;if(this.hasListeners()){const n=M(this,xi),a=Me(this,wn,ag).call(this,M(this,ir),M(this,$u)),l=Me(this,wn,ig).call(this,a,(t=M(this,Is))==null?void 0:t.combine);n!==l&&Bt.batch(()=>{this.listeners.forEach(o=>{o(M(this,ir))})})}},PS),Vr,BS,uT=(BS=class extends wl{constructor(t={}){super();Se(this,Vr);this.config=t,pe(this,Vr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Yg(l,n);let c=this.get(o);return c||(c=new eT({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){M(this,Vr).has(t.queryHash)||(M(this,Vr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,Vr).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,Vr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,Vr).get(t)}getAll(){return[...M(this,Vr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>o1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>o1(t,a)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vr=new WeakMap,BS),Pt,wi,Si,Ls,Us,ki,Ps,Bs,$S,cT=($S=class{constructor(e={}){Se(this,Pt);Se(this,wi);Se(this,Si);Se(this,Ls);Se(this,Us);Se(this,ki);Se(this,Ps);Se(this,Bs);pe(this,Pt,e.queryCache||new uT),pe(this,wi,e.mutationCache||new iT),pe(this,Si,e.defaultOptions||{}),pe(this,Ls,new Map),pe(this,Us,new Map),pe(this,ki,0)}mount(){gd(this,ki)._++,M(this,ki)===1&&(pe(this,Ps,Gg.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Pt).onFocus())})),pe(this,Bs,Vd.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Pt).onOnline())})))}unmount(){var e,t;gd(this,ki)._--,M(this,ki)===0&&((e=M(this,Ps))==null||e.call(this),pe(this,Ps,void 0),(t=M(this,Bs))==null||t.call(this),pe(this,Bs,void 0))}isFetching(e){return M(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,wi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,Pt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ci(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return M(this,Pt).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,Pt).get(a.queryHash),o=l==null?void 0:l.state.data,c=H2(t,o);if(c!==void 0)return M(this,Pt).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>M(this,Pt).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,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,Pt);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,Pt);return Bt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Bt.batch(()=>M(this,Pt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Cn).catch(Cn)}invalidateQueries(e,t={}){return Bt.batch(()=>(M(this,Pt).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=Bt.batch(()=>M(this,Pt).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,Pt).build(this,t);return n.isStaleByTime(Ci(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=g1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cn).catch(Cn)}ensureInfiniteQueryData(e){return e.behavior=g1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vd.isOnline()?M(this,wi).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Pt)}getMutationCache(){return M(this,wi)}getDefaultOptions(){return M(this,Si)}setDefaultOptions(e){pe(this,Si,e)}setQueryDefaults(e,t){M(this,Ls).set(pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Ls).values()],n={};return t.forEach(a=>{Su(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){M(this,Us).set(pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,Us).values()],n={};return t.forEach(a=>{Su(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Yg(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===Jg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,Pt).clear(),M(this,wi).clear()}},Pt=new WeakMap,wi=new WeakMap,Si=new WeakMap,Ls=new WeakMap,Us=new WeakMap,ki=new WeakMap,Ps=new WeakMap,Bs=new WeakMap,$S),JS=x.createContext(void 0),sn=e=>{const t=x.useContext(JS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dT=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(JS.Provider,{value:e,children:t})),WS=x.createContext(!1),ek=()=>x.useContext(WS);WS.Provider;function fT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hT=x.createContext(fT()),tk=()=>x.useContext(hT),nk=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Wg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},rk=e=>{x.useEffect(()=>{e.clearReset()},[e])},ak=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Wg(n,[e.error,a])),ik=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))}},mT=(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 pT({queries:e,...t},n){const a=sn(),l=ek(),o=tk(),c=x.useMemo(()=>e.map(j=>{const C=a.defaultQueryOptions(j);return C._optimisticResults=l?"isRestoring":"optimistic",C}),[e,a,l]);c.forEach(j=>{ik(j);const C=a.getQueryCache().get(j.queryHash);nk(j,o,C)}),rk(o);const[f]=x.useState(()=>new oT(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Bt.batchCalls(j)):Cn,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const w=m.some((j,C)=>ug(c[C],j))?m.flatMap((j,C)=>{const E=c[C];if(E&&ug(E,j)){const A=new ey(a,E);return cg(E,A,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,C)=>{const E=c[C];return E&&ak({result:j,errorResetBoundary:o,throwOnError:E.throwOnError,query:a.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function gT(e,t,n){var b,w,k,j;const a=ek(),l=tk(),o=sn(),c=o.defaultQueryOptions(e);(w=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||w.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",ik(c),nk(c,l,f),rk(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(C=>{const E=g?h.subscribe(Bt.batchCalls(C)):Cn;return h.updateResult(),E},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),ug(c,y))throw cg(c,h,l);if(ak({result:y,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,y),c.experimental_prefetchInRender&&!ju.isServer()&&mT(y,a)){const C=m?cg(c,h,l):f==null?void 0:f.promise;C==null||C.catch(Cn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function Fe(e,t){return gT(e,ey)}function kt(e,t){const n=sn(),[a]=x.useState(()=>new lT(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Bt.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(Cn)},[a]);if(l.error&&Wg(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 b1="popstate";function x1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function yT(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:Cu(l)}return bT(t,n,null,e)}function Rt(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 vT(){return Math.random().toString(36).substring(2,10)}function w1(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"?Ys(t):t,state:n,key:t&&t.key||a||vT(),unstable_mask:l}}function Cu({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 Ys(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 bT(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let C=y(),E=C==null?null:C-h;h=C,m&&m({action:f,location:j.location,delta:E})}function b(C,E){f="PUSH";let A=x1(C)?C:dg(j.location,C,E);h=y()+1;let z=w1(A,h),U=j.createHref(A.unstable_mask||A);try{c.pushState(z,"",U)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;l.location.assign(U)}o&&m&&m({action:f,location:j.location,delta:1})}function w(C,E){f="REPLACE";let A=x1(C)?C:dg(j.location,C,E);h=y();let z=w1(A,h),U=j.createHref(A.unstable_mask||A);c.replaceState(z,"",U),o&&m&&m({action:f,location:j.location,delta:0})}function k(C){return xT(C)}let j={get action(){return f},get location(){return e(l,c)},listen(C){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(b1,g),m=C,()=>{l.removeEventListener(b1,g),m=null}},createHref(C){return t(l,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:w,go(C){return c.go(C)}};return j}function xT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Rt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Cu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function lk(e,t,n="/"){return wT(e,t,n,!1)}function wT(e,t,n,a){let l=typeof t=="string"?Ys(t):t,o=Ea(l.pathname||"/",n);if(o==null)return null;let c=sk(e);ST(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=OT(o);f=RT(c[m],h,a)}return f}function sk(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;Rt(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Gr([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(Rt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),sk(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:TT(g,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 ok(c.path))o(c,f,!0,h)}),t}function ok(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=ok(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 ST(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var kT=/^:[\w-]+$/,jT=3,CT=2,ET=1,NT=10,_T=-2,S1=e=>e==="*";function TT(e,t){let n=e.split("/"),a=n.length;return n.some(S1)&&(a+=_T),t&&(a+=CT),n.filter(l=>!S1(l)).reduce((l,o)=>l+(kT.test(o)?jT:o===""?ET:NT),a)}function AT(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 RT(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,y=o==="/"?t:t.slice(o.length)||"/",g=Qd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Qd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:Gr([o,g.pathname]),pathnameBase:LT(Gr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=Gr([o,g.pathnameBase]))}return c}function Qd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=zT(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:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[b];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function zT(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,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 OT(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 DT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function MT(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Ys(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=k1(n.substring(1),"/"):o=k1(n,t)):o=t,{pathname:o,search:UT(a),hash:PT(l)}}function k1(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 IT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ny(e){let t=IT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function ff(e,t,n,a=!1){let l;typeof e=="string"?l=Ys(e):(l={...e},Rt(!l.pathname||!l.pathname.includes("?"),np("?","pathname","search",l)),Rt(!l.pathname||!l.pathname.includes("#"),np("#","pathname","hash",l)),Rt(!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 g=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=MT(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Gr=e=>e.join("/").replace(/\/\/+/g,"/"),LT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,BT=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 $T(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function FT(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var uk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ck(e,t){let n=e;if(typeof n!="string"||!DT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(uk)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 dk=["POST","PUT","PATCH","DELETE"];new Set(dk);var qT=["GET",...dk];new Set(qT);var Xs=x.createContext(null);Xs.displayName="DataRouter";var hf=x.createContext(null);hf.displayName="DataRouterState";var HT=x.createContext(!1),fk=x.createContext({isTransitioning:!1});fk.displayName="ViewTransition";var ZT=x.createContext(new Map);ZT.displayName="Fetchers";var VT=x.createContext(null);VT.displayName="Await";var ur=x.createContext(null);ur.displayName="Navigation";var Fu=x.createContext(null);Fu.displayName="Location";var Nr=x.createContext({outlet:null,matches:[],isDataRoute:!1});Nr.displayName="Route";var ry=x.createContext(null);ry.displayName="RouteError";var hk="REACT_ROUTER_ERROR",QT="REDIRECT",KT="ROUTE_ERROR_RESPONSE";function GT(e){if(e.startsWith(`${hk}:${QT}:{`))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 YT(e){if(e.startsWith(`${hk}:${KT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new BT(t.status,t.statusText,t.data)}catch{}}function XT(e,{relative:t}={}){Rt(Js(),"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}=qu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Gr([n,o])),a.createHref({pathname:f,search:c,hash:l})}function Js(){return x.useContext(Fu)!=null}function Qn(){return Rt(Js(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Fu).location}var mk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pk(e){x.useContext(ur).static||x.useLayoutEffect(e)}function On(){let{isDataRoute:e}=x.useContext(Nr);return e?fA():JT()}function JT(){Rt(Js(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Xs),{basename:t,navigator:n}=x.useContext(ur),{matches:a}=x.useContext(Nr),{pathname:l}=Qn(),o=JSON.stringify(ny(a)),c=x.useRef(!1);return pk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Cr(c.current,mk),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=ff(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Gr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var WT=x.createContext(null);function eA(e){let t=x.useContext(Nr).outlet;return x.useMemo(()=>t&&x.createElement(WT.Provider,{value:e},t),[t,e])}function gk(){let{matches:e}=x.useContext(Nr),t=e[e.length-1];return t?t.params:{}}function qu(e,{relative:t}={}){let{matches:n}=x.useContext(Nr),{pathname:a}=Qn(),l=JSON.stringify(ny(n));return x.useMemo(()=>ff(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function tA(e,t){return yk(e,t)}function yk(e,t,n){var C;Rt(Js(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(ur),{matches:l}=x.useContext(Nr),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";bk(f,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Qn(),g;if(t){let E=typeof t=="string"?Ys(t):t;Rt(m==="/"||((C=E.pathname)==null?void 0:C.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 "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=y;let b=g.pathname||"/",w=b;if(m!=="/"){let E=m.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=lk(e,{pathname:w});Cr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.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 "${g.pathname}${g.search}${g.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=lA(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:Gr([m,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Gr([m,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,n);return t&&j?x.createElement(Fu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function nA(){let e=dA(),t=$T(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 rA=x.createElement(nA,null),vk=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=YT(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Nr.Provider,{value:this.props.routeContext},x.createElement(ry.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(aA,{error:e},t):t}};vk.contextType=HT;var rp=new WeakMap;function aA({children:e,error:t}){let{basename:n}=x.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=GT(t.digest);if(a){let l=rp.get(t);if(l)throw l;let o=ck(a.location,n);if(uk&&!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 iA({routeContext:e,match:t,children:n}){let a=x.useContext(Xs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Nr.Provider,{value:e},n)}function lA(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 y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Rt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:w}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.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?(y,g)=>{var b,w;m(y,{location:a.location,params:((w=(b=a.matches)==null?void 0:b[0])==null?void 0:w.params)??{},unstable_pattern:FT(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let w,k=!1,j=null,C=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||rA,c&&(f<0&&b===0?(bk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,C=null):f===b&&(k=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,b+1)),A=()=>{let z;return w?z=j:k?z=C:g.route.Component?z=x.createElement(g.route.Component,null):g.route.element?z=g.route.element:z=y,x.createElement(iA,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:a!=null},children:z})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(vk,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):A()},null)}function ay(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sA(e){let t=x.useContext(Xs);return Rt(t,ay(e)),t}function oA(e){let t=x.useContext(hf);return Rt(t,ay(e)),t}function uA(e){let t=x.useContext(Nr);return Rt(t,ay(e)),t}function iy(e){let t=uA(e),n=t.matches[t.matches.length-1];return Rt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function cA(){return iy("useRouteId")}function dA(){var a;let e=x.useContext(ry),t=oA("useRouteError"),n=iy("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function fA(){let{router:e}=sA("useNavigate"),t=iy("useNavigate"),n=x.useRef(!1);return pk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Cr(n.current,mk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var j1={};function bk(e,t,n){!t&&!j1[e]&&(j1[e]=!0,Cr(!1,n))}x.memo(hA);function hA({routes:e,future:t,state:n,isStatic:a,onError:l}){return yk(e,void 0,{state:n,isStatic:a,onError:l})}function lr({to:e,replace:t,state:n,relative:a}){Rt(Js(),"<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(Nr),{pathname:c}=Qn(),f=On(),m=ff(e,ny(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 $s(e){return eA(e.context)}function At(e){Rt(!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 mA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){Rt(!Js(),"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=Ys(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:w="default",unstable_mask:k}=n,j=x.useMemo(()=>{let C=Ea(h,f);return C==null?null:{location:{pathname:C,search:y,hash:g,state:b,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,b,w,a,k]);return Cr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" 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(Fu.Provider,{children:t,value:j}))}function pA({children:e,location:t}){return tA(fg(e),t)}function fg(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,fg(a.props.children,o));return}Rt(a.type===At,`[${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>`),Rt(!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=fg(a.props.children,o)),n.push(c)}),n}var Ud="get",Pd="application/x-www-form-urlencoded";function mf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function gA(e){return mf(e)&&e.tagName.toLowerCase()==="button"}function yA(e){return mf(e)&&e.tagName.toLowerCase()==="form"}function vA(e){return mf(e)&&e.tagName.toLowerCase()==="input"}function bA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xA(e,t){return e.button===0&&(!t||t==="_self")&&!bA(e)}function hg(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 wA(e,t){let n=hg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var vd=null;function SA(){if(vd===null)try{new FormData(document.createElement("form"),0),vd=!1}catch{vd=!0}return vd}var kA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ap(e){return e!=null&&!kA.has(e)?(Cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pd}"`),null):e}function jA(e,t){let n,a,l,o,c;if(yA(e)){let f=e.getAttribute("action");a=f?Ea(f,t):null,n=e.getAttribute("method")||Ud,l=ap(e.getAttribute("enctype"))||Pd,o=new FormData(e)}else if(gA(e)||vA(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")||Ud,l=ap(e.getAttribute("formenctype"))||ap(f.getAttribute("enctype"))||Pd,o=new FormData(f,e),!SA()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(mf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ud,a=null,l=Pd,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 ly(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function CA(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 EA(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 NA(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 _A(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await EA(o,n);return c.links?c.links():[]}return[]}));return zA(a.flat(1).filter(NA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function C1(e,t,n,a,l,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.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 g;let y=a.routes[m.route.id];if(!y||!y.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:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function TA(e,t,{includeHydrateFallback:n}={}){return AA(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 AA(e){return[...new Set(e)]}function RA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function zA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(RA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function xk(){let e=x.useContext(Xs);return ly(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function OA(){let e=x.useContext(hf);return ly(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var sy=x.createContext(void 0);sy.displayName="FrameworkContext";function wk(){let e=x.useContext(sy);return ly(e,"You must render this element inside a <HydratedRouter> element"),e}function DA(e,t){let n=x.useContext(sy),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=E=>{E.forEach(A=>{c(A.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:au(f,w),onBlur:au(m,k),onMouseEnter:au(h,w),onMouseLeave:au(y,k),onTouchStart:au(g,w)}]:[!1,b,{}]}function au(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function MA({page:e,...t}){let{router:n}=xk(),a=x.useMemo(()=>lk(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(LA,{page:e,matches:a,...t}):null}function IA(e){let{manifest:t,routeModules:n}=wk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return _A(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function LA({page:e,matches:t,...n}){let a=Qn(),{future:l,manifest:o,routeModules:c}=wk(),{basename:f}=xk(),{loaderData:m,matches:h}=OA(),y=x.useMemo(()=>C1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>C1(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,C=!1;if(t.forEach(A=>{var U;let z=o.routes[A.route.id];!z||!z.hasLoader||(!y.some(D=>D.route.id===A.route.id)&&A.route.id in m&&((U=c[A.route.id])!=null&&U.shouldRevalidate)||z.hasClientLoader?C=!0:j.add(A.route.id))}),j.size===0)return[];let E=CA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&E.searchParams.set("_routes",t.filter(A=>j.has(A.route.id)).map(A=>A.route.id).join(",")),[E.pathname+E.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),w=x.useMemo(()=>TA(g,o),[g,o]),k=IA(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:C})=>x.createElement("link",{key:j,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function UA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var PA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PA&&(window.__reactRouterVersion="7.13.1")}catch{}function BA({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=yT({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(mA,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var Sk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hu=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:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w,...k},j){let{basename:C,navigator:E,unstable_useTransitions:A}=x.useContext(ur),z=typeof y=="string"&&Sk.test(y),U=ck(y,C);y=U.to;let D=XT(y,{relative:l}),O=Qn(),P=null;if(f){let re=ff(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(re.pathname=re.pathname==="/"?C:Gr([C,re.pathname])),P=E.createHref(re)}let[L,V,F]=DA(a,k),X=qA(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:A});function ee(re){t&&t(re),re.defaultPrevented||X(re)}let we=!(U.isExternal||o),se=x.createElement("a",{...k,...F,href:(we?P:void 0)||U.absoluteURL||D,onClick:we?ee:t,ref:UA(j,V),target:h,"data-discover":!z&&n==="render"?"true":void 0});return L&&!z?x.createElement(x.Fragment,null,se,x.createElement(MA,{page:D})):se});Hu.displayName="Link";var pf=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},y){let g=qu(c,{relative:h.relative}),b=Qn(),w=x.useContext(hf),{navigator:k,basename:j}=x.useContext(ur),C=w!=null&&KA(g)&&f===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,A=b.pathname,z=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(A=A.toLowerCase(),z=z?z.toLowerCase():null,E=E.toLowerCase()),z&&j&&(z=Ea(z,j)||z);const U=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=A===E||!l&&A.startsWith(E)&&A.charAt(U)==="/",O=z!=null&&(z===E||!l&&z.startsWith(E)&&z.charAt(E.length)==="/"),P={isActive:D,isPending:O,isTransitioning:C},L=D?t:void 0,V;typeof a=="function"?V=a(P):V=[a,D?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(P):o;return x.createElement(Hu,{...h,"aria-current":L,className:V,ref:y,style:F,to:c,viewTransition:f},typeof m=="function"?m(P):m)});pf.displayName="NavLink";var $A=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=Ud,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...w},k)=>{let{unstable_useTransitions:j}=x.useContext(ur),C=VA(),E=QA(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&Sk.test(f),U=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,P=(O==null?void 0:O.getAttribute("formmethod"))||c,L=()=>C(O||D.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>L()):L()};return x.createElement("form",{ref:k,method:A,action:E,onSubmit:a?m:U,...w,"data-discover":!z&&e==="render"?"true":void 0})});$A.displayName="Form";function FA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kk(e){let t=x.useContext(Xs);return Rt(t,FA(e)),t}function qA(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=On(),g=Qn(),b=qu(e,{relative:c});return x.useCallback(w=>{if(xA(w,t)){w.preventDefault();let k=n!==void 0?n:Cu(g)===Cu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,c,f,m,h])}function gf(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(hg(e)),n=x.useRef(!1),a=Qn(),l=x.useMemo(()=>wA(a.search,n.current?null:t.current),[a.search]),o=On(),c=x.useCallback((f,m)=>{const h=hg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var HA=0,ZA=()=>`__${String(++HA)}__`;function VA(){let{router:e}=kk("useSubmit"),{basename:t}=x.useContext(ur),n=cA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=jA(o,t);if(c.navigate===!1){let b=c.fetcherKey||ZA();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,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:y,body:g,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 QA(e,{relative:t}={}){let{basename:n}=x.useContext(ur),a=x.useContext(Nr);Rt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...qu(e||".",{relative:t})},c=Qn();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}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])),Cu(o)}function KA(e,{relative:t}={}){let n=x.useContext(fk);Rt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=kk("useViewTransitionState"),l=qu(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 GA="/api/v1";async function YA(e,t){const n=await fetch(`${GA}/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 jk="/api/v1",oy="first-tree-hub:tokens";let mg=null;function iu(e){mg=e}function XA(e){if(!mg||!e.startsWith("/admin/")&&e!=="/admin"||/[?&]organizationId=/.test(e))return e;const t=e.includes("?")?"&":"?";return`${e}${t}organizationId=${encodeURIComponent(mg)}`}function uy(){const e=localStorage.getItem(oy);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function pg(e){localStorage.setItem(oy,JSON.stringify(e))}function Ck(){localStorage.removeItem(oy)}class Zu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let lu=null;async function JA(e){return lu||(lu=(async()=>{try{const t=await fetch(`${jk}/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{lu=null}})(),lu)}async function bd(e,t){const{method:n="GET",body:a}=t??{},l=XA(e),o=m=>{const h={};return m&&(h.Authorization=`Bearer ${m}`),a!==void 0&&(h["Content-Type"]="application/json"),fetch(`${jk}${l}`,{method:n,headers:h,body:a!==void 0?JSON.stringify(a):void 0})},c=uy();let f=await o(c==null?void 0:c.accessToken);if(f.status===401&&(c!=null&&c.refreshToken)){const m=await JA(c.refreshToken);m&&(f=await o(m.accessToken))}if(!f.ok){f.status===401&&(Ck(),window.dispatchEvent(new CustomEvent("auth:logout")));const m=await f.text();let h,y;try{const g=JSON.parse(m);h=g.error??m,Array.isArray(g.details)&&(y=g.details.filter(b=>typeof b=="object"&&b!==null&&Array.isArray(b.path)))}catch{h=m}throw new Zu(f.status,h,y)}if(f.status!==204)return await f.json()}const Ne={get:e=>bd(e),post:(e,t)=>bd(e,{method:"POST",body:t}),patch:(e,t)=>bd(e,{method:"PATCH",body:t}),delete:e=>bd(e,{method:"DELETE"})},cy="onboarding:joinPath",WA="onboarding:draft";function Ek(e){typeof window>"u"||window.sessionStorage.setItem(cy,e)}function eR(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(cy);return e==="solo"||e==="invite"?e:null}function tR(){typeof window>"u"||window.sessionStorage.removeItem(cy)}function nR(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function dy(e){return`${WA}:${e}`}function rR(e){if(!e||typeof e!="object"||!("displayName"in e)||typeof e.displayName!="string")return null;const t="selectedRuntime"in e?e.selectedRuntime:null;if(t!==null&&typeof t!="string")return null;const n="connectToken"in e?e.connectToken:null;if(n!==null&&typeof n!="string")return null;const a="connectTokenExpiresAt"in e?e.connectTokenExpiresAt:null;return a!==null&&typeof a!="number"?null:{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a}}function aR(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(dy(e));if(!t)return null;try{return rR(JSON.parse(t))}catch{return null}}function iR(e,t){typeof window>"u"||window.sessionStorage.setItem(dy(e),JSON.stringify(t))}function lR(e){typeof window>"u"||window.sessionStorage.removeItem(dy(e))}const Nk=x.createContext(null),gg="first-tree-hub:selectedOrganizationId";function sR(){try{return localStorage.getItem(gg)}catch{return null}}function ip(e){try{e===null?localStorage.removeItem(gg):localStorage.setItem(gg,e)}catch{}}function oR({children:e}){const t=sn(),[n,a]=x.useState(()=>!!uy()),[l,o]=x.useState(null),[c,f]=x.useState([]),[m,h]=x.useState(()=>{const U=sR();return iu(U),U}),[y,g]=x.useState(null),[b,w]=x.useState(null),k=x.useCallback(()=>{Ck(),ip(null),iu(null),t.clear(),a(!1),o(null),f([]),h(null),g(null),w(null)},[t]),j=x.useCallback(async()=>{var U;try{const D=await Ne.get("/me");o(D.user??null),g(D.member);const O=D.memberships??[];f(O);const P=((U=D.wizard)==null?void 0:U.step)??null;w(P),P==="completed"&&tR(),h(L=>{var X;const V=L&&O.some(ee=>ee.organizationId===L)?L:null;if(V)return iu(V),V;const F=D.member.organizationId??((X=O[0])==null?void 0:X.organizationId)??null;return ip(F),iu(F),F})}catch{}},[]),C=x.useCallback(async(U,D)=>{const O=await YA(U,D);pg({accessToken:O.accessToken,refreshToken:O.refreshToken}),a(!0),await j()},[j]),E=x.useCallback(async U=>{pg(U),a(!0),await j()},[j]),A=x.useCallback(async U=>{await Ne.post("/auth/switch-org",{organizationId:U}),ip(U),iu(U),t.clear(),h(U),await j()},[j,t]);x.useEffect(()=>{n&&!l&&j()},[n,l,j]),x.useEffect(()=>{const U=()=>k();return window.addEventListener("auth:logout",U),()=>window.removeEventListener("auth:logout",U)},[k]);const z=x.useMemo(()=>{if(c.length>0){const U=c.find(D=>D.organizationId===m);return U||(c[0]??null)}if(y){const U=y.role==="admin"?"admin":"member";return{id:y.id,organizationId:y.organizationId,organizationName:"",role:U,agentId:y.agentId}}return null},[c,m,y]);return u.jsx(Nk.Provider,{value:{isAuthenticated:n,user:l,memberships:c,currentMembership:z,organizationId:(z==null?void 0:z.organizationId)??null,memberId:(z==null?void 0:z.id)??null,role:(z==null?void 0:z.role)??null,agentId:(z==null?void 0:z.agentId)??null,wizardStep:b,login:C,adoptTokens:E,selectOrganization:A,refreshMe:j,logout:k},children:e})}function $t(){const e=x.useContext(Nk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const uR="modulepreload",cR=function(e){return"/"+e},E1={},dR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};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=cR(h),h in E1)return;E1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":uR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,k)=>{b.addEventListener("load",w),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)})},fR=x.lazy(()=>dR(()=>import("./index-BQda2sqe.js"),[]).then(e=>({default:e.LandingPage}))),hR=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function mR(){const{isAuthenticated:e}=$t(),t=Qn();return e?u.jsx($s,{}):t.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx(hR,{}),children:u.jsx(fR,{})}):u.jsx(lr,{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 _k=(...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 pR=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 gR=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 N1=e=>{const t=gR(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 yR={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 vR=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 bR=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,...yR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:_k("lucide",l),...!o&&!vR(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>x.createElement(h,y)),...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 st=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(bR,{ref:o,iconNode:t,className:_k(`lucide-${pR(N1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=N1(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 xR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],fy=st("arrow-left",xR);/**
|
|
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 wR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],SR=st("arrow-right",wR);/**
|
|
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 kR=[["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"}]],jR=st("bell",kR);/**
|
|
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 CR=[["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"}]],ER=st("bot",CR);/**
|
|
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 NR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Er=st("check",NR);/**
|
|
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 _R=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Tk=st("chevron-down",_R);/**
|
|
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 TR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],AR=st("chevron-right",TR);/**
|
|
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 RR=[["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"}]],Ak=st("copy",RR);/**
|
|
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 zR=[["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"}]],OR=st("eye-off",zR);/**
|
|
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 DR=[["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"}]],MR=st("eye",DR);/**
|
|
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 IR=[["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"}]],Rk=st("github",IR);/**
|
|
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 LR=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],UR=st("key-round",LR);/**
|
|
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 PR=[["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"}]],BR=st("layout-dashboard",PR);/**
|
|
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 $R=[["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"}]],yg=st("link-2",$R);/**
|
|
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 FR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qR=st("loader-circle",FR);/**
|
|
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 HR=[["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"}]],zk=st("lock",HR);/**
|
|
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 ZR=[["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"}]],VR=st("log-out",ZR);/**
|
|
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 QR=[["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"}]],hy=st("message-square",QR);/**
|
|
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 KR=[["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"}]],GR=st("moon",KR);/**
|
|
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 YR=[["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"}]],XR=st("paperclip",YR);/**
|
|
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 JR=[["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"}]],WR=st("pause",JR);/**
|
|
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 ez=[["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"}]],Vu=st("pencil",ez);/**
|
|
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 tz=[["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"}]],Ok=st("play",tz);/**
|
|
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 nz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Na=st("plus",nz);/**
|
|
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 rz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],my=st("search",rz);/**
|
|
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 az=[["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"}]],iz=st("send",az);/**
|
|
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 lz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],sz=st("square",lz);/**
|
|
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 oz=[["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"}]],uz=st("sun",oz);/**
|
|
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 cz=[["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"}]],Fs=st("trash-2",cz);/**
|
|
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 dz=[["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"}]],py=st("triangle-alert",dz);/**
|
|
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 fz=[["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"}]],hz=st("undo-2",fz);/**
|
|
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 mz=[["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"}]],pz=st("unplug",mz);/**
|
|
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 gz=[["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"}]],Dk=st("user-plus",gz);/**
|
|
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 yz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kd=st("x",yz);/**
|
|
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 vz=[["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"}]],bz=st("zap",vz);function Mk(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=Mk(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Ik(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Mk(e))&&(a&&(a+=" "),a+=t);return a}const xz=(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},wz=(e,t)=>({classGroupId:e,validator:t}),Lk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Gd="-",_1=[],Sz="arbitrary..",kz=e=>{const t=Cz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return jz(c);const f=c.split(Gd),m=f[0]===""&&f.length>1?1:0;return Uk(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?xz(h,m):m:h||_1}return n[c]||_1}}},Uk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Uk(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Gd):e.slice(t).join(Gd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},jz=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?Sz+a:void 0})(),Cz=e=>{const{theme:t,classGroups:n}=e;return Ez(n,t)},Ez=(e,t)=>{const n=Lk();for(const a in e){const l=e[a];gy(l,n,a,t)}return n},gy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Nz(c,t,n,a)}},Nz=(e,t,n,a)=>{if(typeof e=="string"){_z(e,t,n);return}if(typeof e=="function"){Tz(e,t,n,a);return}Az(e,t,n,a)},_z=(e,t,n)=>{const a=e===""?t:Pk(t,e);a.classGroupId=n},Tz=(e,t,n,a)=>{if(Rz(e)){gy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(wz(n,e))},Az=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];gy(m,Pk(t,f),n,a)}},Pk=(e,t)=>{let n=e;const a=t.split(Gd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=Lk(),n.nextPart.set(c,f)),n=f}return n},Rz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zz=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)}}},vg="!",T1=":",Oz=[],A1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Dz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const C=l[j];if(c===0&&f===0){if(C===T1){o.push(l.slice(m,j)),m=j+1;continue}if(C==="/"){h=j;continue}}C==="["?c++:C==="]"?c--:C==="("?f++:C===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,w=!1;g.endsWith(vg)?(b=g.slice(0,-1),w=!0):g.startsWith(vg)&&(b=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return A1(o,w,b,k)};if(t){const l=t+T1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):A1(Oz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Mz=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}},Iz=e=>({cache:zz(e.cacheSize),parseClassName:Dz(e),sortModifiers:Mz(e),...kz(e)}),Lz=/\s+/,Uz=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(Lz);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let C=!!j,E=a(C?k.substring(0,j):k);if(!E){if(!C){m=y+(m.length>0?" "+m:m);continue}if(E=a(k),!E){m=y+(m.length>0?" "+m:m);continue}C=!1}const A=b.length===0?"":b.length===1?b[0]:o(b).join(":"),z=w?A+vg:A,U=z+E;if(c.indexOf(U)>-1)continue;c.push(U);const D=l(E,C);for(let O=0;O<D.length;++O){const P=D[O];c.push(z+P)}m=y+(m.length>0?" "+m:m)}return m},Pz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Bk(n))&&(l&&(l+=" "),l+=a);return l},Bk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Bk(e[a]))&&(n&&(n+=" "),n+=t);return n},Bz=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=Iz(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const y=Uz(m,n);return l(m,y),y};return o=c,(...m)=>o(Pz(...m))},$z=[],rn=e=>{const t=n=>n[e]||$z;return t.isThemeGetter=!0,t},$k=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hz=/\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$/,Zz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>Fz.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),lp=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),va=e=>qz.test(e),qk=()=>!0,Kz=e=>Hz.test(e)&&!Zz.test(e),yy=()=>!1,Gz=e=>Vz.test(e),Yz=e=>Qz.test(e),Xz=e=>!Ce(e)&&!Ee(e),Jz=e=>zi(e,Vk,yy),Ce=e=>$k.test(e),rl=e=>zi(e,Qk,Kz),R1=e=>zi(e,lO,Ke),Wz=e=>zi(e,Gk,qk),eO=e=>zi(e,Kk,yy),z1=e=>zi(e,Hk,yy),tO=e=>zi(e,Zk,Yz),xd=e=>zi(e,Yk,Gz),Ee=e=>Fk.test(e),su=e=>Sl(e,Qk),nO=e=>Sl(e,Kk),O1=e=>Sl(e,Hk),rO=e=>Sl(e,Vk),aO=e=>Sl(e,Zk),wd=e=>Sl(e,Yk,!0),iO=e=>Sl(e,Gk,!0),zi=(e,t,n)=>{const a=$k.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Sl=(e,t,n=!1)=>{const a=Fk.exec(e);return a?a[1]?t(a[1]):n:!1},Hk=e=>e==="position"||e==="percentage",Zk=e=>e==="image"||e==="url",Vk=e=>e==="length"||e==="size"||e==="bg-size",Qk=e=>e==="length",lO=e=>e==="number",Kk=e=>e==="family-name",Gk=e=>e==="number"||e==="weight",Yk=e=>e==="shadow",sO=()=>{const e=rn("color"),t=rn("font"),n=rn("text"),a=rn("font-weight"),l=rn("tracking"),o=rn("leading"),c=rn("breakpoint"),f=rn("container"),m=rn("spacing"),h=rn("radius"),y=rn("shadow"),g=rn("inset-shadow"),b=rn("text-shadow"),w=rn("drop-shadow"),k=rn("blur"),j=rn("perspective"),C=rn("aspect"),E=rn("ease"),A=rn("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...U(),Ee,Ce],O=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],L=()=>[Ee,Ce,m],V=()=>[oi,"full","auto",...L()],F=()=>[ui,"none","subgrid",Ee,Ce],X=()=>["auto",{span:["full",ui,Ee,Ce]},ui,Ee,Ce],ee=()=>[ui,"auto",Ee,Ce],we=()=>["auto","min","max","fr",Ee,Ce],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...L()],te=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],ye=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...L()],Ae=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],_=()=>[e,Ee,Ce],I=()=>[...U(),O1,z1,{position:[Ee,Ce]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",rO,Jz,{size:[Ee,Ce]}],q=()=>[lp,su,rl],Y=()=>["","none","full",h,Ee,Ce],ue=()=>["",Ke,su,rl],ve=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Ke,lp,O1,z1],Ge=()=>["","none",k,Ee,Ce],Ie=()=>["none",Ke,Ee,Ce],ne=()=>["none",Ke,Ee,Ce],je=()=>[Ke,Ee,Ce],Le=()=>[oi,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[va],breakpoint:[va],color:[qk],container:[va],"drop-shadow":[va],ease:["in","out","in-out"],font:[Xz],"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",Ke],text:[va],"text-shadow":[va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,Ce,Ee,C]}],container:["container"],columns:[{columns:[Ke,Ce,Ee,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",Ee,Ce]}],basis:[{basis:[oi,"full","auto",f,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,oi,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Ee,Ce]}],shrink:[{shrink:["",Ke,Ee,Ce]}],order:[{order:[ui,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],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":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...ye()]}],"min-inline-size":[{"min-inline":["auto",...ye()]}],"max-inline-size":[{"max-inline":["none",...ye()]}],"block-size":[{block:["auto",...Ae()]}],"min-block-size":[{"min-block":["auto",...Ae()]}],"max-block-size":[{"max-block":["none",...Ae()]}],w:[{w:[f,"screen",...te()]}],"min-w":[{"min-w":[f,"screen","none",...te()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,su,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,iO,Wz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lp,Ce]}],"font-family":[{font:[nO,eO,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":[Ke,"none",Ee,R1]}],leading:[{leading:[o,...L()]}],"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:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ee,rl]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Ke,"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:L()}],"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:I()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,Ee,Ce],radial:["",Ee,Ce],conic:[ui,Ee,Ce]},aO,tO]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"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:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ee,Ce]}],"outline-w":[{outline:["",Ke,su,rl]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",y,wd,xd]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",g,wd,xd]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Ke,rl]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",b,wd,xd]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Ke,Ee,Ce]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"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":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":U()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Ge()}],brightness:[{brightness:[Ke,Ee,Ce]}],contrast:[{contrast:[Ke,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",w,wd,xd]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Ke,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Ee,Ce]}],invert:[{invert:["",Ke,Ee,Ce]}],saturate:[{saturate:[Ke,Ee,Ce]}],sepia:[{sepia:["",Ke,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Ge()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"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:[Ke,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",E,Ee,Ce]}],delay:[{delay:[Ke,Ee,Ce]}],animate:[{animate:["none",A,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ee,Ce]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",..._()]}],"stroke-w":[{stroke:[Ke,su,rl,R1]}],stroke:[{stroke:["none",..._()]}],"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"]}},oO=Bz(sO);function Te(...e){return oO(Ik(e))}function gl(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 uO(e){return Ne.delete(`/clients/${encodeURIComponent(e)}`)}function Qu(){return Ne.get("/admin/agents/activity")}function _a(){return Ne.get("/clients")}function vy(e){return Ne.get(`/clients/${e}`)}function cO(e){return Ne.post(`/clients/${e}/disconnect`)}function dO(){return Ne.post("/connect-tokens")}const Xk=(e,t)=>["session",e,t],Yd=e=>["agent-sessions",e];function fO(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 hO(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 mO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Ws(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 Ne.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function pO(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 Ne.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function gO(e,t){return Ne.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function yO(e,t){return Ne.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var D1=1,vO=.9,bO=.8,xO=.17,sp=.1,op=.999,wO=.9999,SO=.99,kO=/[\\\/_+.#"@\[\(\{&]/,jO=/[\\\/_+.#"@\[\(\{&]/g,CO=/[\s-]/,Jk=/[\s-]/g;function bg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?D1:SO;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,w,k;h>=0;)g=bg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=D1:kO.test(e.charAt(h-1))?(g*=bO,w=e.slice(l,h-1).match(jO),w&&l>0&&(g*=Math.pow(op,w.length))):CO.test(e.charAt(h-1))?(g*=vO,k=e.slice(l,h-1).match(Jk),k&&l>0&&(g*=Math.pow(op,k.length))):(g*=xO,l>0&&(g*=Math.pow(op,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=wO)),(g<sp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=bg(e,t,n,a,h+1,o+2,c),b*sp>g&&(g=b*sp)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function M1(e){return e.toLowerCase().replace(Jk," ")}function EO(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,bg(e,t,M1(e),M1(t),0,0,{})}function Ei(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 I1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _i(...e){return t=>{let n=!1;const a=e.map(l=>{const o=I1(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():I1(e[l],null)}}}}function kl(...e){return x.useCallback(_i(...e),e)}function NO(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 _O(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var E;const{scope:b,children:w,...k}=g,j=((E=b==null?void 0:b[e])==null?void 0:E[m])||f,C=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:C,children:w})};h.displayName=o+"Provider";function y(g,b){var j;const w=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(w);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}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,TO(l,...t)]}function TO(...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 g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Eu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},AO=Kg[" useId ".trim().toString()]||(()=>{}),RO=0;function ja(e){const[t,n]=x.useState(AO());return Eu(()=>{n(a=>a??String(RO++))},[e]),t?`radix-${t}`:""}var zO=Kg[" useInsertionEffect ".trim().toString()]||Eu;function OO({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=DO({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} is changing from ${g?"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.`),y.current=f},[f,a])}const h=x.useCallback(y=>{var g;if(f){const b=MO(y)?y(e):y;b!==e&&((g=c.current)==null||g.call(c,b))}else o(y)},[f,e,o,c]);return[m,h]}function DO({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return zO(()=>{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 MO(e){return typeof e=="function"}var by=FS();const IO=df(by);function Wk(e){const t=LO(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(PO);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function LO(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=$O(l),f=BO(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(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 UO=Symbol("radix.slottable");function PO(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UO}function BO(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 $O(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 FO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=FO.reduce((e,t)=>{const n=Wk(`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 qO(e,t){e&&by.flushSync(()=>e.dispatchEvent(t))}function Nu(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 HO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(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 ZO="DismissableLayer",xg="dismissableLayer.update",VO="dismissableLayer.pointerDownOutside",QO="dismissableLayer.focusOutside",L1,ej=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(ej),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),k=kl(t,P=>g(P)),j=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(C),A=y?j.indexOf(y):-1,z=h.layersWithOutsidePointerEventsDisabled.size>0,U=A>=E,D=YO(P=>{const L=P.target,V=[...h.branches].some(F=>F.contains(L));!U||V||(l==null||l(P),c==null||c(P),P.defaultPrevented||f==null||f())},b),O=XO(P=>{const L=P.target;[...h.branches].some(F=>F.contains(L))||(o==null||o(P),c==null||c(P),P.defaultPrevented||f==null||f())},b);return HO(P=>{A===h.layers.size-1&&(a==null||a(P),!P.defaultPrevented&&f&&(P.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(L1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),U1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=L1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),U1())},[y,h]),x.useEffect(()=>{const P=()=>w({});return document.addEventListener(xg,P),()=>document.removeEventListener(xg,P)},[]),u.jsx(Ta.div,{...m,ref:k,style:{pointerEvents:z?U?"auto":"none":void 0,...e.style},onFocusCapture:Ei(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ei(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ei(e.onPointerDownCapture,D.onPointerDownCapture)})});tj.displayName=ZO;var KO="DismissableLayerBranch",GO=x.forwardRef((e,t)=>{const n=x.useContext(ej),a=x.useRef(null),l=kl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ta.div,{...e,ref:l})});GO.displayName=KO;function YO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){nj(VO,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 XO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&nj(QO,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 U1(){const e=new CustomEvent(xg);document.dispatchEvent(e)}function nj(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?qO(l,o):l.dispatchEvent(o)}var up="focusScope.autoFocusOnMount",cp="focusScope.autoFocusOnUnmount",P1={bubbles:!1,cancelable:!0},JO="FocusScope",rj=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=Nu(l),y=Nu(o),g=x.useRef(null),b=kl(t,j=>m(j)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(z){if(w.paused||!f)return;const U=z.target;f.contains(U)?g.current=U:fi(g.current,{select:!0})},C=function(z){if(w.paused||!f)return;const U=z.relatedTarget;U!==null&&(f.contains(U)||fi(g.current,{select:!0}))},E=function(z){if(document.activeElement===document.body)for(const D of z)D.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",C);const A=new MutationObserver(E);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",C),A.disconnect()}}},[a,f,w.paused]),x.useEffect(()=>{if(f){$1.add(w);const j=document.activeElement;if(!f.contains(j)){const E=new CustomEvent(up,P1);f.addEventListener(up,h),f.dispatchEvent(E),E.defaultPrevented||(WO(a3(aj(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(up,h),setTimeout(()=>{const E=new CustomEvent(cp,P1);f.addEventListener(cp,y),f.dispatchEvent(E),E.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(cp,y),$1.remove(w)},0)}}},[f,h,y,w]);const k=x.useCallback(j=>{if(!n&&!a||w.paused)return;const C=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(C&&E){const A=j.currentTarget,[z,U]=e3(A);z&&U?!j.shiftKey&&E===U?(j.preventDefault(),n&&fi(z,{select:!0})):j.shiftKey&&E===z&&(j.preventDefault(),n&&fi(U,{select:!0})):E===A&&j.preventDefault()}},[n,a,w.paused]);return u.jsx(Ta.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});rj.displayName=JO;function WO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function e3(e){const t=aj(e),n=B1(t,e),a=B1(t.reverse(),e);return[n,a]}function aj(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 B1(e,t){for(const n of e)if(!t3(n,{upTo:t}))return n}function t3(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 n3(e){return e instanceof HTMLInputElement&&"select"in e}function fi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&n3(e)&&t&&e.select()}}var $1=r3();function r3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=F1(e,t),e.unshift(t)},remove(t){var n;e=F1(e,t),(n=e[0])==null||n.resume()}}}function F1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function a3(e){return e.filter(t=>t.tagName!=="A")}var i3="Portal",ij=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Eu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?IO.createPortal(u.jsx(Ta.div,{...a,ref:t}),c):null});ij.displayName=i3;function l3(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var yf=e=>{const{present:t,children:n}=e,a=s3(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=kl(a.ref,o3(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};yf.displayName="Presence";function s3(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=l3(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Sd(a.current);o.current=f==="mounted"?h:"none"},[f]),Eu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,w=Sd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Eu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=Sd(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&j&&(m("ANIMATION_END"),!l.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=w=>{w.target===t&&(o.current=Sd(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function Sd(e){return(e==null?void 0:e.animationName)||"none"}function o3(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 dp=0;function u3(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??q1()),document.body.insertAdjacentElement("beforeend",e[1]??q1()),dp++,()=>{dp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),dp--}},[])}function q1(){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 Qr=function(){return Qr=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},Qr.apply(this,arguments)};function lj(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 c3(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 Bd="right-scroll-bar-position",$d="width-before-scroll-bar",d3="with-scroll-bars-hidden",f3="--removed-body-scroll-bar-size";function fp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function h3(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 m3=typeof window<"u"?x.useLayoutEffect:x.useEffect,H1=new WeakMap;function p3(e,t){var n=h3(null,function(a){return e.forEach(function(l){return fp(l,a)})});return m3(function(){var a=H1.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||fp(f,null)}),o.forEach(function(f){l.has(f)||fp(f,c)})}H1.set(n,e)},[e]),n}function g3(e){return e}function y3(e,t){t===void 0&&(t=g3);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 y=c;c=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return l}function v3(e){e===void 0&&(e={});var t=y3(null);return t.options=Qr({async:!0,ssr:!1},e),t}var sj=function(e){var t=e.sideCar,n=lj(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,Qr({},n))};sj.isSideCarExport=!0;function b3(e,t){return e.useMedium(t),sj}var oj=v3(),hp=function(){},vf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:hp,onWheelCapture:hp,onTouchMoveCapture:hp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,C=e.allowPinchZoom,E=e.as,A=E===void 0?"div":E,z=e.gapMode,U=lj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,O=p3([n,t]),P=Qr(Qr({},U),l);return x.createElement(x.Fragment,null,y&&x.createElement(D,{sideCar:oj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:z}),c?x.cloneElement(x.Children.only(f),Qr(Qr({},P),{ref:O})):x.createElement(A,Qr({},P,{className:m,ref:O}),f))});vf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vf.classNames={fullWidth:$d,zeroRight:Bd};var x3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function w3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=x3();return t&&e.setAttribute("nonce",t),e}function S3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function k3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var j3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=w3())&&(S3(t,n),k3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},C3=function(){var e=j3();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uj=function(){var e=C3(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},E3={left:0,top:0,right:0,gap:0},mp=function(e){return parseInt(e||"",10)||0},N3=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[mp(n),mp(a),mp(l)]},_3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return E3;var t=N3(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])}},T3=uj(),ks="data-scroll-locked",A3=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(d3,` {
|
|
277
|
-
overflow: hidden `).concat(a,`;
|
|
278
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
279
|
-
}
|
|
280
|
-
body[`).concat(ks,`] {
|
|
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(Bd,` {
|
|
294
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.`).concat($d,` {
|
|
298
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.`).concat(Bd," .").concat(Bd,` {
|
|
302
|
-
right: 0 `).concat(a,`;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.`).concat($d," .").concat($d,` {
|
|
306
|
-
margin-right: 0 `).concat(a,`;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
body[`).concat(ks,`] {
|
|
310
|
-
`).concat(f3,": ").concat(f,`px;
|
|
311
|
-
}
|
|
312
|
-
`)},Z1=function(){var e=parseInt(document.body.getAttribute(ks)||"0",10);return isFinite(e)?e:0},R3=function(){x.useEffect(function(){return document.body.setAttribute(ks,(Z1()+1).toString()),function(){var e=Z1()-1;e<=0?document.body.removeAttribute(ks):document.body.setAttribute(ks,e.toString())}},[])},z3=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;R3();var o=x.useMemo(function(){return _3(l)},[l]);return x.createElement(T3,{styles:A3(o,!t,l,n?"":"!important")})},wg=!1;if(typeof window<"u")try{var kd=Object.defineProperty({},"passive",{get:function(){return wg=!0,!0}});window.addEventListener("test",kd,kd),window.removeEventListener("test",kd,kd)}catch{wg=!1}var ds=wg?{passive:!1}:!1,O3=function(e){return e.tagName==="TEXTAREA"},cj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!O3(e)&&n[t]==="visible")},D3=function(e){return cj(e,"overflowY")},M3=function(e){return cj(e,"overflowX")},V1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=dj(e,a);if(l){var o=fj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},I3=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},L3=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},dj=function(e,t){return e==="v"?D3(t):M3(t)},fj=function(e,t){return e==="v"?I3(t):L3(t)},U3=function(e,t){return e==="h"&&t==="rtl"?-1:1},P3=function(e,t,n,a,l){var o=U3(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,y=c>0,g=0,b=0;do{if(!f)break;var w=fj(e,f),k=w[0],j=w[1],C=w[2],E=j-C-o*k;(k||E)&&dj(e,f)&&(g+=E,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(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(h=!0),h},jd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q1=function(e){return[e.deltaX,e.deltaY]},K1=function(e){return e&&"current"in e?e.current:e},B3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$3=function(e){return`
|
|
313
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
-
`)},F3=0,fs=[];function q3(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(F3++)[0],o=x.useState(uj)[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=c3([e.lockRef.current],(e.shards||[]).map(K1),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var E=jd(j),A=n.current,z="deltaX"in j?j.deltaX:A[0]-E[0],U="deltaY"in j?j.deltaY:A[1]-E[1],D,O=j.target,P=Math.abs(z)>Math.abs(U)?"h":"v";if("touches"in j&&P==="h"&&O.type==="range")return!1;var L=window.getSelection(),V=L&&L.anchorNode,F=V?V===O||V.contains(O):!1;if(F)return!1;var X=V1(P,O);if(!X)return!0;if(X?D=P:(D=P==="v"?"h":"v",X=V1(P,O)),!X)return!1;if(!a.current&&"changedTouches"in j&&(z||U)&&(a.current=D),!D)return!0;var ee=a.current||D;return P3(ee,C,j,ee==="h"?z:U)},[]),m=x.useCallback(function(j){var C=j;if(!(!fs.length||fs[fs.length-1]!==o)){var E="deltaY"in C?Q1(C):jd(C),A=t.current.filter(function(D){return D.name===C.type&&(D.target===C.target||C.target===D.shadowParent)&&B3(D.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var z=(c.current.shards||[]).map(K1).filter(Boolean).filter(function(D){return D.contains(C.target)}),U=z.length>0?f(C,z[0]):!c.current.noIsolation;U&&C.cancelable&&C.preventDefault()}}},[]),h=x.useCallback(function(j,C,E,A){var z={name:j,delta:C,target:E,should:A,shadowParent:H3(E)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(U){return U!==z})},1)},[]),y=x.useCallback(function(j){n.current=jd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,Q1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,jd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return fs.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ds),document.addEventListener("touchmove",m,ds),document.addEventListener("touchstart",y,ds),function(){fs=fs.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ds),document.removeEventListener("touchmove",m,ds),document.removeEventListener("touchstart",y,ds)}},[]);var w=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:$3(l)}):null,w?x.createElement(z3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function H3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Z3=b3(oj,q3);var hj=x.forwardRef(function(e,t){return x.createElement(vf,Qr({},e,{ref:t,sideCar:Z3}))});hj.classNames=vf.classNames;var V3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hs=new WeakMap,Cd=new WeakMap,Ed={},pp=0,mj=function(e){return e&&(e.host||mj(e.parentNode))},Q3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=mj(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})},K3=function(e,t,n,a){var l=Q3(t,Array.isArray(e)?e:[e]);Ed[n]||(Ed[n]=new WeakMap);var o=Ed[n],c=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var w=b.getAttribute(a),k=w!==null&&w!=="false",j=(hs.get(b)||0)+1,C=(o.get(b)||0)+1;hs.set(b,j),o.set(b,C),c.push(b),j===1&&k&&Cd.set(b,!0),C===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return y(t),f.clear(),pp++,function(){c.forEach(function(g){var b=hs.get(g)-1,w=o.get(g)-1;hs.set(g,b),o.set(g,w),b||(Cd.has(g)||g.removeAttribute(a),Cd.delete(g)),w||g.removeAttribute(n)}),pp--,pp||(hs=new WeakMap,hs=new WeakMap,Cd=new WeakMap,Ed={})}},G3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=V3(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),K3(a,l,n,"aria-hidden")):function(){return null}},bf="Dialog",[pj]=_O(bf),[Y3,Lr]=pj(bf),gj=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,y]=OO({prop:a,defaultProp:l??!1,onChange:o,caller:bf});return u.jsx(Y3,{scope:t,triggerRef:f,contentRef:m,contentId:ja(),titleId:ja(),descriptionId:ja(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};gj.displayName=bf;var yj="DialogTrigger",X3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(yj,n),o=kl(t,l.triggerRef);return u.jsx(Ta.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Sy(l.open),...a,ref:o,onClick:Ei(e.onClick,l.onOpenToggle)})});X3.displayName=yj;var xy="DialogPortal",[J3,vj]=pj(xy,{forceMount:void 0}),bj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Lr(xy,t);return u.jsx(J3,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(yf,{present:n||o.open,children:u.jsx(ij,{asChild:!0,container:l,children:c})}))})};bj.displayName=xy;var Xd="DialogOverlay",xj=x.forwardRef((e,t)=>{const n=vj(Xd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(Xd,e.__scopeDialog);return o.modal?u.jsx(yf,{present:a||o.open,children:u.jsx(eD,{...l,ref:t})}):null});xj.displayName=Xd;var W3=Wk("DialogOverlay.RemoveScroll"),eD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Xd,n);return u.jsx(hj,{as:W3,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(Ta.div,{"data-state":Sy(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),yl="DialogContent",wj=x.forwardRef((e,t)=>{const n=vj(yl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Lr(yl,e.__scopeDialog);return u.jsx(yf,{present:a||o.open,children:o.modal?u.jsx(tD,{...l,ref:t}):u.jsx(nD,{...l,ref:t})})});wj.displayName=yl;var tD=x.forwardRef((e,t)=>{const n=Lr(yl,e.__scopeDialog),a=x.useRef(null),l=kl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return G3(o)},[]),u.jsx(Sj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ei(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ei(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ei(e.onFocusOutside,o=>o.preventDefault())})}),nD=x.forwardRef((e,t)=>{const n=Lr(yl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(Sj,{...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()}})}),Sj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Lr(yl,n),m=x.useRef(null),h=kl(t,m);return u3(),u.jsxs(u.Fragment,{children:[u.jsx(rj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(tj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Sy(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(rD,{titleId:f.titleId}),u.jsx(iD,{contentRef:m,descriptionId:f.descriptionId})]})]})}),wy="DialogTitle",kj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(wy,n);return u.jsx(Ta.h2,{id:l.titleId,...a,ref:t})});kj.displayName=wy;var jj="DialogDescription",Cj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(jj,n);return u.jsx(Ta.p,{id:l.descriptionId,...a,ref:t})});Cj.displayName=jj;var Ej="DialogClose",Nj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Lr(Ej,n);return u.jsx(Ta.button,{type:"button",...a,ref:t,onClick:Ei(e.onClick,()=>l.onOpenChange(!1))})});Nj.displayName=Ej;function Sy(e){return e?"open":"closed"}var _j="DialogTitleWarning",[aZ,Tj]=NO(_j,{contentName:yl,titleName:wy,docsSlug:"dialog"}),rD=({titleId:e})=>{const t=Tj(_j),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},aD="DialogDescriptionWarning",iD=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tj(aD).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},Aj=gj,Rj=bj,zj=xj,Oj=wj,lD=kj,sD=Cj,oD=Nj,uD=Symbol.for("react.lazy"),Jd=Kg[" use ".trim().toString()];function cD(e){return typeof e=="object"&&e!==null&&"then"in e}function Dj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===uD&&"_payload"in e&&cD(e._payload)}function Mj(e){const t=fD(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;Dj(o)&&typeof Jd=="function"&&(o=Jd(o._payload));const f=x.Children.toArray(o),m=f.find(mD);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var dD=Mj("Slot");function fD(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Dj(l)&&typeof Jd=="function"&&(l=Jd(l._payload)),x.isValidElement(l)){const c=gD(l),f=pD(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(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 hD=Symbol("radix.slottable");function mD(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hD}function pD(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 gD(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 yD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Aa=yD.reduce((e,t)=>{const n=Mj(`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}},{}),ou='[cmdk-group=""]',gp='[cmdk-group-items=""]',vD='[cmdk-group-heading=""]',Ij='[cmdk-item=""]',G1=`${Ij}:not([aria-disabled="true"])`,Sg="cmdk-item-select",gs="data-value",bD=(e,t,n)=>EO(e,t,n),Lj=x.createContext(void 0),Ku=()=>x.useContext(Lj),Uj=x.createContext(void 0),ky=()=>x.useContext(Uj),Pj=x.createContext(void 0),Bj=x.forwardRef((e,t)=>{let n=ys(()=>{var B,T;return{search:"",value:(T=(B=e.value)!=null?B:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ys(()=>new Set),l=ys(()=>new Map),o=ys(()=>new Map),c=ys(()=>new Set),f=$j(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:C=!0,...E}=e,A=ja(),z=ja(),U=ja(),D=x.useRef(null),O=AD();vl(()=>{if(y!==void 0){let B=y.trim();n.current.value=B,P.emit()}},[y]),vl(()=>{O(6,we)},[]);let P=x.useMemo(()=>({subscribe:B=>(c.current.add(B),()=>c.current.delete(B)),snapshot:()=>n.current,setState:(B,T,q)=>{var Y,ue,ve,be;if(!Object.is(n.current[B],T)){if(n.current[B]=T,B==="search")ee(),F(),O(1,X);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(U);fe?fe.focus():(Y=document.getElementById(A))==null||Y.focus()}if(O(7,()=>{var fe;n.current.selectedItemId=(fe=se())==null?void 0:fe.id,P.emit()}),q||O(5,we),((ue=f.current)==null?void 0:ue.value)!==void 0){let fe=T??"";(be=(ve=f.current).onValueChange)==null||be.call(ve,fe);return}}P.emit()}},emit:()=>{c.current.forEach(B=>B())}}),[]),L=x.useMemo(()=>({value:(B,T,q)=>{var Y;T!==((Y=o.current.get(B))==null?void 0:Y.value)&&(o.current.set(B,{value:T,keywords:q}),n.current.filtered.items.set(B,V(T,q)),O(2,()=>{F(),P.emit()}))},item:(B,T)=>(a.current.add(B),T&&(l.current.has(T)?l.current.get(T).add(B):l.current.set(T,new Set([B]))),O(3,()=>{ee(),F(),n.current.value||X(),P.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let q=se();O(4,()=>{ee(),(q==null?void 0:q.getAttribute("id"))===B&&X(),P.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:U,labelId:z,listInnerRef:D}),[]);function V(B,T){var q,Y;let ue=(Y=(q=f.current)==null?void 0:q.filter)!=null?Y:bD;return B?ue(B,n.current.search,T):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(Y=>{let ue=l.current.get(Y),ve=0;ue.forEach(be=>{let fe=B.get(be);ve=Math.max(fe,ve)}),T.push([Y,ve])});let q=D.current;re().sort((Y,ue)=>{var ve,be;let fe=Y.getAttribute("id"),Ge=ue.getAttribute("id");return((ve=B.get(Ge))!=null?ve:0)-((be=B.get(fe))!=null?be:0)}).forEach(Y=>{let ue=Y.closest(gp);ue?ue.appendChild(Y.parentElement===ue?Y:Y.closest(`${gp} > *`)):q.appendChild(Y.parentElement===q?Y:Y.closest(`${gp} > *`))}),T.sort((Y,ue)=>ue[1]-Y[1]).forEach(Y=>{var ue;let ve=(ue=D.current)==null?void 0:ue.querySelector(`${ou}[${gs}="${encodeURIComponent(Y[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function X(){let B=re().find(q=>q.getAttribute("aria-disabled")!=="true"),T=B==null?void 0:B.getAttribute(gs);P.setState("value",T||void 0)}function ee(){var B,T,q,Y;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 ve of a.current){let be=(T=(B=o.current.get(ve))==null?void 0:B.value)!=null?T:"",fe=(Y=(q=o.current.get(ve))==null?void 0:q.keywords)!=null?Y:[],Ge=V(be,fe);n.current.filtered.items.set(ve,Ge),Ge>0&&ue++}for(let[ve,be]of l.current)for(let fe of be)if(n.current.filtered.items.get(fe)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=ue}function we(){var B,T,q;let Y=se();Y&&(((B=Y.parentElement)==null?void 0:B.firstChild)===Y&&((q=(T=Y.closest(ou))==null?void 0:T.querySelector(vD))==null||q.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function se(){var B;return(B=D.current)==null?void 0:B.querySelector(`${Ij}[aria-selected="true"]`)}function re(){var B;return Array.from(((B=D.current)==null?void 0:B.querySelectorAll(G1))||[])}function Z(B){let T=re()[B];T&&P.setState("value",T.getAttribute(gs))}function te(B){var T;let q=se(),Y=re(),ue=Y.findIndex(be=>be===q),ve=Y[ue+B];(T=f.current)!=null&&T.loop&&(ve=ue+B<0?Y[Y.length-1]:ue+B===Y.length?Y[0]:Y[ue+B]),ve&&P.setState("value",ve.getAttribute(gs))}function ye(B){let T=se(),q=T==null?void 0:T.closest(ou),Y;for(;q&&!Y;)q=B>0?_D(q,ou):TD(q,ou),Y=q==null?void 0:q.querySelector(G1);Y?P.setState("value",Y.getAttribute(gs)):te(B)}let Ae=()=>Z(re().length-1),_=B=>{B.preventDefault(),B.metaKey?Ae():B.altKey?ye(1):te(1)},I=B=>{B.preventDefault(),B.metaKey?Z(0):B.altKey?ye(-1):te(-1)};return x.createElement(Aa.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:B=>{var T;(T=E.onKeyDown)==null||T.call(E,B);let q=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||q))switch(B.key){case"n":case"j":{C&&B.ctrlKey&&_(B);break}case"ArrowDown":{_(B);break}case"p":case"k":{C&&B.ctrlKey&&I(B);break}case"ArrowUp":{I(B);break}case"Home":{B.preventDefault(),Z(0);break}case"End":{B.preventDefault(),Ae();break}case"Enter":{B.preventDefault();let Y=se();if(Y){let ue=new Event(Sg);Y.dispatchEvent(ue)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:zD},m),xf(e,B=>x.createElement(Uj.Provider,{value:P},x.createElement(Lj.Provider,{value:L},B))))}),xD=x.forwardRef((e,t)=>{var n,a;let l=ja(),o=x.useRef(null),c=x.useContext(Pj),f=Ku(),m=$j(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;vl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=Fj(l,o,[e.value,e.children,o],e.keywords),g=ky(),b=Ti(O=>O.value&&O.value===y.current),w=Ti(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(Sg,k),()=>O.removeEventListener(Sg,k)},[w,e.onSelect,e.disabled]);function k(){var O,P;j(),(P=(O=m.current).onSelect)==null||P.call(O,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:C,value:E,onSelect:A,forceMount:z,keywords:U,...D}=e;return x.createElement(Aa.div,{ref:_i(o,t),...D,id:l,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!b,"data-disabled":!!C,"data-selected":!!b,onPointerMove:C||f.getDisablePointerSelection()?void 0:j,onClick:C?void 0:k},e.children)}),wD=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(),y=Ku(),g=Ti(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);vl(()=>y.group(c),[]),Fj(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Aa.div,{ref:_i(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),xf(e,w=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(Pj.Provider,{value:b},w))))}),SD=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ti(c=>!c.search);return!n&&!o?null:x.createElement(Aa.div,{ref:_i(l,t),...a,"cmdk-separator":"",role:"separator"})}),kD=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=ky(),c=Ti(h=>h.search),f=Ti(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Aa.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)}})}),jD=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ti(h=>h.selectedItemId),m=Ku();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Aa.div,{ref:_i(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},xf(e,h=>x.createElement("div",{ref:_i(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),CD=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Aj,{open:n,onOpenChange:a},x.createElement(Rj,{container:c},x.createElement(zj,{"cmdk-overlay":"",className:l}),x.createElement(Oj,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(Bj,{ref:t,...f}))))}),ED=x.forwardRef((e,t)=>Ti(n=>n.filtered.count===0)?x.createElement(Aa.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ND=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Aa.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},xf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Kn=Object.assign(Bj,{List:jD,Item:xD,Input:kD,Group:wD,Separator:SD,Dialog:CD,Empty:ED,Loading:ND});function _D(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function TD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $j(e){let t=x.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function ys(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ti(e){let t=ky(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Fj(e,t,n,a=[]){let l=x.useRef(),o=Ku();return vl(()=>{var c;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.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(gs,f),l.current=f}),l}var AD=()=>{let[e,t]=x.useState(),n=ys(()=>new Map);return vl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function RD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function xf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(RD(t),{ref:t.ref},n(t.props.children)):n(t)}var zD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Wt=Aj,OD=Rj,qj=x.forwardRef(({className:e,...t},n)=>u.jsx(zj,{ref:n,className:Te("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}));qj.displayName="DialogOverlay";const Vt=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(OD,{children:[u.jsx(qj,{}),u.jsxs(Oj,{ref:a,className:Te("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(oD,{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(Kd,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vt.displayName="DialogContent";function ln({className:e,...t}){return u.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Nn({className:e,...t}){return u.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const en=x.forwardRef(({className:e,...t},n)=>u.jsx(lD,{ref:n,className:Te("text-subtitle leading-none tracking-tight",e),...t}));en.displayName="DialogTitle";const jy=x.forwardRef(({className:e,...t},n)=>u.jsx(sD,{ref:n,className:Te("text-body text-muted-foreground",e),...t}));jy.displayName="DialogDescription";const Hj=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Hj.displayName=Kn.displayName;function DD({open:e,onOpenChange:t,children:n}){return u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsx(Vt,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(Hj,{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 Zj=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(my,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Kn.Input,{ref:n,className:Te("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})]}));Zj.displayName=Kn.Input.displayName;const Vj=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.List,{ref:n,className:Te("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Vj.displayName=Kn.List.displayName;const Qj=x.forwardRef((e,t)=>u.jsx(Kn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Qj.displayName=Kn.Empty.displayName;const Fd=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.Group,{ref:n,className:Te("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}));Fd.displayName=Kn.Group.displayName;const kg=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));kg.displayName=Kn.Separator.displayName;const qd=x.forwardRef(({className:e,...t},n)=>u.jsx(Kn.Item,{ref:n,className:Te("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}));qd.displayName=Kn.Item.displayName;function Gu(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 Ne.get(`/admin/agents${n?`?${n}`:""}`)}function Kj(){return Ne.get("/me/managed-agents")}function MD(e){return Ne.get(`/admin/agents/${encodeURIComponent(e)}`)}function ID(e){return Ne.post("/admin/agents",e)}function LD(e){return Ne.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function Y1(e,t){return Ne.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function UD(e,t){return Ne.patch(`/admin/agents/${encodeURIComponent(e)}/rebind`,t)}function PD(e){return Ne.delete(`/admin/agents/${encodeURIComponent(e)}`)}function BD(e){return Ne.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function $D(e){return Ne.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function FD(e){return Ne.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function eo(){const{data:e}=Fe({queryKey:["agents","name-map"],queryFn:()=>Gu({limit:100}),staleTime:3e4}),{data:t}=Fe({queryKey:["managed-agents","name-map"],queryFn:Kj,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,a.displayName);if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,a.displayName);return a=>a?n.get(a)??a:"—"},[e,t])}function Gj(){const{data:e}=Fe({queryKey:["agents","name-map"],queryFn:()=>Gu({limit:100}),staleTime:3e4}),{data:t}=Fe({queryKey:["managed-agents","name-map"],queryFn:Kj,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,{name:a.name,displayName:a.displayName});if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,{name:a.name,displayName:a.displayName});return a=>a?n.get(a)??null:null},[e,t])}const qD=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function HD({open:e,onOpenChange:t}){const n=On(),a=eo(),{data:l}=Fe({queryKey:["activity"],queryFn:Qu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Fe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await Ws(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return u.jsxs(DD,{open:e,onOpenChange:t,children:[u.jsx(Zj,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(Vj,{children:[u.jsx(Qj,{children:"No results"}),o.length>0&&u.jsx(Fd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(qd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(ER,{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:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(kg,{}),u.jsx(Fd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(qd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(hy,{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:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),u.jsx(kg,{}),u.jsx(Fd,{heading:"Pages",children:qD.map(h=>u.jsxs(qd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(BR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function ZD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function VD(){var a;const{user:e}=$t(),{data:t}=Fe({queryKey:["clients"],queryFn:_a,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=ZD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const QD=160;function KD(){const e=On(),{rows:t,firstHostname:n}=VD();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return u.jsxs("button",{type:"button",onClick:()=>e("/settings/computers"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[u.jsx(GD,{}),a?u.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[u.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):u.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[u.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:QD,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),u.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function GD(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function to(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 jg(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 Ne.get(`/admin/notifications${n?`?${n}`:""}`)}function Yj(e){return Ne.post(`/admin/notifications/${e}/read`)}function YD(){return Ne.post("/admin/notifications/read-all")}const XD={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 JD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Xj({notification:e,onClick:t,clickable:n}){const a=(XD[e.type]??e.type).toString(),l=JD(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:Te("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:gl(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function WD(){var w;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=On(),c=sn(),{data:f}=Fe({queryKey:["notifications","bell"],queryFn:()=>jg({limit:8}),refetchInterval:1e4}),{data:m}=Fe({queryKey:["notifications","unread-count"],queryFn:()=>jg({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(Yj(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 YD(),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(jR,{className:"h-4 w-4"}),y&&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"}),y&&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(Xj,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function eM(){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 tM(){const[e,t]=x.useState(eM);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(uz,{className:"h-4 w-4"}):u.jsx(GR,{className:"h-4 w-4"})})}function nM(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function X1({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:nM(t)})})}const J1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,W1=Ik,rM=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return W1(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 y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=J1(y)||J1(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:b,...w}=y;return Object.entries(w).every(k=>{let[j,C]=k;return Array.isArray(C)?C.includes({...o,...f}[j]):{...o,...f}[j]===C})?[...h,g,b]:h},[]);return W1(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},aM=rM("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?dD:"button";return u.jsx(c,{className:Te(aM({variant:t,size:n,className:e})),ref:o,...l})});me.displayName="Button";const _t=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:Te("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}));_t.displayName="Input";function iM({action:e,onClose:t}){const n=e!==null;return u.jsx(Wt,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(Vt,{children:[u.jsxs(ln,{children:[u.jsx(en,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(jy,{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(sM,{onDone:t}),e==="join"&&u.jsx(oM,{onDone:t})]})})}function lM(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function sM({onDone:e}){const{adoptTokens:t}=$t(),n=On(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const b=await Ne.post("/me/organizations",{name:lM(g),displayName:g});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(_t,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.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 oM({onDone:e}){const{adoptTokens:t}=$t(),n=On(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),b=/\/invite\/([^/?#]+)/.exec(g),w=(b==null?void 0:b[1])??g,k=await Ne.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.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(_t,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.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 uM(){var D,O;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:l}=$t(),o=On(),[c,f]=x.useState([]),[m,h]=x.useState(!1),[y,g]=x.useState(null),b=x.useRef(null);x.useEffect(()=>{(async()=>{try{const P=await Ne.get("/me/organizations");f(P)}catch{}})()},[]),x.useEffect(()=>{const P=V=>{m&&b.current&&!b.current.contains(V.target)&&h(!1)},L=V=>{m&&V.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",P),window.addEventListener("keydown",L),()=>{window.removeEventListener("mousedown",P),window.removeEventListener("keydown",L)}},[m]);const w=(n==null?void 0:n.displayName)??"User",k=(n==null?void 0:n.username)??"",j=(n==null?void 0:n.avatarUrl)??null,C=c.find(P=>P.id===e)??null,E=(C==null?void 0:C.role)??(t==="admin"||t==="member"?t:null),A=async P=>{if(P===e){h(!1);return}try{await a(P),h(!1),o("/",{replace:!0})}catch{}},z=()=>{h(!1),g("create")},U=()=>{h(!1),g("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:b,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${w}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h(P=>!P),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:m?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(X1,{src:j,name:w,size:28})}),m&&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(X1,{src:j,name:w,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:w}),k&&k!==w&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",k]})]})]}),c.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:"Current team"}),c.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(Er,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:(D=c[0])==null?void 0:D.displayName}),u.jsx(ew,{role:((O=c[0])==null?void 0:O.role)??E})]}):u.jsx("div",{children:c.map(P=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void A(P.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:P.id===e?u.jsx(Er,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:P.displayName}),u.jsx(ew,{role:P.role})]},P.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:z,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(Na,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:U,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(Dk,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsx("div",{className:"py-1",children:u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),l()},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(VR,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})})]})]}),u.jsx(iM,{action:y,onClose:()=>g(null)})]})}function ew({role:e}){return e!=="admin"&&e!=="member"?null:u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:e==="admin"?"var(--accent-dim)":"var(--fg-3)",border:"var(--hairline) solid var(--border)",background:e==="admin"?"var(--accent-bg)":"var(--bg-sunken)"},children:e})}const cM=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/context",label:"Context",end:!1,kbd:"⌘2"},{to:"/team",label:"Team",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}];function dM(){const[e,t]=x.useState(!1),n=Qn(),a=n.pathname==="/"||n.search.includes("a=");return x.useEffect(()=>{const l=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),t(c=>!c))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),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:"1fr auto 1fr",gap:"var(--sp-3)",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:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[u.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[u.jsx(to,{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(KD,{})]}),u.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:cM.map(l=>u.jsx(pf,{to:l.to,end:l.end,style:{pointerEvents:"auto"},className:({isActive:o})=>Te("inline-flex items-center transition-colors",o?"":"hover:text-[var(--fg)]"),children:({isActive:o})=>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:o?"var(--fg)":"var(--fg-3)",background:o?"var(--bg-hover)":"transparent"},children:[l.label,o&&u.jsx("span",{className:"kbd",children:l.kbd})]})},l.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[u.jsxs("button",{type:"button",onClick:()=>t(!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:l=>{l.currentTarget.style.color="var(--fg)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(my,{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(WD,{}),u.jsx(tM,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(uM,{})]})]}),u.jsx(HD,{open:e,onOpenChange:t}),a?u.jsx($s,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx($s,{})})})]})}function le(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,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];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 y of h._zod.deferred)y();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 js extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Jj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Wj={};function Ai(e){return Wj}function eC(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 Cg(e,t){return typeof t=="bigint"?t.toString():t}function wf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Cy(e){return e==null}function Ey(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function fM(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 tw=Symbol("evaluating");function mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==tw)return a===void 0&&(a=tw,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function jl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function nw(e){return JSON.stringify(e)}function hM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const tC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mM=wf(()=>{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 qs(e){if(_u(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(_u(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function nC(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const pM=new Set(["string","number","symbol"]);function Hs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Di(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 Re(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 gM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const yM={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 vM(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=Oi(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 jl(this,"shape",c),c},checks:[]});return Di(e,o)}function bM(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=Oi(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 jl(this,"shape",c),c},checks:[]});return Di(e,o)}function xM(e,t){if(!qs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const 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=Oi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return jl(this,"shape",o),o}});return Di(e,l)}function wM(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return jl(this,"shape",a),a}});return Di(e,n)}function SM(e,t){const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return jl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Di(e,n)}function kM(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=Oi(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 jl(this,"shape",m),m},checks:[]});return Di(t,c)}function jM(e,t,n){const a=Oi(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 jl(this,"shape",o),o}});return Di(t,a)}function bs(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 xs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Nd(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ri(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Nd((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??Nd((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Nd((m=n.customError)==null?void 0:m.call(n,e))??Nd((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=y}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function Ny(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const rC=(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,Cg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aC=le("$ZodError",rC),iC=le("$ZodError",rC,{Parent:Error});function CM(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 EM(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 _y=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 js;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw tC(f,l==null?void 0:l.callee),f}return c.value},Ty=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=>Ri(m,o,Ai())));throw tC(f,l==null?void 0:l.callee),f}return c.value},Sf=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 js;return o.issues.length?{success:!1,error:new(e??aC)(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},NM=Sf(iC),kf=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=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},_M=kf(iC),TM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return _y(e)(t,n,l)},AM=e=>(t,n,a)=>_y(e)(t,n,a),RM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ty(e)(t,n,l)},zM=e=>async(t,n,a)=>Ty(e)(t,n,a),OM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sf(e)(t,n,l)},DM=e=>(t,n,a)=>Sf(e)(t,n,a),MM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kf(e)(t,n,l)},IM=e=>async(t,n,a)=>kf(e)(t,n,a),LM=/^[cC][^\s-]{8,}$/,UM=/^[0-9a-z]+$/,PM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,BM=/^[0-9a-vA-V]{20}$/,$M=/^[A-Za-z0-9]{27}$/,FM=/^[a-zA-Z0-9_-]{21}$/,qM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,HM=/^([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})$/,rw=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)$/,ZM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,VM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function QM(){return new RegExp(VM,"u")}const KM=/^(?:(?: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])$/,GM=/^(([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}|:))$/,YM=/^((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])$/,XM=/^(([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])$/,JM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lC=/^[A-Za-z0-9_-]*$/,WM=/^\+[1-9]\d{6,14}$/,sC="(?:(?:\\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])))",e4=new RegExp(`^${sC}$`);function oC(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 t4(e){return new RegExp(`^${oC(e)}$`)}function n4(e){const t=oC({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(`^${sC}T(?:${a})$`)}const r4=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}$`)},a4=/^-?\d+$/,uC=/^-?\d+(?:\.\d+)?$/,i4=/^(?:true|false)$/i,l4=/^[^A-Z]*$/,s4=/^[^a-z]*$/,Gn=le("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),cC={number:"number",bigint:"bigint",object:"date"},dC=le("$ZodCheckLessThan",(e,t)=>{Gn.init(e,t);const n=cC[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})}}),fC=le("$ZodCheckGreaterThan",(e,t)=>{Gn.init(e,t);const n=cC[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})}}),o4=le("$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):fM(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})}}),u4=le("$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]=yM[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=a4)}),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})}}),c4=le("$ZodCheckMaxLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Cy(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=Ny(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),d4=le("$ZodCheckMinLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Cy(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=Ny(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),f4=le("$ZodCheckLengthEquals",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Cy(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=Ny(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})}}),jf=le("$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=()=>{})}),h4=le("$ZodCheckRegex",(e,t)=>{jf.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})}}),m4=le("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=l4),jf.init(e,t)}),p4=le("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=s4),jf.init(e,t)}),g4=le("$ZodCheckIncludes",(e,t)=>{Gn.init(e,t);const n=Hs(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})}}),y4=le("$ZodCheckStartsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`^${Hs(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})}}),v4=le("$ZodCheckEndsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`.*${Hs(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})}}),b4=le("$ZodCheckOverwrite",(e,t)=>{Gn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class x4{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(`
|
|
320
|
-
`).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(`
|
|
321
|
-
`))}}const w4={major:4,minor:3,patch:6},Ot=le("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=w4;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 y=bs(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new js;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==w&&(y||(y=bs(f,w)))});else{if(f.issues.length===w)continue;y||(y=bs(f,w))}}return g?g.then(()=>f):f},c=(f,m,h)=>{if(bs(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new js;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>c(g,f,m)):c(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new js;return h.then(y=>o(y,a,m))}return o(h,a,m)}}mt(e,"~standard",()=>({validate:o=>{var c;try{const f=NM(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return _M(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}))}),Ay=le("$ZodString",(e,t)=>{var n;Ot.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??r4(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}}),zt=le("$ZodStringFormat",(e,t)=>{jf.init(e,t),Ay.init(e,t)}),S4=le("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=HM),zt.init(e,t)}),k4=le("$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=rw(a))}else t.pattern??(t.pattern=rw());zt.init(e,t)}),j4=le("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ZM),zt.init(e,t)}),C4=le("$ZodURL",(e,t)=>{zt.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})}}}),E4=le("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=QM()),zt.init(e,t)}),N4=le("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=FM),zt.init(e,t)}),_4=le("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=LM),zt.init(e,t)}),T4=le("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=UM),zt.init(e,t)}),A4=le("$ZodULID",(e,t)=>{t.pattern??(t.pattern=PM),zt.init(e,t)}),R4=le("$ZodXID",(e,t)=>{t.pattern??(t.pattern=BM),zt.init(e,t)}),z4=le("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$M),zt.init(e,t)}),O4=le("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=n4(t)),zt.init(e,t)}),D4=le("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=e4),zt.init(e,t)}),M4=le("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=t4(t)),zt.init(e,t)}),I4=le("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=qM),zt.init(e,t)}),L4=le("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=KM),zt.init(e,t),e._zod.bag.format="ipv4"}),U4=le("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=GM),zt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),P4=le("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=YM),zt.init(e,t)}),B4=le("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=XM),zt.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 hC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const $4=le("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=JM),zt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{hC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function F4(e){if(!lC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return hC(n)}const q4=le("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=lC),zt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{F4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),H4=le("$ZodE164",(e,t)=>{t.pattern??(t.pattern=WM),zt.init(e,t)});function Z4(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 V4=le("$ZodJWT",(e,t)=>{zt.init(e,t),e._zod.check=n=>{Z4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),mC=le("$ZodNumber",(e,t)=>{Ot.init(e,t),e._zod.pattern=e._zod.bag.pattern??uC,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=le("$ZodNumberFormat",(e,t)=>{u4.init(e,t),mC.init(e,t)}),K4=le("$ZodBoolean",(e,t)=>{Ot.init(e,t),e._zod.pattern=i4,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}}),G4=le("$ZodUnknown",(e,t)=>{Ot.init(e,t),e._zod.parse=n=>n}),Y4=le("$ZodNever",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function aw(e,t,n){e.issues.length&&t.issues.push(...xs(n,e.issues)),t.value[n]=e.value}const X4=le("$ZodArray",(e,t)=>{Ot.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=>aw(h,n,c))):aw(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function Wd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...xs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function pC(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=gM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function gC(e,t,n,a,l,o){const c=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){c.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(w=>Wd(w,n,g,t,y))):Wd(b,n,g,t,y)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const J4=le("$ZodObject",(e,t)=>{Ot.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=wf(()=>pC(t));mt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=_u,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 y=[],g=c.shape;for(const b of c.keys){const w=g[b],k=w._zod.optout==="optional",j=w._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(C=>Wd(C,f,b,h,k))):Wd(j,f,b,h,k)}return o?gC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),W4=le("$ZodObjectJIT",(e,t)=>{J4.init(e,t);const n=e._zod.parse,a=wf(()=>pC(t)),l=b=>{var z;const w=new x4(["shape","payload","ctx"]),k=a.value,j=U=>{const D=nw(U);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};w.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const U of k.keys)C[U]=`key_${E++}`;w.write("const newResult = {};");for(const U of k.keys){const D=C[U],O=nw(U),P=b[U],L=((z=P==null?void 0:P._zod)==null?void 0:z.optout)==="optional";w.write(`const ${D} = ${j(U)};`),L?w.write(`
|
|
322
|
-
if (${D}.issues.length) {
|
|
323
|
-
if (${O} in input) {
|
|
324
|
-
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
325
|
-
...iss,
|
|
326
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
327
|
-
})));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (${D}.value === undefined) {
|
|
332
|
-
if (${O} in input) {
|
|
333
|
-
newResult[${O}] = undefined;
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
newResult[${O}] = ${D}.value;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
`):w.write(`
|
|
340
|
-
if (${D}.issues.length) {
|
|
341
|
-
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
|
342
|
-
...iss,
|
|
343
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
344
|
-
})));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
if (${D}.value === undefined) {
|
|
348
|
-
if (${O} in input) {
|
|
349
|
-
newResult[${O}] = undefined;
|
|
350
|
-
}
|
|
351
|
-
} else {
|
|
352
|
-
newResult[${O}] = ${D}.value;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
`)}w.write("payload.value = newResult;"),w.write("return payload;");const A=w.compile();return(U,D)=>A(b,U,D)};let o;const c=_u,f=!Wj.jitless,h=f&&mM.value,y=t.catchall;let g;e._zod.parse=(b,w)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),b=o(b,w),y?gC([],k,b,w,g,e):b):n(b,w):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function iw(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=>!bs(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=>Ri(c,a,Ai())))}),t)}const yC=le("$ZodUnion",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),mt(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=>Ey(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=>iw(m,l,e,o)):iw(f,l,e,o)}}),e5=le("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yC.init(e,t);const n=e._zod.parse;mt(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=wf(()=>{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(!_u(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)}}),t5=le("$ZodIntersection",(e,t)=>{Ot.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])=>lw(n,m,h)):lw(n,o,c)}});function Eg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qs(e)&&qs(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const c=Eg(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=Eg(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 lw(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}),bs(e))return e;const c=Eg(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 n5=le("$ZodRecord",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!qs(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 y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...xs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...xs(h,y.issues)),n.value[h]=y.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"&&uC.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ri(g,a,Ai())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...xs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...xs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),r5=le("$ZodEnum",(e,t)=>{Ot.init(e,t);const n=eC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>pM.has(typeof l)).map(l=>typeof l=="string"?Hs(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}}),a5=le("$ZodLiteral",(e,t)=>{if(Ot.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"?Hs(a):a?Hs(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}}),i5=le("$ZodTransform",(e,t)=>{Ot.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Jj(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 js;return n.value=l,n}});function sw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vC=le("$ZodOptional",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ey(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=>sw(o,n.value)):sw(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),l5=le("$ZodExactOptional",(e,t)=>{vC.init(e,t),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),s5=le("$ZodNullable",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ey(n.source)}|null)$`):void 0}),mt(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)}),o5=le("$ZodDefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",mt(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=>ow(o,t)):ow(l,t)}});function ow(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const u5=le("$ZodPrefault",(e,t)=>{Ot.init(e,t),e._zod.optin="optional",mt(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))}),c5=le("$ZodNonOptional",(e,t)=>{Ot.init(e,t),mt(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=>uw(o,e)):uw(l,e)}});function uw(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 d5=le("$ZodCatch",(e,t)=>{Ot.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(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=>Ri(c,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ri(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),f5=le("$ZodPipe",(e,t)=>{Ot.init(e,t),mt(e._zod,"values",()=>t.in._zod.values),mt(e._zod,"optin",()=>t.in._zod.optin),mt(e._zod,"optout",()=>t.out._zod.optout),mt(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=>_d(c,t.in,a)):_d(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>_d(o,t.out,a)):_d(l,t.out,a)}});function _d(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const h5=le("$ZodReadonly",(e,t)=>{Ot.init(e,t),mt(e._zod,"propValues",()=>t.innerType._zod.propValues),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),mt(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(cw):cw(l)}});function cw(e){return e.value=Object.freeze(e.value),e}const m5=le("$ZodCustom",(e,t)=>{Gn.init(e,t),Ot.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=>dw(o,n,a,e));dw(l,n,a,e)}});function dw(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(Tu(l))}}var fw;class p5{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 g5(){return new p5}(fw=globalThis).__zod_globalRegistry??(fw.__zod_globalRegistry=g5());const pu=globalThis.__zod_globalRegistry;function y5(e,t){return new e({type:"string",...Re(t)})}function v5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function hw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function b5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function x5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function w5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function S5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function k5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function j5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function C5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function E5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function N5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function _5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function T5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function A5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function R5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function z5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function O5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function D5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function M5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function I5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function L5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function U5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function P5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function B5(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function $5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function F5(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function q5(e,t){return new e({type:"number",checks:[],...Re(t)})}function H5(e,t){return new e({type:"number",coerce:!0,checks:[],...Re(t)})}function Z5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function V5(e,t){return new e({type:"boolean",...Re(t)})}function Q5(e){return new e({type:"unknown"})}function K5(e,t){return new e({type:"never",...Re(t)})}function mw(e,t){return new dC({check:"less_than",...Re(t),value:e,inclusive:!1})}function yp(e,t){return new dC({check:"less_than",...Re(t),value:e,inclusive:!0})}function pw(e,t){return new fC({check:"greater_than",...Re(t),value:e,inclusive:!1})}function vp(e,t){return new fC({check:"greater_than",...Re(t),value:e,inclusive:!0})}function gw(e,t){return new o4({check:"multiple_of",...Re(t),value:e})}function bC(e,t){return new c4({check:"max_length",...Re(t),maximum:e})}function ef(e,t){return new d4({check:"min_length",...Re(t),minimum:e})}function xC(e,t){return new f4({check:"length_equals",...Re(t),length:e})}function G5(e,t){return new h4({check:"string_format",format:"regex",...Re(t),pattern:e})}function Y5(e){return new m4({check:"string_format",format:"lowercase",...Re(e)})}function X5(e){return new p4({check:"string_format",format:"uppercase",...Re(e)})}function J5(e,t){return new g4({check:"string_format",format:"includes",...Re(t),includes:e})}function W5(e,t){return new y4({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function eI(e,t){return new v4({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function no(e){return new b4({check:"overwrite",tx:e})}function tI(e){return no(t=>t.normalize(e))}function nI(){return no(e=>e.trim())}function rI(){return no(e=>e.toLowerCase())}function aI(){return no(e=>e.toUpperCase())}function iI(){return no(e=>hM(e))}function lI(e,t,n){return new e({type:"array",element:t,...Re(n)})}function sI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Re(n)})}function oI(e){const t=uI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Tu(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(Tu(l))}},e(n.value,n)));return t}function uI(e,t){const n=new Gn({check:"custom",...Re(t)});return n._zod.check=e,n}function wC(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)??pu,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 y,g;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=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);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 w=e._zod.parent;w&&(c.ref||(c.ref=w),Jt(w,t,b),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&An(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 SC(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 y of e.seen.entries()){const g=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(g){const b=a.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const C=(j=e.external.registry.get(y[0]))==null?void 0:j.id,E=e.external.uri??(z=>z);if(C)return{ref:E(C)};const A=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=A,{defId:A,ref:`${E("__shared")}#/${g}/${A}`}}if(y[1]===n)return{ref:"#"};const w=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:w+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);const k=g.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
|
|
356
|
-
|
|
357
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function kC(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 y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),C=j.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,b),h._zod.parent===w)for(const A in g)A==="$ref"||A==="allOf"||A in b||delete g[A];if(C.$ref&&j.def)for(const A in g)A==="$ref"||A==="allOf"||A in j.def&&JSON.stringify(g[A])===JSON.stringify(j.def[A])&&delete g[A]}const k=h._zod.parent;if(k&&k!==w){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const C in g)C==="$ref"||C==="allOf"||C in j.def&&JSON.stringify(g[C])===JSON.stringify(j.def[C])&&delete g[C]}e.override({zodSchema:h,jsonSchema:g,path:y.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 y=h[1];y.def&&y.defId&&(o[y.defId]=y.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:tf(t,"input",e.processors),output:tf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function An(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 An(a.element,n);if(a.type==="set")return An(a.valueType,n);if(a.type==="lazy")return An(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 An(a.innerType,n);if(a.type==="intersection")return An(a.left,n)||An(a.right,n);if(a.type==="record"||a.type==="map")return An(a.keyType,n)||An(a.valueType,n);if(a.type==="pipe")return An(a.in,n)||An(a.out,n);if(a.type==="object"){for(const l in a.shape)if(An(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(An(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(An(l,n))return!0;return!!(a.rest&&An(a.rest,n))}return!1}const cI=(e,t={})=>n=>{const a=wC({...n,processors:t});return Jt(e,a),SC(a,e),kC(a,e)},tf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=wC({...l??{},target:o,io:t,processors:n});return Jt(e,c),SC(c,e),kC(c,e)},dI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fI=(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=dI[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},hI=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=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)},mI=(e,t,n,a)=>{n.type="boolean"},pI=(e,t,n,a)=>{n.not={}},gI=(e,t,n,a)=>{},yI=(e,t,n,a)=>{const l=e._zod.def,o=eC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},vI=(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},bI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},xI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wI=(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"]})},SI=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const y in c)l.properties[y]=Jt(c[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(c)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.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)},kI=(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},jI=(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},CI=(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 y=Jt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const g of m)l.patternProperties[g.source]=y}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 y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},EI=(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"}]},NI=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},_I=(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))},TI=(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)))},AI=(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},RI=(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},zI=(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},jC=(e,t,n,a)=>{const l=e._zod.def;Jt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},OI=le("ZodISODateTime",(e,t)=>{O4.init(e,t),Mt.init(e,t)});function DI(e){return P5(OI,e)}const MI=le("ZodISODate",(e,t)=>{D4.init(e,t),Mt.init(e,t)});function II(e){return B5(MI,e)}const LI=le("ZodISOTime",(e,t)=>{M4.init(e,t),Mt.init(e,t)});function UI(e){return $5(LI,e)}const PI=le("ZodISODuration",(e,t)=>{I4.init(e,t),Mt.init(e,t)});function BI(e){return F5(PI,e)}const $I=(e,t)=>{aC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>EM(e,n)},flatten:{value:n=>CM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Cg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Cg,2)}},isEmpty:{get(){return e.issues.length===0}}})},_r=le("ZodError",$I,{Parent:Error}),FI=_y(_r),qI=Ty(_r),HI=Sf(_r),ZI=kf(_r),VI=TM(_r),QI=AM(_r),KI=RM(_r),GI=zM(_r),YI=OM(_r),XI=DM(_r),JI=MM(_r),WI=IM(_r),Dt=le("ZodType",(e,t)=>(Ot.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tf(e,"input"),output:tf(e,"output")}}),e.toJSONSchema=cI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Oi(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)=>Di(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>FI(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>HI(e,n,a),e.parseAsync=async(n,a)=>qI(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>ZI(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>VI(e,n,a),e.decode=(n,a)=>QI(e,n,a),e.encodeAsync=async(n,a)=>KI(e,n,a),e.decodeAsync=async(n,a)=>GI(e,n,a),e.safeEncode=(n,a)=>YI(e,n,a),e.safeDecode=(n,a)=>XI(e,n,a),e.safeEncodeAsync=async(n,a)=>JI(e,n,a),e.safeDecodeAsync=async(n,a)=>WI(e,n,a),e.refine=(n,a)=>e.check(ZL(n,a)),e.superRefine=n=>e.check(VL(n)),e.overwrite=n=>e.check(no(n)),e.optional=()=>bw(e),e.exactOptional=()=>zL(e),e.nullable=()=>xw(e),e.nullish=()=>bw(xw(e)),e.nonoptional=n=>UL(e,n),e.array=()=>Zn(e),e.or=n=>NC([e,n]),e.and=n=>NL(e,n),e.transform=n=>_g(e,_C(n)),e.default=n=>ML(e,n),e.prefault=n=>LL(e,n),e.catch=n=>BL(e,n),e.pipe=n=>_g(e,n),e.readonly=()=>qL(e),e.describe=n=>{const a=e.clone();return pu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=pu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return pu.get(e);const a=e.clone();return pu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),CC=le("_ZodString",(e,t)=>{Ay.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>fI(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(G5(...a)),e.includes=(...a)=>e.check(J5(...a)),e.startsWith=(...a)=>e.check(W5(...a)),e.endsWith=(...a)=>e.check(eI(...a)),e.min=(...a)=>e.check(ef(...a)),e.max=(...a)=>e.check(bC(...a)),e.length=(...a)=>e.check(xC(...a)),e.nonempty=(...a)=>e.check(ef(1,...a)),e.lowercase=a=>e.check(Y5(a)),e.uppercase=a=>e.check(X5(a)),e.trim=()=>e.check(nI()),e.normalize=(...a)=>e.check(tI(...a)),e.toLowerCase=()=>e.check(rI()),e.toUpperCase=()=>e.check(aI()),e.slugify=()=>e.check(iI())}),eL=le("ZodString",(e,t)=>{Ay.init(e,t),CC.init(e,t),e.email=n=>e.check(v5(tL,n)),e.url=n=>e.check(k5(nL,n)),e.jwt=n=>e.check(U5(yL,n)),e.emoji=n=>e.check(j5(rL,n)),e.guid=n=>e.check(hw(yw,n)),e.uuid=n=>e.check(b5(Td,n)),e.uuidv4=n=>e.check(x5(Td,n)),e.uuidv6=n=>e.check(w5(Td,n)),e.uuidv7=n=>e.check(S5(Td,n)),e.nanoid=n=>e.check(C5(aL,n)),e.guid=n=>e.check(hw(yw,n)),e.cuid=n=>e.check(E5(iL,n)),e.cuid2=n=>e.check(N5(lL,n)),e.ulid=n=>e.check(_5(sL,n)),e.base64=n=>e.check(M5(mL,n)),e.base64url=n=>e.check(I5(pL,n)),e.xid=n=>e.check(T5(oL,n)),e.ksuid=n=>e.check(A5(uL,n)),e.ipv4=n=>e.check(R5(cL,n)),e.ipv6=n=>e.check(z5(dL,n)),e.cidrv4=n=>e.check(O5(fL,n)),e.cidrv6=n=>e.check(D5(hL,n)),e.e164=n=>e.check(L5(gL,n)),e.datetime=n=>e.check(DI(n)),e.date=n=>e.check(II(n)),e.time=n=>e.check(UI(n)),e.duration=n=>e.check(BI(n))});function R(e){return y5(eL,e)}const Mt=le("ZodStringFormat",(e,t)=>{zt.init(e,t),CC.init(e,t)}),tL=le("ZodEmail",(e,t)=>{j4.init(e,t),Mt.init(e,t)}),yw=le("ZodGUID",(e,t)=>{S4.init(e,t),Mt.init(e,t)}),Td=le("ZodUUID",(e,t)=>{k4.init(e,t),Mt.init(e,t)}),nL=le("ZodURL",(e,t)=>{C4.init(e,t),Mt.init(e,t)}),rL=le("ZodEmoji",(e,t)=>{E4.init(e,t),Mt.init(e,t)}),aL=le("ZodNanoID",(e,t)=>{N4.init(e,t),Mt.init(e,t)}),iL=le("ZodCUID",(e,t)=>{_4.init(e,t),Mt.init(e,t)}),lL=le("ZodCUID2",(e,t)=>{T4.init(e,t),Mt.init(e,t)}),sL=le("ZodULID",(e,t)=>{A4.init(e,t),Mt.init(e,t)}),oL=le("ZodXID",(e,t)=>{R4.init(e,t),Mt.init(e,t)}),uL=le("ZodKSUID",(e,t)=>{z4.init(e,t),Mt.init(e,t)}),cL=le("ZodIPv4",(e,t)=>{L4.init(e,t),Mt.init(e,t)}),dL=le("ZodIPv6",(e,t)=>{U4.init(e,t),Mt.init(e,t)}),fL=le("ZodCIDRv4",(e,t)=>{P4.init(e,t),Mt.init(e,t)}),hL=le("ZodCIDRv6",(e,t)=>{B4.init(e,t),Mt.init(e,t)}),mL=le("ZodBase64",(e,t)=>{$4.init(e,t),Mt.init(e,t)}),pL=le("ZodBase64URL",(e,t)=>{q4.init(e,t),Mt.init(e,t)}),gL=le("ZodE164",(e,t)=>{H4.init(e,t),Mt.init(e,t)}),yL=le("ZodJWT",(e,t)=>{V4.init(e,t),Mt.init(e,t)}),Ry=le("ZodNumber",(e,t)=>{mC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>hI(e,a,l),e.gt=(a,l)=>e.check(pw(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(mw(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(vw(a)),e.safe=a=>e.check(vw(a)),e.positive=a=>e.check(pw(0,a)),e.nonnegative=a=>e.check(vp(0,a)),e.negative=a=>e.check(mw(0,a)),e.nonpositive=a=>e.check(yp(0,a)),e.multipleOf=(a,l)=>e.check(gw(a,l)),e.step=(a,l)=>e.check(gw(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 Qe(e){return q5(Ry,e)}const vL=le("ZodNumberFormat",(e,t)=>{Q4.init(e,t),Ry.init(e,t)});function vw(e){return Z5(vL,e)}const bL=le("ZodBoolean",(e,t)=>{K4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>mI(e,n,a)});function Yr(e){return V5(bL,e)}const xL=le("ZodUnknown",(e,t)=>{G4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>gI()});function wt(){return Q5(xL)}const wL=le("ZodNever",(e,t)=>{Y4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>pI(e,n,a)});function SL(e){return K5(wL,e)}const kL=le("ZodArray",(e,t)=>{X4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>wI(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(ef(n,a)),e.nonempty=n=>e.check(ef(1,n)),e.max=(n,a)=>e.check(bC(n,a)),e.length=(n,a)=>e.check(xC(n,a)),e.unwrap=()=>e.element});function Zn(e,t){return lI(kL,e,t)}const jL=le("ZodObject",(e,t)=>{W4.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>SI(e,n,a,l),mt(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:wt()}),e.loose=()=>e.clone({...e._zod.def,catchall:wt()}),e.strict=()=>e.clone({...e._zod.def,catchall:SL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>xM(e,n),e.safeExtend=n=>wM(e,n),e.merge=n=>SM(e,n),e.pick=n=>vM(e,n),e.omit=n=>bM(e,n),e.partial=(...n)=>kM(TC,e,n[0]),e.required=(...n)=>jM(AC,e,n[0])});function ce(e,t){const n={type:"object",shape:e??{},...Re(t)};return new jL(n)}const EC=le("ZodUnion",(e,t)=>{yC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kI(e,n,a,l),e.options=t.options});function NC(e,t){return new EC({type:"union",options:e,...Re(t)})}const CL=le("ZodDiscriminatedUnion",(e,t)=>{EC.init(e,t),e5.init(e,t)});function zy(e,t,n){return new CL({type:"union",options:t,discriminator:e,...Re(n)})}const EL=le("ZodIntersection",(e,t)=>{t5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jI(e,n,a,l)});function NL(e,t){return new EL({type:"intersection",left:e,right:t})}const _L=le("ZodRecord",(e,t)=>{n5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>CI(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ft(e,t,n){return new _L({type:"record",keyType:e,valueType:t,...Re(n)})}const Ng=le("ZodEnum",(e,t)=>{r5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>yI(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 Ng({...t,checks:[],...Re(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 Ng({...t,checks:[],...Re(l),entries:o})}});function qe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Ng({type:"enum",entries:n,...Re(t)})}const TL=le("ZodLiteral",(e,t)=>{a5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>vI(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 an(e,t){return new TL({type:"literal",values:Array.isArray(e)?e:[e],...Re(t)})}const AL=le("ZodTransform",(e,t)=>{i5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Jj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Tu(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(Tu(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function _C(e){return new AL({type:"transform",transform:e})}const TC=le("ZodOptional",(e,t)=>{vC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new TC({type:"optional",innerType:e})}const RL=le("ZodExactOptional",(e,t)=>{l5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>jC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function zL(e){return new RL({type:"optional",innerType:e})}const OL=le("ZodNullable",(e,t)=>{s5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>EI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function xw(e){return new OL({type:"nullable",innerType:e})}const DL=le("ZodDefault",(e,t)=>{o5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>_I(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ML(e,t){return new DL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():nC(t)}})}const IL=le("ZodPrefault",(e,t)=>{u5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>TI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function LL(e,t){return new IL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():nC(t)}})}const AC=le("ZodNonOptional",(e,t)=>{c5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>NI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function UL(e,t){return new AC({type:"nonoptional",innerType:e,...Re(t)})}const PL=le("ZodCatch",(e,t)=>{d5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>AI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function BL(e,t){return new PL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const $L=le("ZodPipe",(e,t)=>{f5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>RI(e,n,a,l),e.in=t.in,e.out=t.out});function _g(e,t){return new $L({type:"pipe",in:e,out:t})}const FL=le("ZodReadonly",(e,t)=>{h5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>zI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function qL(e){return new FL({type:"readonly",innerType:e})}const HL=le("ZodCustom",(e,t)=>{m5.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>bI(e,n)});function ZL(e,t={}){return sI(HL,e,t)}function VL(e){return oI(e)}function QL(e,t){return _g(_C(e),t)}const bp={custom:"custom"};function Cf(e){return H5(Ry,e)}const KL=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function GL(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function YL(e,t){const n=GL(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(KL)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const XL=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,ww="/";function RC(e){return!e||typeof e!="string"||e.length>256||!XL.test(e)?"/":e}const JL={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},zC=qe(["feishu","slack","kael"]),OC=qe(["active","inactive"]);ce({platform:zC,agentId:R().min(1),credentials:Ft(R(),wt()),status:OC.default("active")});ce({agentId:R().min(1).optional(),credentials:Ft(R(),wt()).optional(),status:OC.optional()});ce({id:Qe(),platform:R(),agentId:R(),hasCredentials:Yr(),status:R(),createdAt:R(),updatedAt:R()});const WL=qe(["code","reverse_token","oauth","manual"]);ce({appId:R().min(1),appSecret:R().min(1)});ce({platform:zC,externalUserId:R().min(1),agentId:R().min(1),boundVia:WL.default("manual"),displayName:R().max(200).optional()});ce({id:Qe(),platform:R(),externalUserId:R(),agentId:R(),boundVia:R().nullable(),displayName:R().nullable(),createdAt:R()});ce({feishuUserId:R().min(1),displayName:R().max(200).optional()});ce({configId:Qe(),platform:R(),agentId:R(),appId:R(),connected:Yr(),lastActiveAt:R().nullable()});const DC=qe(["online","offline"]),MC=qe(["idle","working","blocked","error"]);qe(["active","suspended","evicted"]);const e6=qe(["active","suspended"]);ce({chatId:R().min(1),state:e6});ce({runtimeState:MC});ce({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"]);ce({agentId:R(),status:DC,connectedAt:R().nullable(),lastSeenAt:R(),clientId:R().nullable().optional(),runtimeType:R().nullable().optional(),runtimeVersion:R().nullable().optional(),runtimeState:MC.nullable().optional(),activeSessions:Qe().int().nullable().optional(),totalSessions:Qe().int().nullable().optional(),runtimeUpdatedAt:R().nullable().optional()});ce({total:Qe().int(),running:Qe().int(),byState:ce({idle:Qe().int(),working:Qe().int(),blocked:Qe().int(),error:Qe().int()}),clients:Qe().int()});const nf={CLAUDE_CODE:"claude-code",CODEX:"codex"},Ef=qe(["claude-code","codex"]),Nf=qe(["human","personal_assistant","autonomous_agent"]),Sw={PRIVATE:"private",ORGANIZATION:"organization"},Oy=qe(["private","organization"]),t6=qe(["admin-api","portal"]);qe(["active","suspended"]);const Tg=/^[a-z0-9][a-z0-9_-]{0,63}$/,ws=64,n6=["admin","agent","first-tree","hub","me","null","system","undefined"],r6=new Set(n6);function Ag(e){return r6.has(e)}ce({name:R().min(1).max(64).regex(Tg,"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:Nf,displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).optional(),organizationId:R().min(1).max(100).optional(),source:t6.optional(),visibility:Oy.optional(),metadata:Ft(R(),wt()).optional(),managerId:R().optional(),clientId:R().min(1).max(100).optional(),runtimeProvider:Ef.optional()});ce({type:Nf.optional(),displayName:R().min(1).max(200).optional(),delegateMention:R().max(100).nullable().optional(),visibility:Oy.optional(),metadata:Ft(R(),wt()).optional(),managerId:R().nullable().optional(),clientId:R().min(1).max(100).nullable().optional()});ce({clientId:R().min(1).max(100),runtimeProvider:Ef,force:Yr().optional()});ce({uuid:R(),name:R().nullable(),organizationId:R(),type:Nf,displayName:R(),delegateMention:R().nullable(),inboxId:R(),status:R(),source:R().nullable().optional(),visibility:Oy,metadata:Ft(R(),wt()),managerId:R().nullable(),clientId:R().nullable(),runtimeProvider:Ef,presenceStatus:DC.optional(),createdAt:R(),updatedAt:R()});ce({repo:R().nullable(),branch:R().nullable()});ce({type:an("agent:pinned"),agentId:R(),name:R().nullable(),displayName:R(),agentType:Nf,runtimeProvider:Ef});const a6=32e3,Dy=/^[a-z0-9][a-z0-9_-]{0,63}$/i,i6=/^[A-Z][A-Z0-9_]*$/,l6=ce({append:R().max(a6).default("")}),s6=ce({name:R().regex(Dy,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:an("stdio"),command:R().min(1),args:Zn(R()).optional()}),o6=ce({name:R().regex(Dy,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:an("http"),url:R().url(),headers:Ft(R(),R()).optional()}),u6=ce({name:R().regex(Dy,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:an("sse"),url:R().url(),headers:Ft(R(),R()).optional()}),c6=zy("transport",[s6,o6,u6]),d6=ce({key:R().regex(i6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:R(),sensitive:Yr().default(!1)}),f6=ce({url:R().min(1),ref:R().min(1).optional(),localPath:R().min(1).optional()}),_f=ce({prompt:l6.default({append:""}),model:R().default("opus"),mcpServers:Zn(c6).default([]),env:Zn(d6).default([]),gitRepos:Zn(f6).default([])}),h6=_f.extend({kind:an("claude-code")}),m6=_f.extend({kind:an("codex")}),p6=zy("kind",[h6,m6]),g6=(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??af(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))})},IC=QL(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,p6).superRefine((e,t)=>{g6(e,t)}),y6=ce({agentId:R(),version:Qe().int().positive(),payload:IC,updatedAt:R(),updatedBy:R()});ce({expectedVersion:Qe().int().positive(),payload:_f.partial()});ce({payload:_f.partial()});ce({current:y6,next:IC,diff:Zn(ce({path:R(),op:qe(["add","remove","replace"]),before:wt().optional(),after:wt().optional()}))});const rf="***";function af(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}ce({username:R().min(1),password:R().min(1)});ce({accessToken:R(),refreshToken:R()});ce({refreshToken:R().min(1)});ce({token:R().min(1)});ce({token:R(),expiresIn:Qe(),command:R()});const v6=qe(["direct","group","thread"]);ce({type:v6,topic:R().max(500).optional(),participantIds:Zn(R()).min(1),metadata:Ft(R(),wt()).optional()});const LC=ce({agentId:R(),role:R(),mode:R(),joinedAt:R()});LC.extend({name:R().nullable(),displayName:R(),type:R()});const b6=ce({id:R(),organizationId:R(),type:R(),topic:R().nullable(),lifecyclePolicy:R().nullable().optional(),metadata:Ft(R(),wt()),createdAt:R(),updatedAt:R()});b6.extend({participants:Zn(LC)});ce({topic:R().trim().max(500).nullable()});ce({agentId:R().min(1),mode:qe(["full","mention_only"]).default("full")});ce({agentId:R().min(1)});const x6=qe(["connected","disconnected"]),w6=qe(["ok","expired"]);ce({id:R(),userId:R().nullable(),status:x6,authState:w6,sdkVersion:R().max(50).nullable(),hostname:R().max(100).nullable(),os:R().max(50).nullable(),agentCount:Qe().int().min(0),connectedAt:R().nullable(),lastSeenAt:R(),metadata:Ft(R(),wt()).nullable()});const S6=ce({wsInboxDeliver:Yr().default(!1)}).partial();ce({clientId:R().min(1).max(100),hostname:R().max(100).optional(),os:R().max(50).optional(),sdkVersion:R().max(50).optional(),wireCapabilities:S6.optional()});ce({clientId:R(),previousUserId:R().nullable(),unpinnedAgentCount:Qe().int().nonnegative()});const k6=qe(["ok","missing","unauthenticated","error"]),j6=qe(["api_key","oauth","auth_json","none"]),C6=ce({state:k6,available:Yr(),authenticated:Yr(),sdkVersion:R().nullable().optional(),authMethod:j6,error:R().nullable().optional(),detectedAt:R()}),E6=Ft(R(),C6);ce({capabilities:E6});ce({limit:Cf().int().min(1).max(100).default(20),cursor:R().optional()});const N6=["image/png","image/jpeg","image/gif","image/webp"],My=qe(N6);ce({data:R().min(1),mimeType:My,filename:R().min(1),size:Qe().int().nonnegative().optional(),imageId:R().uuid().optional()});ce({imageId:R().uuid(),mimeType:My,filename:R().min(1),size:Qe().int().nonnegative().optional()});ce({type:an("image_payload"),imageId:R().uuid(),chatId:R(),base64:R().min(1),mimeType:My,filename:R().min(1),size:Qe().int().nonnegative().optional()});const Iy=qe(["hub_ui","cli","feishu","github","api"]),UC=qe(["text","markdown","card","reference","file","task"]);ce({format:UC.default("text"),content:wt(),metadata:Ft(R(),wt()).optional(),inReplyTo:R().optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Iy.optional()});ce({format:UC.default("text"),content:wt(),metadata:Ft(R(),wt()).optional(),replyToInbox:R().optional(),replyToChat:R().optional(),source:Iy.optional()});const _6=ce({id:R(),chatId:R(),senderId:R(),format:R(),content:wt(),metadata:Ft(R(),wt()),replyToInbox:R().nullable(),replyToChat:R().nullable(),inReplyTo:R().nullable(),source:Iy.nullable(),createdAt:R()}),T6=ce({senderId:R(),chatId:R(),replyToChat:R().nullable()}).nullable(),A6=qe(["full","mention_only"]),R6=ce({id:R(),senderId:R(),format:R(),content:wt(),metadata:Ft(R(),wt()).default({}),createdAt:R()}),PC=_6.extend({configVersion:Qe().int().positive(),recipientMode:A6.default("full"),inReplyToSnapshot:T6.default(null),precedingMessages:Zn(R6).default([])});qe(["pending","delivered","acked","failed"]);const z6=ce({id:Qe(),inboxId:R(),messageId:R(),chatId:R().nullable(),status:R(),retryCount:Qe(),createdAt:R(),deliveredAt:R().nullable(),ackedAt:R().nullable()});z6.extend({message:PC});ce({limit:Cf().int().min(1).max(50).default(10)});ce({type:an("inbox:deliver"),entryId:Qe().int().nonnegative(),inboxId:R().min(1),chatId:R().nullable(),message:PC}).passthrough();ce({type:an("inbox:ack"),entryId:Qe().int().nonnegative()});const O6=7;ce({organizationId:R(),organizationName:R(),organizationDisplayName:R(),role:R(),expiresAt:R().nullable()});ce({id:R(),organizationId:R(),token:R(),inviteUrl:R(),role:R(),createdAt:R(),expiresAt:R().nullable()});ce({token:R().min(1)});ce({}).optional();qe(["connect","create_agent","completed"]);ce({id:R(),name:R(),displayName:R(),role:qe(["admin","member"])});ce({name:R().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:R().min(1).max(200)});ce({organizationId:R().min(1)});ce({id:R(),organizationId:R(),organizationName:R(),role:qe(["admin","member"]),agentId:R()});const D6={ADMIN:"admin",MEMBER:"member"},Ly=qe(["admin","member"]),M6=ce({id:R(),userId:R(),organizationId:R(),agentId:R(),role:Ly,createdAt:R()});ce({username:R().min(1).max(100),displayName:R().min(1).max(200),role:Ly.default("member")});ce({role:Ly.optional(),displayName:R().min(1).max(200).optional()});M6.extend({username:R(),displayName:R(),password:R()});const I6=qe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),BC=qe(["high","medium","low"]);ce({id:R(),organizationId:R(),type:I6,severity:BC,agentId:R().nullable(),chatId:R().nullable(),message:R(),read:Yr(),createdAt:R()});ce({limit:Cf().int().min(1).max(100).default(20),cursor:R().optional(),severity:BC.optional(),read:qe(["true","false"]).transform(e=>e==="true").optional(),agentId:R().optional()});ce({next:R().max(256).optional()});ce({code:R().min(1),state:R().min(1)});ce({githubId:R().min(1),login:R().min(1),email:R().email().optional(),displayName:R().optional(),next:R().max(256).optional()});const $C=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ce({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=>!$C.test(e),"Name must not be a UUID format"),displayName:R().min(1).max(200),maxAgents:Qe().int().min(0).default(0),maxMessagesPerMinute:Qe().int().min(0).default(0),features:Ft(R(),wt()).default({})});ce({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=>!$C.test(e),"Name must not be a UUID format").optional(),displayName:R().min(1).max(200).optional(),maxAgents:Qe().int().min(0).optional(),maxMessagesPerMinute:Qe().int().min(0).optional(),features:Ft(R(),wt()).optional()});ce({id:R(),name:R(),displayName:R(),maxAgents:Qe(),maxMessagesPerMinute:Qe(),features:Ft(R(),wt()),createdAt:R(),updatedAt:R()});const L6=ce({workingCount:Qe().int().nonnegative(),errorMask:Yr()}),U6=ce({type:an("pulse:tick"),organizationId:R(),agents:Ft(R(),Zn(L6).length(32))}),P6=qe(["tool_call","error","assistant_text","thinking","turn_end"]),FC=ce({toolUseId:R(),name:R(),args:wt(),status:qe(["pending","ok","error"]),durationMs:Qe().int().nonnegative().optional(),resultPreview:R().max(400).optional()}),qC=ce({source:qe(["sdk","runtime","tool"]),message:R().max(2e3)}),HC=ce({text:R().max(8e3)}),ZC=ce({}),VC=ce({status:qe(["success","error"])}),B6=zy("kind",[ce({kind:an("tool_call"),payload:FC}),ce({kind:an("error"),payload:qC}),ce({kind:an("assistant_text"),payload:HC}),ce({kind:an("thinking"),payload:ZC}),ce({kind:an("turn_end"),payload:VC})]);ce({id:R(),agentId:R(),chatId:R(),seq:Qe().int().positive(),kind:P6,payload:NC([FC,qC,HC,ZC,VC]),createdAt:R()});ce({agentId:R(),chatId:R(),event:B6});ce({agentId:R(),chatId:R()});ce({type:an("session:reconcile"),agentId:R().min(1),chatIds:Zn(R().min(1)).max(500)});ce({type:an("session:reconcile:result"),agentId:R().min(1),staleChatIds:Zn(R().min(1))});const $6=ce({organizationId:R(),agentCount:Qe(),chatCount:Qe(),messageCount:Qe()});ce({totalAgents:Qe(),totalChats:Qe(),totalMessages:Qe(),byOrganization:Zn($6)});ce({key:R(),value:wt(),updatedAt:R()});Ft(R(),wt());const ji={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Hd={[ji.INBOX_TIMEOUT_SECONDS]:300,[ji.MAX_RETRY_COUNT]:3,[ji.POLLING_INTERVAL_SECONDS]:5,[ji.PRESENCE_CLEANUP_SECONDS]:60},Au=qe(["pending","assigned","working","completed","failed","cancelled"]),kw=qe(["agent","admin"]),F6=qe(["assigned","status_changed","cancelled"]);ce({taskId:R(),event:F6,title:R(),body:R().default(""),status:Au,fromStatus:Au.optional(),originRef:R().nullable().optional()});const q6=ce({title:R().min(1).max(500),body:R().optional(),assigneeAgentId:R().optional(),originRef:R().max(500).optional(),metadata:Ft(R(),wt()).optional()});q6.extend({organizationId:R().optional()});ce({status:qe(["working","completed","failed"]),result:R().optional()});ce({assigneeAgentId:R().nullable().optional(),status:Au.optional(),result:R().optional()});ce({chatId:R().min(1)});const H6=ce({id:R(),organizationId:R(),title:R(),body:R(),status:Au,assigneeAgentId:R().nullable(),createdByType:kw,createdById:R(),originRef:R().nullable(),result:R().nullable(),metadata:Ft(R(),wt()),createdAt:R(),updatedAt:R(),cancelledAt:R().nullable(),cancelledByType:kw.nullable(),cancelledById:R().nullable()}),Z6=ce({taskId:R(),chatId:R(),linkedByAgentId:R().nullable(),linkedAt:R()});H6.extend({chats:Zn(Z6)});ce({status:Au.optional(),assigneeAgentId:R().optional(),originRef:R().optional(),limit:Cf().int().min(1).max(100).default(20),cursor:R().optional()});const V6=qe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ce({taskId:R(),signal:V6,reason:R()});const Q6=qe(["active","suspended"]);ce({id:R(),username:R(),displayName:R(),avatarUrl:R().nullable(),status:Q6,createdAt:R(),updatedAt:R()});ce({username:R().min(1).max(100),displayName:R().min(1).max(200),password:R().min(8).max(200)});ce({displayName:R().min(1).max(200).optional(),password:R().min(8).max(200).optional()});ce({type:an("auth"),token:R().min(1)});const K6=ce({wsInboxDeliver:Yr().default(!1)}).partial();ce({type:an("server:welcome"),serverCommandVersion:R().min(1),serverTimeMs:Qe().int().nonnegative(),capabilities:K6.optional()}).passthrough();const QC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function G6(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 Y6=2e3,X6=3e4;let hi=null,lf=!1,xp=0,yu=null;const Rg=new Set;let gu=null,Ss=0;function J6(e){for(const t of Rg)try{t(e)}catch{}gu&&(e.type==="notification"?gu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(gu.invalidateQueries({queryKey:["activity"]}),gu.invalidateQueries({queryKey:["sessions"]})))}function KC(){const e=uy();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);hi=a,a.onmessage=l=>{if(a===hi)try{const o=JSON.parse(l.data);J6(o)}catch{}},a.onopen=()=>{a===hi&&(xp=0)},a.onclose=()=>{if(a!==hi||(hi=null,lf||Ss===0))return;xp++;const l=Math.min(Y6*2**(xp-1),X6);yu=setTimeout(()=>{yu=null,!lf&&Ss>0&&KC()},l)}}function W6(){lf=!0,yu&&(clearTimeout(yu),yu=null),hi&&(hi.close(1e3,"unmount"),hi=null)}function GC(e){const{onMessage:t,enabled:n=!0}=e??{},a=sn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{gu=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Rg.add(o),Ss++,Ss===1&&(lf=!1,KC()),()=>{Rg.delete(o),Ss--,Ss===0&&W6()}},[n])}const YC=x.createContext({aggregated:QC,agents:{},receivedAtMs:null,stale:!0});function eU({children:e}){const[t,n]=x.useState({aggregated:QC,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());GC({onMessage:c=>{const f=U6.safeParse(c);f.success&&n({aggregated:G6(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(YC.Provider,{value:o,children:e})}function tU(){return x.useContext(YC)}function nU(e){return Ne.get(`/admin/agents/${e}/config`)}function rU(e,t){return Ne.patch(`/admin/agents/${e}/config`,t)}function aU(e,t){return Ne.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function iU(e){return Ne.get(`/admin/agents/${e}/client-status`)}function lU({className:e,style:t,...n}){return u.jsx("div",{className:Te("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function sU({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 oU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function uU({children:e,mono:t}){return u.jsx("span",{className:Te("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const cU={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 Dr({tone:e="neutral",className:t,style:n,...a}){const l=cU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:Te("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})}function zg({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:Te("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 Tf({className:e,style:t,...n}){return u.jsx("span",{className:Te("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Ni({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:Te("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:Te("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:Te("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:Te("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function dU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function bl({state:e,className:t}){const n=e!==null&&dU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(Ni,{state:n,size:7}),n]})}function Ad({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 fU({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 hU(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(py,{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(wp,{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(wp,{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(wp,{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(Fs,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(mU,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(pU,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function wp(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 mU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsxs(en,{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(Nn,{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 pU({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(Wt,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsxs(en,{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(_t,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(Nn,{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"})]})]})]})})}var gU="Label",XC=x.forwardRef((e,t)=>u.jsx(Aa.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())}}));XC.displayName=gU;var yU=XC;const dt=x.forwardRef(({className:e,...t},n)=>u.jsx(yU,{ref:n,className:Te("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));dt.displayName="Label";const Vn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));Vn.displayName="Panel";const Ra=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("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}));Ra.displayName="PanelHeader";const za=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));za.displayName="PanelTitle";const Oa=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Oa.displayName="PanelBody";const vU={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 Uy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=vU[e],f=e==="deleted";return u.jsxs("div",{className:Te("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:Te("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(hz,{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(Vu,{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(Fs,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function bU(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(Vn,{children:[u.jsxs(Ra,{children:[u.jsxs(za,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Na,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Oa,{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===rf,y=m&&!h&&!!f.value.value,g=a.has(f.key);let b;return m?y&&g?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs(Uy,{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(zk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?u.jsx(OR,{className:"h-3.5 w-3.5"}):u.jsx(MR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(xU,{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 xU({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,y]=x.useState((n==null?void 0:n.sensitive)??!1),[g,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)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function w(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=rf),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{htmlFor:"env-key",children:"Key"}),u.jsx(_t,{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(dt,{htmlFor:"env-value",children:"Value"}),u.jsx(_t,{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=>y(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."}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(Nn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function wU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(Vn,{children:[u.jsxs(Ra,{children:[u.jsxs(za,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Na,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Oa,{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??af(l.value.url);return u.jsxs(Uy,{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(SU,{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 SU({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,y]=x.useState((n==null?void 0:n.localPath)??""),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function w(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const C=h.trim()||af(j);if(C&&a.has(C)){b(`Another repo already occupies local path "${C}".`);return}const E={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(E)}return u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{htmlFor:"git-url",children:"URL"}),u.jsx(_t,{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(dt,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(_t,{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(dt,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(_t,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:af(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."})]}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(Nn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function kU({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:Te("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:Te("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:y??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:Te("inline-flex items-baseline gap-1.5",o),style:c,title:y??void 0,children:[h&&u.jsx("span",{style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function Af(){return Ne.get("/members")}function jU(e,t){return Ne.patch(`/members/${encodeURIComponent(e)}`,t)}function CU(e){return Ne.delete(`/members/${encodeURIComponent(e)}`)}function JC(){const{data:e}=Fe({queryKey:["members","name-map"],queryFn:Af,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 EU({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=Gj(),o=JC(),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"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return u.jsxs(Vn,{children:[u.jsxs(Ra,{children:[u.jsx(za,{children:"Profile"}),e.status==="active"&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(Vu,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(Oa,{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]}),g&&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(kU,{name:g.name,displayName:g.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:y??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(Dr,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(Dr,{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(Dr,{tone:"outline",children:b},b))})]})]})]}),u.jsx(NU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function NU({agent:e,open:t,onOpenChange:n,onSave:a}){var U;const{memberId:l,role:o}=$t(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,w]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const C=e.type==="human",E=o==="admin"||e.managerId===l,A=Fe({queryKey:["agents-for-delegate"],queryFn:async()=>(await Gu({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&C});async function z(D){D.preventDefault(),j(null);const O=c.trim();if(!O){j("Display name is required.");return}w(!0);try{const P={displayName:O,delegateMention:m||null};y!==e.visibility&&(P.visibility=y),await a(P),n(!1)}catch(P){j(P instanceof Error?P.message:String(P))}finally{w(!1)}}return u.jsx(Wt,{open:t,onOpenChange:n,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:z,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{children:"Agent name"}),u.jsx(_t,{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(dt,{htmlFor:"id-display",children:"Display Name"}),u.jsx(_t,{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(dt,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:y,onChange:D=>g(D.target.value),disabled:!E,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:Sw.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:Sw.ORGANIZATION,children:"Organization — all members"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:E?"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."})]}),C&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{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"}),(U=A.data)==null?void 0:U.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(Nn,{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 _U(e){return e==="working"?"accent":e==="error"?"error":"outline"}function TU(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(Vn,{children:[u.jsxs(Ra,{children:[u.jsxs(za,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(Na,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Oa,{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(Uy,{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(Dr,{tone:_U(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:AU(l.value)})]},l.key)})}),t&&u.jsx(RU,{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 AU(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 RU({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,y]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,C]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((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:""),C(null))},[e,n]);function E(A){if(A.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){C("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){C(`Another MCP server is already named "${f}".`);return}let z;if(o==="stdio"){if(!h.trim()){C("stdio transport requires a command.");return}const U=g.trim().split(/\s+/).filter(D=>D.length>0);z={name:f,transport:"stdio",command:h.trim(),...U.length?{args:U}:{}}}else{const U=w.trim();try{new URL(U)}catch{C("URL is not valid.");return}z={name:f,transport:o,url:U}}l(z)}return u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:E,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{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(dt,{htmlFor:"mcp-name",children:"Name"}),u.jsx(_t,{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(dt,{htmlFor:"mcp-command",children:"Command"}),u.jsx(_t,{id:"mcp-command",value:h,onChange:A=>y(A.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(_t,{id:"mcp-args",value:g,onChange:A=>b(A.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{htmlFor:"mcp-url",children:"URL"}),u.jsx(_t,{id:"mcp-url",value:w,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(Nn,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const zU=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],OU=[{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"}],DU={"claude-code":zU,codex:OU},MU={"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."},IU={value:"",label:"(unset — inherits local)"};function LU({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=DU[o],m=x.useMemo(()=>{const h=[IU,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(Vn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Ra,{children:[u.jsxs(za,{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(Oa,{className:"space-y-2",children:[u.jsx(UU,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:MU[o]})]})]})}function UU({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),y=e.find(b=>b.value===t)??e[0],g=x.useCallback(()=>{const b=m.current;if(!b)return;const w=b.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var E,A;const C=j.target;(E=m.current)!=null&&E.contains(C)||(A=h.current)!=null&&A.contains(C)||o(!1)},w=j=>{var C;j.key==="Escape"&&(o(!1),(C=m.current)==null||C.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),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:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),u.jsx(Tk,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&by.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 w=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:w?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(Er,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"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 PU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const BU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$U=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FU={};function jw(e,t){return(FU.jsx?$U:BU).test(e)}const qU=/[ \t\n\f\r]/g;function HU(e){return typeof e=="object"?e.type==="text"?Cw(e.value):!1:Cw(e)}function Cw(e){return e.replace(qU,"")===""}class Yu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Yu.prototype.normal={};Yu.prototype.property={};Yu.prototype.space=void 0;function WC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Yu(n,a,t)}function Og(e){return e.toLowerCase()}class Yn{constructor(t,n){this.attribute=n,this.property=t}}Yn.prototype.attribute="";Yn.prototype.booleanish=!1;Yn.prototype.boolean=!1;Yn.prototype.commaOrSpaceSeparated=!1;Yn.prototype.commaSeparated=!1;Yn.prototype.defined=!1;Yn.prototype.mustUseProperty=!1;Yn.prototype.number=!1;Yn.prototype.overloadedBoolean=!1;Yn.prototype.property="";Yn.prototype.spaceSeparated=!1;Yn.prototype.space=void 0;let ZU=0;const Ve=Cl(),Xt=Cl(),Dg=Cl(),he=Cl(),Ct=Cl(),Cs=Cl(),ar=Cl();function Cl(){return 2**++ZU}const Mg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Xt,commaOrSpaceSeparated:ar,commaSeparated:Cs,number:he,overloadedBoolean:Dg,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),Sp=Object.keys(Mg);class Py extends Yn{constructor(t,n,a,l){let o=-1;if(super(t,n),Ew(this,"space",l),typeof a=="number")for(;++o<Sp.length;){const c=Sp[o];Ew(this,Sp[o],(a&Mg[c])===Mg[c])}}}Py.prototype.defined=!0;function Ew(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 Py(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Og(a)]=a,n[Og(o.attribute)]=a}return new Yu(t,n,e.space)}const eE=ro({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Xt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Xt,ariaFlowTo:Ct,ariaGrabbed:Xt,ariaHasPopup:null,ariaHidden:Xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:he,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:Ct,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Xt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tE(e,t){return t in e?e[t]:t}function nE(e,t){return tE(e,t.toLowerCase())}const VU=ro({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cs,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:Ct,autoFocus:Ve,autoPlay:Ve,blocking:Ct,capture:null,charSet:null,checked:Ve,cite:null,className:Ct,cols:he,colSpan:null,content:null,contentEditable:Xt,controls:Ve,controlsList:Ct,coords:he|Cs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Dg,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:Ct,height:he,hidden:Dg,high:he,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ve,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,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:he,pattern:null,ping:Ct,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:Ct,required:Ve,reversed:Ve,rows:he,rowSpan:he,sandbox:Ct,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Xt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,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:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Xt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:nE}),QU=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:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:Ct,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:Cs,g2:Cs,glyphName:Cs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:ar,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:ar,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ar,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,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:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tE}),rE=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()}}),aE=ro({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nE}),iE=ro({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),KU={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"},GU=/[A-Z]/g,Nw=/-[a-z]/g,YU=/^data[-\w.:]+$/i;function XU(e,t){const n=Og(t);let a=t,l=Yn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&YU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Nw,WU);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Nw.test(o)){let c=o.replace(GU,JU);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Py}return new l(a,t)}function JU(e){return"-"+e.toLowerCase()}function WU(e){return e.charAt(1).toUpperCase()}const eP=WC([eE,VU,rE,aE,iE],"html"),By=WC([eE,QU,rE,aE,iE],"svg");function tP(e){return e.join(" ").trim()}var ms={},kp,_w;function nP(){if(_w)return kp;_w=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=`
|
|
358
|
-
`,h="/",y="*",g="",b="comment",w="declaration";function k(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var A=1,z=1;function U(se){var re=se.match(t);re&&(A+=re.length);var Z=se.lastIndexOf(m);z=~Z?se.length-Z:z+se.length}function D(){var se={line:A,column:z};return function(re){return re.position=new O(se),V(),re}}function O(se){this.start=se,this.end={line:A,column:z},this.source=E.source}O.prototype.content=C;function P(se){var re=new Error(E.source+":"+A+":"+z+": "+se);if(re.reason=se,re.filename=E.source,re.line=A,re.column=z,re.source=C,!E.silent)throw re}function L(se){var re=se.exec(C);if(re){var Z=re[0];return U(Z),C=C.slice(Z.length),re}}function V(){L(n)}function F(se){var re;for(se=se||[];re=X();)re!==!1&&se.push(re);return se}function X(){var se=D();if(!(h!=C.charAt(0)||y!=C.charAt(1))){for(var re=2;g!=C.charAt(re)&&(y!=C.charAt(re)||h!=C.charAt(re+1));)++re;if(re+=2,g===C.charAt(re-1))return P("End of comment missing");var Z=C.slice(2,re-2);return z+=2,U(Z),C=C.slice(re),z+=2,se({type:b,comment:Z})}}function ee(){var se=D(),re=L(a);if(re){if(X(),!L(l))return P("property missing ':'");var Z=L(o),te=se({type:w,property:j(re[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return L(c),te}}function we(){var se=[];F(se);for(var re;re=ee();)re!==!1&&(se.push(re),F(se));return se}return V(),we()}function j(C){return C?C.replace(f,g):g}return kp=k,kp}var Tw;function rP(){if(Tw)return ms;Tw=1;var e=ms&&ms.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ms,"__esModule",{value:!0}),ms.default=n;const t=e(nP());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:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return ms}var uu={},Aw;function aP(){if(Aw)return uu;Aw=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.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,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,c))};return uu.camelCase=m,uu}var cu,Rw;function iP(){if(Rw)return cu;Rw=1;var e=cu&&cu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(rP()),n=aP();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,cu=a,cu}var lP=iP();const sP=df(lP),lE=sE("end"),$y=sE("start");function sE(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 oP(e){const t=$y(e),n=lE(e);if(t&&n)return{start:t,end:n}}function vu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?zw(e.position):"start"in e||"end"in e?zw(e):"line"in e||"column"in e?Ig(e):""}function Ig(e){return Ow(e&&e.line)+":"+Ow(e&&e.column)}function zw(e){return Ig(e&&e.start)+"-"+Ig(e&&e.end)}function Ow(e){return e&&typeof e=="number"?e:1}class _n 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=vu(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}}_n.prototype.file="";_n.prototype.name="";_n.prototype.reason="";_n.prototype.message="";_n.prototype.stack="";_n.prototype.column=void 0;_n.prototype.line=void 0;_n.prototype.ancestors=void 0;_n.prototype.cause=void 0;_n.prototype.fatal=void 0;_n.prototype.place=void 0;_n.prototype.ruleId=void 0;_n.prototype.source=void 0;const Fy={}.hasOwnProperty,uP=new Map,cP=/[A-Z]/g,dP=new Set(["table","tbody","thead","tfoot","tr"]),fP=new Set(["td","th"]),oE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hP(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=wP(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=xP(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"?By:eP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=uE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function uE(e,t,n){if(t.type==="element")return mP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yP(e,t,n);if(t.type==="mdxjsEsm")return gP(e,t);if(t.type==="root")return vP(e,t,n);if(t.type==="text")return bP(e,t)}function mP(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=By,e.schema=l),e.ancestors.push(t);const o=dE(e,t.tagName,!1),c=SP(e,t);let f=Hy(e,t);return dP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!HU(m):!0})),cE(e,c,o,t),qy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function pP(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)}Ru(e,t.position)}function gP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ru(e,t.position)}function yP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=By,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:dE(e,t.name,!0),c=kP(e,t),f=Hy(e,t);return cE(e,c,o,t),qy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function vP(e,t,n){const a={};return qy(a,Hy(e,t)),e.create(t,e.Fragment,a,n)}function bP(e,t){return t.value}function cE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function qy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function xP(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 wP(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=$y(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 SP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Fy.call(t.properties,l)){const o=jP(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&fP.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 kP(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 Ru(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 Ru(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function Hy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:uP;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=uE(e,o,c);f!==void 0&&n.push(f)}return n}function jP(e,t,n){const a=XU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?PU(n):tP(n)),a.property==="style"){let l=typeof n=="object"?n:CP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=EP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?KU[a.property]||a.property:a.attribute,n]}}function CP(e,t){try{return sP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new _n("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=oE+"#cannot-parse-style-attribute",l}}function dE(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=jw(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=jw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Fy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Ru(e)}function Ru(e,t){const n=new _n("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=oE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function EP(e){const t={};let n;for(n in e)Fy.call(e,n)&&(t[NP(n)]=e[n]);return t}function NP(e){let t=e.replace(cP,_P);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _P(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"]},TP={};function Zy(e,t){const n=TP,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return fE(e,a,l)}function fE(e,t,n){if(AP(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 Dw(e.children,t,n)}return Array.isArray(e)?Dw(e,t,n):""}function Dw(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=fE(e[l],t,n);return a.join("")}function AP(e){return!!(e&&typeof e=="object")}const Mw=document.createElement("i");function Vy(e){const t="&"+e+";";Mw.innerHTML=t;const n=Mw.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 Iw={}.hasOwnProperty;function hE(e){const t={};let n=-1;for(;++n<e.length;)RP(t,e[n]);return t}function RP(e,t){let n;for(n in t){const l=(Iw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Iw.call(l,c)||(l[c]=[]);const f=o[c];zP(l[c],Array.isArray(f)?f:f?[f]:[])}}}function zP(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 mE(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 Ir(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zn=Mi(/[A-Za-z]/),En=Mi(/[\dA-Za-z]/),OP=Mi(/[#-'*+\--9=?A-Z^-~]/);function sf(e){return e!==null&&(e<32||e===127)}const Lg=Mi(/\d/),DP=Mi(/[\dA-Fa-f]/),MP=Mi(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const Rf=Mi(new RegExp("\\p{P}|\\p{S}","u")),xl=Mi(/\s/);function Mi(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 ot(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return et(m)?(e.enter(n),f(m)):t(m)}function f(m){return et(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const IP={tokenize:LP};function LP(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"),ot(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 Oe(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const UP={tokenize:PP},Lw={tokenize:BP};function PP(e){const t=this,n=[];let a=0,l,o,c;return f;function f(z){if(a<n.length){const U=n[a];return t.containerState=U[1],e.attempt(U[0].continuation,m,h)(z)}return h(z)}function m(z){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const U=t.events.length;let D=U,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}E(a);let P=U;for(;P<t.events.length;)t.events[P][1].end={...O},P++;return or(t.events,D+1,0,t.events.slice(U)),t.events.length=P,h(z)}return f(z)}function h(z){if(a===n.length){if(!l)return b(z);if(l.currentConstruct&&l.currentConstruct.concrete)return k(z);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Lw,y,g)(z)}function y(z){return l&&A(),E(a),b(z)}function g(z){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(z)}function b(z){return t.containerState={},e.attempt(Lw,w,k)(z)}function w(z){return a++,n.push([t.currentConstruct,t.containerState]),b(z)}function k(z){if(z===null){l&&A(),E(0),e.consume(z);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(z)}function j(z){if(z===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(z);return}return Oe(z)?(e.consume(z),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(z),j)}function C(z,U){const D=t.sliceStream(z);if(U&&D.push(null),z.previous=o,o&&(o.next=z),o=z,l.defineSkip(z.start),l.write(D),t.parser.lazy[z.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<c&&(!l.events[O][1].end||l.events[O][1].end.offset>c))return;const P=t.events.length;let L=P,V,F;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(V){F=t.events[L][1].end;break}V=!0}for(E(a),O=P;O<t.events.length;)t.events[O][1].end={...F},O++;or(t.events,L+1,0,t.events.slice(P)),t.events.length=O}}function E(z){let U=n.length;for(;U-- >z;){const D=n[U];t.containerState=D[1],D[0].exit.call(t,e)}n.length=z}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function BP(e,t,n){return ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zs(e){if(e===null||jt(e)||xl(e))return 1;if(Rf(e))return 2}function zf(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 Ug={name:"attention",resolveAll:$P,tokenize:FP};function $P(e,t){let n=-1,a,l,o,c,f,m,h,y;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 g={...e[a][1].end},b={...e[n][1].start};Uw(g,-m),Uw(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,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,zf(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?(y=2,h=jr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,or(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function FP(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Zs(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"),y=Zs(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function Uw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const qP={name:"autolink",tokenize:HP};function HP(e,t,n){let a=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return zn(w)?(e.consume(w),c):w===64?n(w):h(w)}function c(w){return w===43||w===45||w===46||En(w)?(a=1,f(w)):h(w)}function f(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||En(w))&&a++<32?(e.consume(w),f):(a=0,h(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||sf(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):OP(w)?(e.consume(w),h):n(w)}function y(w){return En(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):b(w)}function b(w){if((w===45||En(w))&&a++<63){const k=w===45?b:g;return e.consume(w),k}return n(w)}}const Xu={partial:!0,tokenize:ZP};function ZP(e,t,n){return a;function a(o){return et(o)?ot(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Oe(o)?t(o):n(o)}}const pE={continuation:{tokenize:QP},exit:KP,name:"blockQuote",tokenize:VP};function VP(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 et(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function QP(e,t,n){const a=this;return l;function l(c){return et(c)?ot(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(pE,t,n)(c)}}function KP(e){e.exit("blockQuote")}const gE={name:"characterEscape",tokenize:GP};function GP(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 MP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const yE={name:"characterReference",tokenize:YP};function YP(e,t,n){const a=this;let l=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=En,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=DP,y):(e.enter("characterReferenceValue"),o=7,c=Lg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===En&&!Vy(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const Pw={partial:!0,tokenize:JP},Bw={concrete:!0,name:"codeFenced",tokenize:XP};function XP(e,t,n){const a=this,l={partial:!0,tokenize:D};let o=0,c=0,f;return m;function m(O){return h(O)}function h(O){const P=a.events[a.events.length-1];return o=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===f?(c++,e.consume(O),y):c<3?n(O):(e.exit("codeFencedFenceSequence"),et(O)?ot(e,g,"whitespace")(O):g(O))}function g(O){return O===null||Oe(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(Pw,j,U)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ot(e,w,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),b)}function w(O){return O===null||Oe(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||Oe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===f?n(O):(e.consume(O),k)}function j(O){return e.attempt(l,U,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&et(O)?ot(e,A,"linePrefix",o+1)(O):A(O)}function A(O){return O===null||Oe(O)?e.check(Pw,j,U)(O):(e.enter("codeFlowValue"),z(O))}function z(O){return O===null||Oe(O)?(e.exit("codeFlowValue"),A(O)):(e.consume(O),z)}function U(O){return e.exit("codeFenced"),t(O)}function D(O,P,L){let V=0;return F;function F(re){return O.enter("lineEnding"),O.consume(re),O.exit("lineEnding"),X}function X(re){return O.enter("codeFencedFence"),et(re)?ot(O,ee,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):ee(re)}function ee(re){return re===f?(O.enter("codeFencedFenceSequence"),we(re)):L(re)}function we(re){return re===f?(V++,O.consume(re),we):V>=c?(O.exit("codeFencedFenceSequence"),et(re)?ot(O,se,"whitespace")(re):se(re)):L(re)}function se(re){return re===null||Oe(re)?(O.exit("codeFencedFence"),P(re)):L(re)}}}function JP(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:e9},WP={partial:!0,tokenize:t9};function e9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),ot(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):Oe(h)?e.attempt(WP,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Oe(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function t9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Oe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):ot(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):Oe(c)?l(c):n(c)}}const n9={name:"codeText",previous:a9,resolve:r9,tokenize:i9};function r9(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 a9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function i9(e,t,n){let a=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):Oe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Oe(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class l9{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&&du(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),du(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),du(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);du(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);du(this.left,n.reverse())}}}function du(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 vE(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new l9(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.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,s9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.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={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return or(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function s9(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 y,g,b=-1,w=n,k=0,j=0;const C=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=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,C.push(j),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):C.pop(),b=C.length;b--;){const E=f.slice(C[b],C[b+1]),A=o.pop();m.push([A,A+E.length-1]),e.splice(A,2,E)}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 o9={resolve:c9,tokenize:d9},u9={partial:!0,tokenize:f9};function c9(e){return vE(e),e}function d9(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):Oe(f)?e.check(u9,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 f9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ot(e,o,"linePrefix")}function o(c){if(c===null||Oe(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 bE(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(E),e.exit(o),b):E===null||E===32||E===41||sf(E)?n(E):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function b(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===62?(e.exit("chunkString"),e.exit(f),b(E)):E===null||E===60||Oe(E)?n(E):(e.consume(E),E===92?k:w)}function k(E){return E===60||E===62||E===92?(e.consume(E),w):w(E)}function j(E){return!y&&(E===null||E===41||jt(E))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(E)):y<h&&E===40?(e.consume(E),y++,j):E===41?(e.consume(E),y--,j):E===null||E===32||E===40||sf(E)?n(E):(e.consume(E),E===92?C:j)}function C(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function xE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Oe(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!et(w)),w===92?b:g)}function b(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function wE(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):Oe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ot(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||Oe(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===c||b===92?(e.consume(b),y):y(b)}}function bu(e,t){let n;return a;function a(l){return Oe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):et(l)?ot(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const h9={name:"definition",tokenize:p9},m9={partial:!0,tokenize:g9};function p9(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),c(w)}function c(w){return xE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Ir(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return jt(w)?bu(e,h)(w):h(w)}function h(w){return bE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(m9,g,g)(w)}function g(w){return et(w)?ot(e,b,"whitespace")(w):b(w)}function b(w){return w===null||Oe(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function g9(e,t,n){return a;function a(f){return jt(f)?bu(e,l)(f):n(f)}function l(f){return wE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return et(f)?ot(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Oe(f)?t(f):n(f)}}const y9={name:"hardBreakEscape",tokenize:v9};function v9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const b9={name:"headingAtx",resolve:x9,tokenize:w9};function x9(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 w9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||jt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Oe(y)?(e.exit("atxHeading"),t(y)):et(y)?ot(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||jt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const S9=["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"],$w=["pre","script","style","textarea"],k9={concrete:!0,name:"htmlFlow",resolveTo:E9,tokenize:N9},j9={partial:!0,tokenize:T9},C9={partial:!0,tokenize:_9};function E9(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 N9(e,t,n){const a=this;let l,o,c,f,m;return h;function h(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),b):T===47?(e.consume(T),o=!0,j):T===63?(e.consume(T),l=3,a.interrupt?t:_):zn(T)?(e.consume(T),c=String.fromCharCode(T),C):n(T)}function b(T){return T===45?(e.consume(T),l=2,w):T===91?(e.consume(T),l=5,f=0,k):zn(T)?(e.consume(T),l=4,a.interrupt?t:_):n(T)}function w(T){return T===45?(e.consume(T),a.interrupt?t:_):n(T)}function k(T){const q="CDATA[";return T===q.charCodeAt(f++)?(e.consume(T),f===q.length?a.interrupt?t:ee:k):n(T)}function j(T){return zn(T)?(e.consume(T),c=String.fromCharCode(T),C):n(T)}function C(T){if(T===null||T===47||T===62||jt(T)){const q=T===47,Y=c.toLowerCase();return!q&&!o&&$w.includes(Y)?(l=1,a.interrupt?t(T):ee(T)):S9.includes(c.toLowerCase())?(l=6,q?(e.consume(T),E):a.interrupt?t(T):ee(T)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):o?A(T):z(T))}return T===45||En(T)?(e.consume(T),c+=String.fromCharCode(T),C):n(T)}function E(T){return T===62?(e.consume(T),a.interrupt?t:ee):n(T)}function A(T){return et(T)?(e.consume(T),A):F(T)}function z(T){return T===47?(e.consume(T),F):T===58||T===95||zn(T)?(e.consume(T),U):et(T)?(e.consume(T),z):F(T)}function U(T){return T===45||T===46||T===58||T===95||En(T)?(e.consume(T),U):D(T)}function D(T){return T===61?(e.consume(T),O):et(T)?(e.consume(T),D):z(T)}function O(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),m=T,P):et(T)?(e.consume(T),O):L(T)}function P(T){return T===m?(e.consume(T),m=null,V):T===null||Oe(T)?n(T):(e.consume(T),P)}function L(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||jt(T)?D(T):(e.consume(T),L)}function V(T){return T===47||T===62||et(T)?z(T):n(T)}function F(T){return T===62?(e.consume(T),X):n(T)}function X(T){return T===null||Oe(T)?ee(T):et(T)?(e.consume(T),X):n(T)}function ee(T){return T===45&&l===2?(e.consume(T),Z):T===60&&l===1?(e.consume(T),te):T===62&&l===4?(e.consume(T),I):T===63&&l===3?(e.consume(T),_):T===93&&l===5?(e.consume(T),Ae):Oe(T)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(j9,B,we)(T)):T===null||Oe(T)?(e.exit("htmlFlowData"),we(T)):(e.consume(T),ee)}function we(T){return e.check(C9,se,B)(T)}function se(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),re}function re(T){return T===null||Oe(T)?we(T):(e.enter("htmlFlowData"),ee(T))}function Z(T){return T===45?(e.consume(T),_):ee(T)}function te(T){return T===47?(e.consume(T),c="",ye):ee(T)}function ye(T){if(T===62){const q=c.toLowerCase();return $w.includes(q)?(e.consume(T),I):ee(T)}return zn(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),ye):ee(T)}function Ae(T){return T===93?(e.consume(T),_):ee(T)}function _(T){return T===62?(e.consume(T),I):T===45&&l===2?(e.consume(T),_):ee(T)}function I(T){return T===null||Oe(T)?(e.exit("htmlFlowData"),B(T)):(e.consume(T),I)}function B(T){return e.exit("htmlFlow"),t(T)}}function _9(e,t,n){const a=this;return l;function l(c){return Oe(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 T9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Xu,t,n)}}const A9={name:"htmlText",tokenize:R9};function R9(e,t,n){const a=this;let l,o,c;return f;function f(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),m}function m(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),D):_===63?(e.consume(_),z):zn(_)?(e.consume(_),L):n(_)}function h(_){return _===45?(e.consume(_),y):_===91?(e.consume(_),o=0,k):zn(_)?(e.consume(_),A):n(_)}function y(_){return _===45?(e.consume(_),w):n(_)}function g(_){return _===null?n(_):_===45?(e.consume(_),b):Oe(_)?(c=g,te(_)):(e.consume(_),g)}function b(_){return _===45?(e.consume(_),w):g(_)}function w(_){return _===62?Z(_):_===45?b(_):g(_)}function k(_){const I="CDATA[";return _===I.charCodeAt(o++)?(e.consume(_),o===I.length?j:k):n(_)}function j(_){return _===null?n(_):_===93?(e.consume(_),C):Oe(_)?(c=j,te(_)):(e.consume(_),j)}function C(_){return _===93?(e.consume(_),E):j(_)}function E(_){return _===62?Z(_):_===93?(e.consume(_),E):j(_)}function A(_){return _===null||_===62?Z(_):Oe(_)?(c=A,te(_)):(e.consume(_),A)}function z(_){return _===null?n(_):_===63?(e.consume(_),U):Oe(_)?(c=z,te(_)):(e.consume(_),z)}function U(_){return _===62?Z(_):z(_)}function D(_){return zn(_)?(e.consume(_),O):n(_)}function O(_){return _===45||En(_)?(e.consume(_),O):P(_)}function P(_){return Oe(_)?(c=P,te(_)):et(_)?(e.consume(_),P):Z(_)}function L(_){return _===45||En(_)?(e.consume(_),L):_===47||_===62||jt(_)?V(_):n(_)}function V(_){return _===47?(e.consume(_),Z):_===58||_===95||zn(_)?(e.consume(_),F):Oe(_)?(c=V,te(_)):et(_)?(e.consume(_),V):Z(_)}function F(_){return _===45||_===46||_===58||_===95||En(_)?(e.consume(_),F):X(_)}function X(_){return _===61?(e.consume(_),ee):Oe(_)?(c=X,te(_)):et(_)?(e.consume(_),X):V(_)}function ee(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,we):Oe(_)?(c=ee,te(_)):et(_)?(e.consume(_),ee):(e.consume(_),se)}function we(_){return _===l?(e.consume(_),l=void 0,re):_===null?n(_):Oe(_)?(c=we,te(_)):(e.consume(_),we)}function se(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||jt(_)?V(_):(e.consume(_),se)}function re(_){return _===47||_===62||jt(_)?V(_):n(_)}function Z(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function te(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ye}function ye(_){return et(_)?ot(e,Ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Ae(_)}function Ae(_){return e.enter("htmlTextData"),c(_)}}const Qy={name:"labelEnd",resolveAll:M9,resolveTo:I9,tokenize:L9},z9={tokenize:U9},O9={tokenize:P9},D9={tokenize:B9};function M9(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 I9(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}},y={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",y,t]]),f=jr(f,zf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=jr(f,[["exit",y,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 L9(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?g(b):(c=a.parser.defined.includes(Ir(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(z9,y,c?y:g)(b):b===91?e.attempt(O9,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(D9,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function U9(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return jt(g)?bu(e,o)(g):o(g)}function o(g){return g===41?y(g):bE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return jt(g)?bu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?wE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return jt(g)?bu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function P9(e,t,n){const a=this;return l;function l(f){return xE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Ir(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function B9(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 $9={name:"labelStartImage",resolveAll:Qy.resolveAll,tokenize:F9};function F9(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 q9={name:"labelStartLink",resolveAll:Qy.resolveAll,tokenize:H9};function H9(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:Z9};function Z9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ot(e,t,"linePrefix")}}const Zd={name:"thematicBreak",tokenize:V9};function V9(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||Oe(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),et(h)?ot(e,f,"whitespace")(h):f(h))}}const Fn={continuation:{tokenize:Y9},exit:J9,name:"list",tokenize:G9},Q9={partial:!0,tokenize:W9},K9={partial:!0,tokenize:X9};function G9(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(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Lg(w)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Zd,n,h)(w):h(w);if(!a.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return n(w)}function m(w){return Lg(w)&&++c<10?(e.consume(w),m):(!a.interrupt||c<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(Xu,a.interrupt?n:y,e.attempt(Q9,b,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,b(w)}function g(w){return et(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),b):n(w)}function b(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function Y9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Xu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ot(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!et(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(K9,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,ot(e,e.attempt(Fn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function X9(e,t,n){const a=this;return ot(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 J9(e){e.exit(this.containerState.type)}function W9(e,t,n){const a=this;return ot(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!et(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Fw={name:"setextUnderline",resolveTo:e8,tokenize:t8};function e8(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 t8(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(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"),et(h)?ot(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Oe(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const n8={tokenize:r8};function r8(e){const t=this,n=e.attempt(Xu,a,e.attempt(this.parser.constructs.flowInitial,l,ot(e,e.attempt(this.parser.constructs.flow,l,e.attempt(o9,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 a8={resolveAll:kE()},i8=SE("string"),l8=SE("text");function SE(e){return{resolveAll:kE(e==="text"?s8: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(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const w=g[b];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function kE(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 s8(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 o8={42:Fn,43:Fn,45:Fn,48:Fn,49:Fn,50:Fn,51:Fn,52:Fn,53:Fn,54:Fn,55:Fn,56:Fn,57:Fn,62:pE},u8={91:h9},c8={[-2]:Cp,[-1]:Cp,32:Cp},d8={35:b9,42:Zd,45:[Fw,Zd],60:k9,61:Fw,95:Zd,96:Bw,126:Bw},f8={38:yE,92:gE},h8={[-5]:Ep,[-4]:Ep,[-3]:Ep,33:$9,38:yE,42:Ug,60:[qP,A9],91:q9,92:[y9,gE],93:Qy,95:Ug,96:n9},m8={null:[Ug,a8]},p8={null:[42,95]},g8={null:[]},y8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:p8,contentInitial:u8,disable:g8,document:o8,flow:d8,flowInitial:c8,insideSpan:m8,string:f8,text:h8},Symbol.toStringTag,{value:"Module"}));function v8(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:P(D),check:P(O),consume:A,enter:z,exit:U,interrupt:P(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(X){return c=jr(c,X),C(),c[c.length-1]!==null?[]:(L(t,0),h.events=zf(o,h.events,h),h.events)}function b(X,ee){return x8(w(X),ee)}function w(X){return b8(c,X)}function k(){const{_bufferIndex:X,_index:ee,line:we,column:se,offset:re}=a;return{_bufferIndex:X,_index:ee,line:we,column:se,offset:re}}function j(X){l[X.line]=X.column,F()}function C(){let X;for(;a._index<c.length;){const ee=c[a._index];if(typeof ee=="string")for(X=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===X&&a._bufferIndex<ee.length;)E(ee.charCodeAt(a._bufferIndex));else E(ee)}}function E(X){y=y(X)}function A(X){Oe(X)?(a.line++,a.column=1,a.offset+=X===-3?2:1,F()):X!==-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=X}function z(X,ee){const we=ee||{};return we.type=X,we.start=k(),h.events.push(["enter",we,h]),f.push(we),we}function U(X){const ee=f.pop();return ee.end=k(),h.events.push(["exit",ee,h]),ee}function D(X,ee){L(X,ee.from)}function O(X,ee){ee.restore()}function P(X,ee){return we;function we(se,re,Z){let te,ye,Ae,_;return Array.isArray(se)?B(se):"tokenize"in se?B([se]):I(se);function I(ue){return ve;function ve(be){const fe=be!==null&&ue[be],Ge=be!==null&&ue.null,Ie=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return B(Ie)(be)}}function B(ue){return te=ue,ye=0,ue.length===0?Z:T(ue[ye])}function T(ue){return ve;function ve(be){return _=V(),Ae=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?Y():ue.tokenize.call(ee?Object.assign(Object.create(h),ee):h,m,q,Y)(be)}}function q(ue){return X(Ae,_),re}function Y(ue){return _.restore(),++ye<te.length?T(te[ye]):Z}}}function L(X,ee){X.resolveAll&&!o.includes(X)&&o.push(X),X.resolve&&or(h.events,ee,h.events.length-ee,X.resolve(h.events.slice(ee),h)),X.resolveTo&&(h.events=X.resolveTo(h.events,h))}function V(){const X=k(),ee=h.previous,we=h.currentConstruct,se=h.events.length,re=Array.from(f);return{from:se,restore:Z};function Z(){a=X,h.previous=ee,h.currentConstruct=we,h.events.length=se,f=re,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function b8(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 x8(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=`
|
|
359
|
-
`;break}case-3:{c=`\r
|
|
360
|
-
`;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 w8(e){const a={constructs:hE([y8,...(e||{}).extensions||[]]),content:l(IP),defined:[],document:l(UP),flow:l(n8),lazy:{},string:l(i8),text:l(l8)};return a;function l(o){return c;function c(f){return v8(a,o,f)}}}function S8(e){for(;!vE(e););return e}const qw=/[\0\t\n\r]/g;function k8(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(qw.lastIndex=g,h=qw.exec(o),b=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(b),!h){t=o.slice(g);break}if(w===10&&g===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),w){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const j8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function C8(e){return e.replace(j8,E8)}function E8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return mE(n.slice(o?2:1),o?16:10)}return Vy(n)||e}const jE={}.hasOwnProperty;function N8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_8(n)(S8(w8(n).document().write(k8()(e,t,!0))))}function _8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ma),autolinkProtocol:V,autolinkEmail:V,atxHeading:o(Pe),blockQuote:o(Ge),characterEscape:V,characterReference:V,codeFenced:o(Ie),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Ie,c),codeText:o(ne,c),codeTextData:V,data:V,codeFlowValue:V,definition:o(je),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Le),hardBreakEscape:o(It),hardBreakTrailing:o(It),htmlFlow:o(dn,c),htmlFlowData:V,htmlText:o(dn,c),htmlTextData:V,image:o(El),label:c,link:o(Ma),listItem:o(Jr),listItemValue:b,listOrdered:o(Ia,g),listUnordered:o(Ia),paragraph:o(oo),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Pe),strong:o(uo),thematicBreak:o(co)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:fe,autolinkProtocol:be,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:ue,characterReference:ve,codeFenced:m(C),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(E),codeText:m(re),codeTextData:F,data:F,definition:m(),definitionDestinationString:U,definitionLabelString:A,definitionTitleString:z,emphasis:m(),hardBreakEscape:m(ee),hardBreakTrailing:m(ee),htmlFlow:m(we),htmlFlowData:F,htmlText:m(se),htmlTextData:F,image:m(te),label:Ae,labelText:ye,lineEnding:X,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:q,resourceDestinationString:_,resourceTitleString:I,resource:B,setextHeading:m(L),setextHeadingLineSequence:P,setextHeadingText:O,strong:m(),thematicBreak:m()}};CE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ie){let ge={type:"root",children:[]};const Ue={stack:[ge],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},Be=[];let at=-1;for(;++at<ie.length;)if(ie[at][1].type==="listOrdered"||ie[at][1].type==="listUnordered")if(ie[at][0]==="enter")Be.push(at);else{const hn=Be.pop();at=l(ie,hn,at)}for(at=-1;++at<ie.length;){const hn=t[ie[at][0]];jE.call(hn,ie[at][1].type)&&hn[ie[at][1].type].call(Object.assign({sliceSerialize:ie[at][2].sliceSerialize},Ue),ie[at][1])}if(Ue.tokenStack.length>0){const hn=Ue.tokenStack[Ue.tokenStack.length-1];(hn[1]||Hw).call(Ue,void 0,hn[0])}for(ge.position={start:ci(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:ci(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)ge=t.transforms[at](ge)||ge;return ge}function l(ie,ge,Ue){let Be=ge-1,at=-1,hn=!1,cr,tn,qt,mn;for(;++Be<=Ue;){const ht=ie[Be];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?at++:at--,mn=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(cr&&!mn&&!at&&!qt&&(qt=Be),mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mn=void 0}if(!at&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||at===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(cr){let Tr=Be;for(tn=void 0;Tr--;){const Dn=ie[Tr];if(Dn[1].type==="lineEnding"||Dn[1].type==="lineEndingBlank"){if(Dn[0]==="exit")continue;tn&&(ie[tn][1].type="lineEndingBlank",hn=!0),Dn[1].type="lineEnding",tn=Tr}else if(!(Dn[1].type==="linePrefix"||Dn[1].type==="blockQuotePrefix"||Dn[1].type==="blockQuotePrefixWhitespace"||Dn[1].type==="blockQuoteMarker"||Dn[1].type==="listItemIndent"))break}qt&&(!tn||qt<tn)&&(cr._spread=!0),cr.end=Object.assign({},tn?ie[tn][1].start:ht[1].end),ie.splice(tn||Be,0,["exit",cr,ht[2]]),Be++,Ue++}if(ht[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};cr=Tr,ie.splice(Be,0,["enter",Tr,ht[2]]),Be++,Ue++,qt=void 0,mn=!0}}}return ie[ge][1]._spread=hn,Ue}function o(ie,ge){return Ue;function Ue(Be){f.call(this,ie(Be),Be),ge&&ge.call(this,Be)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ie,ge,Ue){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ge,Ue||void 0]),ie.position={start:ci(ge.start),end:void 0}}function m(ie){return ge;function ge(Ue){ie&&ie.call(this,Ue),h.call(this,Ue)}}function h(ie,ge){const Ue=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==ie.type&&(ge?ge.call(this,ie,Be[0]):(Be[1]||Hw).call(this,ie,Be[0]));else throw new Error("Cannot close `"+ie.type+"` ("+vu({start:ie.start,end:ie.end})+"): it’s not open");Ue.position.end=ci(ie.end)}function y(){return Zy(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(ie){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ie}function k(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ie}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie.replace(/(\r?\n|\r)$/g,"")}function A(ie){const ge=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ge,Ue.identifier=Ir(this.sliceSerialize(ie)).toLowerCase()}function z(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ie}function U(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ie}function D(ie){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Ue=this.sliceSerialize(ie).length;ge.depth=Ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function P(ie){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function V(ie){const Ue=this.stack[this.stack.length-1].children;let Be=Ue[Ue.length-1];(!Be||Be.type!=="text")&&(Be=fn(),Be.position={start:ci(ie.start),end:void 0},Ue.push(Be)),this.stack.push(Be)}function F(ie){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ie),ge.position.end=ci(ie.end)}function X(ie){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=ge.children[ge.children.length-1];Ue.position.end=ci(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(V.call(this,ie),F.call(this,ie))}function ee(){this.data.atHardBreak=!0}function we(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie}function se(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie}function re(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie}function Z(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ge,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function te(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ge,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ye(ie){const ge=this.sliceSerialize(ie),Ue=this.stack[this.stack.length-2];Ue.label=C8(ge),Ue.identifier=Ir(ge).toLowerCase()}function Ae(){const ie=this.stack[this.stack.length-1],ge=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const Be=ie.children;Ue.children=Be}else Ue.alt=ge}function _(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ie}function I(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ie}function B(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function q(ie){const ge=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ge,Ue.identifier=Ir(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function Y(ie){this.data.characterReferenceType=ie.type}function ue(ie){const ge=this.sliceSerialize(ie),Ue=this.data.characterReferenceType;let Be;Ue?(Be=mE(ge,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Vy(ge);const at=this.stack[this.stack.length-1];at.value+=Be}function ve(ie){const ge=this.stack.pop();ge.position.end=ci(ie.end)}function be(ie){F.call(this,ie);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ie)}function fe(ie){F.call(this,ie);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ie)}function Ge(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function ne(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function Pe(){return{type:"heading",depth:0,children:[]}}function It(){return{type:"break"}}function dn(){return{type:"html",value:""}}function El(){return{type:"image",title:null,url:"",alt:null}}function Ma(){return{type:"link",title:null,url:"",children:[]}}function Ia(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Jr(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function oo(){return{type:"paragraph",children:[]}}function uo(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function co(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function CE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?CE(e,a):T8(e,a)}}function T8(e,t){let n;for(n in t)if(jE.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 Hw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vu({start:t.start,end:t.end})+") is still open")}function A8(e){const t=this;t.parser=n;function n(a){return N8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function R8(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 z8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
361
|
-
`}]}function O8(e,t){const n=t.value?t.value+`
|
|
362
|
-
`:"",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 D8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function M8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I8(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 L8(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 U8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function EE(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 P8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return EE(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 B8(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 $8(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 F8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return EE(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 q8(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 H8(e,t,n){const a=e.all(t),l=n?Z8(n):NE(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.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 y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
|
|
363
|
-
`}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
364
|
-
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function Z8(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=NE(n[a])}return t}function NE(e){const t=e.spread;return t??e.children.length>1}function V8(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 Q8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function G8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y8(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=$y(t.children[1]),m=lE(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 X8(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 g=t.children[m],b={},w=c?c[m]:void 0;w&&(b.align=w);let k={type:"element",tagName:o,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function J8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Zw=9,Vw=32;function W8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(Qw(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(Qw(t.slice(l),l>0,!1)),o.join("")}function Qw(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Zw||o===Vw;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Zw||o===Vw;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function eB(e,t){const n={type:"text",value:W8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const nB={blockquote:R8,break:z8,code:O8,delete:D8,emphasis:M8,footnoteReference:I8,heading:L8,html:U8,imageReference:P8,image:B8,inlineCode:$8,linkReference:F8,link:q8,listItem:H8,list:V8,paragraph:Q8,root:K8,strong:G8,table:Y8,tableCell:J8,tableRow:X8,text:eB,thematicBreak:tB,toml:Rd,yaml:Rd,definition:Rd,footnoteDefinition:Rd};function Rd(){}const _E=-1,Of=0,xu=1,of=2,Ky=3,Gy=4,Yy=5,Xy=6,TE=7,AE=8,Kw=typeof self=="object"?self:globalThis,rB=(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 Of:case _E:return n(c,l);case xu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case of:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case Ky:return n(new Date(c),l);case Gy:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case Yy:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case Xy:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case TE:{const{name:f,message:m}=c;return n(new Kw[f](m),l)}case AE: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 Kw[o](c),l)};return a},Gw=e=>rB(new Map,e)(0),ps="",{toString:aB}={},{keys:iB}=Object,fu=e=>{const t=typeof e;if(t!=="object"||!e)return[Of,t];const n=aB.call(e).slice(8,-1);switch(n){case"Array":return[xu,ps];case"Object":return[of,ps];case"Date":return[Ky,ps];case"RegExp":return[Gy,ps];case"Map":return[Yy,ps];case"Set":return[Xy,ps];case"DataView":return[xu,n]}return n.includes("Array")?[xu,n]:n.includes("Error")?[TE,n]:[of,n]},zd=([e,t])=>e===Of&&(t==="function"||t==="symbol"),lB=(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]=fu(c);switch(f){case Of:{let y=c;switch(m){case"bigint":f=AE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([_E],c)}return l([f,y],c)}case xu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const y=[],g=l([f,y],c);for(const b of c)y.push(o(b));return g}case of:{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 y=[],g=l([f,y],c);for(const b of iB(c))(e||!zd(fu(c[b])))&&y.push([o(b),o(c[b])]);return g}case Ky:return l([f,c.toISOString()],c);case Gy:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case Yy:{const y=[],g=l([f,y],c);for(const[b,w]of c)(e||!(zd(fu(b))||zd(fu(w))))&&y.push([o(b),o(w)]);return g}case Xy:{const y=[],g=l([f,y],c);for(const b of c)(e||!zd(fu(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},Yw=(e,{json:t,lossy:n}={})=>{const a=[];return lB(!(t||n),!!t,new Map,a)(e),a},uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Gw(Yw(e,t)):structuredClone(e):(e,t)=>Gw(Yw(e,t));function sB(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 oB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function uB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||sB,a=e.options.footnoteBackLabel||oB,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 y=e.all(h),g=String(h.identifier).toUpperCase(),b=ao(g.toLowerCase());let w=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++w<=j;){k.length>0&&k.push({type:"text",value:" "});let A=typeof n=="string"?n:n(m,w);typeof A=="string"&&(A={type:"text",value:A}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const A=C.children[C.children.length-1];A&&A.type==="text"?A.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...uf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
365
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
366
|
-
`}]}}const Df=(function(e){if(e==null)return hB;if(typeof e=="function")return Mf(e);if(typeof e=="object")return Array.isArray(e)?cB(e):dB(e);if(typeof e=="string")return fB(e);throw new Error("Expected function, string, or object as test")});function cB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Df(e[n]);return Mf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function dB(e){const t=e;return Mf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function fB(e){return Mf(t);function t(n){return n&&n.type===e}}function Mf(e){return t;function t(n,a,l){return!!(mB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function hB(){return!0}function mB(e){return e!==null&&typeof e=="object"&&"type"in e}const RE=[],pB=!0,Pg=!1,gB="skip";function zE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Df(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return b;function b(){let w=RE,k,j,C;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=yB(n(m,y)),w[0]===Pg))return w;if("children"in m&&m.children){const E=m;if(E.children&&w[0]!==gB)for(j=(a?E.children.length:-1)+c,C=y.concat(E);j>-1&&j<E.children.length;){const A=E.children[j];if(k=f(A,j,C)(),k[0]===Pg)return k;j=typeof k[1]=="number"?k[1]:j+c}}return w}}}function yB(e){return Array.isArray(e)?e:typeof e=="number"?[pB,e]:e==null?RE:[e]}function Jy(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),zE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const Bg={}.hasOwnProperty,vB={};function bB(e,t){const n=t||vB,a=new Map,l=new Map,o=new Map,c={...nB,...n.handlers},f={all:h,applyData:wB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:xB,wrap:kB};return Jy(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,w=f.handlers[b];if(Bg.call(f.handlers,b)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...C}=y,E=uf(C);return E.children=f.all(y),E}return uf(y)}return(f.options.unknownHandler||SB)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let w=-1;for(;++w<b.length;){const k=f.one(b[w],y);if(k){if(w&&b[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Xw(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=Xw(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function xB(e,t){e.position&&(t.position=oP(e))}function wB(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,uf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function SB(e,t){const n=t.data||{},a="value"in t&&!(Bg.call(n,"hProperties")||Bg.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 kB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
367
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
368
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
369
|
-
`}),n}function Xw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Jw(e,t){const n=bB(e,t),a=n.one(e,void 0),l=uB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
370
|
-
`},l),o}function jB(e,t){return e&&"run"in e?async function(n,a){const l=Jw(n,{file:a,...t});await e.run(l,a)}:function(n,a){return Jw(n,{file:a,...e||t})}}function Ww(e){if(e)throw e}var Np,eS;function CB(){if(eS)return Np;eS=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 y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},c=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return Np=function m(){var h,y,g,b,w,k,j=arguments[0],C=1,E=arguments.length,A=!1;for(typeof j=="boolean"&&(A=j,j=arguments[1]||{},C=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});C<E;++C)if(h=arguments[C],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(A&&b&&(o(b)||(w=l(b)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(A,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Np}var EB=CB();const _p=df(EB);function $g(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 NB(){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 y=e[++o];let g=-1;if(m){c(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?_B(y,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 _B(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 y=h;if(f&&n)throw y;return l(y)}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 qr={basename:TB,dirname:AB,extname:RB,join:zB,sep:"/"};function TB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ju(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 AB(e){if(Ju(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 RB(e){Ju(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 zB(...e){let t=-1,n;for(;++t<e.length;)Ju(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":OB(n)}function OB(e){Ju(e);const t=e.codePointAt(0)===47;let n=DB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function DB(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 Ju(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const MB={cwd:IB};function IB(){return"/"}function Fg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LB(e){if(typeof e=="string")e=new URL(e);else if(!Fg(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 UB(e)}function UB(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 Tp=["history","path","basename","stem","extname","dirname"];class OE{constructor(t){let n;t?Fg(t)?n={path:t}:typeof t=="string"||PB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":MB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Tp.length;){const o=Tp[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)Tp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?qr.basename(this.path):void 0}set basename(t){Rp(t,"basename"),Ap(t,"basename"),this.path=qr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qr.dirname(this.path):void 0}set dirname(t){tS(this.basename,"dirname"),this.path=qr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qr.extname(this.path):void 0}set extname(t){if(Ap(t,"extname"),tS(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=qr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fg(t)&&(t=LB(t)),Rp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qr.basename(this.path,this.extname):void 0}set stem(t){Rp(t,"stem"),Ap(t,"stem"),this.path=qr.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 _n(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 Ap(e,t){if(e&&e.includes(qr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qr.sep+"`")}function Rp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function tS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BB=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),$B={}.hasOwnProperty;class Wy extends BB{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=NB()}copy(){const t=new Wy;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):$B.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=Od(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=Od(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const w=g,k=a.stringify(w,b);HB(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?c(y):o?o(g):n(void 0,g)}}}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),rS("processSync","process",n),a;function l(o,c){n=!0,Ww(o),a=c}}run(t,n,a){nS(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=Od(n);l.run(t,m,h);function h(y,g,b){const w=g||t;y?f(y):c?c(w):a(void 0,w,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),rS("runSync","run",a),l;function o(c,f){Ww(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Od(n),l=this.compiler||this.Compiler;return Op("stringify",l),nS(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[y,...g]=h;m(y,g)}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 y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,b=-1;for(;++g<a.length;)if(a[g][0]===h){b=g;break}if(b===-1)a.push([h,...y]);else if(y.length>0){let[w,...k]=y;const j=a[b][1];$g(j)&&$g(w)&&(w=_p(!0,j,w)),a[b]=[h,w,...k]}}}}const FB=new Wy().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 nS(e){if(!$g(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Od(e){return qB(e)?e:new OE(e)}function qB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HB(e){return typeof e=="string"||ZB(e)}function ZB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",aS=[],iS={allowDangerousHtml:!0},QB=/^(https?|ircs?|mailto|xmpp)$/i,KB=[{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 GB(e){const t=YB(e),n=XB(e);return JB(t.runSync(t.parse(n),n),e)}function YB(e){const t=e.rehypePlugins||aS,n=e.remarkPlugins||aS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...iS}:iS;return FB().use(A8).use(n).use(jB,a).use(t)}function XB(e){const t=e.children||"",n=new OE;return typeof t=="string"&&(n.value=t),n}function JB(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||WB;for(const y of KB)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+VB+y.id,void 0);return Jy(e,h),hP(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return c?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in jp)if(Object.hasOwn(jp,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=jp[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,b)),w&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function WB(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||QB.test(e.slice(0,t))?e:""}function e$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DE(e,t,n){const l=Df((n||{}).ignore||[]),o=t$(t);let c=-1;for(;++c<o.length;)zE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const w=y[g],k=b?b.children:void 0;if(l(w,k?k.indexOf(w):void 0,b))return;b=w}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],w=o[c][1];let k=0;const C=g.children.indexOf(h);let E=!1,A=[];b.lastIndex=0;let z=b.exec(h.value);for(;z;){const U=z.index,D={index:z.index,input:z.input,stack:[...y,h]};let O=w(...z,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?b.lastIndex=U+1:(k!==U&&A.push({type:"text",value:h.value.slice(k,U)}),Array.isArray(O)?A.push(...O):O&&A.push(O),k=U+z[0].length,E=!0),!b.global)break;z=b.exec(h.value)}return E?(k<h.value.length&&A.push({type:"text",value:h.value.slice(k)}),g.children.splice(C,1,...A)):A=[h],C+A.length}}function t$(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([n$(l[0]),r$(l[1])])}return t}function n$(e){return typeof e=="string"?new RegExp(e$(e),"g"):e}function r$(e){return typeof e=="function"?e:function(){return e}}function a$(e){DE(e,[/\r?\n|\r/g,i$])}function i$(){return{type:"break"}}function l$(){return function(e){a$(e)}}function lS(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",Ip=["autolink","link","image","label"];function s$(){return{transforms:[m$],enter:{literalAutolink:u$,literalAutolinkEmail:Lp,literalAutolinkHttp:Lp,literalAutolinkWww:Lp},exit:{literalAutolink:h$,literalAutolinkEmail:f$,literalAutolinkHttp:c$,literalAutolinkWww:d$}}}function o$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Ip},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mp,notInConstruct:Ip},{character:":",before:"[ps]",after:"\\/",inConstruct:Mp,notInConstruct:Ip}]}}function u$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lp(e){this.config.enter.autolinkProtocol.call(this,e)}function c$(e){this.config.exit.autolinkProtocol.call(this,e)}function d$(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 f$(e){this.config.exit.autolinkEmail.call(this,e)}function h$(e){this.exit(e)}function m$(e){DE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,p$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),g$]],{ignore:["link","linkReference"]})}function p$(e,t,n,a,l){let o="";if(!ME(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!y$(n)))return!1;const c=v$(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 g$(e,t,n,a){return!ME(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function y$(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 v$(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=lS(e,"(");let o=lS(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 ME(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xl(n)||Rf(n))&&(!t||n!==47)}IE.peek=N$;function b$(){this.buffer()}function x$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function w$(){this.buffer()}function S$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function k$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function j$(e){this.exit(e)}function C$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ir(this.sliceSerialize(e)).toLowerCase(),n.label=t}function E$(e){this.exit(e)}function N$(){return"["}function IE(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 _$(){return{enter:{gfmFootnoteCallString:b$,gfmFootnoteCall:x$,gfmFootnoteDefinitionLabelString:w$,gfmFootnoteDefinition:S$},exit:{gfmFootnoteCallString:k$,gfmFootnoteCall:j$,gfmFootnoteDefinitionLabelString:C$,gfmFootnoteDefinition:E$}}}function T$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:IE},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"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
371
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?LE:A$))),h(),m}}function A$(e,t,n){return t===0?e:LE(e,t,n)}function LE(e,t,n){return(n?"":" ")+e}const R$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];UE.peek=I$;function z$(){return{canContainEols:["delete"],enter:{strikethrough:D$},exit:{strikethrough:M$}}}function O$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:R$}],handlers:{delete:UE}}}function D$(e){this.enter({type:"delete",children:[]},e)}function M$(e){this.exit(e)}function UE(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 I$(){return"~"}function L$(e){return e.length}function U$(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||L$,o=[],c=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],C=[];let E=-1;for(e[y].length>h&&(h=e[y].length);++E<e[y].length;){const A=P$(e[y][E]);if(n.alignDelimiters!==!1){const z=l(A);C[E]=z,(m[E]===void 0||z>m[E])&&(m[E]=z)}j.push(A)}c[y]=j,f[y]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=sS(a[g]);else{const j=sS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],w=[];for(;++g<h;){const j=o[g];let C="",E="";j===99?(C=":",E=":"):j===108?C=":":j===114&&(E=":");let A=n.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const z=C+"-".repeat(A)+E;n.alignDelimiters!==!1&&(A=C.length+A+E.length,A>m[g]&&(m[g]=A),w[g]=A),b[g]=z}c.splice(1,0,b),f.splice(1,0,w),y=-1;const k=[];for(;++y<c.length;){const j=c[y],C=f[y];g=-1;const E=[];for(;++g<h;){const A=j[g]||"";let z="",U="";if(n.alignDelimiters!==!1){const D=m[g]-(C[g]||0),O=o[g];O===114?z=" ".repeat(D):O===99?D%2?(z=" ".repeat(D/2+.5),U=" ".repeat(D/2-.5)):(z=" ".repeat(D/2),U=z):U=" ".repeat(D)}n.delimiterStart!==!1&&!g&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||g)&&E.push(" "),n.alignDelimiters!==!1&&E.push(z),E.push(A),n.alignDelimiters!==!1&&E.push(U),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
372
|
-
`)}function P$(e){return e==null?"":String(e)}function sS(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 B$(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()),$$);return l(),c}function $$(e,t,n){return">"+(n?"":" ")+e}function F$(e,t){return oS(e,t.inConstruct,!0)&&!oS(e,t.notInConstruct,!1)}function oS(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 uS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
373
|
-
`&&F$(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
374
|
-
`}function q$(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 H$(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 Z$(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 V$(e,t,n,a){const l=Z$(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(H$(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,Q$);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(q$(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
375
|
-
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
376
|
-
`),o&&(y+=f.move(o+`
|
|
377
|
-
`)),y+=f.move(m),h(),y}function Q$(e,t,n){return(n?"":" ")+e}function ev(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 K$(e,t,n,a){const l=ev(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?" ":`
|
|
378
|
-
`,...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 G$(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 zu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cf(e,t,n){const a=Zs(e),l=Zs(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}}PE.peek=Y$;function PE(e,t,n,a){const l=G$(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),y=cf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=zu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=cf(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+zu(g));const w=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function Y$(e,t,n){return n.options.emphasis||"*"}function X$(e,t){let n=!1;return Jy(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Pg}),!!((!e.depth||e.depth<3)&&Zy(e)&&(t.options.setext||n))}function J$(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(X$(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
379
|
-
`,after:`
|
|
380
|
-
`});return g(),y(),b+`
|
|
381
|
-
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
382
|
-
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
383
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=zu(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}BE.peek=W$;function BE(e){return e.value||""}function W$(){return"<"}$E.peek=eF;function $E(e,t,n,a){const l=ev(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 eF(){return"!"}FE.peek=tF;function FE(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 y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function tF(){return"!"}qE.peek=nF;function qE(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 nF(){return"`"}function HE(e,t){const n=Zy(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))}ZE.peek=rF;function ZE(e,t,n,a){const l=ev(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(HE(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=y,g}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 rF(e,t,n){return HE(e,n)?"<":"["}VE.peek=aF;function VE(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 y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function aF(){return"["}function tv(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 iF(e){const t=tv(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 lF(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 QE(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 sF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?lF(n):tv(n);const f=e.ordered?c==="."?")":".":iF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.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),QE(n)===c&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];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 oF(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 uF(e,t,n,a){const l=oF(n);let o=n.bulletCurrent||tv(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()),y);return m(),h;function y(g,b,w){return b?(w?"":" ".repeat(c))+g:(w?o:o+" ".repeat(c-o.length))+g}}function cF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const dF=Df(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function fF(e,t,n,a){return(e.children.some(function(c){return dF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function hF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KE.peek=mF;function KE(e,t,n,a){const l=hF(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),y=cf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=zu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=cf(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+zu(g));const w=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function mF(e,t,n){return n.options.strong||"*"}function pF(e,t,n,a){return n.safe(e.value,a)}function gF(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 yF(e,t,n){const a=(QE(n)+(n.options.ruleSpaces?" ":"")).repeat(gF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const GE={blockquote:B$,break:uS,code:V$,definition:K$,emphasis:PE,hardBreak:uS,heading:J$,html:BE,image:$E,imageReference:FE,inlineCode:qE,link:ZE,linkReference:VE,list:sF,listItem:uF,paragraph:cF,root:fF,strong:KE,text:pF,thematicBreak:yF};function vF(){return{enter:{table:bF,tableData:cS,tableHeader:cS,tableRow:wF},exit:{codeText:SF,table:xF,tableData:Up,tableHeader:Up,tableRow:Up}}}function bF(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 xF(e){this.exit(e),this.data.inTable=void 0}function wF(e){this.enter({type:"tableRow",children:[]},e)}function Up(e){this.exit(e)}function cS(e){this.enter({type:"tableCell",children:[]},e)}function SF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kF(e,t){return t==="|"?t:e}function jF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
384
|
-
`,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(w,k,j,C){return h(y(w,j,C),w.align)}function f(w,k,j,C){const E=g(w,j,C),A=h([E]);return A.slice(0,A.indexOf(`
|
|
385
|
-
`))}function m(w,k,j,C){const E=j.enter("tableCell"),A=j.enter("phrasing"),z=j.containerPhrasing(w,{...C,before:o,after:o});return A(),E(),z}function h(w,k){return U$(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const C=w.children;let E=-1;const A=[],z=k.enter("table");for(;++E<C.length;)A[E]=g(C[E],k,j);return z(),A}function g(w,k,j){const C=w.children;let E=-1;const A=[],z=k.enter("tableRow");for(;++E<C.length;)A[E]=m(C[E],w,k,j);return z(),A}function b(w,k,j){let C=GE.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function CF(){return{exit:{taskListCheckValueChecked:dS,taskListCheckValueUnchecked:dS,paragraph:NF}}}function EF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_F}}}function dS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function NF(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 _F(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=GE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+c}}function TF(){return[s$(),_$(),z$(),vF(),CF()]}function AF(e){return{extensions:[o$(),T$(e),O$(),jF(e),EF()]}}const RF={tokenize:LF,partial:!0},YE={tokenize:UF,partial:!0},XE={tokenize:PF,partial:!0},JE={tokenize:BF,partial:!0},zF={tokenize:$F,partial:!0},WE={name:"wwwAutolink",tokenize:MF,previous:tN},eN={name:"protocolAutolink",tokenize:IF,previous:nN},Da={name:"emailAutolink",tokenize:DF,previous:rN},Xr={};function OF(){return{text:Xr}}let al=48;for(;al<123;)Xr[al]=Da,al++,al===58?al=65:al===91&&(al=97);Xr[43]=Da;Xr[45]=Da;Xr[46]=Da;Xr[95]=Da;Xr[72]=[Da,eN];Xr[104]=[Da,eN];Xr[87]=[Da,WE];Xr[119]=[Da,WE];function DF(e,t,n){const a=this;let l,o;return c;function c(g){return!qg(g)||!rN.call(a,a.previous)||nv(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return qg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(zF,y,h)(g):g===45||g===95||En(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&zn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function MF(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!tN.call(a,a.previous)||nv(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(RF,e.attempt(YE,e.attempt(XE,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function IF(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&nN.call(a,a.previous)&&!nv(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(zn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||sf(g)||jt(g)||xl(g)||Rf(g)?n(g):e.attempt(YE,e.attempt(XE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function LF(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 UF(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(JE,m,f)(h):h===null||jt(h)||xl(h)||h!==45&&Rf(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 PF(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(JE,t,o)(c):c===null||jt(c)||xl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function BF(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||jt(f)||xl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||jt(f)||xl(f)?t(f):a(f)}function o(f){return zn(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):zn(f)?(e.consume(f),c):n(f)}}function $F(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return En(o)?n(o):t(o)}}function tN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function nN(e){return!zn(e)}function rN(e){return!(e===47||qg(e))}function qg(e){return e===43||e===45||e===46||e===95||En(e)}function nv(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 FF={tokenize:YF,partial:!0};function qF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:QF,continuation:{tokenize:KF},exit:GF}},text:{91:{name:"gfmFootnoteCall",tokenize:VF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:HF,resolveTo:ZF}}}}function HF(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=Ir(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 ZF(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 VF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!c||g===null||g===91||jt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Ir(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return jt(g)||(c=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function QF(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",y):n(k)}function y(k){if(c>999||k===93&&!f||k===null||k===91||jt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Ir(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return jt(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),ot(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function KF(e,t,n){return e.check(Xu,t,e.attempt(FF,t,n))}function GF(e){e.exit("gfmFootnoteDefinition")}function YF(e,t,n){const a=this;return ot(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 XF(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 y={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&or(b,b.length,0,zf(w,c.slice(h+1,m),f)),or(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,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,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=Zs(h);if(k===126)return g>1?m(k):(c.consume(k),g++,w);if(g<2&&!n)return m(k);const C=c.exit("strikethroughSequenceTemporary"),E=Zs(k);return C._open=!E||E===2&&!!j,C._close=!j||j===2&&!!E,f(k)}}}class JF{constructor(){this.map=[]}add(t,n,a){WF(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 WF(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 eq(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 tq(){return{flow:{null:{name:"table",tokenize:nq,resolveAll:rq}}}}function nq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(F){let X=a.events.length-1;for(;X>-1;){const se=a.events[X][1].type;if(se==="lineEnding"||se==="linePrefix")X--;else break}const ee=X>-1?a.events[X][1].type:null,we=ee==="tableHead"||ee==="tableRow"?O:m;return we===O&&a.parser.lazy[a.now().line]?n(F):we(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(c=!0,o+=1),y(F)}function y(F){return F===null?n(F):Oe(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),w):n(F):et(F)?ot(e,y,"whitespace")(F):(o+=1,c&&(c=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(F)))}function g(F){return F===null||F===124||jt(F)?(e.exit("data"),y(F)):(e.consume(F),F===92?b:g)}function b(F){return F===92||F===124?(e.consume(F),g):g(F)}function w(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),c=!1,et(F)?ot(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?C(F):F===124?(c=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):D(F)}function j(F){return et(F)?ot(e,C,"whitespace")(F):C(F)}function C(F){return F===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),E):F===45?(o+=1,E(F)):F===null||Oe(F)?U(F):D(F)}function E(F){return F===45?(e.enter("tableDelimiterFiller"),A(F)):D(F)}function A(F){return F===45?(e.consume(F),A):F===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return et(F)?ot(e,U,"whitespace")(F):U(F)}function U(F){return F===124?k(F):F===null||Oe(F)?!c||l!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),P(F)}function P(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),P):F===null||Oe(F)?(e.exit("tableRow"),t(F)):et(F)?ot(e,P,"whitespace")(F):(e.enter("data"),L(F))}function L(F){return F===null||F===124||jt(F)?(e.exit("data"),P(F)):(e.consume(F),F===92?V:L)}function V(F){return F===92||F===124?(e.consume(F),L):L(F)}}function rq(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,y,g;const b=new JF;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(fS(b,t,m,h,y),y=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,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Dd(b,t,o,l,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Dd(b,t,o,l,void 0,g)),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],g=Dd(b,t,o,l,n,g)):c[1]!==0&&(g=Dd(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&fS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=eq(t.events,n))}return e}function Dd(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},vs(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=vs(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=vs(t.events,n[2]),y=vs(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const b=t.events[n[2]],w=t.events[n[3]];if(b[1].end=Object.assign({},w[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",g,t]])}return l!==void 0&&(o.end=Object.assign({},vs(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function fS(e,t,n,a,l){const o=[],c=vs(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 vs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const aq={name:"tasklistCheck",tokenize:lq};function iq(){return{text:{91:aq}}}function lq(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 jt(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 Oe(m)?t(m):et(m)?e.check({tokenize:sq},t,n)(m):n(m)}}function sq(e,t,n){return ot(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function oq(e){return hE([OF(),qF(),XF(e),tq(),iq()])}const uq={};function cq(e){const t=this,n=e||uq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(oq(n)),o.push(TF()),c.push(AF(n))}function aN({children:e,className:t}){return u.jsx("div",{className:Te("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(GB,{remarkPlugins:[cq,l$],children:e})})}function dq({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(Vn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Ra,{children:[u.jsxs(za,{children:["System prompt append",m&&u.jsx(fq,{})]}),!o&&!l&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(Vu,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(Oa,{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(aN,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function fq(){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 iN={"claude-code":"Claude Code",codex:"Codex"},hq=[nf.CLAUDE_CODE,nf.CODEX];function mq({open:e,onOpenChange:t,agent:n}){const a=sn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),w=Fe({queryKey:["clients-rebind"],queryFn:_a,enabled:e}).data??[],k=pT({queries:w.map(L=>({queryKey:["client-capabilities",L.id],queryFn:()=>vy(L.id),enabled:e}))}),j=x.useMemo(()=>{const L=new Map;return k.forEach((V,F)=>{const X=w[F];if(!X)return;const ee=V.data;ee!=null&&ee.capabilities&&L.set(X.id,ee.capabilities)}),L},[k,w]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const C=c?j.get(c)??null:null,E=(C==null?void 0:C[m])??null,A=!E||E.state==="missing"||E.state==="error",z=!!c&&(c!==l||m!==o)&&(!A||y),U=m!==o,D=c!==l,O=kt({mutationFn:()=>{if(!c)throw new Error("clientId required");return UD(n.uuid,{clientId:c,runtimeProvider:m,force:A&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),P=O.error instanceof Zu||O.error instanceof Error?O.error.message:null;return u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{className:"max-w-lg",children:[u.jsx(ln,{children:u.jsx(en,{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:gq(l,w,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{children:"Computer"}),u.jsx("select",{value:c??"",onChange:L=>f(L.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(L=>u.jsx("option",{value:L.id,children:pq(L)},L.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:hq.map(L=>{const V=(C==null?void 0:C[L])??null,F=!!V&&V.state!=="missing",X=m===L;return u.jsxs("label",{className:X?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":F?"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:X,onChange:()=>h(L),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:iN[L]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:vq(V,L)})]})]},L)})})]}),(D||U)&&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."]}),U&&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:y,onChange:L=>g(L.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."})]}),P&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:P})]}),u.jsxs(Nn,{children:[u.jsx(me,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),u.jsx(me,{onClick:()=>O.mutate(),disabled:!z||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function pq(e){return`${e.hostname??e.id} · ${e.status}`}function gq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${iN[n]}`}const yq={"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 vq(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. ${yq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const bq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function xq(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(Ni,{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:bq[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(Er,{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(qR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function wu(e){return`agent-cfg-${e}`}function hu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:Te("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 wq(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const Sq={"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 kq(e){const t=Sq[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(jq,{name:t.name,caption:t.caption,locked:!0}),u.jsx(Cq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function jq({name:e,caption:t,locked:n}){return u.jsxs(Vn,{children:[u.jsx(Ra,{children:u.jsxs(za,{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(zk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(Oa,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(Ok,{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 Cq(e){const t=!!e.computerLabel;return u.jsxs(Vn,{children:[u.jsxs(Ra,{children:[u.jsx(za,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(yg,{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(yg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(Oa,{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 Eq(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 Nq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function _q(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 hS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:_q(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=Nq(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:hS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:hS(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 Tq(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 Aq(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(Tq(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 z=[],U=L=>L.reduce((V,F)=>F.status==="unchanged"?V:V+1,0),D=U(a.mcp),O=U(a.env),P=U(a.git);return c&&z.push("prompt"),f&&z.push("model"),D>0&&z.push("mcp"),O>0&&z.push("env"),P>0&&z.push("git"),{anyDirty:z.length>0,dirtySections:z,counts:{prompt:c?1:0,model:f?1:0,mcp:D,env:O,git:P}}},[a,c,f]),h=x.useCallback(z=>{n(U=>U&&z(U))},[]),y=x.useCallback(z=>h(U=>({...U,promptAppend:z})),[h]),g=x.useCallback(()=>h(z=>({...z,promptAppend:l})),[h,l]),b=x.useCallback(z=>h(U=>({...U,model:z})),[h]),w=x.useCallback(()=>h(z=>({...z,model:o})),[h,o]),k=x.useMemo(()=>Bp("mcp",h),[h]),j=x.useMemo(()=>Bp("env",h),[h]),C=x.useMemo(()=>Bp("git",h),[h]),E=x.useCallback(()=>{n(null)},[]),A=x.useCallback(()=>{if(!t||!e)return{};const z={};c&&(z.prompt={append:t.promptAppend}),f&&(z.model=t.model);const U=m.counts.mcp>0,D=m.counts.env>0,O=m.counts.git>0;return U&&(z.mcpServers=t.mcp.filter(P=>P.status!=="deleted").map(P=>P.value)),D&&(z.env=t.env.filter(P=>P.status!=="deleted").map(P=>{const L=P.value;return L.sensitive&&L.value===rf?{key:L.key,value:rf,sensitive:!0}:L})),O&&(z.gitRepos=t.git.filter(P=>P.status!=="deleted").map(P=>P.value)),z},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:w,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:C.add,updateGit:C.update,deleteGit:C.remove,undoDeleteGit:C.undo,resetAll:E,buildPayloadPatch:A}}const jn={overview:"ad-overview",setup:"ad-setup",prompt:wu("prompt"),tools:wu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function Rq(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 zq(){var mn,ht,Tr,Dn,tc,Ii,Li,Ui,Ur,Pi,La,nc;const t=gk().uuid??"",n=On(),a=sn(),l=Fe({queryKey:["agent",t],queryFn:()=>MD(t),enabled:!!t}),o=Fe({queryKey:["agent-config",t],queryFn:()=>nU(t),enabled:!!t&&((mn=l.data)==null?void 0:mn.type)!=="human"}),c=Fe({queryKey:["agent-client-status",t],queryFn:()=>iU(t),enabled:!!t&&((ht=l.data)==null?void 0:ht.type)!=="human"}),f=Fe({queryKey:["agent-sessions-active",t],queryFn:()=>Ws(t,{state:"active"}),enabled:!!t&&((Tr=l.data)==null?void 0:Tr.type)!=="human"}),m=Fe({queryKey:["clients"],queryFn:_a,enabled:!!t&&((Dn=l.data)==null?void 0:Dn.type)!=="human",refetchInterval:3e4}),h=Aq(o.data),[y,g]=x.useState(null),[b,w]=x.useState(null),[k,j]=x.useState(!1),C=kt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const xe=h.buildPayloadPatch();return rU(t,{expectedVersion:o.data.version,payload:xe})},onSuccess:xe=>{a.setQueryData(["agent-config",t],xe),g(null),w(null),j(!0)},onError:xe=>{if(j(!1),xe instanceof Zu&&xe.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(xe instanceof Error?xe.message:String(xe))}});x.useEffect(()=>{if(!k)return;const xe=setTimeout(()=>j(!1),2500);return()=>clearTimeout(xe)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const E=x.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),A=x.useCallback(xe=>{const Xe=document.getElementById(xe);Xe&&Xe.scrollIntoView({behavior:"smooth",block:"start"})},[]),z=kt({mutationFn:xe=>Y1(t,xe),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),U=kt({mutationFn:()=>BD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),D=kt({mutationFn:()=>$D(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=kt({mutationFn:()=>PD(t),onSuccess:()=>n("/team")}),P=kt({mutationFn:()=>FD(t)}),[L,V]=x.useState(!1),[F,X]=x.useState(""),[ee,we]=x.useState(null),[se,re]=x.useState(!1),Z=Fe({queryKey:["clients"],queryFn:_a,enabled:L}),te=kt({mutationFn:xe=>Y1(t,{clientId:xe}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),V(!1),X(""),we(null)},onError:xe=>we(xe instanceof Error?xe.message:String(xe))}),[ye,Ae]=x.useState(!1),[_,I]=x.useState(null),B=kt({mutationFn:()=>aU(t,h.buildPayloadPatch()),onSuccess:xe=>{const Xe=xe.diff.length?xe.diff.map(pn=>`${pn.op} ${pn.path}`).join(`
|
|
386
|
-
`):"(no changes)";I(Xe)},onError:xe=>I(`Dry run failed: ${xe instanceof Error?xe.message:String(xe)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const xe=Xe=>{Xe.preventDefault(),Xe.returnValue=""};return window.addEventListener("beforeunload",xe),()=>window.removeEventListener("beforeunload",xe)},[h.summary.anyDirty]);const T=((tc=l.data)==null?void 0:tc.type)==="human",q=x.useMemo(()=>Rq(T),[T]),Y=x.useRef(null),[ue,ve]=x.useState(!1);x.useEffect(()=>{if(T)return;const xe=Y.current;if(!xe||typeof IntersectionObserver>"u")return;const Xe=new IntersectionObserver(pn=>{const Wr=pn[0];Wr&&ve(!Wr.isIntersecting&&Wr.boundingClientRect.top<0)},{threshold:0});return Xe.observe(xe),()=>Xe.disconnect()},[T]);const[be,fe]=x.useState(jn.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const xe=[];for(const Xe of q){const pn=document.getElementById(Xe.anchor);if(!pn)continue;const Wr=new IntersectionObserver(fo=>{for(const rc of fo)rc.isIntersecting&&fe(Xe.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});Wr.observe(pn),xe.push(Wr)}return()=>{for(const Xe of xe)Xe.disconnect()}},[q]);const Ge=x.useMemo(()=>{const xe=new Set;for(const Xe of h.summary.dirtySections)Xe==="prompt"&&xe.add(jn.prompt),Xe==="model"&&xe.add(jn.setup),Xe==="mcp"&&xe.add(jn.tools),(Xe==="env"||Xe==="git")&&xe.add(jn.advanced);return xe},[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 Ie=l.data;if(!Ie)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const ne=Ie.type==="human",je=c.data,Le=((Ii=f.data)==null?void 0:Ii.length)??0,Pe=!ne&&!(je!=null&&je.clientId),It=!ne&&je?!je.online&&!!je.clientId:!1,dn=Ie,El=dn.runtimeState??null,Ma=dn.runtimeType??null,Ia=dn.totalSessions??null,Jr=Ie.uuid.slice(0,8),oo=Eq({activeSessions:Le,isUnclaimed:Pe,isOffline:It}),uo=h.draft.mcp.filter(xe=>xe.status!=="deleted"),fn=h.draft.env.filter(xe=>xe.status!=="deleted"),co=h.draft.git.filter(xe=>xe.status!=="deleted"),ie=xe=>new Set(uo.filter(Xe=>Xe.key!==xe).map(Xe=>Xe.value.name.toLowerCase())),ge=xe=>new Set(fn.filter(Xe=>Xe.key!==xe).map(Xe=>Xe.value.key)),Ue=xe=>new Set(co.filter(Xe=>Xe.key!==xe).map(Xe=>{const{value:pn}=Xe;return pn.localPath?pn.localPath:((pn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Be={sessions:Ia??"—",active:Le,runtime:Ma??(ne?"human":"—"),model:((Ui=(Li=o.data)==null?void 0:Li.payload.model)==null?void 0:Ui.trim())||"—"},at=(je==null?void 0:je.clientId)??null,hn=at?((Ur=m.data)==null?void 0:Ur.find(xe=>xe.id===at))??null:null,cr=at?(hn==null?void 0:hn.hostname)??at:null,tn=Ie.runtimeProvider??"claude-code",qt=tn==="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(Tf,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),q.map(xe=>u.jsxs("div",{children:[xe.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(Oq,{label:xe.label,active:be===xe.anchor,danger:xe.danger??!1,dirty:Ge.has(xe.anchor),onClick:()=>A(xe.anchor)})]},xe.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(lU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(sU,{onClick:()=>n("/team"),children:"Agents"}),u.jsx(oU,{}),u.jsx(uU,{mono:!0,children:Ie.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(to,{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:Ie.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",Ie.name??Jr]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(Dr,{tone:Ie.type==="autonomous_agent"?"accent":"neutral",children:Ie.type}),Ie.visibility&&u.jsx(Dr,{tone:Ie.visibility==="organization"?"accent":"outline",children:Ie.visibility}),(je==null?void 0:je.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",gl(je.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(bl,{state:El}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${Ie.uuid}`),children:[u.jsx(hy,{className:"h-3 w-3"})," Open chat"]}),!ne&&Ie.status==="active"&&u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>{P.reset(),P.mutate()},disabled:P.isPending,children:[u.jsx(Ok,{className:"h-3 w-3"}),P.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(Ad,{label:"sessions",value:Be.sessions}),u.jsx(Ad,{label:"active",value:Be.active,accent:typeof Be.active=="number"&&Be.active>0?"var(--accent)":void 0}),u.jsx(Ad,{label:"runtime",value:Be.runtime}),u.jsx(Ad,{label:"model",value:Be.model})]})]}),u.jsx("div",{ref:Y,"aria-hidden":!0,style:{height:0}}),!ne&&u.jsx(fU,{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:[(P.data||P.error)&&u.jsx(Pq,{result:P.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>P.reset()}),u.jsx(hu,{anchorId:jn.overview,title:"Profile",right:u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${Ie.uuid}`),title:"Manage platform bindings in Integrations",children:[u.jsx(yg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(EU,{agent:Ie,onSave:async xe=>{await z.mutateAsync(xe)}})}),!ne&&u.jsxs(u.Fragment,{children:[u.jsxs(hu,{anchorId:jn.setup,title:"Setup",caption:((Pi=o.data)==null?void 0:Pi.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(kq,{runtimeProvider:tn,computerLabel:cr,canBindComputer:Pe&&Ie.status==="active",bindComputerPending:te.isPending,onBindComputer:()=>V(!0),onRebind:Ie.clientId?()=>re(!0):void 0,modelSlot:u.jsx(LU,{value:h.draft.model,baseline:((La=o.data)==null?void 0:La.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:Ie.status!=="active",provider:tn})})]}),u.jsx(hu,{anchorId:jn.prompt,title:"Prompt",children:o.data?u.jsx(dq,{value:h.draft.promptAppend,baseline:((nc=o.data)==null?void 0:nc.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:Ie.status!=="active"}):null}),u.jsx(hu,{anchorId:jn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(TU,{items:h.draft.mcp,otherNames:ie,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:Ie.status!=="active"}):null}),u.jsx(hu,{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:wu("env"),children:u.jsx(bU,{items:h.draft.env,otherKeys:ge,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:Ie.status!=="active"})}),u.jsx("div",{id:wu("git"),children:u.jsx(wU,{items:h.draft.git,otherPaths:Ue,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:Ie.status!=="active"})}),_&&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:_}),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(wq,{}),u.jsx(hU,{agent:Ie,suspendPending:U.isPending,reactivatePending:D.isPending,deletePending:O.isPending,onSuspend:()=>U.mutate(),onReactivate:()=>D.mutate(),onDelete:()=>O.mutate()})]}),!ne&&u.jsx(xq,{summary:h.summary,saveHint:oo,conflictMessage:b,errorMessage:y,saving:C.isPending,justSaved:k,onSave:()=>C.mutate(),onDiscard:()=>{h.summary.anyDirty&&Ae(!0)},onReloadRemote:E,onJumpTo:xe=>A(wu(xe))})]}),u.jsx(Dq,{open:ye,onOpenChange:Ae,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(),g(null),w(null),Ae(!1)}}),u.jsx(Wt,{open:L,onOpenChange:xe=>{V(xe),xe||(X(""),we(null),te.reset())},children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{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(Mq,{clients:Z.data??[],selected:F,onSelect:X}),ee&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:ee})]}),u.jsxs(Nn,{children:[u.jsx(me,{variant:"outline",onClick:()=>V(!1),children:"Cancel"}),u.jsx(me,{disabled:!F||te.isPending,onClick:()=>{we(null),te.mutate(F)},children:te.isPending?"Binding…":"Bind"})]})]})}),u.jsx(mq,{open:se,onOpenChange:re,agent:Ie})]})}function Oq({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:Te("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 Dq(e){return u.jsx(Wt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Nn,{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 Mq({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:Te("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:Te("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 Iq={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},Lq={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},Uq={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function Pq({result:e,onDismiss:t}){const n=Lq[e.status],a=Uq[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(Dr,{tone:a,children:Iq[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 Wu({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-4) var(--sp-5) var(--sp-3)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-subtitle",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 Bq(){return u.jsxs("div",{className:"-m-6",children:[u.jsx(Wu,{title:"Context",subtitle:"The team's living source of truth"}),u.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:u.jsx(Vn,{children:u.jsx("div",{className:"text-body",style:{padding:"var(--sp-6) var(--sp-5)",color:"var(--fg-3)",textAlign:"center"},children:"Tree visualization is on the way. This view will surface structure, relationships, and recent changes to the context-tree at a glance."})})})]})}const io=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));io.displayName="Card";const lo=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));lo.displayName="CardHeader";const ec=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("text-subtitle leading-none",e),...t}));ec.displayName="CardTitle";const lN=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("text-body text-muted-foreground",e),...t}));lN.displayName="CardDescription";const so=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));so.displayName="CardContent";const $q=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));$q.displayName="CardFooter";function Fq(){const{token:e}=gk(),t=On(),{isAuthenticated:n,adoptTokens:a}=$t(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1),[y,g]=x.useState(null);if(x.useEffect(()=>{e&&(async()=>{try{const C=await fetch(`/api/v1/invite/${encodeURIComponent(e)}/preview`);if(!C.ok){f("This invitation is no longer valid");return}o(await C.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const C=await Ne.get("/me/organizations"),E=await Ne.get("/me"),A=C.find(z=>z.id===E.member.organizationId);g((A==null?void 0:A.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(mS,{message:"Bad invitation URL"});if(c)return u.jsx(mS,{message:"This invitation is no longer valid"});if(!l)return u.jsx(qq,{});const b=async()=>{h(!0);try{const C=await Ne.post("/me/organizations/join",{token:e});await a(C.tokens),Ek("invite"),t("/",{replace:!0})}catch(C){f(C instanceof Error?C.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=Hq(l.expiresAt);return u.jsx(rv,{children:u.jsxs(io,{className:"w-full max-w-sm",children:[u.jsx(lo,{className:"text-center",children:u.jsxs(ec,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(so,{className:"space-y-4",children:[k&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[u.jsx(py,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("span",{children:["You'll switch from ",u.jsx("span",{className:"font-medium",children:y})," to"," ",u.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?u.jsx(me,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:w,children:[u.jsx(Rk,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&u.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),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"})]})]})]})})}function rv({children:e}){return u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Hu,{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(fy,{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:e})]})}function qq(){return u.jsx(rv,{children:u.jsxs(io,{className:"w-full max-w-sm",children:[u.jsxs(lo,{className:"text-center",children:[u.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),u.jsxs(so,{className:"space-y-4",children:[u.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function mS({message:e}){return u.jsx(rv,{children:u.jsxs(io,{className:"w-full max-w-sm",children:[u.jsxs(lo,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(py,{className:"h-6 w-6"})}),u.jsx(ec,{className:"text-title",children:e})]}),u.jsxs(so,{className:"space-y-4",children:[u.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Hu,{to:"/",children:[u.jsx(fy,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function Hq(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const n=t-Date.now();if(n<=0)return null;const a=Math.floor(n/6e4),l=Math.floor(a/60),o=Math.floor(l/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:l>=1?{text:`Expires in ${l} ${l===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function Zq(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=RC(l);return o===ww&&l!==ww?null:o}function Vq(){const{isAuthenticated:e}=$t(),t=Qn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=Zq(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(lr,{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(Hu,{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(fy,{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(io,{className:"w-full max-w-sm",children:[u.jsxs(lo,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(to,{width:28,height:32})}),u.jsxs(ec,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(so,{className:"space-y-4",children:[u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Rk,{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(bz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function Qq(){const e=On(),{adoptTokens:t}=$t(),[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=RC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Ek(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…"})}const Vs=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("table",{ref:a,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0,...t},...n}));Vs.displayName="DenseTable";const Qs=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));Qs.displayName="DenseTableHeader";const Ks=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));Ks.displayName="DenseTableBody";const Mr=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:Te("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}));Mr.displayName="DenseTableRow";const rt=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:Te("text-left text-label whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3_5)",color:"var(--fg-3)",fontWeight:500,borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));rt.displayName="DenseTableHead";const Ye=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:Te("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ye.displayName="DenseTableCell";function Kq(){const{data:e}=Fe({queryKey:["members","user-name-map"],queryFn:Af,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])}const Gq=1500;function Yq({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=x.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),Gq))},b=t!==void 0?Math.max(1,Math.round(t/60)):null,w=u.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?u.jsxs(u.Fragment,{children:[e,b!==null&&u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",b,"m"]})]}):"Generating token…"}),k=u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?u.jsx(Er,{className:"h-3.5 w-3.5"}):u.jsx(Ak,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):u.jsxs(u.Fragment,{children:[w,k]}),f&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[u.jsx(Xq,{}),l]}),n==="success"&&o&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[u.jsx(Er,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),u.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:c})]})}function Xq(){return u.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const Jq=3e3,Wq=1200;function e7({open:e,onOpenChange:t}){const n=sn(),{user:a}=$t(),[l,o]=x.useState("loading"),[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),b=x.useRef(new Set);return x.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),b.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return b.current=new Set(k),(async()=>{try{const j=await dO();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),x.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:_a}),C=b.current,E=j.find(A=>!C.has(A.id)&&A.status==="connected"&&A.userId===a.id);E&&(g(E.hostname??null),o("success"))}catch{}},Jq);return()=>clearInterval(k)},[e,l,n,a]),x.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},Wq);return()=>clearTimeout(w)},[l,t,n]),u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{children:[u.jsxs(ln,{children:[u.jsx(en,{children:"Connect computer"}),u.jsx(jy,{children:"Run this command on the machine you want to pair with this Hub."})]}),u.jsx(Yq,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:l,successContent:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),u.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:u.jsx(me,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function t7({embedded:e=!1}={}){const t=sn(),n=eo(),a=Kq(),{role:l}=$t(),o=l==="admin",[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),[b,w]=x.useState(null),[k,j]=x.useState(!1),{data:C}=Fe({queryKey:["clients"],queryFn:_a,refetchInterval:1e4}),{data:E}=Fe({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),A=kt({mutationFn:cO,onSuccess:()=>{h(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),z=kt({mutationFn:uO,onSuccess:()=>{g(null),w(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:V=>{V instanceof Zu?w(V.message):w(V instanceof Error?V.message:String(V))}}),U=x.useMemo(()=>{const V=new Map;for(const F of(E==null?void 0:E.agents)??[]){if(!F.clientId)continue;const X=V.get(F.clientId)??[];X.push(F),V.set(F.clientId,X)}return V},[E==null?void 0:E.agents]),D=V=>U.get(V)??[],O=(C??[]).filter(V=>V.status==="connected").length,P=(C??[]).reduce((V,F)=>V+F.agentCount,0),L=(C??[]).filter(V=>V.authState!=="ok").length;return u.jsxs("div",{className:e?"":"-m-6",children:[u.jsx(Wu,{title:"Computers",subtitle:C&&C.length>0?u.jsxs(u.Fragment,{children:[C.length," total · ",O," connected · ",P," agents bound",L>0&&u.jsxs(u.Fragment,{children:[" · ",u.jsxs("span",{style:{color:"var(--state-error)"},children:[L," need re-auth"]})]})]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>j(!0),children:[u.jsx(Na,{className:"h-3 w-3"}),"Connect computer"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(e7,{open:k,onOpenChange:j}),y&&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:y.hostname??y.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)."]}),D(y.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:D(y.id).map(V=>u.jsx("li",{className:"font-medium",children:n(V.agentId)},V.agentId))})]}),b&&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:b}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>{g(null),w(null)},children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>z.mutate(y.id),disabled:z.isPending,children:z.isPending?"Retiring…":"Retire"})]})]})}),m&&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:m.hostname??m.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:D(m.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):D(m.id).map(V=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:n(V.agentId)}),u.jsx(bl,{state:V.runtimeState})]},V.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>h(null),children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>A.mutate(m.id),disabled:A.isPending,children:A.isPending?"Disconnecting…":"Disconnect"})]})]})}),!C||C.length===0?u.jsx(Vn,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers connected. Use the button above to generate a connect command."})}):u.jsxs(Vn,{children:[u.jsxs(zg,{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 · ",C.length]}),u.jsxs(Vs,{children:[u.jsx(Qs,{children:u.jsxs(Mr,{children:[u.jsx(rt,{style:{width:16}}),u.jsx(rt,{children:"Hostname"}),o&&u.jsx(rt,{children:"Owner"}),u.jsx(rt,{children:"OS"}),u.jsx(rt,{children:"SDK"}),u.jsx(rt,{children:"Agents"}),u.jsx(rt,{children:"Connected"}),u.jsx(rt,{children:"Status"}),u.jsx(rt,{})]})}),u.jsx(Ks,{children:C.map(V=>{const F=c===V.id,X=D(V.id);return u.jsx(o7,{client:V,boundAgents:X,isExpanded:F,agentName:n,showOwner:o,ownerName:a,onToggle:()=>f(F?null:V.id),onDisconnect:()=>h(V),onRetire:()=>{w(null),g(V)},onReconnect:()=>j(!0)},V.id)})})]})]})]})]})}const n7={"claude-code":"Claude Code",codex:"Codex"},r7=[nf.CLAUDE_CODE,nf.CODEX],pS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},a7={"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 i7({clientId:e,enabled:t}){const{data:n,isLoading:a}=Fe({queryKey:["client-capabilities",e],queryFn:()=>vy(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Tf,{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:r7.map(o=>u.jsx(l7,{provider:o,entry:l?l[o]??null:null},o))})]})}function l7({provider:e,entry:t}){const n=n7[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 · ",pS[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 ·"," ",a7[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 · ",pS[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 s7(){return u.jsxs("span",{className:"mono inline-flex items-center gap-1.5 uppercase text-caption",style:{color:"var(--state-error)"},children:[u.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--state-error)",display:"inline-block"}}),"AUTH EXPIRED"]})}function o7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:c,onDisconnect:f,onRetire:m,onReconnect:h}){const y=l?9:8,g=e.status!=="connected",b=e.authState!=="ok",w=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs(Mr,{interactive:!0,selected:n,onClick:c,children:[u.jsx(Ye,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Tk,{className:"h-3.5 w-3.5"}):u.jsx(AR,{className:"h-3.5 w-3.5"})})}),u.jsx(Ye,{className:"font-medium",children:e.hostname??"—"}),l&&u.jsx(Ye,{style:{color:"var(--fg-2)"},children:o(e.userId)}),u.jsx(Ye,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(Ye,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(Ye,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(Ye,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?gl(e.connectedAt):"—"}),u.jsx(Ye,{children:b?u.jsx(s7,{}):u.jsx(bl,{state:w})}),u.jsx(Ye,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-1 justify-end",children:[g&&u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",style:b?{color:"var(--state-error)"}:void 0,onClick:k=>{k.stopPropagation(),h()},children:[u.jsx(UR,{className:"h-3 w-3"})," Reconnect"]}),u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),f()},children:[u.jsx(pz,{className:"h-3 w-3"})," Disconnect"]}),u.jsxs(me,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:k=>{k.stopPropagation(),m()},children:[u.jsx(Fs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(Ye,{}),u.jsxs(Ye,{colSpan:y-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(i7,{clientId:e.id,enabled:n}),u.jsxs(Tf,{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(k=>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(k.agentId)}),u.jsx(bl,{state:k.runtimeState}),k.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[k.activeSessions," / ",k.totalSessions??0," sessions"]})]},k.agentId))})]})]})]})}function u7(){return u.jsx(t7,{embedded:!0})}function c7(){return Ne.get("/admin/adapter-mappings")}function d7(e){return Ne.post("/admin/adapter-mappings",e)}function f7(e){return Ne.delete(`/admin/adapter-mappings/${e}`)}function h7(){return Ne.get("/admin/adapters/status")}function m7(){return Ne.get("/admin/adapters")}function p7(e){return Ne.post("/admin/adapters",e)}function g7(e,t){return Ne.patch(`/admin/adapters/${e}`,t)}function y7(e){return Ne.delete(`/admin/adapters/${e}`)}const v7=Object.values(JL),gS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function yS(e){const[t,n]=x.useState(gS),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...gS,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=b7(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(Wt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{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:v7.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(dt,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(_t,{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(dt,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(_t,{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(dt,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(_t,{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(dt,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(_t,{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(dt,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(_t,{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(dt,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(_t,{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(dt,{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(dt,{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(Nn,{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 b7(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 x7(){var T;const e=On(),t=sn(),[n,a]=gf(),l=n.get("agent"),o=eo(),c=Fe({queryKey:["adapters"],queryFn:m7}),f=Fe({queryKey:["adapter-mappings"],queryFn:c7}),m=Fe({queryKey:["adapter-statuses"],queryFn:h7,refetchInterval:15e3}),y=((T=Fe({queryKey:["agents","name-map"],queryFn:()=>Gu({limit:100}),staleTime:3e4}).data)==null?void 0:T.items)??[],g=x.useMemo(()=>{const q=new Map;for(const Y of m.data??[])q.set(Y.configId,Y);return q},[m.data]),b=x.useMemo(()=>{const q=c.data??[];return l?q.filter(Y=>Y.agentId===l):q},[c.data,l]),w=x.useMemo(()=>{const q=f.data??[];return l?q.filter(Y=>Y.agentId===l):q},[f.data,l]),k=b.reduce((q,Y)=>{var ue;return q+((ue=g.get(Y.id))!=null&&ue.connected?1:0)},0),j=b.length-k,C=c.isLoading||f.isLoading,[E,A]=x.useState(null),[z,U]=x.useState(""),[D,O]=x.useState(null),[P,L]=x.useState(null),[V,F]=x.useState(null),[X,ee]=x.useState(null),we=kt({mutationFn:q=>p7({platform:q.platform,agentId:q.agentId,credentials:q.credentials,status:q.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),se=kt({mutationFn:q=>{const Y={status:q.status};return q.credentials&&(Y.credentials=q.credentials),g7(q.id,Y)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),re=kt({mutationFn:y7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=kt({mutationFn:q=>d7({platform:q.platform,externalUserId:q.externalUserId,agentId:q.agentId,boundVia:"manual",displayName:q.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),L(null)}}),te=kt({mutationFn:f7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function ye(q){if(l){q==="bot"?O({agentId:l,editingId:null}):L({agentId:l});return}U(""),A({kind:q})}function Ae(){!E||!z||(E.kind==="bot"?O({agentId:z,editingId:null}):L({agentId:z}),A(null))}function _(q){if(D){if(q.kind==="bot-create")we.mutate({agentId:D.agentId,platform:q.draft.platform,status:q.draft.status,credentials:q.draft.credentials});else if(q.kind==="bot-update"){if(!D.editingId)return;se.mutate({id:D.editingId,status:q.status,credentials:q.credentials})}}}function I(q){!P||q.kind!=="user-create"||Z.mutate({agentId:P.agentId,platform:q.draft.platform,externalUserId:q.draft.externalUserId,displayName:q.draft.displayName})}const B=l?y.find(q=>q.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 q=new URLSearchParams(n);q.delete("agent"),a(q,{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(Kd,{className:"h-3 w-3"})})]})]}),u.jsxs(Vn,{className:"mb-3.5",children:[u.jsxs(zg,{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(Ni,{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(Ni,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>ye("bot"),children:[u.jsx(Na,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),C?u.jsx(Md,{children:"Loading…"}):b.length?u.jsxs(Vs,{children:[u.jsx(Qs,{children:u.jsxs(Mr,{children:[u.jsx(rt,{children:"Agent"}),u.jsx(rt,{children:"Platform"}),u.jsx(rt,{children:"Status"}),u.jsx(rt,{children:"Connection"}),u.jsx(rt,{children:"Created"}),u.jsx(rt,{style:{width:96,textAlign:"right"}})]})}),u.jsx(Ks,{children:b.map(q=>{var ue;const Y=((ue=g.get(q.id))==null?void 0:ue.connected)??!1;return u.jsxs(Mr,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Ye,{children:u.jsx("span",{className:"mono font-medium",children:o(q.agentId)})}),u.jsx(Ye,{children:u.jsx(Dr,{children:q.platform})}),u.jsx(Ye,{children:u.jsx(Dr,{tone:q.status==="active"?"accent":"outline",children:q.status})}),u.jsx(Ye,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(Ni,{state:Y?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:Y?"Online":"Offline"})]})}),u.jsx(Ye,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(q.createdAt)}),u.jsxs(Ye,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:ve=>ve.stopPropagation(),children:[u.jsx(me,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:q.agentId,editingId:q.id,initialPlatform:w7(q.platform),initialStatus:S7(q.status)}),children:"Edit"}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>F(q.id),disabled:re.isPending,title:"Delete",children:u.jsx(Fs,{className:"h-3.5 w-3.5"})})]})]},q.id)})})]}):u.jsx(Md,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(Vn,{children:[u.jsxs(zg,{right:u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>ye("user"),children:[u.jsx(Na,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),C?u.jsx(Md,{children:"Loading…"}):w.length?u.jsxs(Vs,{children:[u.jsx(Qs,{children:u.jsxs(Mr,{children:[u.jsx(rt,{children:"Agent"}),u.jsx(rt,{children:"Platform"}),u.jsx(rt,{children:"External user ID"}),u.jsx(rt,{children:"Display name"}),u.jsx(rt,{children:"Bound via"}),u.jsx(rt,{children:"Created"}),u.jsx(rt,{style:{width:32}})]})}),u.jsx(Ks,{children:w.map(q=>u.jsxs(Mr,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[u.jsx(Ye,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(q.agentId)})}),u.jsx(Ye,{children:u.jsx(Dr,{children:q.platform})}),u.jsx(Ye,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:q.externalUserId})}),u.jsx(Ye,{style:{color:"var(--fg-2)"},children:q.displayName??"—"}),u.jsx(Ye,{children:u.jsx(Dr,{tone:"outline",children:q.boundVia??"—"})}),u.jsx(Ye,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(q.createdAt)}),u.jsx(Ye,{onClick:Y=>Y.stopPropagation(),children:u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>ee(q.id),disabled:te.isPending,title:"Delete",children:u.jsx(Fs,{className:"h-3.5 w-3.5"})})})]},q.id))})]}):u.jsx(Md,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(k7,{open:E!=null,kind:(E==null?void 0:E.kind)??"bot",agents:y,agentId:z,onAgentChange:U,onCancel:()=>A(null),onConfirm:Ae}),u.jsx(yS,{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:we.isPending||se.isPending,errorMessage:(we.error??se.error)instanceof Error?(we.error??se.error).message:null,onOpenChange:q=>{q||(O(null),we.reset(),se.reset())},onSubmit:_}),u.jsx(yS,{open:P!=null,kind:"user",editingId:null,agentLabel:P?o(P.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:q=>{q||(L(null),Z.reset())},onSubmit:I}),u.jsx(vS,{open:V!=null,onOpenChange:q=>!q&&F(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:re.isPending,onConfirm:()=>{V!=null&&(re.mutate(V),F(null))}}),u.jsx(vS,{open:X!=null,onOpenChange:q=>!q&&ee(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:te.isPending,onConfirm:()=>{X!=null&&(te.mutate(X),ee(null))}})]})}function w7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function S7(e){return e==="inactive"?"inactive":"active"}function Md({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function k7(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(Wt,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{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(Nn,{children:[u.jsx(me,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(me,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function vS(e){return u.jsx(Wt,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Nn,{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 j7({embedded:e=!1}={}){return u.jsxs("div",{className:e?"":"-m-6",children:[u.jsx(Wu,{title:"Integrations",subtitle:"External platform bindings"}),u.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:u.jsx(x7,{})})]})}function C7(){return u.jsx(j7,{embedded:!0})}function E7(){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:200,padding:"var(--sp-4) var(--sp-2)"},children:[u.jsx(bS,{to:"/settings/computers",label:"Computers"}),u.jsx(bS,{to:"/settings/integrations",label:"Integrations"})]}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:u.jsx($s,{})})]})}function bS({to:e,label:t}){return u.jsx(pf,{to:e,className:({isActive:n})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!n&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:n})=>u.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:n?"var(--bg-active)":"transparent",color:n?"var(--fg)":"var(--fg-3)",fontWeight:n?500:400,borderRadius:"var(--radius-input)"},children:u.jsx("span",{className:"flex-1 truncate",children:t})})})}function Hg(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,ws)}const $p=200;function N7(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 _7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,ws)}function T7(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 A7({open:e,onOpenChange:t,onCreated:n}){const a=sn(),{refreshMe:l,organizationId:o}=$t(),[c,f]=x.useState(""),[m,h]=x.useState(""),[y,g]=x.useState(!1),[b,w]=x.useState("claude-code"),[k,j]=x.useState("form"),[C,E]=x.useState([]),[A,z]=x.useState(null),[U,D]=x.useState(!1),[O,P]=x.useState({}),[L,V]=x.useState({status:"idle"});x.useEffect(()=>{e&&(f(""),h(""),g(!1),w("claude-code"),j("form"),E([]),z(null),D(!1),P({}),V({status:"idle"}))},[e]),x.useEffect(()=>{y||h(Hg(c))},[c,y]);const F=x.useRef(0);x.useEffect(()=>{if(!e||!m){V({status:"idle"});return}if(!Tg.test(m)){V({status:"bad",reason:"invalid"});return}if(Ag(m)){V({status:"bad",reason:"reserved"});return}const _=++F.current;V({status:"checking"});const I=window.setTimeout(()=>{LD(m).then(B=>{_===F.current&&(B.available?V({status:"ok"}):V({status:"bad",reason:B.reason}))}).catch(()=>{_===F.current&&V({status:"idle"})})},300);return()=>window.clearTimeout(I)},[m,e]);const X=kt({mutationFn:async _=>{const I=c.trim()||m.trim()||"Untitled assistant";return ID({name:m||void 0,type:"personal_assistant",displayName:I,clientId:_.clientId,runtimeProvider:b,...o?{organizationId:o}:{}})},onSuccess:_=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(_,b)}}),ee=x.useMemo(()=>{const _=X.error;if(!_)return{};if(_ instanceof Zu){const I=N7(_.issues);return Object.keys(I).length>0?I:_.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:_.message}}return _ instanceof Error?{_root:_.message}:{}},[X.error]),we=L.status==="bad"?T7(L.reason):void 0,se={...we?{name:we}:{},...ee,...O};function re(){const _={};return m?m.length>ws?_.name=`Agent name must be at most ${ws} characters (got ${m.length}).`:Tg.test(m)?Ag(m)&&(_.name="That agent name is reserved — pick a different one."):_.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":c.trim().length>0&&(_.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),c.length>$p&&(_.displayName=`Display name must be at most ${$p} characters (got ${c.length}).`),_}async function Z(_){var B,T;_.preventDefault();const I=re();if(P(I),!(Object.keys(I).length>0)&&L.status!=="bad"){D(!0);try{const Y=(await _a()).filter(ve=>ve.status==="connected");if(Y.length===0){X.mutate({clientId:void 0});return}if(Y.length===1){X.mutate({clientId:(B=Y[0])==null?void 0:B.id});return}const ue=[...Y].sort((ve,be)=>be.lastSeenAt.localeCompare(ve.lastSeenAt));E(ue),z(((T=ue[0])==null?void 0:T.id)??null),j("pick-computer")}catch{X.mutate({clientId:void 0})}finally{D(!1)}}}function te(){A&&X.mutate({clientId:A})}const ye=L.status==="bad",Ae=c.trim().length>0&&!ye&&!X.isPending&&!U;return k==="pick-computer"?u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{className:"max-w-lg",children:[u.jsx(ln,{children:u.jsx(en,{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:c||m})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:C.map(_=>{const I=A===_.id;return u.jsxs("label",{className:I?"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:I,onChange:()=>z(_.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:_.hostname??_.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[_.os??"unknown OS"," · last seen ",new Date(_.lastSeenAt).toLocaleString()]})]})]},_.id)})}),se.clientId&&u.jsx("p",{className:"text-body text-destructive",children:se.clientId}),se._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:se._root})]}),u.jsxs(Nn,{children:[u.jsx(me,{variant:"outline",onClick:()=>j("form"),disabled:X.isPending,children:"Back"}),u.jsx(me,{onClick:te,disabled:!A||X.isPending,children:X.isPending?"Creating…":"Create"})]})]})}):u.jsx(Wt,{open:e,onOpenChange:t,children:u.jsxs(Vt,{className:"max-w-lg",children:[u.jsx(ln,{children:u.jsx(en,{children:"New Agent"})}),u.jsxs("form",{onSubmit:Z,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(_t,{id:"new-agent-display-name",value:c,onChange:_=>{f(_.target.value),O.displayName&&P(I=>({...I,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:$p,"aria-invalid":se.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."}),se.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:se.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{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(_t,{id:"new-agent-name",value:m,onChange:_=>{const I=_7(_.target.value);h(I),g(!0),O.name&&P(B=>({...B,name:void 0}))},onBlur:_=>{const I=Hg(_.target.value);I!==m&&h(I)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:ws,"aria-invalid":se.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"," ",ws," characters. Permanent after creation."]}),m&&!se.name&&L.status!=="idle"&&u.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:L.status==="ok"?"var(--state-idle)":L.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[L.status==="checking"&&"Checking availability…",L.status==="ok"&&"Available."]}),se.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:se.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:b==="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:b==="claude-code",onChange:()=>w("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:b==="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:b==="codex",onChange:()=>w("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."]})]})]})]})]}),se._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:se._root}),u.jsx(Nn,{children:u.jsx(me,{type:"submit",disabled:!Ae,children:U?"Checking computers…":X.isPending?"Creating…":"Create"})})]})]})})}function If({children:e,count:t,right:n}){return u.jsxs("div",{className:"flex items-baseline justify-between",style:{padding:"var(--sp-1) var(--sp-1) var(--sp-2)"},children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[u.jsx("h2",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t!==void 0&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:t})]}),n]})}function R7(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 z7(){const{organizationId:e}=$t(),[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 y=await Ne.get(`/admin/organizations/${e}/invitations`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const y=await Ne.post(`/admin/organizations/${e}/invitations/rotate`);n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(io,{children:[u.jsxs(lo,{children:[u.jsx(ec,{children:"Invite link"}),u.jsxs(lN,{children:["Anyone with this link can join your team as a member. Links expire after ",O6," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(so,{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?` · ${R7(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const O7=Object.values(D6);function D7(){const e=sn(),{memberId:t,role:n}=$t(),a=n==="admin",[l,o]=x.useState(null),{data:c,isLoading:f,error:m}=Fe({queryKey:["members"],queryFn:Af}),h=kt({mutationFn:CU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function y(g){window.confirm("Delete this member? Their human agent will also be deactivated.")&&h.mutate(g)}return u.jsxs(u.Fragment,{children:[u.jsx("section",{children:f?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):m?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",m instanceof Error?m.message:"Unknown error"]}):(c==null?void 0:c.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:a?"No members yet — share the Invite link to add teammates.":"No members yet."}):u.jsxs(Vs,{className:"table-fixed",children:[u.jsx(Qs,{children:u.jsxs(Mr,{children:[u.jsx(rt,{style:{width:160},children:"Display name"}),u.jsx(rt,{style:{width:140},children:"Username"}),u.jsx(rt,{style:{width:120},children:"Role"}),u.jsx(rt,{style:{width:150},children:"Created"}),u.jsx(rt,{"aria-hidden":!0}),a&&u.jsx(rt,{style:{width:80,textAlign:"right"}})]})}),u.jsx(Ks,{children:c==null?void 0:c.map(g=>{const b=t===g.id;return u.jsxs(Mr,{children:[u.jsxs(Ye,{children:[u.jsx("span",{className:"font-medium",children:g.displayName}),b&&u.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),u.jsx(Ye,{children:u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",g.username]})}),u.jsx(Ye,{className:"text-label",style:{color:"var(--fg-3)"},children:g.role==="admin"?"Admin":"Member"}),u.jsx(Ye,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(g.createdAt)}),u.jsx(Ye,{"aria-hidden":!0}),a&&u.jsx(Ye,{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:()=>o({id:g.id,username:g.username,displayName:g.displayName,role:g.role}),title:"Edit",children:u.jsx(Vu,{className:"h-3.5 w-3.5"})}),!b&&u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(g.id),disabled:h.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(Fs,{className:"h-3.5 w-3.5"})})]})})]},g.id)})})]})}),u.jsx(M7,{target:l,onClose:()=>o(null),onSaved:()=>{o(null),e.invalidateQueries({queryKey:["members"]})}})]})}function M7({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=kt({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:jU(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return u.jsx(Wt,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(dt,{children:"Username"}),u.jsx(_t,{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(dt,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(_t,{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(dt,{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:O7.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(Nn,{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 I7(){var m;const{role:e}=$t(),t=e==="admin",[n,a]=x.useState(!1),{data:l}=Fe({queryKey:["members"],queryFn:Af}),o=Fe({queryKey:["agents","team-page"],queryFn:()=>Gu({limit:100})}),c=(l==null?void 0:l.length)??0,f=(((m=o.data)==null?void 0:m.items)??[]).filter(h=>h.type!=="human").length;return u.jsxs(u.Fragment,{children:[u.jsx(Wu,{title:"Team",subtitle:`${c} ${c===1?"human":"humans"} and ${f} ${f===1?"agent":"agents"} working together`,right:t&&u.jsxs(me,{size:"xs",variant:"ghost",onClick:()=>a(!0),children:[u.jsx(Dk,{className:"h-3 w-3"}),"Invite link"]})}),u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)",display:"flex",flexDirection:"column",gap:"var(--sp-5)"},children:[u.jsx(L7,{}),u.jsx(U7,{data:o.data,isLoading:o.isLoading,error:o.error})]}),u.jsx(Wt,{open:n,onOpenChange:a,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{children:"Invite link"})}),u.jsx(z7,{})]})})]})}function L7(){return u.jsxs("section",{children:[u.jsx(If,{children:"Humans"}),u.jsx(D7,{})]})}function U7({data:e,isLoading:t,error:n}){const a=On(),l=sn(),o=JC(),{memberId:c}=$t(),[f,m]=x.useState(!1),{data:h}=Fe({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),y=x.useMemo(()=>{const w=new Map;for(const k of(h==null?void 0:h.agents)??[])w.set(k.agentId,k);return w},[h==null?void 0:h.agents]),g=x.useMemo(()=>{const w=((e==null?void 0:e.items)??[]).filter(C=>C.type!=="human");if(!c)return w;const k=[],j=[];for(const C of w)(C.managerId===c?k:j).push(C);return[...k,...j]},[e==null?void 0:e.items,c]);function b(w,k){m(!1),l.invalidateQueries({queryKey:["agents"]}),l.invalidateQueries({queryKey:["activity"]})}return u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsx(If,{right:u.jsxs(me,{size:"xs",variant:"ghost",className:"normal-case tracking-normal",onClick:()=>m(!0),children:[u.jsx(Na,{className:"h-3 w-3"}),"New agent"]}),children:"Agents"}),t?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",n instanceof Error?n.message:"Unknown error"]}):g.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents yet — create one with “New agent”."}):u.jsxs(Vs,{children:[u.jsx(Qs,{children:u.jsxs(Mr,{children:[u.jsx(rt,{style:{width:160},children:"Display name"}),u.jsx(rt,{style:{width:140},children:"Agent name"}),u.jsx(rt,{style:{minWidth:150},children:"Type"}),u.jsx(rt,{style:{minWidth:160},children:"Managed by"}),u.jsx(rt,{style:{minWidth:100},children:"Visibility"}),u.jsx(rt,{style:{minWidth:110},children:"Status"}),u.jsx(rt,{style:{minWidth:150},children:"Created"})]})}),u.jsx(Ks,{children:g.map(w=>{const k=y.get(w.uuid);return u.jsxs(Mr,{interactive:!0,onClick:()=>a(`/agents/${encodeURIComponent(w.uuid)}`),children:[u.jsx(Ye,{children:u.jsx("span",{className:"font-medium",children:w.displayName})}),u.jsx(Ye,{children:w.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",w.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(Ye,{className:"text-label",style:{color:"var(--fg-3)"},children:P7(w.type)}),u.jsxs(Ye,{className:"text-label",style:{color:"var(--fg-2)"},children:[w.managerId?o(w.managerId):"—",w.managerId&&w.managerId===c&&u.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),u.jsx(Ye,{className:"text-label",style:{color:"var(--fg-3)"},children:B7(w.visibility)}),u.jsx(Ye,{children:u.jsx(bl,{state:(k==null?void 0:k.runtimeState)??null})}),u.jsx(Ye,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(w.createdAt)})]},w.uuid)})})]})]}),u.jsx(A7,{open:f,onOpenChange:m,onCreated:b})]})}function P7(e){return e==="autonomous_agent"?"Autonomous agent":e==="personal_assistant"?"Personal assistant":e}function B7(e){return e==="organization"?"Shared":e==="private"?"Private":e}function $7(){return Ne.get("/admin/system/config")}function F7(e){return Ne.patch("/admin/system/config",e)}function q7(e){return Ne.get(`/admin/organizations/${encodeURIComponent(e)}`)}function H7(e,t){return Ne.patch(`/admin/organizations/${encodeURIComponent(e)}`,t)}function Z7(){const{organizationId:e}=$t(),t=sn(),n=Fe({queryKey:["organization",e],queryFn:()=>e?q7(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(""),[f,m]=x.useState(!1);x.useEffect(()=>{n.data&&(l(n.data.displayName),c(n.data.name))},[n.data]);const h=kt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},b=a.trim(),w=o.trim();return b&&b!==n.data.displayName&&(g.displayName=b),w&&w!==n.data.name&&(g.name=w),Object.keys(g).length===0?Promise.resolve(n.data):H7(e,g)},onSuccess:g=>{t.setQueryData(["organization",e],g),t.invalidateQueries({queryKey:["me-organizations"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return u.jsxs("section",{children:[u.jsx(If,{right:u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&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",variant:"outline",disabled:h.isPending||!n.data,children:[u.jsx(Er,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]}),children:"Team identity"}),n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[u.jsx(xS,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),u.jsx(xS,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>c(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})]})}function xS({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) var(--sp-1)",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 sN=[{key:ji.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ji.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ji.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ji.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],wS=sN.map(e=>e.key);function V7(){const e=sn(),{data:t,isLoading:n}=Fe({queryKey:["system-config"],queryFn:$7}),[a,l]=x.useState({}),[o,c]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of wS){const b=t[g]??Hd[g]??"";y[g]=String(b)}l(y)},[t]);const f=kt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const w=b.trim();if(w==="")y[g]=Hd[g]??0;else{const k=Number(w);y[g]=Number.isNaN(k)?w:k}}return F7(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),c(!0),setTimeout(()=>c(!1),2e3)}});function m(){const y={};for(const g of wS)y[g]=String(Hd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return u.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[u.jsx(Z7,{}),u.jsx("form",{onSubmit:h,children:u.jsxs("section",{children:[u.jsx(If,{right: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",variant:"outline",disabled:f.isPending,children:[u.jsx(Er,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]}),children:"System configuration"}),n?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):sN.map(y=>u.jsx(Q7,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&u.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})})]})}function Q7({field:e,value:t,onChange:n}){const a=String(Hd[e.key]??"—");return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) var(--sp-1)",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(Tf,{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})]})]})}function K7(){const{role:e}=$t();return e===null?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?u.jsx(lr,{to:"/team",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx(Wu,{title:"Team settings",subtitle:"Organization name, slug, and metadata"}),u.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:u.jsx(V7,{})})]})}function G7(){const{role:e}=$t();return e!=="admin"?u.jsx($s,{}):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:200,padding:"var(--sp-4) var(--sp-2)"},children:[u.jsx(SS,{to:"/team",end:!0,label:"Members"}),u.jsx(SS,{to:"/team/settings",label:"Team settings"})]}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:u.jsx($s,{})})]})}function SS({to:e,label:t,end:n}){return u.jsx(pf,{to:e,end:n,className:({isActive:a})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!a&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:a})=>u.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:a?"var(--bg-active)":"transparent",color:a?"var(--fg)":"var(--fg-3)",fontWeight:a?500:400,borderRadius:"var(--radius-input)"},children:u.jsx("span",{className:"flex-1 truncate",children:t})})})}function Y7(e){return Ne.get(`/admin/chats/${encodeURIComponent(e)}`)}function X7(e,t){return Ne.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function kS(e,t){return Ne.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function J7(e,t){return Ne.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function W7(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 oN(e){return Ne.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function eH(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 Ne.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const tH="first-tree-hub-images",nH=1,Gs="images";let Id=null;function uN(){return Id||(Id=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(tH,nH);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Gs)||n.createObjectStore(Gs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Id)}async function rH(e){const t=await uN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Gs,"readwrite"),o=l.objectStore(Gs),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 aH(e){const t=await uN();return t?new Promise(n=>{const o=t.transaction(Gs,"readonly").objectStore(Gs).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 iH(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 lH(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 sH(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}`,y=l.length+c.length+(f?1:0);return{text:h,cursor:y}}function oH({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:iH(e,t),[e,t,l]),y=x.useMemo(()=>h?lH(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(E){if(!h)return;const A=sH(e,h,t,E);A&&a(A)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:E=>{if(!w||!h)return!1;if(E.key==="ArrowDown")return E.preventDefault(),c(A=>y.length===0?0:(A+1)%y.length),!0;if(E.key==="ArrowUp")return E.preventDefault(),c(A=>y.length===0?0:(A-1+y.length)%y.length),!0;if(E.key==="Enter"||E.key==="Tab"){const A=y[o]??y[0];return A?(E.preventDefault(),j(A),!0):!1}return E.key==="Escape"?(E.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function uH({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:Te("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:y=>{y.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 cN(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function cH(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=jS(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=jS(l.payload);return o?a.get(o)===l.seq:!0})}function jS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Lf(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 dN(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 dH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function CS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function fH({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 hH({agentId:e,chatId:t,session:n}){const a=sn(),[,l]=gf(),[o,c]=x.useState(!1),[f,m]=x.useState(null),h=Xk(e,t),y=Yd(e),g=C=>{a.setQueryData(h,E=>E&&{...E,state:C}),a.setQueryData(y,E=>E&&E.map(A=>A.chatId===t?{...A,state:C}:A))},b=kt({mutationFn:()=>gO(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const C=a.getQueryData(h),E=a.getQueryData(y);return g("suspended"),{previousSession:C,previousList:E}},onError:(C,E,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList)},onSuccess:C=>{g(C.state)}}),w=kt({mutationFn:()=>yO(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const C=a.getQueryData(h),E=a.getQueryData(y);return a.setQueryData(y,A=>A&&A.filter(z=>z.chatId!==t)),{previousSession:C,previousList:E}},onError:(C,E,A)=>{A!=null&&A.previousSession&&a.setQueryData(h,A.previousSession),A!=null&&A.previousList&&a.setQueryData(y,A.previousList),m(C instanceof Error?C.message:"Terminate failed")},onSuccess:(C,E,A)=>{if(C.state!=="evicted"){A!=null&&A.previousList&&a.setQueryData(y,A.previousList),g(C.state),m(`Session is ${C.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:C=>C.currentTarget.style.background="var(--bg-hover)",onMouseLeave:C=>C.currentTarget.style.background="transparent",children:[u.jsx(WR,{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:w.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:C=>C.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:C=>C.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[u.jsx(sz,{className:"h-3 w-3"})," Terminate"]})]}),u.jsx(mH,{open:o,onOpenChange:C=>{w.isPending||c(C),C||m(null)},session:n,chatId:t,error:f,pending:w.isPending,onConfirm:()=>w.mutate()})]})}function mH(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:c,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return u.jsx(Wt,{open:t,onOpenChange:n,children:u.jsxs(Vt,{children:[u.jsx(ln,{children:u.jsx(en,{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: ",dN(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(Nn,{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 pH({event:e}){const t=fO(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?CS(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:["(",CS(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:["· ",dH(t.durationMs)]}):null]})]})}function gH({event:e,agentNameFn:t,agentId:n}){const a=mO(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(fN,{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:Lf(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 yH({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:Lf(e.createdAt)})]})}function vH({event:e}){const t=hO(e.payload),n=Lf(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 fN({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(to,{width:9,height:10,style:{color:"var(--accent)"}})})}function bH({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(fN,{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:Lf(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(fH,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&xH(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"&&wH(e.content)?u.jsx(SH,{content:e.content}):e.format==="text"?u.jsx(aN,{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 xH(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 wH(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 SH({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return aH(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 kH({agentId:e,chatId:t}){var Ie;const n=sn(),a=eo(),l=Gj(),{agentId:o}=$t(),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,w]=x.useState(!1),[k,j]=x.useState(null),C=x.useRef(null),E=x.useRef(null),A=x.useRef(null),z=x.useRef(!1),U=x.useRef(new Set);x.useEffect(()=>{z.current=!1},[t]);const{data:D}=Fe({queryKey:["chat-messages",t],queryFn:()=>eH(t,{limit:50}),refetchInterval:5e3}),{data:O}=Fe({queryKey:["session-events",e,t],queryFn:()=>pO(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:P}=Fe({queryKey:Xk(e,t),queryFn:()=>Ws(e).then(ne=>ne.find(je=>je.chatId===t)??null),refetchInterval:5e3}),{data:L}=Fe({queryKey:["chat-detail",t],queryFn:()=>Y7(t),enabled:!!t}),V=kt({mutationFn:ne=>kS(t,ne),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Yd(e)})}}),F=x.useCallback(ne=>{const Le=ne.filter(dn=>dn.type.startsWith("image/"));if(Le.length===0)return;const Pe=Le.find(dn=>dn.size>5242880);if(Pe){j(`Image too large (${(Pe.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const It=Le.map(dn=>({id:crypto.randomUUID(),file:dn,previewUrl:URL.createObjectURL(dn)}));g(dn=>[...dn,...It]),j(null)},[]),X=x.useCallback(ne=>{g(je=>{const Le=je.find(Pe=>Pe.id===ne);return Le&&URL.revokeObjectURL(Le.previewUrl),je.filter(Pe=>Pe.id!==ne)})},[]),ee=async()=>{const ne=c.trim(),je=y;if(!(!ne&&je.length===0)&&!b&&!(Y&&ue.length===0)){if(je.length>0){w(!0),j(null);try{for(const Le of je){const Pe=await W7(Le.file),It=crypto.randomUUID();await rH({imageId:It,base64:Pe,mimeType:Le.file.type}),await J7(t,{data:Pe,mimeType:Le.file.type,filename:Le.file.name,size:Le.file.size,imageId:It}),URL.revokeObjectURL(Le.previewUrl)}g([]),ne&&await kS(t,ne),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:Yd(e)})}catch(Le){j(Le instanceof Error?Le.message:"Failed to send image")}finally{w(!1)}return}V.mutate(ne)}},[we,se]=x.useState(!1),[re,Z]=x.useState(""),te=x.useRef(null);x.useEffect(()=>{var ne;we&&((ne=te.current)==null||ne.focus())},[we]);const ye=kt({mutationFn:ne=>X7(t,ne),onSuccess:()=>{se(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),Ae=()=>{const ne=re.trim();ye.mutate(ne.length>0?ne:null)},_=x.useMemo(()=>{const ne=(D==null?void 0:D.items)??[],je=cH((O==null?void 0:O.items)??[]),Le=[...ne.map(Pe=>({kind:"message",at:Pe.createdAt,key:`m-${Pe.id}`,data:Pe})),...je.map(Pe=>({kind:"event",at:Pe.createdAt,key:`e-${Pe.id}`,data:Pe}))];return Le.sort((Pe,It)=>Pe.at.localeCompare(It.at)),Le},[D,O]),I=_.length;x.useEffect(()=>{var ne;I>0&&((ne=A.current)==null||ne.scrollIntoView({behavior:"smooth"}))},[I]);const B=L!=null&&L.participants?L.participants.map(ne=>{const je=a(ne.agentId);return`@${je.length>20?`${je.slice(0,17)}…`:je}`}).join(" "):`@${a(e)}`,T=a(e),q=x.useMemo(()=>{var Le;const ne=((Le=L==null?void 0:L.participants)==null?void 0:Le.map(Pe=>Pe.agentId))??[e],je=[];for(const Pe of ne){if(Pe===o)continue;const It=l(Pe);!It||!It.name||je.push({agentId:Pe,name:It.name,displayName:It.displayName})}return je},[L==null?void 0:L.participants,e,l,o]),Y=x.useMemo(()=>{if(!L)return!1;if(L.type==="group")return!0;const ne=L.participants.some(je=>je.agentId===o);return L.type==="direct"&&!ne&&L.participants.length>=2},[L,o]);x.useEffect(()=>{if(U.current.has(t)||!D||!O||!L||_.length>0||c.length>0||Y||T===e)return;const ne=`Hi ${T}! What can you help with?`;f(ne),h(ne.length),U.current.add(t),requestAnimationFrame(()=>{const je=E.current;je&&(je.focus(),je.setSelectionRange(ne.length,ne.length))})},[t,e,D,O,L,_.length,c.length,T,Y]);const ue=x.useMemo(()=>{if(!Y)return[];const ne=q.map(je=>({agentId:je.agentId,name:je.name}));return YL(c,ne)},[c,q,Y]),ve=oH({value:c,cursor:m,candidates:q,disabled:V.isPending||b,onSelect:ne=>{f(ne.text),h(ne.cursor),requestAnimationFrame(()=>{const je=E.current;je&&(je.focus(),je.setSelectionRange(ne.cursor,ne.cursor))})}}),be=(P==null?void 0:P.runtimeState)??"idle",fe=cN((P==null?void 0:P.runtimeState)??null,e?"connected":null),Ge=(P==null?void 0:P.messageCount)??((Ie=D==null?void 0:D.items)==null?void 0:Ie.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(Ni,{state:fe,size:8}),we?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:te,value:re,onChange:ne=>Z(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"?(ne.preventDefault(),Ae()):ne.key==="Escape"&&(ne.preventDefault(),se(!1))},disabled:ye.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:Ae,disabled:ye.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(Er,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>se(!1),disabled:ye.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(Kd,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(L==null?void 0:L.topic)||(P==null?void 0:P.summary)||`Chat · ${t.slice(0,8)}`}),u.jsx("button",{type:"button",onClick:()=>{Z((L==null?void 0:L.topic)??""),se(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:ne=>ne.currentTarget.style.color="var(--fg-2)",onMouseLeave:ne=>ne.currentTarget.style.color="var(--fg-4)",children:u.jsx(Vu,{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:B}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",dN((P==null?void 0:P.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[Ge," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:fe==="error"?"var(--state-error)":"var(--fg-2)"},children:be})]})]})]}),u.jsx(hH,{agentId:e,chatId:t,session:P??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[I===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(hy,{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:_.map(ne=>{if(ne.kind==="event"){const je=ne.data;switch(je.kind){case"tool_call":return u.jsx(pH,{event:je},ne.key);case"assistant_text":return u.jsx(gH,{event:je,agentId:e,agentNameFn:a},ne.key);case"thinking":return u.jsx(yH,{event:je},ne.key);case"error":return u.jsx(vH,{event:je},ne.key);default:return null}}return u.jsx(bH,{msg:ne.data,myAgentId:o,agentNameFn:a},ne.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:ne=>ne.preventDefault(),onDrop:ne=>{ne.preventDefault(),F(Array.from(ne.dataTransfer.files))},children:[y.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:y.map(ne=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:ne.previewUrl,alt:ne.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>X(ne.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(Kd,{className:"h-2 w-2"})})]},ne.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(uH,{trigger:ve.trigger,results:ve.results,highlightIndex:ve.highlightIndex,anchorRef:E,onPick:ve.pick}),u.jsx("textarea",{ref:E,value:c,onChange:ne=>{f(ne.target.value),h(ne.target.selectionStart??ne.target.value.length)},onSelect:ne=>{h(ne.currentTarget.selectionStart??c.length)},onFocus:()=>{Y&&(z.current||c.length>0||q.length===0||(z.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ne=E.current;ne&&ne.setSelectionRange(1,1)})))},onPaste:ne=>{const je=Array.from(ne.clipboardData.files);je.length>0&&(ne.preventDefault(),F(je))},placeholder:Y?"Type @ to pick a recipient, then your message":`Message @${T} · / for commands · @ to mention`,rows:2,onKeyDown:ne=>{ve.handleKey(ne)||ne.key==="Enter"&&!ne.shiftKey&&(ne.preventDefault(),ee())},disabled:V.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 ne;return(ne=C.current)==null?void 0:ne.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(XR,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:C,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ne=>{ne.target.files&&(F(Array.from(ne.target.files)),ne.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:ee,disabled:V.isPending||b||!c.trim()&&y.length===0||Y&&ue.length===0,title:Y&&ue.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:Te("inline-flex items-center transition-colors text-label font-semibold",(V.isPending||b||!c.trim()&&y.length===0||Y&&ue.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(iz,{className:"h-3 w-3"})," Send"]})]})]})]}),(V.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??(V.error instanceof Error?V.error.message:"Failed to send")})]})]})}function jH(){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(to,{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."})]})})}const CH=3e4,EH=1e3,NH=3e3;function _H(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function TH(){var ve;const{refreshMe:e,organizationId:t,memberId:n}=$t(),a=On(),l=nR(t,n),o=aR(l),c=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=c?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=x.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=x.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[b,w]=x.useState(null),[k,j]=x.useState(null),[C,E]=x.useState(null),[A,z]=x.useState(()=>c),[U,D]=x.useState(()=>f),[O,P]=x.useState([]),[L,V]=x.useState("form"),[F,X]=x.useState(null),[ee]=x.useState(()=>eR()),we=x.useRef(null),se=x.useRef(null),re=x.useRef(null),Z=x.useRef(0);x.useEffect(()=>()=>{se.current&&(se.current.cancelled=!0)},[]),x.useEffect(()=>{iR(l,{displayName:m,selectedRuntime:y,connectToken:A,connectTokenExpiresAt:U})},[l,m,y,A,U]),x.useEffect(()=>{(async()=>{try{const be=await Ne.get("/me/organizations");P(be)}catch{}})()},[]),x.useEffect(()=>{if(L!=="form")return;let be=!1;const fe=async()=>{const Ie=++Z.current;try{const ne=await _a();if(be||Ie!==Z.current)return;const Le=ne.filter(Pe=>Pe.status==="connected").sort((Pe,It)=>It.lastSeenAt.localeCompare(Pe.lastSeenAt))[0]??null;if(w(Pe=>(Pe==null?void 0:Pe.id)===(Le==null?void 0:Le.id)?Pe:Le),Le){re.current!==Le.id&&(re.current=null,E(null),j(null));try{const Pe=await vy(Le.id);if(be||Ie!==Z.current)return;re.current=Le.id,E(Le.id),j(Pe.capabilities)}catch{}}else re.current=null,E(null),j(null)}catch{}};fe();const Ge=setInterval(fe,NH);return()=>{be=!0,clearInterval(Ge)}},[L]),x.useEffect(()=>{if(b)return;if(A&&U&&U>Date.now()){const fe=Math.max(U-Date.now(),0),Ge=window.setTimeout(()=>{z(null),D(null)},fe);return()=>window.clearTimeout(Ge)}A&&(z(null),D(null));let be=!1;return(async()=>{try{const fe=await Ne.post("/connect-tokens",{});be||(z(fe.token),D(Date.now()+fe.expiresIn*1e3))}catch(fe){be||X(fe instanceof Error?fe.message:"Failed to generate connect token")}})(),()=>{be=!0}},[b,A,U]);const te=b&&C===b.id?k:null;x.useEffect(()=>{g(be=>{if(!te)return be;const fe=Object.entries(te).filter(([,Ge])=>Ge.state==="ok").map(([Ge])=>Ge);return be&&fe.includes(be)?be:fe[0]??null})},[te]);const ye=te?Object.entries(te).filter(([,be])=>be.state==="ok").map(([be])=>be):[],Ae=((ve=O.find(be=>be.id===t))==null?void 0:ve.displayName)??"",_=m.trim(),I=_||"your agent",B=A?`npm install -g @agent-team-foundation/first-tree-hub
|
|
387
|
-
first-tree-hub connect ${A}`:null,T=x.useCallback(async be=>{se.current&&(se.current.cancelled=!0);const fe={cancelled:!1};se.current=fe;const Ge=Date.now();for(;!fe.cancelled;){let Ie=!1;try{const ne=await Ne.get(`/admin/agents/${encodeURIComponent(be)}/client-status`);if(fe.cancelled)return;Ie=ne.online===!0}catch{if(fe.cancelled)return}if(Ie){try{const ne=await oN(be);if(fe.cancelled||(lR(l),await e(),fe.cancelled))return;a(`/?a=${encodeURIComponent(be)}&c=${encodeURIComponent(ne.id)}`,{replace:!0})}catch(ne){if(fe.cancelled)return;X(ne instanceof Error?ne.message:"Failed to open chat"),V("timeout")}return}if(Date.now()-Ge>CH){fe.cancelled||V("timeout");return}await new Promise(ne=>setTimeout(ne,EH))}},[l,e,a]),q=!!(_&&b&&y&&ye.includes(y)&&L==="form"),Y=x.useCallback(async()=>{if(!b||!y||!_)return;X(null),V("creating");const be=Hg(_);let fe;try{fe=(await Ne.post("/admin/agents",{type:"personal_assistant",displayName:_,...be?{name:be}:{},clientId:b.id,runtimeProvider:y,...t?{organizationId:t}:{}})).uuid,we.current=fe}catch(Ge){X(Ge instanceof Error?Ge.message:"Failed to create agent"),V("form");return}await T(fe)},[_,b,y,T,t]),ue=x.useCallback(async()=>{const be=we.current;be&&(X(null),V("creating"),await T(be))},[T]);return u.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:560},children:[L==="form"&&u.jsx(AH,{joinPath:ee,teamName:Ae,displayName:m,setDisplayName:h,trimmedName:_,connectedClient:b,cliCommand:B,okRuntimes:ye,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:te!==null,error:F,canCreate:q,onCreate:Y}),L==="creating"&&u.jsx(LH,{nameOrFallback:I}),L==="timeout"&&u.jsx(UH,{nameOrFallback:I,hostname:(b==null?void 0:b.hostname)??null,error:F,onRetry:ue})]})})}function AH({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:c,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:b,onCreate:w}){const k=x.useRef(null),C=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",E=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return x.useEffect(()=>{var A;l||(A=k.current)==null||A.focus()},[l]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[u.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[u.jsx("span",{style:{color:"var(--fg-2)"},children:C}),u.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),u.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),u.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[u.jsx(RH,{}),u.jsx(ES,{number:"01",state:l?"complete":"active",children:u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[u.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),u.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:A=>a(A.target.value),placeholder:"e.g. Code Reviewer",maxLength:200,className:"onboarding-name-input text-body font-medium",style:{flex:"0 1 28ch",minWidth:"22ch",maxWidth:"30ch",padding:"var(--sp-0_5) 0",background:"transparent",border:0,borderBottom:"var(--hairline) solid var(--border-faint)",borderRadius:0,boxShadow:"none",color:"var(--fg)",outline:"none",caretColor:"var(--accent)",transition:"border-color 160ms ease, color 160ms ease"},onFocus:A=>{A.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:A=>{A.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),u.jsx(ES,{number:"02",state:b?"complete":l?"active":"idle",children:u.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[u.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?u.jsx(DH,{hostname:o.hostname??o.id}):u.jsxs(u.Fragment,{children:[u.jsx(zH,{command:c}),u.jsx(OH,{})]}),o&&u.jsx(MH,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&u.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&u.jsxs("div",{style:{marginTop:b?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!b&&u.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:E}),b&&u.jsxs(me,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter:A=>{A.currentTarget.style.transform="scale(1.01)",A.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:A=>{A.currentTarget.style.transform="scale(1)",A.currentTarget.style.boxShadow="var(--shadow-md)"},children:[u.jsxs("span",{children:["Create ",l]}),u.jsx(SR,{className:"h-4 w-4"})]}),u.jsx("p",{className:"text-caption",style:{margin:b?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function RH(){return u.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function ES({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return u.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[u.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?u.jsx(Er,{className:"h-3 w-3"}):e}),u.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function zH({command:e}){const[t,n]=x.useState(!1),l=(e?e.split(`
|
|
388
|
-
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",c=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return u.jsx("div",{style:{marginTop:"var(--sp-2)"},children:u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[u.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:c||"Generating token…"}),u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?u.jsx(Er,{className:"h-3.5 w-3.5"}):u.jsx(Ak,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function OH(){return u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[u.jsx(IH,{}),u.jsx("span",{children:"Waiting for your computer…"})]})}function DH({hostname:e}){return u.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[u.jsx(Er,{className:"h-3.5 w-3.5"}),u.jsxs("span",{children:[u.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function MH({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?u.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):u.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),u.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[u.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const c=t===l;return u.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:c?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:c?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[u.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:c,onChange:()=>n(l),className:"sr-only"}),u.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:c?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:c?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:c?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:c&&u.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),_H(l)]},l)})]})]})}function IH(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function LH({nameOrFallback:e}){return u.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),u.jsx(PH,{}),u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function UH({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return u.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[u.jsx("p",{children:"This usually means:"}),u.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[u.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),u.jsxs("li",{children:["The connection to ",l," dropped"]})]}),u.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",u.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),u.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:u.jsx(me,{onClick:a,children:"Try again"})})]})}function PH(){return u.jsxs("span",{className:"flex items-center",style:{gap:6},children:[u.jsx(Fp,{delayMs:0}),u.jsx(Fp,{delayMs:160}),u.jsx(Fp,{delayMs:320})]})}function Fp({delayMs:e}){return u.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function BH({selectedAgentId:e,selectedChatId:t}){const{wizardStep:n}=$t();return t&&e?u.jsx(kH,{agentId:e,chatId:t}):n!==null&&n!=="completed"?u.jsx(TH,{}):u.jsx(jH,{})}function hN(){const{data:e}=Fe({queryKey:["clients"],queryFn:_a,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 Zg({children:e}){return u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function mN({children:e}){return u.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Kr({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 NS(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 _S(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 $H({notifications:e,agentId:t}){const[,n]=gf(),a=sn(),l=kt({mutationFn:o=>Yj(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>u.jsx(Xj,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function pN({agentId:e}){var h;const t=eo(),{resolve:n}=hN(),{data:a}=Fe({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),l=(h=a==null?void 0:a.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:c}=Fe({queryKey:["notifications","agent",e],queryFn:()=>jg({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(to,{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(bl,{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:_S((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(Zg,{children:"Computer · runtime"}),u.jsxs(mN,{children:[u.jsx(Kr,{label:"host",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),u.jsx(Kr,{label:"os",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),u.jsx(Kr,{label:"runtime",children:u.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),u.jsx(Kr,{label:"sdk",children:u.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),u.jsx(Kr,{label:"connected",children:u.jsx("span",{className:"mono text-label",children:_S((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(Zg,{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($H,{notifications:c.items,agentId:e})]})]})}function FH({agentId:e,chatId:t}){const{data:n}=Fe({queryKey:["session",e,t],queryFn:()=>Ws(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(Zg,{children:"Session"}),u.jsxs(mN,{children:[u.jsx(Kr,{label:"state",children:u.jsx(bl,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),u.jsx(Kr,{label:"chat",children:u.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),u.jsx(Kr,{label:"started",children:NS((n==null?void 0:n.startedAt)??null)}),u.jsx(Kr,{label:"last",children:NS((n==null?void 0:n.lastActivityAt)??null)}),u.jsx(Kr,{label:"messages",children:u.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),u.jsx(pN,{agentId:e})]})}function qH({selectedAgentId:e,selectedChatId:t}){return t&&e?u.jsx(FH,{agentId:e,chatId:t}):e?u.jsx(pN,{agentId:e}):null}function HH({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:Te("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 ZH=32;function VH({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return u.jsx("div",{className:Te("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:ZH}).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 QH={error:0,blocked:1,working:2,idle:3};function KH(e,t){return t?e?QH[e]??4:4:5}function GH(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function YH({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=eo(),{resolve:o}=hN(),c=tU(),[f,m]=x.useState(""),[h,y]=x.useState("all"),{data:g}=Fe({queryKey:["activity"],queryFn:Qu,refetchInterval:1e4}),{data:b}=Fe({queryKey:e?Yd(e):["agent-sessions",null],queryFn:()=>e?Ws(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),w=kt({mutationFn:D=>oN(D),onSuccess:(D,O)=>{a(O,D.id)}}),{humans:k,agents:j,totalAll:C}=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[],O=f.trim().toLowerCase(),P=D.filter(X=>{var se;if(!GH(X,h))return!1;if(!O)return!0;const ee=l(X.agentId).toLowerCase(),we=X.clientId?(((se=o(X.clientId))==null?void 0:se.hostname)??"").toLowerCase():"";return ee.includes(O)||we.includes(O)||X.agentId.toLowerCase().includes(O)}),L=X=>KH(X.runtimeState,X.clientId),V=[],F=[];for(const X of P)(X.type==="human"?V:F).push(X);return V.sort((X,ee)=>L(X)-L(ee)),F.sort((X,ee)=>L(X)-L(ee)),{humans:V,agents:F,totalAll:D.length}},[g,f,h,l,o]),E=x.useMemo(()=>{const D=(g==null?void 0:g.agents)??[];return{working:D.filter(O=>O.runtimeState==="working").length,blocked:D.filter(O=>O.runtimeState==="blocked").length,error:D.filter(O=>O.runtimeState==="error").length}},[g]),A=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:E.working},{value:"attn",label:"attn",count:E.blocked+E.error,warn:E.blocked+E.error>0}],z=D=>{var X;const O=e===D.agentId,P=cN(D.runtimeState,D.clientId),L=D.clientId?((X=o(D.clientId))==null?void 0:X.hostname)??D.clientId.slice(0,8):null,V=D.activeSessions??0,F=D.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>n(O?null:D.agentId),className:Te("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:O?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${O?"var(--accent)":"transparent"}`},children:[u.jsx(Ni,{state:P,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:P==="offline"?"disconnected":L||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:F>0&&u.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[V,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",F]})]})})]}),O&&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(ee=>ee.state!=="evicted").map(ee=>{const we=ee.state==="active"?"working":"idle";return u.jsxs("button",{type:"button",onClick:()=>a(D.agentId,ee.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===ee.chatId?"var(--bg-hover)":"transparent",color:ee.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:se=>{t!==ee.chatId&&(se.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:se=>{t!==ee.chatId&&(se.currentTarget.style.background="transparent")},children:[u.jsx(Ni,{state:we,size:6}),u.jsx("span",{className:"truncate text-body",style:{color:ee.topic||ee.summary?"var(--fg-2)":"var(--fg-4)"},children:ee.topic||ee.summary||`Chat · ${ee.chatId.slice(0,8)}`})]},ee.chatId)}),u.jsxs("button",{type:"button",onClick:()=>w.mutate(D.agentId),disabled:w.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:ee=>{ee.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ee=>{ee.currentTarget.style.background="transparent"},children:[u.jsx(Na,{className:"h-3 w-3"}),"New chat"]})]})]},D.agentId)},U=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:[C," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(my,{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(HH,{active:h===D.value,count:D.count,warn:D.warn,onClick:()=>y(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(XH,{}),"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:[E.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[E.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[E.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[U===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":u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{margin:0},children:"No agents"}),u.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Your first agent will appear here."})]})}),j.length>0&&u.jsxs("div",{children:[u.jsx(TS,{label:"Agents",count:j.length}),j.map(z)]}),k.length>0&&u.jsxs("div",{children:[u.jsx(TS,{label:"Humans",count:k.length}),k.map(z)]})]})]})}function TS({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 XH(){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]=gf(),n=e.get("a"),a=e.get("c");GC();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:c}=Fe({queryKey:["agent-sessions",n],queryFn:()=>n?Ws(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(YH,{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(BH,{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(qH,{selectedAgentId:n,selectedChatId:a})})]})}const WH=new cT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function eZ(){return u.jsx(dT,{client:WH,children:u.jsx(oR,{children:u.jsx(BA,{children:u.jsxs(pA,{children:[u.jsx(At,{path:"/login",element:u.jsx(Vq,{})}),u.jsx(At,{path:"/signup",element:u.jsx(lr,{to:"/login",replace:!0})}),u.jsx(At,{path:"/auth/github/complete",element:u.jsx(Qq,{})}),u.jsx(At,{path:"/invite/:token",element:u.jsx(Fq,{})}),u.jsx(At,{element:u.jsx(mR,{}),children:u.jsxs(At,{element:u.jsx(eU,{children:u.jsx(dM,{})}),children:[u.jsx(At,{index:!0,element:u.jsx(JH,{})}),u.jsx(At,{path:"context",element:u.jsx(Bq,{})}),u.jsx(At,{path:"agents/:uuid",element:u.jsx(zq,{})}),u.jsxs(At,{path:"team",element:u.jsx(G7,{}),children:[u.jsx(At,{index:!0,element:u.jsx(I7,{})}),u.jsx(At,{path:"settings",element:u.jsx(K7,{})})]}),u.jsxs(At,{path:"settings",element:u.jsx(E7,{}),children:[u.jsx(At,{index:!0,element:u.jsx(lr,{to:"computers",replace:!0})}),u.jsx(At,{path:"computers",element:u.jsx(u7,{})}),u.jsx(At,{path:"integrations",element:u.jsx(C7,{})})]}),u.jsx(At,{path:"agents",element:u.jsx(lr,{to:"/team",replace:!0})}),u.jsx(At,{path:"clients",element:u.jsx(lr,{to:"/settings/computers",replace:!0})}),u.jsx(At,{path:"integrations",element:u.jsx(lr,{to:"/settings/integrations",replace:!0})}),u.jsx(At,{path:"team/members",element:u.jsx(lr,{to:"/team",replace:!0})}),u.jsx(At,{path:"team/agents",element:u.jsx(lr,{to:"/team",replace:!0})}),u.jsx(At,{path:"team/invite",element:u.jsx(lr,{to:"/team",replace:!0})}),u.jsx(At,{path:"admin",element:u.jsx(tZ,{})})]})})]})})})})}function tZ(){const e=Qn();return e.hash==="#bindings"?u.jsx(lr,{to:`/settings/integrations${e.search}`,replace:!0}):u.jsx(lr,{to:`/team${e.hash}`,replace:!0})}const gN=document.getElementById("root");if(!gN)throw new Error("Root element not found");U2.createRoot(gN).render(u.jsx(x.StrictMode,{children:u.jsx(eZ,{})}));export{SR as A,to as F,Hu as L,st as c,u as j,x as r};
|