@agent-team-foundation/first-tree-hub 0.10.0 → 0.10.2

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.
Files changed (24) hide show
  1. package/dist/{bootstrap-CtVqQA8a.mjs → bootstrap-Ca5Fiqz6.mjs} +10 -1
  2. package/dist/cli/index.mjs +9 -19
  3. package/dist/{feishu-DEmwoNn_.mjs → dist-CLiN7cVS.mjs} +88 -51
  4. package/dist/drizzle/0026_saas_onboarding.sql +153 -0
  5. package/dist/drizzle/meta/_journal.json +7 -0
  6. package/dist/feishu-FTWnoOsc.mjs +52 -0
  7. package/dist/{getMachineId-bsd-BB-fnFLA.mjs → getMachineId-bsd-D0w3uAZa.mjs} +1 -1
  8. package/dist/{getMachineId-darwin-DAYWNsYK.mjs → getMachineId-darwin-DOoYFb2_.mjs} +1 -1
  9. package/dist/{getMachineId-win-H5RT49ov.mjs → getMachineId-win-B6hY8edq.mjs} +1 -1
  10. package/dist/index.mjs +7 -5
  11. package/dist/invitation-BTlGMy0o-dIoR8JRj.mjs +3 -0
  12. package/dist/invitation-C_zAhB8x-8Khychlu.mjs +258 -0
  13. package/dist/{observability-DDkJwSKv.mjs → observability-C08jUFsJ.mjs} +1 -1
  14. package/dist/{observability-DV_fQKqV-oxfXX6Z2.mjs → observability-DPyf745N-BSc8QNcR.mjs} +6 -6
  15. package/dist/{core-BgiFGT7Y.mjs → saas-connect-idjpoPTk.mjs} +1111 -153
  16. package/dist/web/assets/index-CEAPwdg7.js +377 -0
  17. package/dist/web/assets/index-CzWeWItA.css +1 -0
  18. package/dist/web/index.html +2 -2
  19. package/package.json +1 -1
  20. package/dist/web/assets/index-DStPeqrX.css +0 -1
  21. package/dist/web/assets/index-Wgxk3V_m.js +0 -371
  22. /package/dist/{execAsync-CP8iWV5b.mjs → execAsync-XMc-nFn-.mjs} +0 -0
  23. /package/dist/{getMachineId-linux-BU7Fi6S0.mjs → getMachineId-linux-MlY63Zsw.mjs} +0 -0
  24. /package/dist/{getMachineId-unsupported-BhWCxKBo.mjs → getMachineId-unsupported-BS652RIy.mjs} +0 -0
@@ -1,371 +0,0 @@
1
- var d0=e=>{throw TypeError(e)};var Am=(e,t,n)=>t.has(e)||d0("Cannot "+n);var I=(e,t,n)=>(Am(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?d0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ve=(e,t,n,a)=>(Am(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Ze=(e,t,n)=>(Am(e,t,"access private method"),n);var nd=(e,t,n,a)=>({set _(l){ve(e,t,l,n)},get _(){return I(e,t,a)}});function I_(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 u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).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 Qd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},Vo={};/**
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 f0;function U_(){if(f0)return Vo;f0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+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:u,ref:l!==void 0?l:null,props:o}}return Vo.Fragment=t,Vo.jsx=n,Vo.jsxs=n,Vo}var h0;function B_(){return h0||(h0=1,Tm.exports=U_()),Tm.exports}var d=B_(),Rm={exports:{}},Pe={};/**
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 m0;function P_(){if(m0)return Pe;m0=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"),u=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 S(U){return U===null||typeof U!="object"?null:(U=b&&U[b]||U["@@iterator"],typeof U=="function"?U:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(U,B,_){this.props=U,this.context=B,this.refs=E,this.updater=_||k}C.prototype.isReactComponent={},C.prototype.setState=function(U,B){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,B,"setState")},C.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function T(){}T.prototype=C.prototype;function O(U,B,_){this.props=U,this.context=B,this.refs=E,this.updater=_||k}var P=O.prototype=new T;P.constructor=O,j(P,C.prototype),P.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function re(U,B,_){var te=_.ref;return{$$typeof:e,type:U,key:B,ref:te!==void 0?te:null,props:_}}function F(U,B){return re(U.type,B,U.props)}function de(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function W(U){var B={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(_){return B[_]})}var ge=/\/+/g;function fe(U,B){return typeof U=="object"&&U!==null&&U.key!=null?W(""+U.key):B.toString(36)}function ee(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(R,R):(U.status="pending",U.then(function(B){U.status==="pending"&&(U.status="fulfilled",U.value=B)},function(B){U.status==="pending"&&(U.status="rejected",U.reason=B)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function q(U,B,_,te,V){var le=typeof U;(le==="undefined"||le==="boolean")&&(U=null);var xe=!1;if(U===null)xe=!0;else switch(le){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(U.$$typeof){case e:case t:xe=!0;break;case y:return xe=U._init,q(xe(U._payload),B,_,te,V)}}if(xe)return V=V(U),xe=te===""?"."+fe(U,0):te,L(V)?(_="",xe!=null&&(_=xe.replace(ge,"$&/")+"/"),q(V,B,_,"",function(xt){return xt})):V!=null&&(de(V)&&(V=F(V,_+(V.key==null||U&&U.key===V.key?"":(""+V.key).replace(ge,"$&/")+"/")+xe)),B.push(V)),1;xe=0;var Oe=te===""?".":te+":";if(L(U))for(var Se=0;Se<U.length;Se++)te=U[Se],le=Oe+fe(te,Se),xe+=q(te,B,_,le,V);else if(Se=S(U),typeof Se=="function")for(U=Se.call(U),Se=0;!(te=U.next()).done;)te=te.value,le=Oe+fe(te,Se++),xe+=q(te,B,_,le,V);else if(le==="object"){if(typeof U.then=="function")return q(ee(U),B,_,te,V);throw B=String(U),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(U,B,_){if(U==null)return U;var te=[],V=0;return q(U,te,"","",function(le){return B.call(_,le,V++)}),te}function K(U){if(U._status===-1){var B=U._result;B=B(),B.then(function(_){(U._status===0||U._status===-1)&&(U._status=1,U._result=_)},function(_){(U._status===0||U._status===-1)&&(U._status=2,U._result=_)}),U._status===-1&&(U._status=0,U._result=B)}if(U._status===1)return U._result.default;throw U._result}var he=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},A={map:oe,forEach:function(U,B,_){oe(U,function(){B.apply(this,arguments)},_)},count:function(U){var B=0;return oe(U,function(){B++}),B},toArray:function(U){return oe(U,function(B){return B})||[]},only:function(U){if(!de(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Pe.Activity=g,Pe.Children=A,Pe.Component=C,Pe.Fragment=n,Pe.Profiler=l,Pe.PureComponent=O,Pe.StrictMode=a,Pe.Suspense=m,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(U){return M.H.useMemoCache(U)}},Pe.cache=function(U){return function(){return U.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(U,B,_){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var te=j({},U.props),V=U.key;if(B!=null)for(le in B.key!==void 0&&(V=""+B.key),B)!Z.call(B,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&B.ref===void 0||(te[le]=B[le]);var le=arguments.length-2;if(le===1)te.children=_;else if(1<le){for(var xe=Array(le),Oe=0;Oe<le;Oe++)xe[Oe]=arguments[Oe+2];te.children=xe}return re(U.type,V,te)},Pe.createContext=function(U){return U={$$typeof:u,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},Pe.createElement=function(U,B,_){var te,V={},le=null;if(B!=null)for(te in B.key!==void 0&&(le=""+B.key),B)Z.call(B,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(V[te]=B[te]);var xe=arguments.length-2;if(xe===1)V.children=_;else if(1<xe){for(var Oe=Array(xe),Se=0;Se<xe;Se++)Oe[Se]=arguments[Se+2];V.children=Oe}if(U&&U.defaultProps)for(te in xe=U.defaultProps,xe)V[te]===void 0&&(V[te]=xe[te]);return re(U,le,V)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(U){return{$$typeof:f,render:U}},Pe.isValidElement=de,Pe.lazy=function(U){return{$$typeof:y,_payload:{_status:-1,_result:U},_init:K}},Pe.memo=function(U,B){return{$$typeof:h,type:U,compare:B===void 0?null:B}},Pe.startTransition=function(U){var B=M.T,_={};M.T=_;try{var te=U(),V=M.S;V!==null&&V(_,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(R,he)}catch(le){he(le)}finally{B!==null&&_.types!==null&&(B.types=_.types),M.T=B}},Pe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Pe.use=function(U){return M.H.use(U)},Pe.useActionState=function(U,B,_){return M.H.useActionState(U,B,_)},Pe.useCallback=function(U,B){return M.H.useCallback(U,B)},Pe.useContext=function(U){return M.H.useContext(U)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(U,B){return M.H.useDeferredValue(U,B)},Pe.useEffect=function(U,B){return M.H.useEffect(U,B)},Pe.useEffectEvent=function(U){return M.H.useEffectEvent(U)},Pe.useId=function(){return M.H.useId()},Pe.useImperativeHandle=function(U,B,_){return M.H.useImperativeHandle(U,B,_)},Pe.useInsertionEffect=function(U,B){return M.H.useInsertionEffect(U,B)},Pe.useLayoutEffect=function(U,B){return M.H.useLayoutEffect(U,B)},Pe.useMemo=function(U,B){return M.H.useMemo(U,B)},Pe.useOptimistic=function(U,B){return M.H.useOptimistic(U,B)},Pe.useReducer=function(U,B,_){return M.H.useReducer(U,B,_)},Pe.useRef=function(U){return M.H.useRef(U)},Pe.useState=function(U){return M.H.useState(U)},Pe.useSyncExternalStore=function(U,B,_){return M.H.useSyncExternalStore(U,B,_)},Pe.useTransition=function(){return M.H.useTransition()},Pe.version="19.2.4",Pe}var p0;function yg(){return p0||(p0=1,Rm.exports=P_()),Rm.exports}var x=yg();const $_=Qd(x),vg=I_({__proto__:null,default:$_},[x]);var zm={exports:{}},Qo={},Om={exports:{}},Mm={};/**
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 g0;function F_(){return g0||(g0=1,(function(e){function t(q,oe){var K=q.length;q.push(oe);e:for(;0<K;){var he=K-1>>>1,A=q[he];if(0<l(A,oe))q[he]=oe,q[K]=A,K=he;else break e}}function n(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var oe=q[0],K=q.pop();if(K!==oe){q[0]=K;e:for(var he=0,A=q.length,U=A>>>1;he<U;){var B=2*(he+1)-1,_=q[B],te=B+1,V=q[te];if(0>l(_,K))te<A&&0>l(V,_)?(q[he]=V,q[te]=K,he=te):(q[he]=_,q[B]=K,he=B);else if(te<A&&0>l(V,K))q[he]=V,q[te]=K,he=te;else break e}}return oe}function l(q,oe){var K=q.sortIndex-oe.sortIndex;return K!==0?K:q.id-oe.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 u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,b=3,S=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function P(q){for(var oe=n(h);oe!==null;){if(oe.callback===null)a(h);else if(oe.startTime<=q)a(h),oe.sortIndex=oe.expirationTime,t(m,oe);else break;oe=n(h)}}function L(q){if(j=!1,P(q),!k)if(n(m)!==null)k=!0,R||(R=!0,W());else{var oe=n(h);oe!==null&&ee(L,oe.startTime-q)}}var R=!1,M=-1,Z=5,re=-1;function F(){return E?!0:!(e.unstable_now()-re<Z)}function de(){if(E=!1,R){var q=e.unstable_now();re=q;var oe=!0;try{e:{k=!1,j&&(j=!1,T(M),M=-1),S=!0;var K=b;try{t:{for(P(q),g=n(m);g!==null&&!(g.expirationTime>q&&F());){var he=g.callback;if(typeof he=="function"){g.callback=null,b=g.priorityLevel;var A=he(g.expirationTime<=q);if(q=e.unstable_now(),typeof A=="function"){g.callback=A,P(q),oe=!0;break t}g===n(m)&&a(m),P(q)}else a(m);g=n(m)}if(g!==null)oe=!0;else{var U=n(h);U!==null&&ee(L,U.startTime-q),oe=!1}}break e}finally{g=null,b=K,S=!1}oe=void 0}}finally{oe?W():R=!1}}}var W;if(typeof O=="function")W=function(){O(de)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,fe=ge.port2;ge.port1.onmessage=de,W=function(){fe.postMessage(null)}}else W=function(){C(de,0)};function ee(q,oe){M=C(function(){q(e.unstable_now())},oe)}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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(q){switch(b){case 1:case 2:case 3:var oe=3;break;default:oe=b}var K=b;b=oe;try{return q()}finally{b=K}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(q,oe){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var K=b;b=q;try{return oe()}finally{b=K}},e.unstable_scheduleCallback=function(q,oe,K){var he=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?he+K:he):K=he,q){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=K+A,q={id:y++,callback:oe,priorityLevel:q,startTime:K,expirationTime:A,sortIndex:-1},K>he?(q.sortIndex=K,t(h,q),n(m)===null&&q===n(h)&&(j?(T(M),M=-1):j=!0,ee(L,K-he))):(q.sortIndex=A,t(m,q),k||S||(k=!0,R||(R=!0,W()))),q},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(q){var oe=b;return function(){var K=b;b=oe;try{return q.apply(this,arguments)}finally{b=K}}}})(Mm)),Mm}var y0;function q_(){return y0||(y0=1,Om.exports=F_()),Om.exports}var Dm={exports:{}},mn={};/**
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 v0;function H_(){if(v0)return mn;v0=1;var e=yg();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 u=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 mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,mn.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)},mn.flushSync=function(m){var h=u.T,y=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=y,a.d.f()}},mn.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))},mn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},mn.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,S=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:S}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},mn.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)},mn.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})}},mn.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)},mn.requestFormReset=function(m){a.d.r(m)},mn.unstable_batchedUpdates=function(m,h){return m(h)},mn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},mn.useFormStatus=function(){return u.H.useHostTransitionStatus()},mn.version="19.2.4",mn}var b0;function XS(){if(b0)return Dm.exports;b0=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(),Dm.exports=H_(),Dm.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 x0;function Z_(){if(x0)return Qo;x0=1;var e=q_(),t=yg(),n=XS();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 u(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,c=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===c)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==c.return)s=p,c=v;else{for(var w=!1,N=p.child;N;){if(N===s){w=!0,s=p,c=v;break}if(N===c){w=!0,c=p,s=v;break}N=N.sibling}if(!w){for(N=v.child;N;){if(N===s){w=!0,s=v,c=p;break}if(N===c){w=!0,c=v,s=p;break}N=N.sibling}if(!w)throw Error(a(189))}}if(s.alternate!==c)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"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),O=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=de&&r[de]||r["@@iterator"],typeof r=="function"?r:null)}var ge=Symbol.for("react.client.reference");function fe(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ge?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case re:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return i=r.displayName||null,i!==null?i:fe(r.type)||"Memo";case Z:i=r._payload,r=r._init;try{return fe(r(i))}catch{}}return null}var ee=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},he=[],A=-1;function U(r){return{current:r}}function B(r){0>A||(r.current=he[A],he[A]=null,A--)}function _(r,i){A++,he[A]=r.current,r.current=i}var te=U(null),V=U(null),le=U(null),xe=U(null);function Oe(r,i){switch(_(le,i),_(V,r),_(te,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Mx(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Mx(i),r=Dx(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(te),_(te,r)}function Se(){B(te),B(V),B(le)}function xt(r){r.memoizedState!==null&&_(xe,r);var i=te.current,s=Dx(i,r.type);i!==s&&(_(V,r),_(te,s))}function ce(r){V.current===r&&(B(te),B(V)),xe.current===r&&(B(xe),Fo._currentValue=K)}var De,lt;function Be(r){if(De===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);De=i&&i[1]||"",lt=-1<s.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+De+r+lt}var Dt=!1;function Kt(r,i){if(!r||Dt)return"";Dt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(J){var Y=J}Reflect.construct(r,[],ue)}else{try{ue.call()}catch(J){Y=J}r.call(ue.prototype)}}else{try{throw Error()}catch(J){Y=J}(ue=r())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(J){if(J&&Y&&typeof J.stack=="string")return[J.stack,Y.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],N=v[1];if(w&&N){var D=w.split(`
44
- `),G=N.split(`
45
- `);for(p=c=0;c<D.length&&!D[c].includes("DetermineComponentFrameRoot");)c++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(c===D.length||p===G.length)for(c=D.length-1,p=G.length-1;1<=c&&0<=p&&D[c]!==G[p];)p--;for(;1<=c&&0<=p;c--,p--)if(D[c]!==G[p]){if(c!==1||p!==1)do if(c--,p--,0>p||D[c]!==G[p]){var ne=`
46
- `+D[c].replace(" at new "," at ");return r.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",r.displayName)),ne}while(1<=c&&0<=p);break}}}finally{Dt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Be(s):""}function Oa(r,i){switch(r.tag){case 26:case 27:case 5:return Be(r.type);case 16:return Be("Lazy");case 13:return r.child!==i&&i!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Kt(r.type,!1);case 11:return Kt(r.type.render,!1);case 1:return Kt(r.type,!0);case 31:return Be("Activity");default:return""}}function Ma(r){try{var i="",s=null;do i+=Oa(r,s),s=r,r=r.return;while(r);return i}catch(c){return`
47
- Error generating stack: `+c.message+`
48
- `+c.stack}}var Ar=Object.prototype.hasOwnProperty,Gr=e.unstable_scheduleCallback,Da=e.unstable_cancelCallback,Di=e.unstable_shouldYield,La=e.unstable_requestPaint,rn=e.unstable_now,Nl=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Le=e.unstable_LowPriority,$e=e.unstable_IdlePriority,an=e.log,nr=e.unstable_setDisableYieldValue,ln=null,Rt=null;function sn(r){if(typeof an=="function"&&nr(r),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(ln,r)}catch{}}var ct=Math.clz32?Math.clz32:_l,Tr=Math.log,Sn=Math.LN2;function _l(r){return r>>>=0,r===0?32:31-(Tr(r)/Sn|0)|0}var Al=256,Tl=262144,Li=4194304;function Rr(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 Rl(r,i,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var N=c&134217727;return N!==0?(c=N&~v,c!==0?p=Rr(c):(w&=N,w!==0?p=Rr(w):s||(s=N&~r,s!==0&&(p=Rr(s))))):(N=c&~v,N!==0?p=Rr(N):w!==0?p=Rr(w):s||(s=c&~r,s!==0&&(p=Rr(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 Ii(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function xf(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 Bu(){var r=Li;return Li<<=1,(Li&62914560)===0&&(Li=4194304),r}function no(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Ui(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Sf(r,i,s,c,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,D=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var ne=31-ct(s),ue=1<<ne;N[ne]=0,D[ne]=-1;var Y=G[ne];if(Y!==null)for(G[ne]=null,ne=0;ne<Y.length;ne++){var J=Y[ne];J!==null&&(J.lane&=-536870913)}s&=~ue}c!==0&&rr(r,c,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~i))}function rr(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var c=31-ct(i);r.entangledLanes|=i,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function Bi(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var c=31-ct(s),p=1<<c;p&i|r[c]&i&&(r[c]|=i),s&=~p}}function zl(r,i){var s=i&-i;return s=(s&42)!==0?1:Ol(s),(s&(r.suspendedLanes|i))!==0?0:s}function Ol(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 Pi(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Pu(){var r=oe.p;return r!==0?r:(r=window.event,r===void 0?32:a0(r.type))}function $u(r,i){var s=oe.p;try{return oe.p=r,i()}finally{oe.p=s}}var Sr=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Sr,on="__reactProps$"+Sr,Kr="__reactContainer$"+Sr,Ml="__reactEvents$"+Sr,Fu="__reactListeners$"+Sr,qu="__reactHandles$"+Sr,ro="__reactResources$"+Sr,Ia="__reactMarker$"+Sr;function Dl(r){delete r[Ft],delete r[on],delete r[Ml],delete r[Fu],delete r[qu]}function Yr(r){var i=r[Ft];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Kr]||s[Ft]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Fx(r);r!==null;){if(s=r[Ft])return s;r=Fx(r)}return i}r=s,s=r.parentNode}return null}function Xr(r){if(r=r[Ft]||r[Kr]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Ua(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Jr(r){var i=r[ro];return i||(i=r[ro]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function X(r){r[Ia]=!0}var Fe=new Set,qn={};function An(r,i){$i(r,i),$i(r+"Capture",i)}function $i(r,i){for(qn[r]=i,r=0;r<i.length;r++)Fe.add(i[r])}var _E=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]*$"),jy={},Cy={};function AE(r){return Ar.call(Cy,r)?!0:Ar.call(jy,r)?!1:_E.test(r)?Cy[r]=!0:(jy[r]=!0,!1)}function Hu(r,i,s){if(AE(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Zu(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 Wr(r,i,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+c)}}function ar(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ey(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function TE(r,i,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,i,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function wf(r){if(!r._valueTracker){var i=Ey(r)?"checked":"value";r._valueTracker=TE(r,i,""+r[i])}}function Ny(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),c="";return r&&(c=Ey(r)?r.checked?"true":"false":r.value),r=c,r!==s?(i.setValue(r),!0):!1}function Vu(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 RE=/[\n"\\]/g;function ir(r){return r.replace(RE,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function kf(r,i,s,c,p,v,w,N){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),i!=null?w==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ar(i)):r.value!==""+ar(i)&&(r.value=""+ar(i)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),i!=null?jf(r,w,ar(i)):s!=null?jf(r,w,ar(s)):c!=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=""+ar(N):r.removeAttribute("name")}function _y(r,i,s,c,p,v,w,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){wf(r);return}s=s!=null?""+ar(s):"",i=i!=null?""+ar(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=N?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),wf(r)}function jf(r,i,s){i==="number"&&Vu(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ll(r,i,s,c){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&&c&&(r[s].defaultSelected=!0)}else{for(s=""+ar(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ay(r,i,s){if(i!=null&&(i=""+ar(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+ar(s):""}function Ty(r,i,s,c){if(i==null){if(c!=null){if(s!=null)throw Error(a(92));if(ee(c)){if(1<c.length)throw Error(a(93));c=c[0]}s=c}s==null&&(s=""),i=s}s=ar(i),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),wf(r)}function Il(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var zE=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 Ry(r,i,s){var c=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":c?r.setProperty(i,s):typeof s!="number"||s===0||zE.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function zy(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in i)c=i[p],i.hasOwnProperty(p)&&s[p]!==c&&Ry(r,p,c)}else for(var v in i)i.hasOwnProperty(v)&&Ry(r,v,i[v])}function Cf(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 OE=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"]]),ME=/^[\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 Qu(r){return ME.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ea(){}var Ef=null;function Nf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ul=null,Bl=null;function Oy(r){var i=Xr(r);if(i&&(r=i.stateNode)){var s=r[on]||null;e:switch(r=i.stateNode,i.type){case"input":if(kf(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="'+ir(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var c=s[i];if(c!==r&&c.form===r.form){var p=c[on]||null;if(!p)throw Error(a(90));kf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)c=s[i],c.form===r.form&&Ny(c)}break e;case"textarea":Ay(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ll(r,!!s.multiple,i,!1)}}}var _f=!1;function My(r,i,s){if(_f)return r(i,s);_f=!0;try{var c=r(i);return c}finally{if(_f=!1,(Ul!==null||Bl!==null)&&(Mc(),Ul&&(i=Ul,r=Bl,Bl=Ul=null,Oy(i),r)))for(i=0;i<r.length;i++)Oy(r[i])}}function ao(r,i){var s=r.stateNode;if(s===null)return null;var c=s[on]||null;if(c===null)return null;s=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Af=!1;if(ta)try{var io={};Object.defineProperty(io,"passive",{get:function(){Af=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Af=!1}var Ba=null,Tf=null,Gu=null;function Dy(){if(Gu)return Gu;var r,i=Tf,s=i.length,c,p="value"in Ba?Ba.value:Ba.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var w=s-r;for(c=1;c<=w&&i[s-c]===p[v-c];c++);return Gu=p.slice(r,1<c?1-c:void 0)}function Ku(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 Yu(){return!0}function Ly(){return!1}function Tn(r){function i(s,c,p,v,w){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Yu:Ly,this.isPropagationStopped=Ly,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=Yu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Yu)},persist:function(){},isPersistent:Yu}),i}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xu=Tn(Fi),lo=g({},Fi,{view:0,detail:0}),DE=Tn(lo),Rf,zf,so,Ju=g({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mf,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!==so&&(so&&r.type==="mousemove"?(Rf=r.screenX-so.screenX,zf=r.screenY-so.screenY):zf=Rf=0,so=r),Rf)},movementY:function(r){return"movementY"in r?r.movementY:zf}}),Iy=Tn(Ju),LE=g({},Ju,{dataTransfer:0}),IE=Tn(LE),UE=g({},lo,{relatedTarget:0}),Of=Tn(UE),BE=g({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),PE=Tn(BE),$E=g({},Fi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),FE=Tn($E),qE=g({},Fi,{data:0}),Uy=Tn(qE),HE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZE={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"},VE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QE(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=VE[r])?!!i[r]:!1}function Mf(){return QE}var GE=g({},lo,{key:function(r){if(r.key){var i=HE[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ku(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?ZE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mf,charCode:function(r){return r.type==="keypress"?Ku(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ku(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),KE=Tn(GE),YE=g({},Ju,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),By=Tn(YE),XE=g({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mf}),JE=Tn(XE),WE=g({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),eN=Tn(WE),tN=g({},Ju,{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}),nN=Tn(tN),rN=g({},Fi,{newState:0,oldState:0}),aN=Tn(rN),iN=[9,13,27,32],Df=ta&&"CompositionEvent"in window,oo=null;ta&&"documentMode"in document&&(oo=document.documentMode);var lN=ta&&"TextEvent"in window&&!oo,Py=ta&&(!Df||oo&&8<oo&&11>=oo),$y=" ",Fy=!1;function qy(r,i){switch(r){case"keyup":return iN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Pl=!1;function sN(r,i){switch(r){case"compositionend":return Hy(i);case"keypress":return i.which!==32?null:(Fy=!0,$y);case"textInput":return r=i.data,r===$y&&Fy?null:r;default:return null}}function oN(r,i){if(Pl)return r==="compositionend"||!Df&&qy(r,i)?(r=Dy(),Gu=Tf=Ba=null,Pl=!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 Py&&i.locale!=="ko"?null:i.data;default:return null}}var uN={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 Zy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!uN[r.type]:i==="textarea"}function Vy(r,i,s,c){Ul?Bl?Bl.push(c):Bl=[c]:Ul=c,i=$c(i,"onChange"),0<i.length&&(s=new Xu("onChange","change",null,s,c),r.push({event:s,listeners:i}))}var uo=null,co=null;function cN(r){_x(r,0)}function Wu(r){var i=Ua(r);if(Ny(i))return r}function Qy(r,i){if(r==="change")return i}var Gy=!1;if(ta){var Lf;if(ta){var If="oninput"in document;if(!If){var Ky=document.createElement("div");Ky.setAttribute("oninput","return;"),If=typeof Ky.oninput=="function"}Lf=If}else Lf=!1;Gy=Lf&&(!document.documentMode||9<document.documentMode)}function Yy(){uo&&(uo.detachEvent("onpropertychange",Xy),co=uo=null)}function Xy(r){if(r.propertyName==="value"&&Wu(co)){var i=[];Vy(i,co,r,Nf(r)),My(cN,i)}}function dN(r,i,s){r==="focusin"?(Yy(),uo=i,co=s,uo.attachEvent("onpropertychange",Xy)):r==="focusout"&&Yy()}function fN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Wu(co)}function hN(r,i){if(r==="click")return Wu(i)}function mN(r,i){if(r==="input"||r==="change")return Wu(i)}function pN(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Hn=typeof Object.is=="function"?Object.is:pN;function fo(r,i){if(Hn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),c=Object.keys(i);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Ar.call(i,p)||!Hn(r[p],i[p]))return!1}return!0}function Jy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Wy(r,i){var s=Jy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=i&&c>=i)return{node:s,offset:i-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Jy(s)}}function ev(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?ev(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function tv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Vu(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=Vu(r.document)}return i}function Uf(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 gN=ta&&"documentMode"in document&&11>=document.documentMode,$l=null,Bf=null,ho=null,Pf=!1;function nv(r,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Pf||$l==null||$l!==Vu(c)||(c=$l,"selectionStart"in c&&Uf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ho&&fo(ho,c)||(ho=c,c=$c(Bf,"onSelect"),0<c.length&&(i=new Xu("onSelect","select",null,i,s),r.push({event:i,listeners:c}),i.target=$l)))}function qi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Fl={animationend:qi("Animation","AnimationEnd"),animationiteration:qi("Animation","AnimationIteration"),animationstart:qi("Animation","AnimationStart"),transitionrun:qi("Transition","TransitionRun"),transitionstart:qi("Transition","TransitionStart"),transitioncancel:qi("Transition","TransitionCancel"),transitionend:qi("Transition","TransitionEnd")},$f={},rv={};ta&&(rv=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function Hi(r){if($f[r])return $f[r];if(!Fl[r])return r;var i=Fl[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in rv)return $f[r]=i[s];return r}var av=Hi("animationend"),iv=Hi("animationiteration"),lv=Hi("animationstart"),yN=Hi("transitionrun"),vN=Hi("transitionstart"),bN=Hi("transitioncancel"),sv=Hi("transitionend"),ov=new Map,Ff="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(" ");Ff.push("scrollEnd");function wr(r,i){ov.set(r,i),An(i,[r])}var ec=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)},lr=[],ql=0,qf=0;function tc(){for(var r=ql,i=qf=ql=0;i<r;){var s=lr[i];lr[i++]=null;var c=lr[i];lr[i++]=null;var p=lr[i];lr[i++]=null;var v=lr[i];if(lr[i++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}v!==0&&uv(s,p,v)}}function nc(r,i,s,c){lr[ql++]=r,lr[ql++]=i,lr[ql++]=s,lr[ql++]=c,qf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Hf(r,i,s,c){return nc(r,i,s,c),rc(r)}function Zi(r,i){return nc(r,null,null,i),rc(r)}function uv(r,i,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.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-ct(s),r=v.hiddenUpdates,c=r[p],c===null?r[p]=[i]:c.push(i),i.lane=s|536870912),v):null}function rc(r){if(50<Do)throw Do=0,Wh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Hl={};function xN(r,i,s,c){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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(r,i,s,c){return new xN(r,i,s,c)}function Zf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function na(r,i){var s=r.alternate;return s===null?(s=Zn(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 cv(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 ac(r,i,s,c,p,v){var w=0;if(c=r,typeof r=="function")Zf(r)&&(w=1);else if(typeof r=="string")w=C_(r,s,te.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case re:return r=Zn(31,s,i,p),r.elementType=re,r.lanes=v,r;case j:return Vi(s.children,p,v,i);case E:w=8,p|=24;break;case C:return r=Zn(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case L:return r=Zn(13,s,i,p),r.elementType=L,r.lanes=v,r;case R:return r=Zn(19,s,i,p),r.elementType=R,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case T:w=9;break e;case P:w=11;break e;case M:w=14;break e;case Z:w=16,c=null;break e}w=29,s=Error(a(130,r===null?"null":typeof r,"")),c=null}return i=Zn(w,s,i,p),i.elementType=r,i.type=c,i.lanes=v,i}function Vi(r,i,s,c){return r=Zn(7,r,c,i),r.lanes=s,r}function Vf(r,i,s){return r=Zn(6,r,null,i),r.lanes=s,r}function dv(r){var i=Zn(18,null,null,0);return i.stateNode=r,i}function Qf(r,i,s){return i=Zn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var fv=new WeakMap;function sr(r,i){if(typeof r=="object"&&r!==null){var s=fv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Ma(i)},fv.set(r,i),i)}return{value:r,source:i,stack:Ma(i)}}var Zl=[],Vl=0,ic=null,mo=0,or=[],ur=0,Pa=null,zr=1,Or="";function ra(r,i){Zl[Vl++]=mo,Zl[Vl++]=ic,ic=r,mo=i}function hv(r,i,s){or[ur++]=zr,or[ur++]=Or,or[ur++]=Pa,Pa=r;var c=zr;r=Or;var p=32-ct(c)-1;c&=~(1<<p),s+=1;var v=32-ct(i)+p;if(30<v){var w=p-p%5;v=(c&(1<<w)-1).toString(32),c>>=w,p-=w,zr=1<<32-ct(i)+p|s<<p|c,Or=v+r}else zr=1<<v|s<<p|c,Or=r}function Gf(r){r.return!==null&&(ra(r,1),hv(r,1,0))}function Kf(r){for(;r===ic;)ic=Zl[--Vl],Zl[Vl]=null,mo=Zl[--Vl],Zl[Vl]=null;for(;r===Pa;)Pa=or[--ur],or[ur]=null,Or=or[--ur],or[ur]=null,zr=or[--ur],or[ur]=null}function mv(r,i){or[ur++]=zr,or[ur++]=Or,or[ur++]=Pa,zr=i.id,Or=i.overflow,Pa=r}var un=null,Et=null,nt=!1,$a=null,cr=!1,Yf=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw po(sr(i,r)),Yf}function pv(r){var i=r.stateNode,s=r.type,c=r.memoizedProps;switch(i[Ft]=r,i[on]=c,s){case"dialog":Xe("cancel",i),Xe("close",i);break;case"iframe":case"object":case"embed":Xe("load",i);break;case"video":case"audio":for(s=0;s<Io.length;s++)Xe(Io[s],i);break;case"source":Xe("error",i);break;case"img":case"image":case"link":Xe("error",i),Xe("load",i);break;case"details":Xe("toggle",i);break;case"input":Xe("invalid",i),_y(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Xe("invalid",i);break;case"textarea":Xe("invalid",i),Ty(i,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||c.suppressHydrationWarning===!0||zx(i.textContent,s)?(c.popover!=null&&(Xe("beforetoggle",i),Xe("toggle",i)),c.onScroll!=null&&Xe("scroll",i),c.onScrollEnd!=null&&Xe("scrollend",i),c.onClick!=null&&(i.onclick=ea),i=!0):i=!1,i||Fa(r,!0)}function gv(r){for(un=r.return;un;)switch(un.tag){case 5:case 31:case 13:cr=!1;return;case 27:case 3:cr=!0;return;default:un=un.return}}function Ql(r){if(r!==un)return!1;if(!nt)return gv(r),nt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||mm(r.type,r.memoizedProps)),s=!s),s&&Et&&Fa(r),gv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=$x(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=$x(r)}else i===27?(i=Et,ni(r.type)?(r=bm,bm=null,Et=r):Et=i):Et=un?fr(r.stateNode.nextSibling):null;return!0}function Qi(){Et=un=null,nt=!1}function Xf(){var r=$a;return r!==null&&(Mn===null?Mn=r:Mn.push.apply(Mn,r),$a=null),r}function po(r){$a===null?$a=[r]:$a.push(r)}var Jf=U(null),Gi=null,aa=null;function qa(r,i,s){_(Jf,i._currentValue),i._currentValue=s}function ia(r){r._currentValue=Jf.current,B(Jf)}function Wf(r,i,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),r===s)break;r=r.return}}function eh(r,i,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var D=0;D<i.length;D++)if(N.context===i[D]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),Wf(v.return,s,r),c||(w=null);break e}v=N.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(a(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),Wf(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Gl(r,i,s,c){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var N=p.type;Hn(p.pendingProps.value,w.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(w=p.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Fo):r=[Fo])}p=p.return}r!==null&&eh(i,r,s,c),i.flags|=262144}function lc(r){for(r=r.firstContext;r!==null;){if(!Hn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ki(r){Gi=r,aa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function cn(r){return yv(Gi,r)}function sc(r,i){return Gi===null&&Ki(r),yv(r,i)}function yv(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},aa===null){if(r===null)throw Error(a(308));aa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else aa=aa.next=i;return s}var SN=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},wN=e.unstable_scheduleCallback,kN=e.unstable_NormalPriority,qt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function th(){return{controller:new SN,data:new Map,refCount:0}}function go(r){r.refCount--,r.refCount===0&&wN(kN,function(){r.controller.abort()})}var yo=null,nh=0,Kl=0,Yl=null;function jN(r,i){if(yo===null){var s=yo=[];nh=0,Kl=im(),Yl={status:"pending",value:void 0,then:function(c){s.push(c)}}}return nh++,i.then(vv,vv),i}function vv(){if(--nh===0&&yo!==null){Yl!==null&&(Yl.status="fulfilled");var r=yo;yo=null,Kl=0,Yl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function CN(r,i){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){c.status="fulfilled",c.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var bv=q.S;q.S=function(r,i){nx=rn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&jN(r,i),bv!==null&&bv(r,i)};var Yi=U(null);function rh(){var r=Yi.current;return r!==null?r:St.pooledCache}function oc(r,i){i===null?_(Yi,Yi.current):_(Yi,i.pool)}function xv(){var r=rh();return r===null?null:{parent:qt._currentValue,pool:r}}var Xl=Error(a(460)),ah=Error(a(474)),uc=Error(a(542)),cc={then:function(){}};function Sv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function wv(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ea,ea),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,jv(r),r;default:if(typeof i.status=="string")i.then(ea,ea);else{if(r=St,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(c){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=c}},function(c){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,jv(r),r}throw Ji=i,Xl}}function Xi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ji=s,Xl):s}}var Ji=null;function kv(){if(Ji===null)throw Error(a(459));var r=Ji;return Ji=null,r}function jv(r){if(r===Xl||r===uc)throw Error(a(483))}var Jl=null,vo=0;function dc(r){var i=vo;return vo+=1,Jl===null&&(Jl=[]),wv(Jl,r,i)}function bo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function fc(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 Cv(r){function i(H,$){if(r){var Q=H.deletions;Q===null?(H.deletions=[$],H.flags|=16):Q.push($)}}function s(H,$){if(!r)return null;for(;$!==null;)i(H,$),$=$.sibling;return null}function c(H){for(var $=new Map;H!==null;)H.key!==null?$.set(H.key,H):$.set(H.index,H),H=H.sibling;return $}function p(H,$){return H=na(H,$),H.index=0,H.sibling=null,H}function v(H,$,Q){return H.index=Q,r?(Q=H.alternate,Q!==null?(Q=Q.index,Q<$?(H.flags|=67108866,$):Q):(H.flags|=67108866,$)):(H.flags|=1048576,$)}function w(H){return r&&H.alternate===null&&(H.flags|=67108866),H}function N(H,$,Q,se){return $===null||$.tag!==6?($=Vf(Q,H.mode,se),$.return=H,$):($=p($,Q),$.return=H,$)}function D(H,$,Q,se){var Re=Q.type;return Re===j?ne(H,$,Q.props.children,se,Q.key):$!==null&&($.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===Z&&Xi(Re)===$.type)?($=p($,Q.props),bo($,Q),$.return=H,$):($=ac(Q.type,Q.key,Q.props,null,H.mode,se),bo($,Q),$.return=H,$)}function G(H,$,Q,se){return $===null||$.tag!==4||$.stateNode.containerInfo!==Q.containerInfo||$.stateNode.implementation!==Q.implementation?($=Qf(Q,H.mode,se),$.return=H,$):($=p($,Q.children||[]),$.return=H,$)}function ne(H,$,Q,se,Re){return $===null||$.tag!==7?($=Vi(Q,H.mode,se,Re),$.return=H,$):($=p($,Q),$.return=H,$)}function ue(H,$,Q){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Vf(""+$,H.mode,Q),$.return=H,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case S:return Q=ac($.type,$.key,$.props,null,H.mode,Q),bo(Q,$),Q.return=H,Q;case k:return $=Qf($,H.mode,Q),$.return=H,$;case Z:return $=Xi($),ue(H,$,Q)}if(ee($)||W($))return $=Vi($,H.mode,Q,null),$.return=H,$;if(typeof $.then=="function")return ue(H,dc($),Q);if($.$$typeof===O)return ue(H,sc(H,$),Q);fc(H,$)}return null}function Y(H,$,Q,se){var Re=$!==null?$.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Re!==null?null:N(H,$,""+Q,se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===Re?D(H,$,Q,se):null;case k:return Q.key===Re?G(H,$,Q,se):null;case Z:return Q=Xi(Q),Y(H,$,Q,se)}if(ee(Q)||W(Q))return Re!==null?null:ne(H,$,Q,se,null);if(typeof Q.then=="function")return Y(H,$,dc(Q),se);if(Q.$$typeof===O)return Y(H,$,sc(H,Q),se);fc(H,Q)}return null}function J(H,$,Q,se,Re){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return H=H.get(Q)||null,N($,H,""+se,Re);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return H=H.get(se.key===null?Q:se.key)||null,D($,H,se,Re);case k:return H=H.get(se.key===null?Q:se.key)||null,G($,H,se,Re);case Z:return se=Xi(se),J(H,$,Q,se,Re)}if(ee(se)||W(se))return H=H.get(Q)||null,ne($,H,se,Re,null);if(typeof se.then=="function")return J(H,$,Q,dc(se),Re);if(se.$$typeof===O)return J(H,$,Q,sc($,se),Re);fc($,se)}return null}function ke(H,$,Q,se){for(var Re=null,st=null,Ee=$,He=$=0,et=null;Ee!==null&&He<Q.length;He++){Ee.index>He?(et=Ee,Ee=null):et=Ee.sibling;var ot=Y(H,Ee,Q[He],se);if(ot===null){Ee===null&&(Ee=et);break}r&&Ee&&ot.alternate===null&&i(H,Ee),$=v(ot,$,He),st===null?Re=ot:st.sibling=ot,st=ot,Ee=et}if(He===Q.length)return s(H,Ee),nt&&ra(H,He),Re;if(Ee===null){for(;He<Q.length;He++)Ee=ue(H,Q[He],se),Ee!==null&&($=v(Ee,$,He),st===null?Re=Ee:st.sibling=Ee,st=Ee);return nt&&ra(H,He),Re}for(Ee=c(Ee);He<Q.length;He++)et=J(Ee,H,He,Q[He],se),et!==null&&(r&&et.alternate!==null&&Ee.delete(et.key===null?He:et.key),$=v(et,$,He),st===null?Re=et:st.sibling=et,st=et);return r&&Ee.forEach(function(si){return i(H,si)}),nt&&ra(H,He),Re}function Ie(H,$,Q,se){if(Q==null)throw Error(a(151));for(var Re=null,st=null,Ee=$,He=$=0,et=null,ot=Q.next();Ee!==null&&!ot.done;He++,ot=Q.next()){Ee.index>He?(et=Ee,Ee=null):et=Ee.sibling;var si=Y(H,Ee,ot.value,se);if(si===null){Ee===null&&(Ee=et);break}r&&Ee&&si.alternate===null&&i(H,Ee),$=v(si,$,He),st===null?Re=si:st.sibling=si,st=si,Ee=et}if(ot.done)return s(H,Ee),nt&&ra(H,He),Re;if(Ee===null){for(;!ot.done;He++,ot=Q.next())ot=ue(H,ot.value,se),ot!==null&&($=v(ot,$,He),st===null?Re=ot:st.sibling=ot,st=ot);return nt&&ra(H,He),Re}for(Ee=c(Ee);!ot.done;He++,ot=Q.next())ot=J(Ee,H,He,ot.value,se),ot!==null&&(r&&ot.alternate!==null&&Ee.delete(ot.key===null?He:ot.key),$=v(ot,$,He),st===null?Re=ot:st.sibling=ot,st=ot);return r&&Ee.forEach(function(L_){return i(H,L_)}),nt&&ra(H,He),Re}function vt(H,$,Q,se){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var Re=Q.key;$!==null;){if($.key===Re){if(Re=Q.type,Re===j){if($.tag===7){s(H,$.sibling),se=p($,Q.props.children),se.return=H,H=se;break e}}else if($.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===Z&&Xi(Re)===$.type){s(H,$.sibling),se=p($,Q.props),bo(se,Q),se.return=H,H=se;break e}s(H,$);break}else i(H,$);$=$.sibling}Q.type===j?(se=Vi(Q.props.children,H.mode,se,Q.key),se.return=H,H=se):(se=ac(Q.type,Q.key,Q.props,null,H.mode,se),bo(se,Q),se.return=H,H=se)}return w(H);case k:e:{for(Re=Q.key;$!==null;){if($.key===Re)if($.tag===4&&$.stateNode.containerInfo===Q.containerInfo&&$.stateNode.implementation===Q.implementation){s(H,$.sibling),se=p($,Q.children||[]),se.return=H,H=se;break e}else{s(H,$);break}else i(H,$);$=$.sibling}se=Qf(Q,H.mode,se),se.return=H,H=se}return w(H);case Z:return Q=Xi(Q),vt(H,$,Q,se)}if(ee(Q))return ke(H,$,Q,se);if(W(Q)){if(Re=W(Q),typeof Re!="function")throw Error(a(150));return Q=Re.call(Q),Ie(H,$,Q,se)}if(typeof Q.then=="function")return vt(H,$,dc(Q),se);if(Q.$$typeof===O)return vt(H,$,sc(H,Q),se);fc(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,$!==null&&$.tag===6?(s(H,$.sibling),se=p($,Q),se.return=H,H=se):(s(H,$),se=Vf(Q,H.mode,se),se.return=H,H=se),w(H)):s(H,$)}return function(H,$,Q,se){try{vo=0;var Re=vt(H,$,Q,se);return Jl=null,Re}catch(Ee){if(Ee===Xl||Ee===uc)throw Ee;var st=Zn(29,Ee,null,H.mode);return st.lanes=se,st.return=H,st}finally{}}}var Wi=Cv(!0),Ev=Cv(!1),Ha=!1;function ih(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lh(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 c=r.updateQueue;if(c===null)return null;if(c=c.shared,(dt&2)!==0){var p=c.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),c.pending=i,i=rc(r),uv(r,null,s),i}return nc(r,c,i,s),rc(r)}function xo(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,Bi(r,s)}}function sh(r,i){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var oh=!1;function So(){if(oh){var r=Yl;if(r!==null)throw r}}function wo(r,i,s,c){oh=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var D=N,G=D.next;D.next=null,w===null?v=G:w.next=G,w=D;var ne=r.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==w&&(N===null?ne.firstBaseUpdate=G:N.next=G,ne.lastBaseUpdate=D))}if(v!==null){var ue=p.baseState;w=0,ne=G=D=null,N=v;do{var Y=N.lane&-536870913,J=Y!==N.lane;if(J?(We&Y)===Y:(c&Y)===Y){Y!==0&&Y===Kl&&(oh=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ke=r,Ie=N;Y=i;var vt=s;switch(Ie.tag){case 1:if(ke=Ie.payload,typeof ke=="function"){ue=ke.call(vt,ue,Y);break e}ue=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ie.payload,Y=typeof ke=="function"?ke.call(vt,ue,Y):ke,Y==null)break e;ue=g({},ue,Y);break e;case 2:Ha=!0}}Y=N.callback,Y!==null&&(r.flags|=64,J&&(r.flags|=8192),J=p.callbacks,J===null?p.callbacks=[Y]:J.push(Y))}else J={lane:Y,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(G=ne=J,D=ue):ne=ne.next=J,w|=Y;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);ne===null&&(D=ue),p.baseState=D,p.firstBaseUpdate=G,p.lastBaseUpdate=ne,v===null&&(p.shared.lanes=0),Xa|=w,r.lanes=w,r.memoizedState=ue}}function Nv(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function _v(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Nv(s[r],i)}var Wl=U(null),hc=U(0);function Av(r,i){r=ma,_(hc,r),_(Wl,i),ma=r|i.baseLanes}function uh(){_(hc,ma),_(Wl,Wl.current)}function ch(){ma=hc.current,B(Wl),B(hc)}var Vn=U(null),dr=null;function Qa(r){var i=r.alternate;_(Bt,Bt.current&1),_(Vn,r),dr===null&&(i===null||Wl.current!==null||i.memoizedState!==null)&&(dr=r)}function dh(r){_(Bt,Bt.current),_(Vn,r),dr===null&&(dr=r)}function Tv(r){r.tag===22?(_(Bt,Bt.current),_(Vn,r),dr===null&&(dr=r)):Ga()}function Ga(){_(Bt,Bt.current),_(Vn,Vn.current)}function Qn(r){B(Vn),dr===r&&(dr=null),B(Bt)}var Bt=U(0);function mc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ym(s)||vm(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 la=0,qe=null,gt=null,Ht=null,pc=!1,es=!1,el=!1,gc=0,ko=0,ts=null,EN=0;function Lt(){throw Error(a(321))}function fh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Hn(r[s],i[s]))return!1;return!0}function hh(r,i,s,c,p,v){return la=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=r===null||r.memoizedState===null?hb:_h,el=!1,v=s(c,p),el=!1,es&&(v=zv(i,s,c,p)),Rv(r),v}function Rv(r){q.H=Eo;var i=gt!==null&&gt.next!==null;if(la=0,Ht=gt=qe=null,pc=!1,ko=0,ts=null,i)throw Error(a(300));r===null||Zt||(r=r.dependencies,r!==null&&lc(r)&&(Zt=!0))}function zv(r,i,s,c){qe=r;var p=0;do{if(es&&(ts=null),ko=0,es=!1,25<=p)throw Error(a(301));if(p+=1,Ht=gt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}q.H=mb,v=i(s,c)}while(es);return v}function NN(){var r=q.H,i=r.useState()[0];return i=typeof i.then=="function"?jo(i):i,r=r.useState()[0],(gt!==null?gt.memoizedState:null)!==r&&(qe.flags|=1024),i}function mh(){var r=gc!==0;return gc=0,r}function ph(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function gh(r){if(pc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}pc=!1}la=0,Ht=gt=qe=null,es=!1,ko=gc=0,ts=null}function wn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?qe.memoizedState=Ht=r:Ht=Ht.next=r,Ht}function Pt(){if(gt===null){var r=qe.alternate;r=r!==null?r.memoizedState:null}else r=gt.next;var i=Ht===null?qe.memoizedState:Ht.next;if(i!==null)Ht=i,gt=r;else{if(r===null)throw qe.alternate===null?Error(a(467)):Error(a(310));gt=r,r={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Ht===null?qe.memoizedState=Ht=r:Ht=Ht.next=r}return Ht}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(r){var i=ko;return ko+=1,ts===null&&(ts=[]),r=wv(ts,r,i),i=qe,(Ht===null?i.memoizedState:Ht.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?hb:_h),r}function vc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return jo(r);if(r.$$typeof===O)return cn(r)}throw Error(a(438,String(r)))}function yh(r){var i=null,s=qe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var c=qe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=yc(),qe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),c=0;c<r;c++)s[c]=F;return i.index++,s}function sa(r,i){return typeof i=="function"?i(r):i}function bc(r){var i=Pt();return vh(i,gt,r)}function vh(r,i,s){var c=r.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=s;var p=r.baseQueue,v=c.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}i.baseQueue=p=v,c.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=w=null,D=null,G=i,ne=!1;do{var ue=G.lane&-536870913;if(ue!==G.lane?(We&ue)===ue:(la&ue)===ue){var Y=G.revertLane;if(Y===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ue===Kl&&(ne=!0);else if((la&Y)===Y){G=G.next,Y===Kl&&(ne=!0);continue}else ue={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},D===null?(N=D=ue,w=v):D=D.next=ue,qe.lanes|=Y,Xa|=Y;ue=G.action,el&&s(v,ue),v=G.hasEagerState?G.eagerState:s(v,ue)}else Y={lane:ue,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},D===null?(N=D=Y,w=v):D=D.next=Y,qe.lanes|=ue,Xa|=ue;G=G.next}while(G!==null&&G!==i);if(D===null?w=v:D.next=N,!Hn(v,r.memoizedState)&&(Zt=!0,ne&&(s=Yl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=D,c.lastRenderedState=v}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function bh(r){var i=Pt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);Hn(v,i.memoizedState)||(Zt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,c]}function Ov(r,i,s){var c=qe,p=Pt(),v=nt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var w=!Hn((gt||p).memoizedState,s);if(w&&(p.memoizedState=s,Zt=!0),p=p.queue,wh(Lv.bind(null,c,p,r),[r]),p.getSnapshot!==i||w||Ht!==null&&Ht.memoizedState.tag&1){if(c.flags|=2048,ns(9,{destroy:void 0},Dv.bind(null,c,p,s,i),null),St===null)throw Error(a(349));v||(la&127)!==0||Mv(c,i,s)}return s}function Mv(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=yc(),qe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Dv(r,i,s,c){i.value=s,i.getSnapshot=c,Iv(i)&&Uv(r)}function Lv(r,i,s){return s(function(){Iv(i)&&Uv(r)})}function Iv(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Hn(r,s)}catch{return!0}}function Uv(r){var i=Zi(r,2);i!==null&&Dn(i,r,2)}function xh(r){var i=wn();if(typeof r=="function"){var s=r;if(r=s(),el){sn(!0);try{s()}finally{sn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:r},i}function Bv(r,i,s,c){return r.baseState=s,vh(r,gt,typeof c=="function"?c:sa)}function _N(r,i,s,c,p){if(wc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};q.T!==null?s(!0):v.isTransition=!1,c(v),s=i.pending,s===null?(v.next=i.pending=v,Pv(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Pv(r,i){var s=i.action,c=i.payload,p=r.state;if(i.isTransition){var v=q.T,w={};q.T=w;try{var N=s(p,c),D=q.S;D!==null&&D(w,N),$v(r,i,N)}catch(G){Sh(r,i,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),q.T=v}}else try{v=s(p,c),$v(r,i,v)}catch(G){Sh(r,i,G)}}function $v(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Fv(r,i,c)},function(c){return Sh(r,i,c)}):Fv(r,i,s)}function Fv(r,i,s){i.status="fulfilled",i.value=s,qv(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Pv(r,s)))}function Sh(r,i,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=s,qv(i),i=i.next;while(i!==c)}r.action=null}function qv(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Hv(r,i){return i}function Zv(r,i){if(nt){var s=St.formState;if(s!==null){e:{var c=qe;if(nt){if(Et){t:{for(var p=Et,v=cr;p.nodeType!==8;){if(!v){p=null;break t}if(p=fr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=fr(p.nextSibling),c=p.data==="F!";break e}}Fa(c)}c=!1}c&&(i=s[0])}}return s=wn(),s.memoizedState=s.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hv,lastRenderedState:i},s.queue=c,s=cb.bind(null,qe,c),c.dispatch=s,c=xh(!1),v=Nh.bind(null,qe,!1,c.queue),c=wn(),p={state:i,dispatch:null,action:r,pending:null},c.queue=p,s=_N.bind(null,qe,p,v,s),p.dispatch=s,c.memoizedState=r,[i,s,!1]}function Vv(r){var i=Pt();return Qv(i,gt,r)}function Qv(r,i,s){if(i=vh(r,i,Hv)[0],r=bc(sa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=jo(i)}catch(w){throw w===Xl?uc:w}else c=i;i=Pt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,ns(9,{destroy:void 0},AN.bind(null,p,s),null)),[c,v,r]}function AN(r,i){r.action=i}function Gv(r){var i=Pt(),s=gt;if(s!==null)return Qv(i,s,r);Pt(),i=i.memoizedState,s=Pt();var c=s.queue.dispatch;return s.memoizedState=r,[i,c,!1]}function ns(r,i,s,c){return r={tag:r,create:s,deps:c,inst:i,next:null},i=qe.updateQueue,i===null&&(i=yc(),qe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,i.lastEffect=r),r}function Kv(){return Pt().memoizedState}function xc(r,i,s,c){var p=wn();qe.flags|=r,p.memoizedState=ns(1|i,{destroy:void 0},s,c===void 0?null:c)}function Sc(r,i,s,c){var p=Pt();c=c===void 0?null:c;var v=p.memoizedState.inst;gt!==null&&c!==null&&fh(c,gt.memoizedState.deps)?p.memoizedState=ns(i,v,s,c):(qe.flags|=r,p.memoizedState=ns(1|i,v,s,c))}function Yv(r,i){xc(8390656,8,r,i)}function wh(r,i){Sc(2048,8,r,i)}function TN(r){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=yc(),qe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Xv(r){var i=Pt().memoizedState;return TN({ref:i,nextImpl:r}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Jv(r,i){return Sc(4,2,r,i)}function Wv(r,i){return Sc(4,4,r,i)}function eb(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 tb(r,i,s){s=s!=null?s.concat([r]):null,Sc(4,4,eb.bind(null,i,r),s)}function kh(){}function nb(r,i){var s=Pt();i=i===void 0?null:i;var c=s.memoizedState;return i!==null&&fh(i,c[1])?c[0]:(s.memoizedState=[r,i],r)}function rb(r,i){var s=Pt();i=i===void 0?null:i;var c=s.memoizedState;if(i!==null&&fh(i,c[1]))return c[0];if(c=r(),el){sn(!0);try{r()}finally{sn(!1)}}return s.memoizedState=[c,i],c}function jh(r,i,s){return s===void 0||(la&1073741824)!==0&&(We&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=ax(),qe.lanes|=r,Xa|=r,s)}function ab(r,i,s,c){return Hn(s,i)?s:Wl.current!==null?(r=jh(r,s,c),Hn(r,i)||(Zt=!0),r):(la&42)===0||(la&1073741824)!==0&&(We&261930)===0?(Zt=!0,r.memoizedState=s):(r=ax(),qe.lanes|=r,Xa|=r,i)}function ib(r,i,s,c,p){var v=oe.p;oe.p=v!==0&&8>v?v:8;var w=q.T,N={};q.T=N,Nh(r,!1,i,s);try{var D=p(),G=q.S;if(G!==null&&G(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ne=CN(D,c);Co(r,i,ne,Yn(r))}else Co(r,i,c,Yn(r))}catch(ue){Co(r,i,{then:function(){},status:"rejected",reason:ue},Yn())}finally{oe.p=v,w!==null&&N.types!==null&&(w.types=N.types),q.T=w}}function RN(){}function Ch(r,i,s,c){if(r.tag!==5)throw Error(a(476));var p=lb(r).queue;ib(r,p,i,K,s===null?RN:function(){return sb(r),s(c)})}function lb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:K},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function sb(r){var i=lb(r);i.next===null&&(i=r.alternate.memoizedState),Co(r,i.next.queue,{},Yn())}function Eh(){return cn(Fo)}function ob(){return Pt().memoizedState}function ub(){return Pt().memoizedState}function zN(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Yn();r=Za(s);var c=Va(i,r,s);c!==null&&(Dn(c,i,s),xo(c,i,s)),i={cache:th()},r.payload=i;return}i=i.return}}function ON(r,i,s){var c=Yn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wc(r)?db(i,s):(s=Hf(r,i,s,c),s!==null&&(Dn(s,r,c),fb(s,i,c)))}function cb(r,i,s){var c=Yn();Co(r,i,s,c)}function Co(r,i,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(wc(r))db(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,N=v(w,s);if(p.hasEagerState=!0,p.eagerState=N,Hn(N,w))return nc(r,i,p,0),St===null&&tc(),!1}catch{}finally{}if(s=Hf(r,i,p,c),s!==null)return Dn(s,r,c),fb(s,i,c),!0}return!1}function Nh(r,i,s,c){if(c={lane:2,revertLane:im(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wc(r)){if(i)throw Error(a(479))}else i=Hf(r,s,c,2),i!==null&&Dn(i,r,2)}function wc(r){var i=r.alternate;return r===qe||i!==null&&i===qe}function db(r,i){es=pc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function fb(r,i,s){if((s&4194048)!==0){var c=i.lanes;c&=r.pendingLanes,s|=c,i.lanes=s,Bi(r,s)}}var Eo={readContext:cn,use:vc,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};Eo.useEffectEvent=Lt;var hb={readContext:cn,use:vc,useCallback:function(r,i){return wn().memoizedState=[r,i===void 0?null:i],r},useContext:cn,useEffect:Yv,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,xc(4194308,4,eb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return xc(4194308,4,r,i)},useInsertionEffect:function(r,i){xc(4,2,r,i)},useMemo:function(r,i){var s=wn();i=i===void 0?null:i;var c=r();if(el){sn(!0);try{r()}finally{sn(!1)}}return s.memoizedState=[c,i],c},useReducer:function(r,i,s){var c=wn();if(s!==void 0){var p=s(i);if(el){sn(!0);try{s(i)}finally{sn(!1)}}}else p=i;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=ON.bind(null,qe,r),[c.memoizedState,r]},useRef:function(r){var i=wn();return r={current:r},i.memoizedState=r},useState:function(r){r=xh(r);var i=r.queue,s=cb.bind(null,qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:kh,useDeferredValue:function(r,i){var s=wn();return jh(s,r,i)},useTransition:function(){var r=xh(!1);return r=ib.bind(null,qe,r.queue,!0,!1),wn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var c=qe,p=wn();if(nt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),St===null)throw Error(a(349));(We&127)!==0||Mv(c,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Yv(Lv.bind(null,c,v,r),[r]),c.flags|=2048,ns(9,{destroy:void 0},Dv.bind(null,c,v,s,i),null),s},useId:function(){var r=wn(),i=St.identifierPrefix;if(nt){var s=Or,c=zr;s=(c&~(1<<32-ct(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=gc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=EN++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Eh,useFormState:Zv,useActionState:Zv,useOptimistic:function(r){var i=wn();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Nh.bind(null,qe,!0,s),s.dispatch=i,[r,i]},useMemoCache:yh,useCacheRefresh:function(){return wn().memoizedState=zN.bind(null,qe)},useEffectEvent:function(r){var i=wn(),s={impl:r};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},_h={readContext:cn,use:vc,useCallback:nb,useContext:cn,useEffect:wh,useImperativeHandle:tb,useInsertionEffect:Jv,useLayoutEffect:Wv,useMemo:rb,useReducer:bc,useRef:Kv,useState:function(){return bc(sa)},useDebugValue:kh,useDeferredValue:function(r,i){var s=Pt();return ab(s,gt.memoizedState,r,i)},useTransition:function(){var r=bc(sa)[0],i=Pt().memoizedState;return[typeof r=="boolean"?r:jo(r),i]},useSyncExternalStore:Ov,useId:ob,useHostTransitionStatus:Eh,useFormState:Vv,useActionState:Vv,useOptimistic:function(r,i){var s=Pt();return Bv(s,gt,r,i)},useMemoCache:yh,useCacheRefresh:ub};_h.useEffectEvent=Xv;var mb={readContext:cn,use:vc,useCallback:nb,useContext:cn,useEffect:wh,useImperativeHandle:tb,useInsertionEffect:Jv,useLayoutEffect:Wv,useMemo:rb,useReducer:bh,useRef:Kv,useState:function(){return bh(sa)},useDebugValue:kh,useDeferredValue:function(r,i){var s=Pt();return gt===null?jh(s,r,i):ab(s,gt.memoizedState,r,i)},useTransition:function(){var r=bh(sa)[0],i=Pt().memoizedState;return[typeof r=="boolean"?r:jo(r),i]},useSyncExternalStore:Ov,useId:ob,useHostTransitionStatus:Eh,useFormState:Gv,useActionState:Gv,useOptimistic:function(r,i){var s=Pt();return gt!==null?Bv(s,gt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:yh,useCacheRefresh:ub};mb.useEffectEvent=Xv;function Ah(r,i,s,c){i=r.memoizedState,s=s(c,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Th={enqueueSetState:function(r,i,s){r=r._reactInternals;var c=Yn(),p=Za(c);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,c),i!==null&&(Dn(i,r,c),xo(i,r,c))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var c=Yn(),p=Za(c);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,c),i!==null&&(Dn(i,r,c),xo(i,r,c))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=Yn(),c=Za(s);c.tag=2,i!=null&&(c.callback=i),i=Va(r,c,s),i!==null&&(Dn(i,r,s),xo(i,r,s))}};function pb(r,i,s,c,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,v,w):i.prototype&&i.prototype.isPureReactComponent?!fo(s,c)||!fo(p,v):!0}function gb(r,i,s,c){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,c),i.state!==r&&Th.enqueueReplaceState(i,i.state,null)}function tl(r,i){var s=i;if("ref"in i){s={};for(var c in i)c!=="ref"&&(s[c]=i[c])}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 yb(r){ec(r)}function vb(r){console.error(r)}function bb(r){ec(r)}function kc(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function xb(r,i,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Rh(r,i,s){return s=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){kc(r,i)},s}function Sb(r){return r=Za(r),r.tag=3,r}function wb(r,i,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;r.payload=function(){return p(v)},r.callback=function(){xb(i,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){xb(i,s,c),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})})}function MN(r,i,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=s.alternate,i!==null&&Gl(i,s,p,!0),s=Vn.current,s!==null){switch(s.tag){case 31:case 13:return dr===null?Dc():s.alternate===null&&It===0&&(It=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===cc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([c]):i.add(c),nm(r,c,p)),!1;case 22:return s.flags|=65536,c===cc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([c]):s.add(c)),nm(r,c,p)),!1}throw Error(a(435,s.tag))}return nm(r,c,p),Dc(),!1}if(nt)return i=Vn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,c!==Yf&&(r=Error(a(422),{cause:c}),po(sr(r,s)))):(c!==Yf&&(i=Error(a(423),{cause:c}),po(sr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=sr(c,s),p=Rh(r.stateNode,c,p),sh(r,p),It!==4&&(It=2)),!1;var v=Error(a(520),{cause:c});if(v=sr(v,s),Mo===null?Mo=[v]:Mo.push(v),It!==4&&(It=2),i===null)return!0;c=sr(c,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Rh(s.stateNode,c,r),sh(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=Sb(p),wb(p,r,s,c),sh(s,p),!1}s=s.return}while(s!==null);return!1}var zh=Error(a(461)),Zt=!1;function dn(r,i,s,c){i.child=r===null?Ev(i,null,s,c):Wi(i,r.child,s,c)}function kb(r,i,s,c,p){s=s.render;var v=i.ref;if("ref"in c){var w={};for(var N in c)N!=="ref"&&(w[N]=c[N])}else w=c;return Ki(i),c=hh(r,i,s,w,v,p),N=mh(),r!==null&&!Zt?(ph(r,i,p),oa(r,i,p)):(nt&&N&&Gf(i),i.flags|=1,dn(r,i,c,p),i.child)}function jb(r,i,s,c,p){if(r===null){var v=s.type;return typeof v=="function"&&!Zf(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,Cb(r,i,v,c,p)):(r=ac(s.type,null,c,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Ph(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:fo,s(w,c)&&r.ref===i.ref)return oa(r,i,p)}return i.flags|=1,r=na(v,c),r.ref=i.ref,r.return=i,i.child=r}function Cb(r,i,s,c,p){if(r!==null){var v=r.memoizedProps;if(fo(v,c)&&r.ref===i.ref)if(Zt=!1,i.pendingProps=c=v,Ph(r,p))(r.flags&131072)!==0&&(Zt=!0);else return i.lanes=r.lanes,oa(r,i,p)}return Oh(r,i,s,c,p)}function Eb(r,i,s,c){var p=c.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(c=i.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,i.child=null;return Nb(r,i,v,s,c)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&oc(i,v!==null?v.cachePool:null),v!==null?Av(i,v):uh(),Tv(i);else return c=i.lanes=536870912,Nb(r,i,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(oc(i,v.cachePool),Av(i,v),Ga(),i.memoizedState=null):(r!==null&&oc(i,null),uh(),Ga());return dn(r,i,p,s),i.child}function No(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Nb(r,i,s,c,p){var v=rh();return v=v===null?null:{parent:qt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&oc(i,null),uh(),Tv(i),r!==null&&Gl(r,i,c,!0),i.childLanes=p,null}function jc(r,i){return i=Ec({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function _b(r,i,s){return Wi(i,r.child,null,s),r=jc(i,i.pendingProps),r.flags|=2,Qn(i),i.memoizedState=null,r}function DN(r,i,s){var c=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(nt){if(c.mode==="hidden")return r=jc(i,c),i.lanes=536870912,No(null,r);if(dh(i),(r=Et)?(r=Px(r,cr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:zr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},s=dv(r),s.return=i,i.child=s,un=i,Et=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return jc(i,c)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(dh(i),p)if(i.flags&256)i.flags&=-257,i=_b(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Zt||Gl(r,i,s,!1),p=(s&r.childLanes)!==0,Zt||p){if(c=St,c!==null&&(w=zl(c,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Zi(r,w),Dn(c,r,w),zh;Dc(),i=_b(r,i,s)}else r=v.treeContext,Et=fr(w.nextSibling),un=i,nt=!0,$a=null,cr=!1,r!==null&&mv(i,r),i=jc(i,c),i.flags|=4096;return i}return r=na(r.child,{mode:c.mode,children:c.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Cc(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 Oh(r,i,s,c,p){return Ki(i),s=hh(r,i,s,c,void 0,p),c=mh(),r!==null&&!Zt?(ph(r,i,p),oa(r,i,p)):(nt&&c&&Gf(i),i.flags|=1,dn(r,i,s,p),i.child)}function Ab(r,i,s,c,p,v){return Ki(i),i.updateQueue=null,s=zv(i,c,s,p),Rv(r),c=mh(),r!==null&&!Zt?(ph(r,i,v),oa(r,i,v)):(nt&&c&&Gf(i),i.flags|=1,dn(r,i,s,v),i.child)}function Tb(r,i,s,c,p){if(Ki(i),i.stateNode===null){var v=Hl,w=s.contextType;typeof w=="object"&&w!==null&&(v=cn(w)),v=new s(c,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Th,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},ih(i),w=s.contextType,v.context=typeof w=="object"&&w!==null?cn(w):Hl,v.state=i.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(Ah(i,s,w,c),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Th.enqueueReplaceState(v,v.state,null),wo(i,c,v,p),So(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,D=tl(s,N);v.props=D;var G=v.context,ne=s.contextType;w=Hl,typeof ne=="object"&&ne!==null&&(w=cn(ne));var ue=s.getDerivedStateFromProps;ne=typeof ue=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ne||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||G!==w)&&gb(i,v,c,w),Ha=!1;var Y=i.memoizedState;v.state=Y,wo(i,c,v,p),So(),G=i.memoizedState,N||Y!==G||Ha?(typeof ue=="function"&&(Ah(i,s,ue,c),G=i.memoizedState),(D=Ha||pb(i,s,D,c,Y,G,w))?(ne||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=c,i.memoizedState=G),v.props=c,v.state=G,v.context=w,c=D):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,lh(r,i),w=i.memoizedProps,ne=tl(s,w),v.props=ne,ue=i.pendingProps,Y=v.context,G=s.contextType,D=Hl,typeof G=="object"&&G!==null&&(D=cn(G)),N=s.getDerivedStateFromProps,(G=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ue||Y!==D)&&gb(i,v,c,D),Ha=!1,Y=i.memoizedState,v.state=Y,wo(i,c,v,p),So();var J=i.memoizedState;w!==ue||Y!==J||Ha||r!==null&&r.dependencies!==null&&lc(r.dependencies)?(typeof N=="function"&&(Ah(i,s,N,c),J=i.memoizedState),(ne=Ha||pb(i,s,ne,c,Y,J,D)||r!==null&&r.dependencies!==null&&lc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,J,D),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,J,D)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=J),v.props=c,v.state=J,v.context=D,c=ne):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&Y===r.memoizedState||(i.flags|=1024),c=!1)}return v=c,Cc(r,i),c=(i.flags&128)!==0,v||c?(v=i.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&c?(i.child=Wi(i,r.child,null,p),i.child=Wi(i,null,s,p)):dn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=oa(r,i,p),r}function Rb(r,i,s,c){return Qi(),i.flags|=256,dn(r,i,s,c),i.child}var Mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dh(r){return{baseLanes:r,cachePool:xv()}}function Lh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Kn),r}function zb(r,i,s){var c=i.pendingProps,p=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Bt.current&2)!==0),w&&(p=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,r===null){if(nt){if(p?Qa(i):Ga(),(r=Et)?(r=Px(r,cr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:zr,overflow:Or}:null,retryLane:536870912,hydrationErrors:null},s=dv(r),s.return=i,i.child=s,un=i,Et=null)):r=null,r===null)throw Fa(i);return vm(r)?i.lanes=32:i.lanes=536870912,null}var N=c.children;return c=c.fallback,p?(Ga(),p=i.mode,N=Ec({mode:"hidden",children:N},p),c=Vi(c,p,s,null),N.return=i,c.return=i,N.sibling=c,i.child=N,c=i.child,c.memoizedState=Dh(s),c.childLanes=Lh(r,w,s),i.memoizedState=Mh,No(null,c)):(Qa(i),Ih(i,N))}var D=r.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=Uh(r,i,s)):i.memoizedState!==null?(Ga(),i.child=r.child,i.flags|=128,i=null):(Ga(),N=c.fallback,p=i.mode,c=Ec({mode:"visible",children:c.children},p),N=Vi(N,p,s,null),N.flags|=2,c.return=i,N.return=i,c.sibling=N,i.child=c,Wi(i,r.child,null,s),c=i.child,c.memoizedState=Dh(s),c.childLanes=Lh(r,w,s),i.memoizedState=Mh,i=No(null,c));else if(Qa(i),vm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(a(419)),c.stack="",c.digest=w,po({value:c,source:null,stack:null}),i=Uh(r,i,s)}else if(Zt||Gl(r,i,s,!1),w=(s&r.childLanes)!==0,Zt||w){if(w=St,w!==null&&(c=zl(w,s),c!==0&&c!==D.retryLane))throw D.retryLane=c,Zi(r,c),Dn(w,r,c),zh;ym(N)||Dc(),i=Uh(r,i,s)}else ym(N)?(i.flags|=192,i.child=r.child,i=null):(r=D.treeContext,Et=fr(N.nextSibling),un=i,nt=!0,$a=null,cr=!1,r!==null&&mv(i,r),i=Ih(i,c.children),i.flags|=4096);return i}return p?(Ga(),N=c.fallback,p=i.mode,D=r.child,G=D.sibling,c=na(D,{mode:"hidden",children:c.children}),c.subtreeFlags=D.subtreeFlags&65011712,G!==null?N=na(G,N):(N=Vi(N,p,s,null),N.flags|=2),N.return=i,c.return=i,c.sibling=N,i.child=c,No(null,c),c=i.child,N=r.child.memoizedState,N===null?N=Dh(s):(p=N.cachePool,p!==null?(D=qt._currentValue,p=p.parent!==D?{parent:D,pool:D}:p):p=xv(),N={baseLanes:N.baseLanes|s,cachePool:p}),c.memoizedState=N,c.childLanes=Lh(r,w,s),i.memoizedState=Mh,No(r.child,c)):(Qa(i),s=r.child,r=s.sibling,s=na(s,{mode:"visible",children:c.children}),s.return=i,s.sibling=null,r!==null&&(w=i.deletions,w===null?(i.deletions=[r],i.flags|=16):w.push(r)),i.child=s,i.memoizedState=null,s)}function Ih(r,i){return i=Ec({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Ec(r,i){return r=Zn(22,r,null,i),r.lanes=0,r}function Uh(r,i,s){return Wi(i,r.child,null,s),r=Ih(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Ob(r,i,s){r.lanes|=i;var c=r.alternate;c!==null&&(c.lanes|=i),Wf(r.return,i,s)}function Bh(r,i,s,c,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function Mb(r,i,s){var c=i.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var w=Bt.current,N=(w&2)!==0;if(N?(w=w&1|2,i.flags|=128):w&=1,_(Bt,w),dn(r,i,c,s),c=nt?mo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ob(r,s,i);else if(r.tag===19)Ob(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&&mc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Bh(i,!1,p,s,v,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&mc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Bh(i,!0,s,null,v,c);break;case"together":Bh(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function oa(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Xa|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Gl(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=na(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=na(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Ph(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&lc(r)))}function LN(r,i,s){switch(i.tag){case 3:Oe(i,i.stateNode.containerInfo),qa(i,qt,r.memoizedState.cache),Qi();break;case 27:case 5:xt(i);break;case 4:Oe(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,dh(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?zb(r,i,s):(Qa(i),r=oa(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(c=(s&i.childLanes)!==0,c||(Gl(r,i,s,!1),c=(s&i.childLanes)!==0),p){if(c)return Mb(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),_(Bt,Bt.current),c)break;return null;case 22:return i.lanes=0,Eb(r,i,s,i.pendingProps);case 24:qa(i,qt,r.memoizedState.cache)}return oa(r,i,s)}function Db(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Zt=!0;else{if(!Ph(r,s)&&(i.flags&128)===0)return Zt=!1,LN(r,i,s);Zt=(r.flags&131072)!==0}else Zt=!1,nt&&(i.flags&1048576)!==0&&hv(i,mo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(r=Xi(i.elementType),i.type=r,typeof r=="function")Zf(r)?(c=tl(r,c),i.tag=1,i=Tb(null,i,r,c,s)):(i.tag=0,i=Oh(null,i,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===P){i.tag=11,i=kb(null,i,r,c,s);break e}else if(p===M){i.tag=14,i=jb(null,i,r,c,s);break e}}throw i=fe(r)||r,Error(a(306,i,""))}}return i;case 0:return Oh(r,i,i.type,i.pendingProps,s);case 1:return c=i.type,p=tl(c,i.pendingProps),Tb(r,i,c,p,s);case 3:e:{if(Oe(i,i.stateNode.containerInfo),r===null)throw Error(a(387));c=i.pendingProps;var v=i.memoizedState;p=v.element,lh(r,i),wo(i,c,null,s);var w=i.memoizedState;if(c=w.cache,qa(i,qt,c),c!==v.cache&&eh(i,[qt],s,!0),So(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Rb(r,i,c,s);break e}else if(c!==p){p=sr(Error(a(424)),i),po(p),i=Rb(r,i,c,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=fr(r.firstChild),un=i,nt=!0,$a=null,cr=!0,s=Ev(i,null,c,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Qi(),c===p){i=oa(r,i,s);break e}dn(r,i,c,s)}i=i.child}return i;case 26:return Cc(r,i),r===null?(s=Vx(i.type,null,i.pendingProps,null))?i.memoizedState=s:nt||(s=i.type,r=i.pendingProps,c=Fc(le.current).createElement(s),c[Ft]=i,c[on]=r,fn(c,s,r),X(c),i.stateNode=c):i.memoizedState=Vx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return xt(i),r===null&&nt&&(c=i.stateNode=qx(i.type,i.pendingProps,le.current),un=i,cr=!0,p=Et,ni(i.type)?(bm=p,Et=fr(c.firstChild)):Et=p),dn(r,i,i.pendingProps.children,s),Cc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&nt&&((p=c=Et)&&(c=f_(c,i.type,i.pendingProps,cr),c!==null?(i.stateNode=c,un=i,Et=fr(c.firstChild),cr=!1,p=!0):p=!1),p||Fa(i)),xt(i),p=i.type,v=i.pendingProps,w=r!==null?r.memoizedProps:null,c=v.children,mm(p,v)?c=null:w!==null&&mm(p,w)&&(i.flags|=32),i.memoizedState!==null&&(p=hh(r,i,NN,null,null,s),Fo._currentValue=p),Cc(r,i),dn(r,i,c,s),i.child;case 6:return r===null&&nt&&((r=s=Et)&&(s=h_(s,i.pendingProps,cr),s!==null?(i.stateNode=s,un=i,Et=null,r=!0):r=!1),r||Fa(i)),null;case 13:return zb(r,i,s);case 4:return Oe(i,i.stateNode.containerInfo),c=i.pendingProps,r===null?i.child=Wi(i,null,c,s):dn(r,i,c,s),i.child;case 11:return kb(r,i,i.type,i.pendingProps,s);case 7:return dn(r,i,i.pendingProps,s),i.child;case 8:return dn(r,i,i.pendingProps.children,s),i.child;case 12:return dn(r,i,i.pendingProps.children,s),i.child;case 10:return c=i.pendingProps,qa(i,i.type,c.value),dn(r,i,c.children,s),i.child;case 9:return p=i.type._context,c=i.pendingProps.children,Ki(i),p=cn(p),c=c(p),i.flags|=1,dn(r,i,c,s),i.child;case 14:return jb(r,i,i.type,i.pendingProps,s);case 15:return Cb(r,i,i.type,i.pendingProps,s);case 19:return Mb(r,i,s);case 31:return DN(r,i,s);case 22:return Eb(r,i,s,i.pendingProps);case 24:return Ki(i),c=cn(qt),r===null?(p=rh(),p===null&&(p=St,v=th(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:c,cache:p},ih(i),qa(i,qt,p)):((r.lanes&s)!==0&&(lh(r,i),wo(i,null,null,s),So()),p=r.memoizedState,v=i.memoizedState,p.parent!==c?(p={parent:c,cache:c},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),qa(i,qt,c)):(c=v.cache,qa(i,qt,c),c!==p.cache&&eh(i,[qt],s,!0))),dn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ua(r){r.flags|=4}function $h(r,i,s,c,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(ox())r.flags|=8192;else throw Ji=cc,ah}else r.flags&=-16777217}function Lb(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Xx(i))if(ox())r.flags|=8192;else throw Ji=cc,ah}function Nc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Bu():536870912,r.lanes|=i,ls|=i)}function _o(r,i){if(!nt)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 c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function Nt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,i}function IN(r,i,s){var c=i.pendingProps;switch(Kf(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,c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),ia(qt),Se(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Ql(i)?ua(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Xf())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ua(i),v!==null?(Nt(i),Lb(i,v)):(Nt(i),$h(i,p,null,c,s))):v?v!==r.memoizedState?(ua(i),Nt(i),Lb(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==c&&ua(i),Nt(i),$h(i,p,r,c,s)),null;case 27:if(ce(i),s=le.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ua(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=te.current,Ql(i)?pv(i):(r=qx(p,c,s),i.stateNode=r,ua(i))}return Nt(i),null;case 5:if(ce(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==c&&ua(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=te.current,Ql(i))pv(i);else{var w=Fc(le.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}v[Ft]=i,v[on]=c;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(fn(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ua(i)}}return Nt(i),$h(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==c&&ua(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(r=le.current,Ql(i)){if(r=i.stateNode,s=i.memoizedProps,c=null,p=un,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[Ft]=i,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||zx(r.nodeValue,s)),r||Fa(i,!0)}else r=Fc(r).createTextNode(c),r[Ft]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(c=Ql(i),s!==null){if(r===null){if(!c)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Ft]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Qn(i),i):(Qn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(c=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ql(i),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Ft]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Qn(i),i):(Qn(i),null)}return Qn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=i.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Nc(i,i.updateQueue),Nt(i),null);case 4:return Se(),r===null&&um(i.stateNode.containerInfo),Nt(i),null;case 10:return ia(i.type),Nt(i),null;case 19:if(B(Bt),c=i.memoizedState,c===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=c.rendering,v===null)if(p)_o(c,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=mc(r),v!==null){for(i.flags|=128,_o(c,!1),r=v.updateQueue,i.updateQueue=r,Nc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)cv(s,r),s=s.sibling;return _(Bt,Bt.current&1|2),nt&&ra(i,c.treeForkCount),i.child}r=r.sibling}c.tail!==null&&rn()>zc&&(i.flags|=128,p=!0,_o(c,!1),i.lanes=4194304)}else{if(!p)if(r=mc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Nc(i,r),_o(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!nt)return Nt(i),null}else 2*rn()-c.renderingStartTime>zc&&s!==536870912&&(i.flags|=128,p=!0,_o(c,!1),i.lanes=4194304);c.isBackwards?(v.sibling=i.child,i.child=v):(r=c.last,r!==null?r.sibling=v:i.child=v,c.last=v)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=rn(),r.sibling=null,s=Bt.current,_(Bt,p?s&1|2:s&1),nt&&ra(i,c.treeForkCount),r):(Nt(i),null);case 22:case 23:return Qn(i),ch(),c=i.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&Nc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),r!==null&&B(Yi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ia(qt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function UN(r,i){switch(Kf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ia(qt),Se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ce(i),null;case 31:if(i.memoizedState!==null){if(Qn(i),i.alternate===null)throw Error(a(340));Qi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Qn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Qi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return B(Bt),null;case 4:return Se(),null;case 10:return ia(i.type),null;case 22:case 23:return Qn(i),ch(),r!==null&&B(Yi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ia(qt),null;case 25:return null;default:return null}}function Ib(r,i){switch(Kf(i),i.tag){case 3:ia(qt),Se();break;case 26:case 27:case 5:ce(i);break;case 4:Se();break;case 31:i.memoizedState!==null&&Qn(i);break;case 13:Qn(i);break;case 19:B(Bt);break;case 10:ia(i.type);break;case 22:case 23:Qn(i),ch(),r!==null&&B(Yi);break;case 24:ia(qt)}}function Ao(r,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&r)===r){c=void 0;var v=s.create,w=s.inst;c=v(),w.destroy=c}s=s.next}while(s!==p)}}catch(N){pt(i,i.return,N)}}function Ka(r,i,s){try{var c=i.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&r)===r){var w=c.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,p=i;var D=s,G=N;try{G()}catch(ne){pt(p,D,ne)}}}c=c.next}while(c!==v)}}catch(ne){pt(i,i.return,ne)}}function Ub(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{_v(i,s)}catch(c){pt(r,r.return,c)}}}function Bb(r,i,s){s.props=tl(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){pt(r,i,c)}}function To(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){pt(r,i,p)}}function Mr(r,i){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){pt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){pt(r,i,p)}else s.current=null}function Pb(r){var i=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){pt(r,r.return,p)}}function Fh(r,i,s){try{var c=r.stateNode;l_(c,r.type,s,i),c[on]=i}catch(p){pt(r,r.return,p)}}function $b(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function qh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||$b(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 Hh(r,i,s){var c=r.tag;if(c===5||c===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=ea));else if(c!==4&&(c===27&&ni(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Hh(r,i,s),r=r.sibling;r!==null;)Hh(r,i,s),r=r.sibling}function _c(r,i,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(c!==4&&(c===27&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(_c(r,i,s),r=r.sibling;r!==null;)_c(r,i,s),r=r.sibling}function Fb(r){var i=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);fn(i,c,s),i[Ft]=r,i[on]=s}catch(v){pt(r,r.return,v)}}var ca=!1,Vt=!1,Zh=!1,qb=typeof WeakSet=="function"?WeakSet:Set,tn=null;function BN(r,i){if(r=r.containerInfo,fm=Kc,r=tv(r),Uf(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,N=-1,D=-1,G=0,ne=0,ue=r,Y=null;t:for(;;){for(var J;ue!==s||p!==0&&ue.nodeType!==3||(N=w+p),ue!==v||c!==0&&ue.nodeType!==3||(D=w+c),ue.nodeType===3&&(w+=ue.nodeValue.length),(J=ue.firstChild)!==null;)Y=ue,ue=J;for(;;){if(ue===r)break t;if(Y===s&&++G===p&&(N=w),Y===v&&++ne===c&&(D=w),(J=ue.nextSibling)!==null)break;ue=Y,Y=ue.parentNode}ue=J}s=N===-1||D===-1?null:{start:N,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(hm={focusedElem:r,selectionRange:s},Kc=!1,tn=i;tn!==null;)if(i=tn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,tn=r;else for(;tn!==null;){switch(i=tn,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,c=s.stateNode;try{var ke=tl(s.type,p);r=c.getSnapshotBeforeUpdate(ke,v),c.__reactInternalSnapshotBeforeUpdate=r}catch(Ie){pt(s,s.return,Ie)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)gm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":gm(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,tn=r;break}tn=i.return}}function Hb(r,i,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:fa(r,s),c&4&&Ao(5,s);break;case 1:if(fa(r,s),c&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(w){pt(s,s.return,w)}else{var p=tl(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(w){pt(s,s.return,w)}}c&64&&Ub(s),c&512&&To(s,s.return);break;case 3:if(fa(r,s),c&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{_v(r,i)}catch(w){pt(s,s.return,w)}}break;case 27:i===null&&c&4&&Fb(s);case 26:case 5:fa(r,s),i===null&&c&4&&Pb(s),c&512&&To(s,s.return);break;case 12:fa(r,s);break;case 31:fa(r,s),c&4&&Qb(r,s);break;case 13:fa(r,s),c&4&&Gb(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=GN.bind(null,s),m_(r,s))));break;case 22:if(c=s.memoizedState!==null||ca,!c){i=i!==null&&i.memoizedState!==null||Vt,p=ca;var v=Vt;ca=c,(Vt=i)&&!v?ha(r,s,(s.subtreeFlags&8772)!==0):fa(r,s),ca=p,Vt=v}break;case 30:break;default:fa(r,s)}}function Zb(r){var i=r.alternate;i!==null&&(r.alternate=null,Zb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Dl(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var _t=null,Rn=!1;function da(r,i,s){for(s=s.child;s!==null;)Vb(r,i,s),s=s.sibling}function Vb(r,i,s){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(ln,s)}catch{}switch(s.tag){case 26:Vt||Mr(s,i),da(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Vt||Mr(s,i);var c=_t,p=Rn;ni(s.type)&&(_t=s.stateNode,Rn=!1),da(r,i,s),Bo(s.stateNode),_t=c,Rn=p;break;case 5:Vt||Mr(s,i);case 6:if(c=_t,p=Rn,_t=null,da(r,i,s),_t=c,Rn=p,_t!==null)if(Rn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(v){pt(s,i,v)}else try{_t.removeChild(s.stateNode)}catch(v){pt(s,i,v)}break;case 18:_t!==null&&(Rn?(r=_t,Ux(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),ms(r)):Ux(_t,s.stateNode));break;case 4:c=_t,p=Rn,_t=s.stateNode.containerInfo,Rn=!0,da(r,i,s),_t=c,Rn=p;break;case 0:case 11:case 14:case 15:Ka(2,s,i),Vt||Ka(4,s,i),da(r,i,s);break;case 1:Vt||(Mr(s,i),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Bb(s,i,c)),da(r,i,s);break;case 21:da(r,i,s);break;case 22:Vt=(c=Vt)||s.memoizedState!==null,da(r,i,s),Vt=c;break;default:da(r,i,s)}}function Qb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ms(r)}catch(s){pt(i,i.return,s)}}}function Gb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ms(r)}catch(s){pt(i,i.return,s)}}function PN(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new qb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new qb),i;default:throw Error(a(435,r.tag))}}function Ac(r,i){var s=PN(r);i.forEach(function(c){if(!s.has(c)){s.add(c);var p=KN.bind(null,r,c);c.then(p,p)}})}function zn(r,i){var s=i.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],v=r,w=i,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ni(N.type)){_t=N.stateNode,Rn=!1;break e}break;case 5:_t=N.stateNode,Rn=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Rn=!0;break e}N=N.return}if(_t===null)throw Error(a(160));Vb(v,w,p),_t=null,Rn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Kb(i,r),i=i.sibling}var kr=null;function Kb(r,i){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:zn(i,r),On(r),c&4&&(Ka(3,r,r.return),Ao(3,r),Ka(5,r,r.return));break;case 1:zn(i,r),On(r),c&512&&(Vt||s===null||Mr(s,s.return)),c&64&&ca&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=kr;if(zn(i,r),On(r),c&512&&(Vt||s===null||Mr(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Ia]||v[Ft]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),fn(v,c,s),v[Ft]=r,X(v),c=v;break e;case"link":var w=Kx("link","href",p).get(c+(s.href||""));if(w){for(var N=0;N<w.length;N++)if(v=w[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(N,1);break t}}v=p.createElement(c),fn(v,c,s),p.head.appendChild(v);break;case"meta":if(w=Kx("meta","content",p).get(c+(s.content||""))){for(N=0;N<w.length;N++)if(v=w[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(N,1);break t}}v=p.createElement(c),fn(v,c,s),p.head.appendChild(v);break;default:throw Error(a(468,c))}v[Ft]=r,X(v),c=v}r.stateNode=c}else Yx(p,r.type,r.stateNode);else r.stateNode=Gx(p,c,r.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Yx(p,r.type,r.stateNode):Gx(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Fh(r,r.memoizedProps,s.memoizedProps)}break;case 27:zn(i,r),On(r),c&512&&(Vt||s===null||Mr(s,s.return)),s!==null&&c&4&&Fh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(zn(i,r),On(r),c&512&&(Vt||s===null||Mr(s,s.return)),r.flags&32){p=r.stateNode;try{Il(p,"")}catch(ke){pt(r,r.return,ke)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Fh(r,p,s!==null?s.memoizedProps:p)),c&1024&&(Zh=!0);break;case 6:if(zn(i,r),On(r),c&4){if(r.stateNode===null)throw Error(a(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(ke){pt(r,r.return,ke)}}break;case 3:if(Zc=null,p=kr,kr=qc(i.containerInfo),zn(i,r),kr=p,On(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ms(i.containerInfo)}catch(ke){pt(r,r.return,ke)}Zh&&(Zh=!1,Yb(r));break;case 4:c=kr,kr=qc(r.stateNode.containerInfo),zn(i,r),On(r),kr=c;break;case 12:zn(i,r),On(r);break;case 31:zn(i,r),On(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ac(r,c)));break;case 13:zn(i,r),On(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Rc=rn()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ac(r,c)));break;case 22:p=r.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,G=ca,ne=Vt;if(ca=G||p,Vt=ne||D,zn(i,r),Vt=ne,ca=G,On(r),c&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||D||ca||Vt||nl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){D=s=i;try{if(v=D.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=D.stateNode;var ue=D.memoizedProps.style,Y=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;N.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ke){pt(D,D.return,ke)}}}else if(i.tag===6){if(s===null){D=i;try{D.stateNode.nodeValue=p?"":D.memoizedProps}catch(ke){pt(D,D.return,ke)}}}else if(i.tag===18){if(s===null){D=i;try{var J=D.stateNode;p?Bx(J,!0):Bx(D.stateNode,!1)}catch(ke){pt(D,D.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}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,Ac(r,s))));break;case 19:zn(i,r),On(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Ac(r,c)));break;case 30:break;case 21:break;default:zn(i,r),On(r)}}function On(r){var i=r.flags;if(i&2){try{for(var s,c=r.return;c!==null;){if($b(c)){s=c;break}c=c.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=qh(r);_c(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Il(w,""),s.flags&=-33);var N=qh(r);_c(r,N,w);break;case 3:case 4:var D=s.stateNode.containerInfo,G=qh(r);Hh(r,G,D);break;default:throw Error(a(161))}}catch(ne){pt(r,r.return,ne)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Yb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Yb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function fa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Hb(r,i.alternate,i),i=i.sibling}function nl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ka(4,i,i.return),nl(i);break;case 1:Mr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Bb(i,i.return,s),nl(i);break;case 27:Bo(i.stateNode);case 26:case 5:Mr(i,i.return),nl(i);break;case 22:i.memoizedState===null&&nl(i);break;case 30:nl(i);break;default:nl(i)}r=r.sibling}}function ha(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,p=r,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:ha(p,v,s),Ao(4,v);break;case 1:if(ha(p,v,s),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){pt(c,c.return,G)}if(c=v,p=c.updateQueue,p!==null){var N=c.stateNode;try{var D=p.shared.hiddenCallbacks;if(D!==null)for(p.shared.hiddenCallbacks=null,p=0;p<D.length;p++)Nv(D[p],N)}catch(G){pt(c,c.return,G)}}s&&w&64&&Ub(v),To(v,v.return);break;case 27:Fb(v);case 26:case 5:ha(p,v,s),s&&c===null&&w&4&&Pb(v),To(v,v.return);break;case 12:ha(p,v,s);break;case 31:ha(p,v,s),s&&w&4&&Qb(p,v);break;case 13:ha(p,v,s),s&&w&4&&Gb(p,v);break;case 22:v.memoizedState===null&&ha(p,v,s),To(v,v.return);break;case 30:break;default:ha(p,v,s)}i=i.sibling}}function Vh(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&&go(s))}function Qh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&go(r))}function jr(r,i,s,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Xb(r,i,s,c),i=i.sibling}function Xb(r,i,s,c){var p=i.flags;switch(i.tag){case 0:case 11:case 15:jr(r,i,s,c),p&2048&&Ao(9,i);break;case 1:jr(r,i,s,c);break;case 3:jr(r,i,s,c),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&go(r)));break;case 12:if(p&2048){jr(r,i,s,c),r=i.stateNode;try{var v=i.memoizedProps,w=v.id,N=v.onPostCommit;typeof N=="function"&&N(w,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(D){pt(i,i.return,D)}}else jr(r,i,s,c);break;case 31:jr(r,i,s,c);break;case 13:jr(r,i,s,c);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?jr(r,i,s,c):Ro(r,i):v._visibility&2?jr(r,i,s,c):(v._visibility|=2,rs(r,i,s,c,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Vh(w,i);break;case 24:jr(r,i,s,c),p&2048&&Qh(i.alternate,i);break;default:jr(r,i,s,c)}}function rs(r,i,s,c,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,w=i,N=s,D=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:rs(v,w,N,D,p),Ao(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?rs(v,w,N,D,p):Ro(v,w):(ne._visibility|=2,rs(v,w,N,D,p)),p&&G&2048&&Vh(w.alternate,w);break;case 24:rs(v,w,N,D,p),p&&G&2048&&Qh(w.alternate,w);break;default:rs(v,w,N,D,p)}i=i.sibling}}function Ro(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,c=i,p=c.flags;switch(c.tag){case 22:Ro(s,c),p&2048&&Vh(c.alternate,c);break;case 24:Ro(s,c),p&2048&&Qh(c.alternate,c);break;default:Ro(s,c)}i=i.sibling}}var zo=8192;function as(r,i,s){if(r.subtreeFlags&zo)for(r=r.child;r!==null;)Jb(r,i,s),r=r.sibling}function Jb(r,i,s){switch(r.tag){case 26:as(r,i,s),r.flags&zo&&r.memoizedState!==null&&E_(s,kr,r.memoizedState,r.memoizedProps);break;case 5:as(r,i,s);break;case 3:case 4:var c=kr;kr=qc(r.stateNode.containerInfo),as(r,i,s),kr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=zo,zo=16777216,as(r,i,s),zo=c):as(r,i,s));break;default:as(r,i,s)}}function Wb(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 Oo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];tn=c,tx(c,r)}Wb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ex(r),r=r.sibling}function ex(r){switch(r.tag){case 0:case 11:case 15:Oo(r),r.flags&2048&&Ka(9,r,r.return);break;case 3:Oo(r);break;case 12:Oo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Tc(r)):Oo(r);break;default:Oo(r)}}function Tc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];tn=c,tx(c,r)}Wb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ka(8,i,i.return),Tc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Tc(i));break;default:Tc(i)}r=r.sibling}}function tx(r,i){for(;tn!==null;){var s=tn;switch(s.tag){case 0:case 11:case 15:Ka(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:go(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,tn=c;else e:for(s=r;tn!==null;){c=tn;var p=c.sibling,v=c.return;if(Zb(c),c===s){tn=null;break e}if(p!==null){p.return=v,tn=p;break e}tn=v}}}var $N={getCacheForType:function(r){var i=cn(qt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return cn(qt).controller.signal}},FN=typeof WeakMap=="function"?WeakMap:Map,dt=0,St=null,Ye=null,We=0,mt=0,Gn=null,Ya=!1,is=!1,Gh=!1,ma=0,It=0,Xa=0,rl=0,Kh=0,Kn=0,ls=0,Mo=null,Mn=null,Yh=!1,Rc=0,nx=0,zc=1/0,Oc=null,Ja=null,Yt=0,Wa=null,ss=null,pa=0,Xh=0,Jh=null,rx=null,Do=0,Wh=null;function Yn(){return(dt&2)!==0&&We!==0?We&-We:q.T!==null?im():Pu()}function ax(){if(Kn===0)if((We&536870912)===0||nt){var r=Tl;Tl<<=1,(Tl&3932160)===0&&(Tl=262144),Kn=r}else Kn=536870912;return r=Vn.current,r!==null&&(r.flags|=32),Kn}function Dn(r,i,s){(r===St&&(mt===2||mt===9)||r.cancelPendingCommit!==null)&&(os(r,0),ei(r,We,Kn,!1)),Ui(r,s),((dt&2)===0||r!==St)&&(r===St&&((dt&2)===0&&(rl|=s),It===4&&ei(r,We,Kn,!1)),Dr(r))}function ix(r,i,s){if((dt&6)!==0)throw Error(a(327));var c=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ii(r,i),p=c?ZN(r,i):tm(r,i,!0),v=c;do{if(p===0){is&&!c&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!qN(s)){p=tm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var N=r;p=Mo;var D=N.current.memoizedState.isDehydrated;if(D&&(os(N,w).flags|=256),w=tm(N,w,!1),w!==2){if(Gh&&!D){N.errorRecoveryDisabledLanes|=v,rl|=v,p=4;break e}v=Mn,Mn=p,v!==null&&(Mn===null?Mn=v:Mn.push.apply(Mn,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){os(r,0),ei(r,i,0,!0);break}e:{switch(c=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ei(c,i,Kn,!Ya);break e;case 2:Mn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Rc+300-rn(),10<p)){if(ei(c,i,Kn,!Ya),Rl(c,0,!0)!==0)break e;pa=i,c.timeoutHandle=Lx(lx.bind(null,c,s,Mn,Oc,Yh,i,Kn,rl,ls,Ya,v,"Throttled",-0,0),p);break e}lx(c,s,Mn,Oc,Yh,i,Kn,rl,ls,Ya,v,null,-0,0)}}break}while(!0);Dr(r)}function lx(r,i,s,c,p,v,w,N,D,G,ne,ue,Y,J){if(r.timeoutHandle=-1,ue=i.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},Jb(i,v,ue);var ke=(v&62914560)===v?Rc-rn():(v&4194048)===v?nx-rn():0;if(ke=N_(ue,ke),ke!==null){pa=v,r.cancelPendingCommit=ke(mx.bind(null,r,i,v,s,c,p,w,N,D,ne,ue,null,Y,J)),ei(r,v,w,!G);return}}mx(r,i,v,s,c,p,w,N,D)}function qN(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 c=0;c<s.length;c++){var p=s[c],v=p.getSnapshot;p=p.value;try{if(!Hn(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,c){i&=~Kh,i&=~rl,r.suspendedLanes|=i,r.pingedLanes&=~i,c&&(r.warmLanes|=i),c=r.expirationTimes;for(var p=i;0<p;){var v=31-ct(p),w=1<<v;c[v]=-1,p&=~w}s!==0&&rr(r,s,i)}function Mc(){return(dt&6)===0?(Lo(0),!1):!0}function em(){if(Ye!==null){if(mt===0)var r=Ye.return;else r=Ye,aa=Gi=null,gh(r),Jl=null,vo=0,r=Ye;for(;r!==null;)Ib(r.alternate,r),r=r.return;Ye=null}}function os(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,u_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),pa=0,em(),St=r,Ye=s=na(r.current,null),We=i,mt=0,Gn=null,Ya=!1,is=Ii(r,i),Gh=!1,ls=Kn=Kh=rl=Xa=It=0,Mn=Mo=null,Yh=!1,(i&8)!==0&&(i|=i&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=i;0<c;){var p=31-ct(c),v=1<<p;i|=r[p],c&=~v}return ma=i,tc(),s}function sx(r,i){qe=null,q.H=Eo,i===Xl||i===uc?(i=kv(),mt=3):i===ah?(i=kv(),mt=4):mt=i===zh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Gn=i,Ye===null&&(It=1,kc(r,sr(i,r.current)))}function ox(){var r=Vn.current;return r===null?!0:(We&4194048)===We?dr===null:(We&62914560)===We||(We&536870912)!==0?r===dr:!1}function ux(){var r=q.H;return q.H=Eo,r===null?Eo:r}function cx(){var r=q.A;return q.A=$N,r}function Dc(){It=4,Ya||(We&4194048)!==We&&Vn.current!==null||(is=!0),(Xa&134217727)===0&&(rl&134217727)===0||St===null||ei(St,We,Kn,!1)}function tm(r,i,s){var c=dt;dt|=2;var p=ux(),v=cx();(St!==r||We!==i)&&(Oc=null,os(r,i)),i=!1;var w=It;e:do try{if(mt!==0&&Ye!==null){var N=Ye,D=Gn;switch(mt){case 8:em(),w=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(i=!0);var G=mt;if(mt=0,Gn=null,us(r,N,D,G),s&&is){w=0;break e}break;default:G=mt,mt=0,Gn=null,us(r,N,D,G)}}HN(),w=It;break}catch(ne){sx(r,ne)}while(!0);return i&&r.shellSuspendCounter++,aa=Gi=null,dt=c,q.H=p,q.A=v,Ye===null&&(St=null,We=0,tc()),w}function HN(){for(;Ye!==null;)dx(Ye)}function ZN(r,i){var s=dt;dt|=2;var c=ux(),p=cx();St!==r||We!==i?(Oc=null,zc=rn()+500,os(r,i)):is=Ii(r,i);e:do try{if(mt!==0&&Ye!==null){i=Ye;var v=Gn;t:switch(mt){case 1:mt=0,Gn=null,us(r,i,v,1);break;case 2:case 9:if(Sv(v)){mt=0,Gn=null,fx(i);break}i=function(){mt!==2&&mt!==9||St!==r||(mt=7),Dr(r)},v.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:Sv(v)?(mt=0,Gn=null,fx(i)):(mt=0,Gn=null,us(r,i,v,7));break;case 5:var w=null;switch(Ye.tag){case 26:w=Ye.memoizedState;case 5:case 27:var N=Ye;if(w?Xx(w):N.stateNode.complete){mt=0,Gn=null;var D=N.sibling;if(D!==null)Ye=D;else{var G=N.return;G!==null?(Ye=G,Lc(G)):Ye=null}break t}}mt=0,Gn=null,us(r,i,v,5);break;case 6:mt=0,Gn=null,us(r,i,v,6);break;case 8:em(),It=6;break e;default:throw Error(a(462))}}VN();break}catch(ne){sx(r,ne)}while(!0);return aa=Gi=null,q.H=c,q.A=p,dt=s,Ye!==null?0:(St=null,We=0,tc(),It)}function VN(){for(;Ye!==null&&!Di();)dx(Ye)}function dx(r){var i=Db(r.alternate,r,ma);r.memoizedProps=r.pendingProps,i===null?Lc(r):Ye=i}function fx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=Ab(s,i,i.pendingProps,i.type,void 0,We);break;case 11:i=Ab(s,i,i.pendingProps,i.type.render,i.ref,We);break;case 5:gh(i);default:Ib(s,i),i=Ye=cv(i,ma),i=Db(s,i,ma)}r.memoizedProps=r.pendingProps,i===null?Lc(r):Ye=i}function us(r,i,s,c){aa=Gi=null,gh(i),Jl=null,vo=0;var p=i.return;try{if(MN(r,p,i,s,We)){It=1,kc(r,sr(s,r.current)),Ye=null;return}}catch(v){if(p!==null)throw Ye=p,v;It=1,kc(r,sr(s,r.current)),Ye=null;return}i.flags&32768?(nt||c===1?r=!0:is||(We&536870912)!==0?r=!1:(Ya=r=!0,(c===2||c===9||c===3||c===6)&&(c=Vn.current,c!==null&&c.tag===13&&(c.flags|=16384))),hx(i,r)):Lc(i)}function Lc(r){var i=r;do{if((i.flags&32768)!==0){hx(i,Ya);return}r=i.return;var s=IN(i.alternate,i,ma);if(s!==null){Ye=s;return}if(i=i.sibling,i!==null){Ye=i;return}Ye=i=r}while(i!==null);It===0&&(It=5)}function hx(r,i){do{var s=UN(r.alternate,r);if(s!==null){s.flags&=32767,Ye=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ye=r;return}Ye=r=s}while(r!==null);It=6,Ye=null}function mx(r,i,s,c,p,v,w,N,D){r.cancelPendingCommit=null;do Ic();while(Yt!==0);if((dt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=qf,Sf(r,s,v,w,N,D),r===St&&(Ye=St=null,We=0),ss=i,Wa=r,pa=s,Xh=v,Jh=p,rx=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,YN(we,function(){return bx(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=q.T,q.T=null,p=oe.p,oe.p=2,w=dt,dt|=4;try{BN(r,i,s)}finally{dt=w,oe.p=p,q.T=c}}Yt=1,px(),gx(),yx()}}function px(){if(Yt===1){Yt=0;var r=Wa,i=ss,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var c=oe.p;oe.p=2;var p=dt;dt|=4;try{Kb(i,r);var v=hm,w=tv(r.containerInfo),N=v.focusedElem,D=v.selectionRange;if(w!==N&&N&&N.ownerDocument&&ev(N.ownerDocument.documentElement,N)){if(D!==null&&Uf(N)){var G=D.start,ne=D.end;if(ne===void 0&&(ne=G),"selectionStart"in N)N.selectionStart=G,N.selectionEnd=Math.min(ne,N.value.length);else{var ue=N.ownerDocument||document,Y=ue&&ue.defaultView||window;if(Y.getSelection){var J=Y.getSelection(),ke=N.textContent.length,Ie=Math.min(D.start,ke),vt=D.end===void 0?Ie:Math.min(D.end,ke);!J.extend&&Ie>vt&&(w=vt,vt=Ie,Ie=w);var H=Wy(N,Ie),$=Wy(N,vt);if(H&&$&&(J.rangeCount!==1||J.anchorNode!==H.node||J.anchorOffset!==H.offset||J.focusNode!==$.node||J.focusOffset!==$.offset)){var Q=ue.createRange();Q.setStart(H.node,H.offset),J.removeAllRanges(),Ie>vt?(J.addRange(Q),J.extend($.node,$.offset)):(Q.setEnd($.node,$.offset),J.addRange(Q))}}}}for(ue=[],J=N;J=J.parentNode;)J.nodeType===1&&ue.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ue.length;N++){var se=ue[N];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Kc=!!fm,hm=fm=null}finally{dt=p,oe.p=c,q.T=s}}r.current=i,Yt=2}}function gx(){if(Yt===2){Yt=0;var r=Wa,i=ss,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var c=oe.p;oe.p=2;var p=dt;dt|=4;try{Hb(r,i.alternate,i)}finally{dt=p,oe.p=c,q.T=s}}Yt=3}}function yx(){if(Yt===4||Yt===3){Yt=0,La();var r=Wa,i=ss,s=pa,c=rx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Yt=5:(Yt=0,ss=Wa=null,vx(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),Pi(s),i=i.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(ln,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=q.T,p=oe.p,oe.p=2,q.T=null;try{for(var v=r.onRecoverableError,w=0;w<c.length;w++){var N=c[w];v(N.value,{componentStack:N.stack})}}finally{q.T=i,oe.p=p}}(pa&3)!==0&&Ic(),Dr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Wh?Do++:(Do=0,Wh=r):Do=0,Lo(0)}}function vx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,go(i)))}function Ic(){return px(),gx(),yx(),bx()}function bx(){if(Yt!==5)return!1;var r=Wa,i=Xh;Xh=0;var s=Pi(pa),c=q.T,p=oe.p;try{oe.p=32>s?32:s,q.T=null,s=Jh,Jh=null;var v=Wa,w=pa;if(Yt=0,ss=Wa=null,pa=0,(dt&6)!==0)throw Error(a(331));var N=dt;if(dt|=4,ex(v.current),Xb(v,v.current,w,s),dt=N,Lo(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(ln,v)}catch{}return!0}finally{oe.p=p,q.T=c,vx(r,i)}}function xx(r,i,s){i=sr(s,i),i=Rh(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(Ui(r,2),Dr(r))}function pt(r,i,s){if(r.tag===3)xx(r,r,s);else for(;i!==null;){if(i.tag===3){xx(i,r,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ja===null||!Ja.has(c))){r=sr(s,r),s=Sb(2),c=Va(i,s,2),c!==null&&(wb(s,c,i,r),Ui(c,2),Dr(c));break}}i=i.return}}function nm(r,i,s){var c=r.pingCache;if(c===null){c=r.pingCache=new FN;var p=new Set;c.set(i,p)}else p=c.get(i),p===void 0&&(p=new Set,c.set(i,p));p.has(s)||(Gh=!0,p.add(s),r=QN.bind(null,r,i,s),i.then(r,r))}function QN(r,i,s){var c=r.pingCache;c!==null&&c.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,St===r&&(We&s)===s&&(It===4||It===3&&(We&62914560)===We&&300>rn()-Rc?(dt&2)===0&&os(r,0):Kh|=s,ls===We&&(ls=0)),Dr(r)}function Sx(r,i){i===0&&(i=Bu()),r=Zi(r,i),r!==null&&(Ui(r,i),Dr(r))}function GN(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),Sx(r,s)}function KN(r,i){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),Sx(r,s)}function YN(r,i){return Gr(r,i)}var Uc=null,cs=null,rm=!1,Bc=!1,am=!1,ti=0;function Dr(r){r!==cs&&r.next===null&&(cs===null?Uc=cs=r:cs=cs.next=r),Bc=!0,rm||(rm=!0,JN())}function Lo(r,i){if(!am&&Bc){am=!0;do for(var s=!1,c=Uc;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var w=c.suspendedLanes,N=c.pingedLanes;v=(1<<31-ct(42|r)+1)-1,v&=p&~(w&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,Cx(c,v))}else v=We,v=Rl(c,c===St?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ii(c,v)||(s=!0,Cx(c,v));c=c.next}while(s);am=!1}}function XN(){wx()}function wx(){Bc=rm=!1;var r=0;ti!==0&&o_()&&(r=ti);for(var i=rn(),s=null,c=Uc;c!==null;){var p=c.next,v=kx(c,i);v===0?(c.next=null,s===null?Uc=p:s.next=p,p===null&&(cs=s)):(s=c,(r!==0||(v&3)!==0)&&(Bc=!0)),c=p}Yt!==0&&Yt!==5||Lo(r),ti!==0&&(ti=0)}function kx(r,i){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-ct(v),N=1<<w,D=p[w];D===-1?((N&s)===0||(N&c)!==0)&&(p[w]=xf(N,i)):D<=i&&(r.expiredLanes|=N),v&=~N}if(i=St,s=We,s=Rl(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===i&&(mt===2||mt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Da(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ii(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(c!==null&&Da(c),Pi(s)){case 2:case 8:s=ye;break;case 32:s=we;break;case 268435456:s=$e;break;default:s=we}return c=jx.bind(null,r),s=Gr(s,c),r.callbackPriority=i,r.callbackNode=s,i}return c!==null&&c!==null&&Da(c),r.callbackPriority=2,r.callbackNode=null,2}function jx(r,i){if(Yt!==0&&Yt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Ic()&&r.callbackNode!==s)return null;var c=We;return c=Rl(r,r===St?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(ix(r,c,i),kx(r,rn()),r.callbackNode!=null&&r.callbackNode===s?jx.bind(null,r):null)}function Cx(r,i){if(Ic())return null;ix(r,i,!0)}function JN(){c_(function(){(dt&6)!==0?Gr(ae,XN):wx()})}function im(){if(ti===0){var r=Kl;r===0&&(r=Al,Al<<=1,(Al&261888)===0&&(Al=256)),ti=r}return ti}function Ex(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Qu(""+r)}function Nx(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 WN(r,i,s,c,p){if(i==="submit"&&s&&s.stateNode===p){var v=Ex((p[on]||null).action),w=c.submitter;w&&(i=(i=w[on]||null)?Ex(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var N=new Xu("action","action",null,c,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ti!==0){var D=w?Nx(p,w):new FormData(p);Ch(s,{pending:!0,data:D,method:p.method,action:v},null,D)}}else typeof v=="function"&&(N.preventDefault(),D=w?Nx(p,w):new FormData(p),Ch(s,{pending:!0,data:D,method:p.method,action:v},v,D))},currentTarget:p}]})}}for(var lm=0;lm<Ff.length;lm++){var sm=Ff[lm],e_=sm.toLowerCase(),t_=sm[0].toUpperCase()+sm.slice(1);wr(e_,"on"+t_)}wr(av,"onAnimationEnd"),wr(iv,"onAnimationIteration"),wr(lv,"onAnimationStart"),wr("dblclick","onDoubleClick"),wr("focusin","onFocus"),wr("focusout","onBlur"),wr(yN,"onTransitionRun"),wr(vN,"onTransitionStart"),wr(bN,"onTransitionCancel"),wr(sv,"onTransitionEnd"),$i("onMouseEnter",["mouseout","mouseover"]),$i("onMouseLeave",["mouseout","mouseover"]),$i("onPointerEnter",["pointerout","pointerover"]),$i("onPointerLeave",["pointerout","pointerover"]),An("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),An("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),An("onBeforeInput",["compositionend","keypress","textInput","paste"]),An("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Io="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(" "),n_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Io));function _x(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var v=void 0;if(i)for(var w=c.length-1;0<=w;w--){var N=c[w],D=N.instance,G=N.currentTarget;if(N=N.listener,D!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){ec(ne)}p.currentTarget=null,v=D}else for(w=0;w<c.length;w++){if(N=c[w],D=N.instance,G=N.currentTarget,N=N.listener,D!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=G;try{v(p)}catch(ne){ec(ne)}p.currentTarget=null,v=D}}}}function Xe(r,i){var s=i[Ml];s===void 0&&(s=i[Ml]=new Set);var c=r+"__bubble";s.has(c)||(Ax(i,r,2,!1),s.add(c))}function om(r,i,s){var c=0;i&&(c|=4),Ax(s,r,c,i)}var Pc="_reactListening"+Math.random().toString(36).slice(2);function um(r){if(!r[Pc]){r[Pc]=!0,Fe.forEach(function(s){s!=="selectionchange"&&(n_.has(s)||om(s,!1,r),om(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Pc]||(i[Pc]=!0,om("selectionchange",!1,i))}}function Ax(r,i,s,c){switch(a0(i)){case 2:var p=T_;break;case 8:p=R_;break;default:p=jm}s=p.bind(null,i,s,r),p=void 0,!Af||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),c?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 cm(r,i,s,c,p){var v=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var N=c.stateNode.containerInfo;if(N===p)break;if(w===4)for(w=c.return;w!==null;){var D=w.tag;if((D===3||D===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;N!==null;){if(w=Yr(N),w===null)return;if(D=w.tag,D===5||D===6||D===26||D===27){c=v=w;continue e}N=N.parentNode}}c=c.return}My(function(){var G=v,ne=Nf(s),ue=[];e:{var Y=ov.get(r);if(Y!==void 0){var J=Xu,ke=r;switch(r){case"keypress":if(Ku(s)===0)break e;case"keydown":case"keyup":J=KE;break;case"focusin":ke="focus",J=Of;break;case"focusout":ke="blur",J=Of;break;case"beforeblur":case"afterblur":J=Of;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":J=Iy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=IE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=JE;break;case av:case iv:case lv:J=PE;break;case sv:J=eN;break;case"scroll":case"scrollend":J=DE;break;case"wheel":J=nN;break;case"copy":case"cut":case"paste":J=FE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=By;break;case"toggle":case"beforetoggle":J=aN}var Ie=(i&4)!==0,vt=!Ie&&(r==="scroll"||r==="scrollend"),H=Ie?Y!==null?Y+"Capture":null:Y;Ie=[];for(var $=G,Q;$!==null;){var se=$;if(Q=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Q===null||H===null||(se=ao($,H),se!=null&&Ie.push(Uo($,se,Q))),vt)break;$=$.return}0<Ie.length&&(Y=new J(Y,ke,null,s,ne),ue.push({event:Y,listeners:Ie}))}}if((i&7)===0){e:{if(Y=r==="mouseover"||r==="pointerover",J=r==="mouseout"||r==="pointerout",Y&&s!==Ef&&(ke=s.relatedTarget||s.fromElement)&&(Yr(ke)||ke[Kr]))break e;if((J||Y)&&(Y=ne.window===ne?ne:(Y=ne.ownerDocument)?Y.defaultView||Y.parentWindow:window,J?(ke=s.relatedTarget||s.toElement,J=G,ke=ke?Yr(ke):null,ke!==null&&(vt=o(ke),Ie=ke.tag,ke!==vt||Ie!==5&&Ie!==27&&Ie!==6)&&(ke=null)):(J=null,ke=G),J!==ke)){if(Ie=Iy,se="onMouseLeave",H="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(Ie=By,se="onPointerLeave",H="onPointerEnter",$="pointer"),vt=J==null?Y:Ua(J),Q=ke==null?Y:Ua(ke),Y=new Ie(se,$+"leave",J,s,ne),Y.target=vt,Y.relatedTarget=Q,se=null,Yr(ne)===G&&(Ie=new Ie(H,$+"enter",ke,s,ne),Ie.target=Q,Ie.relatedTarget=vt,se=Ie),vt=se,J&&ke)t:{for(Ie=r_,H=J,$=ke,Q=0,se=H;se;se=Ie(se))Q++;se=0;for(var Re=$;Re;Re=Ie(Re))se++;for(;0<Q-se;)H=Ie(H),Q--;for(;0<se-Q;)$=Ie($),se--;for(;Q--;){if(H===$||$!==null&&H===$.alternate){Ie=H;break t}H=Ie(H),$=Ie($)}Ie=null}else Ie=null;J!==null&&Tx(ue,Y,J,Ie,!1),ke!==null&&vt!==null&&Tx(ue,vt,ke,Ie,!0)}}e:{if(Y=G?Ua(G):window,J=Y.nodeName&&Y.nodeName.toLowerCase(),J==="select"||J==="input"&&Y.type==="file")var st=Qy;else if(Zy(Y))if(Gy)st=mN;else{st=fN;var Ee=dN}else J=Y.nodeName,!J||J.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&Cf(G.elementType)&&(st=Qy):st=hN;if(st&&(st=st(r,G))){Vy(ue,st,s,ne);break e}Ee&&Ee(r,Y,G),r==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&jf(Y,"number",Y.value)}switch(Ee=G?Ua(G):window,r){case"focusin":(Zy(Ee)||Ee.contentEditable==="true")&&($l=Ee,Bf=G,ho=null);break;case"focusout":ho=Bf=$l=null;break;case"mousedown":Pf=!0;break;case"contextmenu":case"mouseup":case"dragend":Pf=!1,nv(ue,s,ne);break;case"selectionchange":if(gN)break;case"keydown":case"keyup":nv(ue,s,ne)}var He;if(Df)e:{switch(r){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else Pl?qy(r,s)&&(et="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(et="onCompositionStart");et&&(Py&&s.locale!=="ko"&&(Pl||et!=="onCompositionStart"?et==="onCompositionEnd"&&Pl&&(He=Dy()):(Ba=ne,Tf="value"in Ba?Ba.value:Ba.textContent,Pl=!0)),Ee=$c(G,et),0<Ee.length&&(et=new Uy(et,r,null,s,ne),ue.push({event:et,listeners:Ee}),He?et.data=He:(He=Hy(s),He!==null&&(et.data=He)))),(He=lN?sN(r,s):oN(r,s))&&(et=$c(G,"onBeforeInput"),0<et.length&&(Ee=new Uy("onBeforeInput","beforeinput",null,s,ne),ue.push({event:Ee,listeners:et}),Ee.data=He)),WN(ue,r,G,s,ne)}_x(ue,i)})}function Uo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function $c(r,i){for(var s=i+"Capture",c=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=ao(r,s),p!=null&&c.unshift(Uo(r,p,v)),p=ao(r,i),p!=null&&c.push(Uo(r,p,v))),r.tag===3)return c;r=r.return}return[]}function r_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Tx(r,i,s,c,p){for(var v=i._reactName,w=[];s!==null&&s!==c;){var N=s,D=N.alternate,G=N.stateNode;if(N=N.tag,D!==null&&D===c)break;N!==5&&N!==26&&N!==27||G===null||(D=G,p?(G=ao(s,v),G!=null&&w.unshift(Uo(s,G,D))):p||(G=ao(s,v),G!=null&&w.push(Uo(s,G,D)))),s=s.return}w.length!==0&&r.push({event:i,listeners:w})}var a_=/\r\n?/g,i_=/\u0000|\uFFFD/g;function Rx(r){return(typeof r=="string"?r:""+r).replace(a_,`
49
- `).replace(i_,"")}function zx(r,i){return i=Rx(i),Rx(r)===i}function yt(r,i,s,c,p,v){switch(s){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Il(r,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Il(r,""+c);break;case"className":Zu(r,"class",c);break;case"tabIndex":Zu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Zu(r,s,c);break;case"style":zy(r,c,v);break;case"data":if(i!=="object"){Zu(r,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Qu(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="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"&&yt(r,i,"name",p.name,p,null),yt(r,i,"formEncType",p.formEncType,p,null),yt(r,i,"formMethod",p.formMethod,p,null),yt(r,i,"formTarget",p.formTarget,p,null)):(yt(r,i,"encType",p.encType,p,null),yt(r,i,"method",p.method,p,null),yt(r,i,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Qu(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=ea);break;case"onScroll":c!=null&&Xe("scroll",r);break;case"onScrollEnd":c!=null&&Xe("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Qu(""+c),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":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Xe("beforetoggle",r),Xe("toggle",r),Hu(r,"popover",c);break;case"xlinkActuate":Wr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Wr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Wr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Wr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Wr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Wr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Wr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Hu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=OE.get(s)||s,Hu(r,s,c))}}function dm(r,i,s,c,p,v){switch(s){case"style":zy(r,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Il(r,c):(typeof c=="number"||typeof c=="bigint")&&Il(r,""+c);break;case"onScroll":c!=null&&Xe("scroll",r);break;case"onScrollEnd":c!=null&&Xe("scrollend",r);break;case"onClick":c!=null&&(r.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qn.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[on]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof c=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Hu(r,s,c)}}}function fn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",r),Xe("load",r);var c=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:yt(r,i,v,w,s,null)}}p&&yt(r,i,"srcSet",s.srcSet,s,null),c&&yt(r,i,"src",s.src,s,null);return;case"input":Xe("invalid",r);var N=v=w=p=null,D=null,G=null;for(c in s)if(s.hasOwnProperty(c)){var ne=s[c];if(ne!=null)switch(c){case"name":p=ne;break;case"type":w=ne;break;case"checked":D=ne;break;case"defaultChecked":G=ne;break;case"value":v=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:yt(r,i,c,ne,s,null)}}_y(r,v,N,D,G,w,p,!1);return;case"select":Xe("invalid",r),c=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":w=N;break;case"multiple":c=N;default:yt(r,i,p,N,s,null)}i=v,s=w,r.multiple=!!c,i!=null?Ll(r,!!c,i,!1):s!=null&&Ll(r,!!c,s,!0);return;case"textarea":Xe("invalid",r),v=p=c=null;for(w in s)if(s.hasOwnProperty(w)&&(N=s[w],N!=null))switch(w){case"value":c=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:yt(r,i,w,N,s,null)}Ty(r,c,p,v);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(c=s[D],c!=null))switch(D){case"selected":r.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:yt(r,i,D,c,s,null)}return;case"dialog":Xe("beforetoggle",r),Xe("toggle",r),Xe("cancel",r),Xe("close",r);break;case"iframe":case"object":Xe("load",r);break;case"video":case"audio":for(c=0;c<Io.length;c++)Xe(Io[c],r);break;case"image":Xe("error",r),Xe("load",r);break;case"details":Xe("toggle",r);break;case"embed":case"source":case"link":Xe("error",r),Xe("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)&&(c=s[G],c!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:yt(r,i,G,c,s,null)}return;default:if(Cf(i)){for(ne in s)s.hasOwnProperty(ne)&&(c=s[ne],c!==void 0&&dm(r,i,ne,c,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(c=s[N],c!=null&&yt(r,i,N,c,s,null))}function l_(r,i,s,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,N=null,D=null,G=null,ne=null;for(J in s){var ue=s[J];if(s.hasOwnProperty(J)&&ue!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":D=ue;default:c.hasOwnProperty(J)||yt(r,i,J,null,c,ue)}}for(var Y in c){var J=c[Y];if(ue=s[Y],c.hasOwnProperty(Y)&&(J!=null||ue!=null))switch(Y){case"type":v=J;break;case"name":p=J;break;case"checked":G=J;break;case"defaultChecked":ne=J;break;case"value":w=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==ue&&yt(r,i,Y,J,c,ue)}}kf(r,w,N,D,G,ne,v,p);return;case"select":J=w=N=Y=null;for(v in s)if(D=s[v],s.hasOwnProperty(v)&&D!=null)switch(v){case"value":break;case"multiple":J=D;default:c.hasOwnProperty(v)||yt(r,i,v,null,c,D)}for(p in c)if(v=c[p],D=s[p],c.hasOwnProperty(p)&&(v!=null||D!=null))switch(p){case"value":Y=v;break;case"defaultValue":N=v;break;case"multiple":w=v;default:v!==D&&yt(r,i,p,v,c,D)}i=N,s=w,c=J,Y!=null?Ll(r,!!s,Y,!1):!!c!=!!s&&(i!=null?Ll(r,!!s,i,!0):Ll(r,!!s,s?[]:"",!1));return;case"textarea":J=Y=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!c.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:yt(r,i,N,null,c,p)}for(w in c)if(p=c[w],v=s[w],c.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":Y=p;break;case"defaultValue":J=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&yt(r,i,w,p,c,v)}Ay(r,Y,J);return;case"option":for(var ke in s)if(Y=s[ke],s.hasOwnProperty(ke)&&Y!=null&&!c.hasOwnProperty(ke))switch(ke){case"selected":r.selected=!1;break;default:yt(r,i,ke,null,c,Y)}for(D in c)if(Y=c[D],J=s[D],c.hasOwnProperty(D)&&Y!==J&&(Y!=null||J!=null))switch(D){case"selected":r.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:yt(r,i,D,Y,c,J)}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 Ie in s)Y=s[Ie],s.hasOwnProperty(Ie)&&Y!=null&&!c.hasOwnProperty(Ie)&&yt(r,i,Ie,null,c,Y);for(G in c)if(Y=c[G],J=s[G],c.hasOwnProperty(G)&&Y!==J&&(Y!=null||J!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:yt(r,i,G,Y,c,J)}return;default:if(Cf(i)){for(var vt in s)Y=s[vt],s.hasOwnProperty(vt)&&Y!==void 0&&!c.hasOwnProperty(vt)&&dm(r,i,vt,void 0,c,Y);for(ne in c)Y=c[ne],J=s[ne],!c.hasOwnProperty(ne)||Y===J||Y===void 0&&J===void 0||dm(r,i,ne,Y,c,J);return}}for(var H in s)Y=s[H],s.hasOwnProperty(H)&&Y!=null&&!c.hasOwnProperty(H)&&yt(r,i,H,null,c,Y);for(ue in c)Y=c[ue],J=s[ue],!c.hasOwnProperty(ue)||Y===J||Y==null&&J==null||yt(r,i,ue,Y,c,J)}function Ox(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],v=p.transferSize,w=p.initiatorType,N=p.duration;if(v&&N&&Ox(w)){for(w=0,N=p.responseEnd,c+=1;c<s.length;c++){var D=s[c],G=D.startTime;if(G>N)break;var ne=D.transferSize,ue=D.initiatorType;ne&&Ox(ue)&&(D=D.responseEnd,w+=ne*(D<N?1:(N-G)/(D-G)))}if(--c,i+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var fm=null,hm=null;function Fc(r){return r.nodeType===9?r:r.ownerDocument}function Mx(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 Dx(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 mm(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 pm=null;function o_(){var r=window.event;return r&&r.type==="popstate"?r===pm?!1:(pm=r,!0):(pm=null,!1)}var Lx=typeof setTimeout=="function"?setTimeout:void 0,u_=typeof clearTimeout=="function"?clearTimeout:void 0,Ix=typeof Promise=="function"?Promise:void 0,c_=typeof queueMicrotask=="function"?queueMicrotask:typeof Ix<"u"?function(r){return Ix.resolve(null).then(r).catch(d_)}:Lx;function d_(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function Ux(r,i){var s=i,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),ms(i);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")Bo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Bo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,N=v.nodeName;v[Ia]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&Bo(r.ownerDocument.body);s=p}while(s);ms(i)}function Bx(r,i){var s=r;r=0;do{var c=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||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function gm(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":gm(s),Dl(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function f_(r,i,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Ia])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=fr(r.nextSibling),r===null)break}return null}function h_(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=fr(r.nextSibling),r===null))return null;return r}function Px(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=fr(r.nextSibling),r===null))return null;return r}function ym(r){return r.data==="$?"||r.data==="$~"}function vm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function m_(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var c=function(){i(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function fr(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 bm=null;function $x(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return fr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Fx(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 qx(r,i,s){switch(i=Fc(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 Bo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Dl(r)}var hr=new Map,Hx=new Set;function qc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ga=oe.d;oe.d={f:p_,r:g_,D:y_,C:v_,L:b_,m:x_,X:w_,S:S_,M:k_};function p_(){var r=ga.f(),i=Mc();return r||i}function g_(r){var i=Xr(r);i!==null&&i.tag===5&&i.type==="form"?sb(i):ga.r(r)}var ds=typeof document>"u"?null:document;function Zx(r,i,s){var c=ds;if(c&&typeof i=="string"&&i){var p=ir(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Hx.has(p)||(Hx.add(p),r={rel:r,crossOrigin:s,href:i},c.querySelector(p)===null&&(i=c.createElement("link"),fn(i,"link",r),X(i),c.head.appendChild(i)))}}function y_(r){ga.D(r),Zx("dns-prefetch",r,null)}function v_(r,i){ga.C(r,i),Zx("preconnect",r,i)}function b_(r,i,s){ga.L(r,i,s);var c=ds;if(c&&r&&i){var p='link[rel="preload"][as="'+ir(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+ir(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+ir(s.imageSizes)+'"]')):p+='[href="'+ir(r)+'"]';var v=p;switch(i){case"style":v=fs(r);break;case"script":v=hs(r)}hr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),hr.set(v,r),c.querySelector(p)!==null||i==="style"&&c.querySelector(Po(v))||i==="script"&&c.querySelector($o(v))||(i=c.createElement("link"),fn(i,"link",r),X(i),c.head.appendChild(i)))}}function x_(r,i){ga.m(r,i);var s=ds;if(s&&r){var c=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+ir(c)+'"][href="'+ir(r)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=hs(r)}if(!hr.has(v)&&(r=g({rel:"modulepreload",href:r},i),hr.set(v,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector($o(v)))return}c=s.createElement("link"),fn(c,"link",r),X(c),s.head.appendChild(c)}}}function S_(r,i,s){ga.S(r,i,s);var c=ds;if(c&&r){var p=Jr(c).hoistableStyles,v=fs(r);i=i||"default";var w=p.get(v);if(!w){var N={loading:0,preload:null};if(w=c.querySelector(Po(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=hr.get(v))&&xm(r,s);var D=w=c.createElement("link");X(D),fn(D,"link",r),D._p=new Promise(function(G,ne){D.onload=G,D.onerror=ne}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Hc(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:N},p.set(v,w)}}}function w_(r,i){ga.X(r,i);var s=ds;if(s&&r){var c=Jr(s).hoistableScripts,p=hs(r),v=c.get(p);v||(v=s.querySelector($o(p)),v||(r=g({src:r,async:!0},i),(i=hr.get(p))&&Sm(r,i),v=s.createElement("script"),X(v),fn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function k_(r,i){ga.M(r,i);var s=ds;if(s&&r){var c=Jr(s).hoistableScripts,p=hs(r),v=c.get(p);v||(v=s.querySelector($o(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=hr.get(p))&&Sm(r,i),v=s.createElement("script"),X(v),fn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function Vx(r,i,s,c){var p=(p=le.current)?qc(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=fs(s.href),s=Jr(p).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=fs(s.href);var v=Jr(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Po(r)))&&!v._p&&(w.instance=v,w.state.loading=5),hr.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},hr.set(r,s),v||j_(p,r,s,w.state))),i&&c===null)throw Error(a(528,""));return w}if(i&&c!==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=hs(s),s=Jr(p).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function fs(r){return'href="'+ir(r)+'"'}function Po(r){return'link[rel="stylesheet"]['+r+"]"}function Qx(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function j_(r,i,s,c){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=r.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),fn(i,"link",s),X(i),r.head.appendChild(i))}function hs(r){return'[src="'+ir(r)+'"]'}function $o(r){return"script[async]"+r}function Gx(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=r.querySelector('style[data-href~="'+ir(s.href)+'"]');if(c)return i.instance=c,X(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),X(c),fn(c,"style",p),Hc(c,s.precedence,r),i.instance=c;case"stylesheet":p=fs(s.href);var v=r.querySelector(Po(p));if(v)return i.state.loading|=4,i.instance=v,X(v),v;c=Qx(s),(p=hr.get(p))&&xm(c,p),v=(r.ownerDocument||r).createElement("link"),X(v);var w=v;return w._p=new Promise(function(N,D){w.onload=N,w.onerror=D}),fn(v,"link",c),i.state.loading|=4,Hc(v,s.precedence,r),i.instance=v;case"script":return v=hs(s.src),(p=r.querySelector($o(v)))?(i.instance=p,X(p),p):(c=s,(p=hr.get(v))&&(c=g({},s),Sm(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),X(p),fn(p,"link",c),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Hc(c,s.precedence,r));return i.instance}function Hc(r,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,w=0;w<c.length;w++){var N=c[w];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function xm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Sm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Zc=null;function Kx(r,i,s){if(Zc===null){var c=new Map,p=Zc=new Map;p.set(s,c)}else p=Zc,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[Ia]||v[Ft]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=r+w;var N=c.get(w);N?N.push(v):c.set(w,[v])}}return c}function Yx(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function C_(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 Xx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function E_(r,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=fs(c.href),v=i.querySelector(Po(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Vc.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,X(v);return}v=i.ownerDocument||i,c=Qx(c),(p=hr.get(p))&&xm(c,p),v=v.createElement("link"),X(v);var w=v;w._p=new Promise(function(N,D){w.onload=N,w.onerror=D}),fn(v,"link",c),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=Vc.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var wm=0;function N_(r,i){return r.stylesheets&&r.count===0&&Gc(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Gc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&wm===0&&(wm=62500*s_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Gc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>wm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Vc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Qc=null;function Gc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Qc=new Map,i.forEach(__,r),Qc=null,Vc.call(r))}function __(r,i){if(!(i.state.loading&4)){var s=Qc.get(r);if(s)var c=s.get(null);else{s=new Map,Qc.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}p=i.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||c,v===c&&s.set(null,p),s.set(w,p),this.count++,c=Vc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Fo={$$typeof:O,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function A_(r,i,s,c,p,v,w,N,D){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=no(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=no(0),this.hiddenUpdates=no(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Jx(r,i,s,c,p,v,w,N,D,G,ne,ue){return r=new A_(r,i,s,w,D,G,ne,ue,N),i=1,v===!0&&(i|=24),v=Zn(3,null,null,i),r.current=v,v.stateNode=r,i=th(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:i},ih(v),r}function Wx(r){return r?(r=Hl,r):Hl}function e0(r,i,s,c,p,v){p=Wx(p),c.context===null?c.context=p:c.pendingContext=p,c=Za(i),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Va(r,c,i),s!==null&&(Dn(s,r,i),xo(s,r,i))}function t0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function km(r,i){t0(r,i),(r=r.alternate)&&t0(r,i)}function n0(r){if(r.tag===13||r.tag===31){var i=Zi(r,67108864);i!==null&&Dn(i,r,67108864),km(r,67108864)}}function r0(r){if(r.tag===13||r.tag===31){var i=Yn();i=Ol(i);var s=Zi(r,i);s!==null&&Dn(s,r,i),km(r,i)}}var Kc=!0;function T_(r,i,s,c){var p=q.T;q.T=null;var v=oe.p;try{oe.p=2,jm(r,i,s,c)}finally{oe.p=v,q.T=p}}function R_(r,i,s,c){var p=q.T;q.T=null;var v=oe.p;try{oe.p=8,jm(r,i,s,c)}finally{oe.p=v,q.T=p}}function jm(r,i,s,c){if(Kc){var p=Cm(c);if(p===null)cm(r,i,c,Yc,s),i0(r,c);else if(O_(p,r,i,s,c))c.stopPropagation();else if(i0(r,c),i&4&&-1<z_.indexOf(r)){for(;p!==null;){var v=Xr(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Rr(v.pendingLanes);if(w!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var D=1<<31-ct(w);N.entanglements[1]|=D,w&=~D}Dr(v),(dt&6)===0&&(zc=rn()+500,Lo(0))}}break;case 31:case 13:N=Zi(v,2),N!==null&&Dn(N,v,2),Mc(),km(v,2)}if(v=Cm(c),v===null&&cm(r,i,c,Yc,s),v===p)break;p=v}p!==null&&c.stopPropagation()}else cm(r,i,c,null,s)}}function Cm(r){return r=Nf(r),Em(r)}var Yc=null;function Em(r){if(Yc=null,r=Yr(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=u(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 Yc=r,null}function a0(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(Nl()){case ae:return 2;case ye:return 8;case we:case Le:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Nm=!1,ri=null,ai=null,ii=null,qo=new Map,Ho=new Map,li=[],z_="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 i0(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":qo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(i.pointerId)}}function Zo(r,i,s,c,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Xr(i),i!==null&&n0(i)),r):(r.eventSystemFlags|=c,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function O_(r,i,s,c,p){switch(i){case"focusin":return ri=Zo(ri,r,i,s,c,p),!0;case"dragenter":return ai=Zo(ai,r,i,s,c,p),!0;case"mouseover":return ii=Zo(ii,r,i,s,c,p),!0;case"pointerover":var v=p.pointerId;return qo.set(v,Zo(qo.get(v)||null,r,i,s,c,p)),!0;case"gotpointercapture":return v=p.pointerId,Ho.set(v,Zo(Ho.get(v)||null,r,i,s,c,p)),!0}return!1}function l0(r){var i=Yr(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){r.blockedOn=i,$u(r.priority,function(){r0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,$u(r.priority,function(){r0(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 Xc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Cm(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);Ef=c,s.target.dispatchEvent(c),Ef=null}else return i=Xr(s),i!==null&&n0(i),r.blockedOn=s,!1;i.shift()}return!0}function s0(r,i,s){Xc(r)&&s.delete(i)}function M_(){Nm=!1,ri!==null&&Xc(ri)&&(ri=null),ai!==null&&Xc(ai)&&(ai=null),ii!==null&&Xc(ii)&&(ii=null),qo.forEach(s0),Ho.forEach(s0)}function Jc(r,i){r.blockedOn===i&&(r.blockedOn=null,Nm||(Nm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,M_)))}var Wc=null;function o0(r){Wc!==r&&(Wc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wc===r&&(Wc=null);for(var i=0;i<r.length;i+=3){var s=r[i],c=r[i+1],p=r[i+2];if(typeof c!="function"){if(Em(c||s)===null)continue;break}var v=Xr(s);v!==null&&(r.splice(i,3),i-=3,Ch(v,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function ms(r){function i(D){return Jc(D,r)}ri!==null&&Jc(ri,r),ai!==null&&Jc(ai,r),ii!==null&&Jc(ii,r),qo.forEach(i),Ho.forEach(i);for(var s=0;s<li.length;s++){var c=li[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)l0(s),s.blockedOn===null&&li.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],v=s[c+1],w=p[on]||null;if(typeof v=="function")w||o0(s);else if(w){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[on]||null)N=w.formAction;else if(Em(p)!==null)continue}else N=w.action;typeof N=="function"?s[c+1]=N:(s.splice(c,3),c-=3),o0(s)}}}function u0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!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 c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function _m(r){this._internalRoot=r}ed.prototype.render=_m.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,c=Yn();e0(s,c,r,i,null,null)},ed.prototype.unmount=_m.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;e0(r.current,2,null,r,null,null),Mc(),i[Kr]=null}};function ed(r){this._internalRoot=r}ed.prototype.unstable_scheduleHydration=function(r){if(r){var i=Pu();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&&l0(r)}};var c0=t.version;if(c0!=="19.2.4")throw Error(a(527,c0,"19.2.4"));oe.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 D_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!td.isDisabled&&td.supportsFiber)try{ln=td.inject(D_),Rt=td}catch{}}return Qo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,c="",p=yb,v=vb,w=bb;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Jx(r,1,!1,null,null,s,c,null,p,v,w,u0),r[Kr]=i.current,um(r),new _m(i)},Qo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var c=!1,p="",v=yb,w=vb,N=bb,D=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),i=Jx(r,1,!0,i,s??null,c,p,D,v,w,N,u0),i.context=Wx(null),s=i.current,c=Yn(),c=Ol(c),p=Za(c),p.callback=null,Va(s,p,c),s=c,i.current.lanes=s,Ui(i,s),Dr(i),r[Kr]=i.current,um(r),new ed(i)},Qo.version="19.2.4",Qo}var S0;function V_(){if(S0)return zm.exports;S0=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(),zm.exports=Z_(),zm.exports}var Q_=V_(),Gs=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(){}},sl,mi,Rs,PS,G_=(PS=class extends Gs{constructor(){super();Te(this,sl);Te(this,mi);Te(this,Rs);ve(this,Rs,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){I(this,mi)||this.setEventListener(I(this,Rs))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,mi))==null||t.call(this),ve(this,mi,void 0))}setEventListener(t){var n;ve(this,Rs,t),(n=I(this,mi))==null||n.call(this),ve(this,mi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){I(this,sl)!==t&&(ve(this,sl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof I(this,sl)=="boolean"?I(this,sl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sl=new WeakMap,mi=new WeakMap,Rs=new WeakMap,PS),bg=new G_,K_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pi,gg,$S,Y_=($S=class{constructor(){Te(this,pi,K_);Te(this,gg,!1)}setTimeoutProvider(e){ve(this,pi,e)}setTimeout(e,t){return I(this,pi).setTimeout(e,t)}clearTimeout(e){I(this,pi).clearTimeout(e)}setInterval(e,t){return I(this,pi).setInterval(e,t)}clearInterval(e){I(this,pi).clearInterval(e)}},pi=new WeakMap,gg=new WeakMap,$S),ll=new Y_;function X_(e){setTimeout(e,0)}var J_=typeof window>"u"||"Deno"in globalThis;function Cn(){}function W_(e,t){return typeof e=="function"?e(t):e}function Cp(e){return typeof e=="number"&&e>=0&&e!==1/0}function JS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function pr(e,t){return typeof e=="function"?e(t):e}function w0(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==xg(u,t.options))return!1}else if(!fu(t.queryKey,u))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 k0(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(gl(t.options.mutationKey)!==gl(o))return!1}else if(!fu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function xg(e,t){return((t==null?void 0:t.queryKeyHashFn)||gl)(e)}function gl(e){return JSON.stringify(e,(t,n)=>Ep(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function fu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fu(e[n],t[n])):!1}var e2=Object.prototype.hasOwnProperty;function WS(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=j0(e)&&j0(t);if(!a&&!(Ep(e)&&Ep(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:u[y],b=e[g],S=t[g];if(b===S){m[g]=b,(a?y<o:e2.call(e,g))&&h++;continue}if(b===null||S===null||typeof b!="object"||typeof S!="object"){m[g]=S;continue}const k=WS(b,S,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function Rd(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 j0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ep(e){if(!C0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!C0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function C0(e){return Object.prototype.toString.call(e)==="[object Object]"}function t2(e){return new Promise(t=>{ll.setTimeout(t,e)})}function Np(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WS(e,t):t}function n2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function r2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Sg=Symbol();function ew(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wg(e,t){return typeof e=="function"?e(...t):!!e}function a2(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 hu=(()=>{let e=()=>J_;return{isServer(){return e()},setIsServer(t){e=t}}})();function _p(){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 i2=X_;function l2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=i2;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{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||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Jt=l2(),zs,gi,Os,FS,s2=(FS=class extends Gs{constructor(){super();Te(this,zs,!0);Te(this,gi);Te(this,Os);ve(this,Os,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(){I(this,gi)||this.setEventListener(I(this,Os))}onUnsubscribe(){var t;this.hasListeners()||((t=I(this,gi))==null||t.call(this),ve(this,gi,void 0))}setEventListener(t){var n;ve(this,Os,t),(n=I(this,gi))==null||n.call(this),ve(this,gi,t(this.setOnline.bind(this)))}setOnline(t){I(this,zs)!==t&&(ve(this,zs,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return I(this,zs)}},zs=new WeakMap,gi=new WeakMap,Os=new WeakMap,FS),zd=new s2;function o2(e){return Math.min(1e3*2**e,3e4)}function tw(e){return(e??"online")==="online"?zd.isOnline():!0}var Ap=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function nw(e){let t=!1,n=0,a;const l=_p(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const C=new Ap(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>bg.isFocused()&&(e.networkMode==="always"||zd.isOnline())&&e.canRun(),y=()=>tw(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},S=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(g).catch(C=>{var R;if(o())return;const T=e.retry??(hu.isServer()?0:3),O=e.retryDelay??o2,P=typeof O=="function"?O(n,C):O,L=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,C);if(t||!L){b(C);return}n++,(R=e.onFail)==null||R.call(e,n,C),t2(P).then(()=>h()?void 0:S()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():S().then(k),l)}}var ol,qS,rw=(qS=class{constructor(){Te(this,ol)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cp(this.gcTime)&&ve(this,ol,ll.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hu.isServer()?1/0:300*1e3))}clearGcTimeout(){I(this,ol)&&(ll.clearTimeout(I(this,ol)),ve(this,ol,void 0))}},ol=new WeakMap,qS),ul,Ms,mr,cl,nn,ju,dl,Jn,aw,va,HS,u2=(HS=class extends rw{constructor(t){super();Te(this,Jn);Te(this,ul);Te(this,Ms);Te(this,mr);Te(this,cl);Te(this,nn);Te(this,ju);Te(this,dl);ve(this,dl,!1),ve(this,ju,t.defaultOptions),this.setOptions(t.options),this.observers=[],ve(this,cl,t.client),ve(this,mr,I(this,cl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ve(this,ul,N0(this.options)),this.state=t.state??I(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=I(this,nn))==null?void 0:t.promise}setOptions(t){if(this.options={...I(this,ju),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=N0(this.options);n.data!==void 0&&(this.setState(E0(n.data,n.dataUpdatedAt)),ve(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,mr).remove(this)}setData(t,n){const a=Np(this.state.data,t,this.options);return Ze(this,Jn,va).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Ze(this,Jn,va).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=I(this,nn))==null?void 0:a.promise;return(l=I(this,nn))==null||l.cancel(t),n?n.then(Cn).catch(Cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return I(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>pr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ji(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:!JS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,nn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=I(this,nn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),I(this,mr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(I(this,nn)&&(I(this,dl)||Ze(this,Jn,aw).call(this)?I(this,nn).cancel({revert:!0}):I(this,nn).cancelRetry()),this.scheduleGc()),I(this,mr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ze(this,Jn,va).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,S,k,j,E,C,T,O;if(this.state.fetchStatus!=="idle"&&((m=I(this,nn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(I(this,nn))return I(this,nn).continueRetry(),I(this,nn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const P=this.observers.find(L=>L.options.queryFn);P&&this.setOptions(P.options)}const a=new AbortController,l=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(ve(this,dl,!0),a.signal)})},o=()=>{const P=ew(this.options,n),R=(()=>{const M={client:I(this,cl),queryKey:this.queryKey,meta:this.meta};return l(M),M})();return ve(this,dl,!1),this.options.persister?this.options.persister(P,R,this):P(R)},f=(()=>{const P={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:I(this,cl),state:this.state,fetchFn:o};return l(P),P})();(h=this.options.behavior)==null||h.onFetch(f,this),ve(this,Ms,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Ze(this,Jn,va).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ve(this,nn,nw({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:P=>{P instanceof Ap&&P.revert&&this.setState({...I(this,Ms),fetchStatus:"idle"}),a.abort()},onFail:(P,L)=>{Ze(this,Jn,va).call(this,{type:"failed",failureCount:P,error:L})},onPause:()=>{Ze(this,Jn,va).call(this,{type:"pause"})},onContinue:()=>{Ze(this,Jn,va).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const P=await I(this,nn).start();if(P===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(P),(S=(b=I(this,mr).config).onSuccess)==null||S.call(b,P,this),(j=(k=I(this,mr).config).onSettled)==null||j.call(k,P,this.state.error,this),P}catch(P){if(P instanceof Ap){if(P.silent)return I(this,nn).promise;if(P.revert){if(this.state.data===void 0)throw P;return this.state.data}}throw Ze(this,Jn,va).call(this,{type:"error",error:P}),(C=(E=I(this,mr).config).onError)==null||C.call(E,P,this),(O=(T=I(this,mr).config).onSettled)==null||O.call(T,this.state.data,P,this),P}finally{this.scheduleGc()}}},ul=new WeakMap,Ms=new WeakMap,mr=new WeakMap,cl=new WeakMap,nn=new WeakMap,ju=new WeakMap,dl=new WeakMap,Jn=new WeakSet,aw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},va=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,...iw(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...E0(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ve(this,Ms,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),Jt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),I(this,mr).notify({query:this,type:"updated",action:t})})},HS);function iw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function E0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function N0(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 In,rt,Cu,jn,fl,Ds,ba,yi,Eu,Ls,Is,hl,ml,vi,Us,ht,ru,Tp,Rp,zp,Op,Mp,Dp,Lp,lw,ZS,c2=(ZS=class extends Gs{constructor(t,n){super();Te(this,ht);Te(this,In);Te(this,rt);Te(this,Cu);Te(this,jn);Te(this,fl);Te(this,Ds);Te(this,ba);Te(this,yi);Te(this,Eu);Te(this,Ls);Te(this,Is);Te(this,hl);Te(this,ml);Te(this,vi);Te(this,Us,new Set);this.options=n,ve(this,In,t),ve(this,yi,null),ve(this,ba,_p()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,rt).addObserver(this),_0(I(this,rt),this.options)?Ze(this,ht,ru).call(this):this.updateResult(),Ze(this,ht,Op).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ip(I(this,rt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ip(I(this,rt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ze(this,ht,Mp).call(this),Ze(this,ht,Dp).call(this),I(this,rt).removeObserver(this)}setOptions(t){const n=this.options,a=I(this,rt);if(this.options=I(this,In).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pr(this.options.enabled,I(this,rt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ze(this,ht,Lp).call(this),I(this,rt).setOptions(this.options),n._defaulted&&!Rd(this.options,n)&&I(this,In).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,rt),observer:this});const l=this.hasListeners();l&&A0(I(this,rt),a,this.options,n)&&Ze(this,ht,ru).call(this),this.updateResult(),l&&(I(this,rt)!==a||pr(this.options.enabled,I(this,rt))!==pr(n.enabled,I(this,rt))||ji(this.options.staleTime,I(this,rt))!==ji(n.staleTime,I(this,rt)))&&Ze(this,ht,Tp).call(this);const o=Ze(this,ht,Rp).call(this);l&&(I(this,rt)!==a||pr(this.options.enabled,I(this,rt))!==pr(n.enabled,I(this,rt))||o!==I(this,vi))&&Ze(this,ht,zp).call(this,o)}getOptimisticResult(t){const n=I(this,In).getQueryCache().build(I(this,In),t),a=this.createResult(n,t);return f2(this,a)&&(ve(this,jn,a),ve(this,Ds,this.options),ve(this,fl,I(this,rt).state)),a}getCurrentResult(){return I(this,jn)}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&&I(this,ba).status==="pending"&&I(this,ba).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){I(this,Us).add(t)}getCurrentQuery(){return I(this,rt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=I(this,In).defaultQueryOptions(t),a=I(this,In).getQueryCache().build(I(this,In),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Ze(this,ht,ru).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,jn)))}createResult(t,n){var re;const a=I(this,rt),l=this.options,o=I(this,jn),u=I(this,fl),f=I(this,Ds),h=t!==a?t.state:I(this,Cu),{state:y}=t;let g={...y},b=!1,S;if(n._optimisticResults){const F=this.hasListeners(),de=!F&&_0(t,n),W=F&&A0(t,a,n,l);(de||W)&&(g={...g,...iw(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;S=g.data;let C=!1;if(n.placeholderData!==void 0&&S===void 0&&E==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,C=!0):F=typeof n.placeholderData=="function"?n.placeholderData((re=I(this,Is))==null?void 0:re.state.data,I(this,Is)):n.placeholderData,F!==void 0&&(E="success",S=Np(o==null?void 0:o.data,F,n),b=!0)}if(n.select&&S!==void 0&&!C)if(o&&S===(u==null?void 0:u.data)&&n.select===I(this,Eu))S=I(this,Ls);else try{ve(this,Eu,n.select),S=n.select(S),S=Np(o==null?void 0:o.data,S,n),ve(this,Ls,S),ve(this,yi,null)}catch(F){ve(this,yi,F)}I(this,yi)&&(k=I(this,yi),S=I(this,Ls),j=Date.now(),E="error");const T=g.fetchStatus==="fetching",O=E==="pending",P=E==="error",L=O&&T,R=S!==void 0,Z={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:P,isInitialLoading:L,isLoading:L,data:S,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:T,isRefetching:T&&!O,isLoadingError:P&&!R,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:P&&R,isStale:kg(t,n),refetch:this.refetch,promise:I(this,ba),isEnabled:pr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=Z.data!==void 0,de=Z.status==="error"&&!F,W=ee=>{de?ee.reject(Z.error):F&&ee.resolve(Z.data)},ge=()=>{const ee=ve(this,ba,Z.promise=_p());W(ee)},fe=I(this,ba);switch(fe.status){case"pending":t.queryHash===a.queryHash&&W(fe);break;case"fulfilled":(de||Z.data!==fe.value)&&ge();break;case"rejected":(!de||Z.error!==fe.reason)&&ge();break}}return Z}updateResult(){const t=I(this,jn),n=this.createResult(I(this,rt),this.options);if(ve(this,fl,I(this,rt).state),ve(this,Ds,this.options),I(this,fl).data!==void 0&&ve(this,Is,I(this,rt)),Rd(n,t))return;ve(this,jn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!I(this,Us).size)return!0;const u=new Set(o??I(this,Us));return this.options.throwOnError&&u.add("error"),Object.keys(I(this,jn)).some(f=>{const m=f;return I(this,jn)[m]!==t[m]&&u.has(m)})};Ze(this,ht,lw).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ze(this,ht,Op).call(this)}},In=new WeakMap,rt=new WeakMap,Cu=new WeakMap,jn=new WeakMap,fl=new WeakMap,Ds=new WeakMap,ba=new WeakMap,yi=new WeakMap,Eu=new WeakMap,Ls=new WeakMap,Is=new WeakMap,hl=new WeakMap,ml=new WeakMap,vi=new WeakMap,Us=new WeakMap,ht=new WeakSet,ru=function(t){Ze(this,ht,Lp).call(this);let n=I(this,rt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Cn)),n},Tp=function(){Ze(this,ht,Mp).call(this);const t=ji(this.options.staleTime,I(this,rt));if(hu.isServer()||I(this,jn).isStale||!Cp(t))return;const a=JS(I(this,jn).dataUpdatedAt,t)+1;ve(this,hl,ll.setTimeout(()=>{I(this,jn).isStale||this.updateResult()},a))},Rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,rt)):this.options.refetchInterval)??!1},zp=function(t){Ze(this,ht,Dp).call(this),ve(this,vi,t),!(hu.isServer()||pr(this.options.enabled,I(this,rt))===!1||!Cp(I(this,vi))||I(this,vi)===0)&&ve(this,ml,ll.setInterval(()=>{(this.options.refetchIntervalInBackground||bg.isFocused())&&Ze(this,ht,ru).call(this)},I(this,vi)))},Op=function(){Ze(this,ht,Tp).call(this),Ze(this,ht,zp).call(this,Ze(this,ht,Rp).call(this))},Mp=function(){I(this,hl)&&(ll.clearTimeout(I(this,hl)),ve(this,hl,void 0))},Dp=function(){I(this,ml)&&(ll.clearInterval(I(this,ml)),ve(this,ml,void 0))},Lp=function(){const t=I(this,In).getQueryCache().build(I(this,In),this.options);if(t===I(this,rt))return;const n=I(this,rt);ve(this,rt,t),ve(this,Cu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},lw=function(t){Jt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(I(this,jn))}),I(this,In).getQueryCache().notify({query:I(this,rt),type:"observerResultsUpdated"})})},ZS);function d2(e,t){return pr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function _0(e,t){return d2(e,t)||e.state.data!==void 0&&Ip(e,t,t.refetchOnMount)}function Ip(e,t,n){if(pr(t.enabled,e)!==!1&&ji(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&kg(e,t)}return!1}function A0(e,t,n,a){return(e!==t||pr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kg(e,n)}function kg(e,t){return pr(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function f2(e,t){return!Rd(e.getCurrentResult(),t)}function T0(e){return{onFetch:(t,n)=>{var y,g,b,S,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=((S=t.state.data)==null?void 0:S.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{a2(O,()=>t.signal,()=>j=!0)},C=ew(t.options,t.fetchOptions),T=async(O,P,L)=>{if(j)return Promise.reject();if(P==null&&O.pages.length)return Promise.resolve(O);const M=(()=>{const de={client:t.client,queryKey:t.queryKey,pageParam:P,direction:L?"backward":"forward",meta:t.options.meta};return E(de),de})(),Z=await C(M),{maxPages:re}=t.options,F=L?r2:n2;return{pages:F(O.pages,Z,re),pageParams:F(O.pageParams,P,re)}};if(l&&o.length){const O=l==="backward",P=O?h2:R0,L={pages:o,pageParams:u},R=P(a,L);f=await T(L,R,O)}else{const O=e??o.length;do{const P=m===0?u[0]??a.initialPageParam:R0(a,f);if(m>0&&P==null)break;f=await T(f,P),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function R0(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 h2(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 Nu,Ur,pn,pl,Br,di,VS,m2=(VS=class extends rw{constructor(t){super();Te(this,Br);Te(this,Nu);Te(this,Ur);Te(this,pn);Te(this,pl);ve(this,Nu,t.client),this.mutationId=t.mutationId,ve(this,pn,t.mutationCache),ve(this,Ur,[]),this.state=t.state||sw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){I(this,Ur).includes(t)||(I(this,Ur).push(t),this.clearGcTimeout(),I(this,pn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ve(this,Ur,I(this,Ur).filter(n=>n!==t)),this.scheduleGc(),I(this,pn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){I(this,Ur).length||(this.state.status==="pending"?this.scheduleGc():I(this,pn).remove(this))}continue(){var t;return((t=I(this,pl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,b,S,k,j,E,C,T,O,P,L,R,M;const n=()=>{Ze(this,Br,di).call(this,{type:"continue"})},a={client:I(this,Nu),meta:this.options.meta,mutationKey:this.options.mutationKey};ve(this,pl,nw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(Z,re)=>{Ze(this,Br,di).call(this,{type:"failed",failureCount:Z,error:re})},onPause:()=>{Ze(this,Br,di).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,pn).canRun(this)}));const l=this.state.status==="pending",o=!I(this,pl).canStart();try{if(l)n();else{Ze(this,Br,di).call(this,{type:"pending",variables:t,isPaused:o}),I(this,pn).config.onMutate&&await I(this,pn).config.onMutate(t,this,a);const re=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));re!==this.state.context&&Ze(this,Br,di).call(this,{type:"pending",context:re,variables:t,isPaused:o})}const Z=await I(this,pl).start();return await((h=(m=I(this,pn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,Z,t,this.state.context,a)),await((S=(b=I(this,pn).config).onSettled)==null?void 0:S.call(b,Z,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,a)),Ze(this,Br,di).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((C=(E=I(this,pn).config).onError)==null?void 0:C.call(E,Z,t,this.state.context,this,a))}catch(re){Promise.reject(re)}try{await((O=(T=this.options).onError)==null?void 0:O.call(T,Z,t,this.state.context,a))}catch(re){Promise.reject(re)}try{await((L=(P=I(this,pn).config).onSettled)==null?void 0:L.call(P,void 0,Z,this.state.variables,this.state.context,this,a))}catch(re){Promise.reject(re)}try{await((M=(R=this.options).onSettled)==null?void 0:M.call(R,void 0,Z,t,this.state.context,a))}catch(re){Promise.reject(re)}throw Ze(this,Br,di).call(this,{type:"error",error:Z}),Z}finally{I(this,pn).runNext(this)}}},Nu=new WeakMap,Ur=new WeakMap,pn=new WeakMap,pl=new WeakMap,Br=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),Jt.batch(()=>{I(this,Ur).forEach(a=>{a.onMutationUpdate(t)}),I(this,pn).notify({mutation:this,type:"updated",action:t})})},VS);function sw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xa,Cr,_u,QS,p2=(QS=class extends Gs{constructor(t={}){super();Te(this,xa);Te(this,Cr);Te(this,_u);this.config=t,ve(this,xa,new Set),ve(this,Cr,new Map),ve(this,_u,0)}build(t,n,a){const l=new m2({client:t,mutationCache:this,mutationId:++nd(this,_u)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){I(this,xa).add(t);const n=rd(t);if(typeof n=="string"){const a=I(this,Cr).get(n);a?a.push(t):I(this,Cr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(I(this,xa).delete(t)){const n=rd(t);if(typeof n=="string"){const a=I(this,Cr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&I(this,Cr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=rd(t);if(typeof n=="string"){const a=I(this,Cr).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=rd(t);if(typeof n=="string"){const l=(a=I(this,Cr).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(){Jt.batch(()=>{I(this,xa).forEach(t=>{this.notify({type:"removed",mutation:t})}),I(this,xa).clear(),I(this,Cr).clear()})}getAll(){return Array.from(I(this,xa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>k0(n,a))}findAll(t={}){return this.getAll().filter(n=>k0(t,n))}notify(t){Jt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Jt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Cn))))}},xa=new WeakMap,Cr=new WeakMap,_u=new WeakMap,QS);function rd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Sa,bi,Un,wa,ja,wd,Up,GS,g2=(GS=class extends Gs{constructor(n,a){super();Te(this,ja);Te(this,Sa);Te(this,bi);Te(this,Un);Te(this,wa);ve(this,Sa,n),this.setOptions(a),this.bindMethods(),Ze(this,ja,wd).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=I(this,Sa).defaultMutationOptions(n),Rd(this.options,a)||I(this,Sa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,Un),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&gl(a.mutationKey)!==gl(this.options.mutationKey)?this.reset():((l=I(this,Un))==null?void 0:l.state.status)==="pending"&&I(this,Un).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=I(this,Un))==null||n.removeObserver(this)}onMutationUpdate(n){Ze(this,ja,wd).call(this),Ze(this,ja,Up).call(this,n)}getCurrentResult(){return I(this,bi)}reset(){var n;(n=I(this,Un))==null||n.removeObserver(this),ve(this,Un,void 0),Ze(this,ja,wd).call(this),Ze(this,ja,Up).call(this)}mutate(n,a){var l;return ve(this,wa,a),(l=I(this,Un))==null||l.removeObserver(this),ve(this,Un,I(this,Sa).getMutationCache().build(I(this,Sa),this.options)),I(this,Un).addObserver(this),I(this,Un).execute(n)}},Sa=new WeakMap,bi=new WeakMap,Un=new WeakMap,wa=new WeakMap,ja=new WeakSet,wd=function(){var a;const n=((a=I(this,Un))==null?void 0:a.state)??sw();ve(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})},Up=function(n){Jt.batch(()=>{var a,l,o,u,f,m,h,y;if(I(this,wa)&&this.hasListeners()){const g=I(this,bi).variables,b=I(this,bi).context,S={client:I(this,Sa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=I(this,wa)).onSuccess)==null||l.call(a,n.data,g,b,S)}catch(k){Promise.reject(k)}try{(u=(o=I(this,wa)).onSettled)==null||u.call(o,n.data,null,g,b,S)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=I(this,wa)).onError)==null||m.call(f,n.error,g,b,S)}catch(k){Promise.reject(k)}try{(y=(h=I(this,wa)).onSettled)==null||y.call(h,void 0,n.error,g,b,S)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(I(this,bi))})})},GS),Pr,KS,y2=(KS=class extends Gs{constructor(t={}){super();Te(this,Pr);this.config=t,ve(this,Pr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??xg(l,n);let u=this.get(o);return u||(u=new u2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){I(this,Pr).has(t.queryHash)||(I(this,Pr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=I(this,Pr).get(t.queryHash);n&&(t.destroy(),n===t&&I(this,Pr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Jt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return I(this,Pr).get(t)}getAll(){return[...I(this,Pr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>w0(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>w0(t,a)):n}notify(t){Jt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Jt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Jt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Pr=new WeakMap,KS),Ut,xi,Si,Bs,Ps,wi,$s,Fs,YS,v2=(YS=class{constructor(e={}){Te(this,Ut);Te(this,xi);Te(this,Si);Te(this,Bs);Te(this,Ps);Te(this,wi);Te(this,$s);Te(this,Fs);ve(this,Ut,e.queryCache||new y2),ve(this,xi,e.mutationCache||new p2),ve(this,Si,e.defaultOptions||{}),ve(this,Bs,new Map),ve(this,Ps,new Map),ve(this,wi,0)}mount(){nd(this,wi)._++,I(this,wi)===1&&(ve(this,$s,bg.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Ut).onFocus())})),ve(this,Fs,zd.subscribe(async e=>{e&&(await this.resumePausedMutations(),I(this,Ut).onOnline())})))}unmount(){var e,t;nd(this,wi)._--,I(this,wi)===0&&((e=I(this,$s))==null||e.call(this),ve(this,$s,void 0),(t=I(this,Fs))==null||t.call(this),ve(this,Fs,void 0))}isFetching(e){return I(this,Ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return I(this,xi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Ut).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=I(this,Ut).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ji(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return I(this,Ut).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=I(this,Ut).get(a.queryHash),o=l==null?void 0:l.state.data,u=W_(t,o);if(u!==void 0)return I(this,Ut).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Jt.batch(()=>I(this,Ut).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=I(this,Ut).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=I(this,Ut);Jt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=I(this,Ut);return Jt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Jt.batch(()=>I(this,Ut).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Cn).catch(Cn)}invalidateQueries(e,t={}){return Jt.batch(()=>(I(this,Ut).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=Jt.batch(()=>I(this,Ut).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=I(this,Ut).build(this,t);return n.isStaleByTime(ji(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=T0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cn).catch(Cn)}ensureInfiniteQueryData(e){return e.behavior=T0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zd.isOnline()?I(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,Ut)}getMutationCache(){return I(this,xi)}getDefaultOptions(){return I(this,Si)}setDefaultOptions(e){ve(this,Si,e)}setQueryDefaults(e,t){I(this,Bs).set(gl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...I(this,Bs).values()],n={};return t.forEach(a=>{fu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){I(this,Ps).set(gl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...I(this,Ps).values()],n={};return t.forEach(a=>{fu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...I(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xg(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===Sg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...I(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){I(this,Ut).clear(),I(this,xi).clear()}},Ut=new WeakMap,xi=new WeakMap,Si=new WeakMap,Bs=new WeakMap,Ps=new WeakMap,wi=new WeakMap,$s=new WeakMap,Fs=new WeakMap,YS),ow=x.createContext(void 0),er=e=>{const t=x.useContext(ow);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},b2=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(ow.Provider,{value:e,children:t})),uw=x.createContext(!1),x2=()=>x.useContext(uw);uw.Provider;function S2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var w2=x.createContext(S2()),k2=()=>x.useContext(w2),j2=(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))},C2=e=>{x.useEffect(()=>{e.clearReset()},[e])},E2=({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])),N2=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))}},_2=(e,t)=>e.isLoading&&e.isFetching&&!t,A2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,z0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function T2(e,t,n){var b,S,k,j;const a=x2(),l=k2(),o=er(),u=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",N2(u),j2(u,l,f),C2(l);const m=!o.getQueryCache().get(u.queryHash),[h]=x.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=g?h.subscribe(Jt.batchCalls(E)):Cn;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(u)},[u,h]),A2(u,y))throw z0(u,h,l);if(E2({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,y),u.experimental_prefetchInRender&&!hu.isServer()&&_2(y,a)){const E=m?z0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(Cn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function Qe(e,t){return T2(e,c2)}function wt(e,t){const n=er(),[a]=x.useState(()=>new g2(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(u=>a.subscribe(Jt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((u,f)=>{a.mutate(u,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 O0="popstate";function M0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function R2(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return Bp("",{pathname:u,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:mu(l)}return O2(t,n,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function yr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function z2(){return Math.random().toString(36).substring(2,10)}function D0(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 Bp(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ks(t):t,state:n,key:t&&t.key||a||z2(),unstable_mask:l}}function mu({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 Ks(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 O2(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let E=y(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let T=M0(E)?E:Bp(j.location,E,C);h=y()+1;let O=D0(T,h),P=j.createHref(T.unstable_mask||T);try{u.pushState(O,"",P)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(P)}o&&m&&m({action:f,location:j.location,delta:1})}function S(E,C){f="REPLACE";let T=M0(E)?E:Bp(j.location,E,C);h=y();let O=D0(T,h),P=j.createHref(T.unstable_mask||T);u.replaceState(O,"",P),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return M2(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(O0,g),m=E,()=>{l.removeEventListener(O0,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:S,go(E){return u.go(E)}};return j}function M2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),At(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:mu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function cw(e,t,n="/"){return D2(e,t,n,!1)}function D2(e,t,n,a){let l=typeof t=="string"?Ks(t):t,o=Ca(l.pathname||"/",n);if(o==null)return null;let u=dw(e);L2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=Q2(o);f=Z2(u[m],h,a)}return f}function dw(e,t=[],n=[],a="",l=!1){let o=(u,f,m=l,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;At(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=qr([a,y.relativePath]),b=n.concat(y);u.children&&u.children.length>0&&(At(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),dw(u.children,t,b,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:q2(g,u.index),routesMeta:b})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of fw(u.path))o(u,f,!0,h)}),t}function fw(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 u=fw(a.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function L2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:H2(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var I2=/^:[\w-]+$/,U2=3,B2=2,P2=1,$2=10,F2=-2,L0=e=>e==="*";function q2(e,t){let n=e.split("/"),a=n.length;return n.some(L0)&&(a+=F2),t&&(a+=B2),n.filter(l=>!L0(l)).reduce((l,o)=>l+(I2.test(o)?U2:o===""?P2:$2),a)}function H2(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 Z2(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",u=[];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=Od({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Od({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:qr([o,g.pathname]),pathnameBase:X2(qr([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=qr([o,g.pathnameBase]))}return u}function Od(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=V2(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const S=f[b];return g&&!S?h[y]=void 0:h[y]=(S||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function V2(e,t=!1,n=!0){yr(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,(u,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+u.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 Q2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return yr(!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 Ca(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 G2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function K2(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Ks(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=I0(n.substring(1),"/"):o=I0(n,t)):o=t,{pathname:o,search:J2(a),hash:W2(l)}}function I0(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 Lm(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 Y2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jg(e){let t=Y2(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Gd(e,t,n,a=!1){let l;typeof e=="string"?l=Ks(e):(l={...e},At(!l.pathname||!l.pathname.includes("?"),Lm("?","pathname","search",l)),At(!l.pathname||!l.pathname.includes("#"),Lm("#","pathname","hash",l)),At(!l.search||!l.search.includes("#"),Lm("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let g=t.length-1;if(!a&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=K2(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var qr=e=>e.join("/").replace(/\/\/+/g,"/"),X2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),J2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,W2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,eA=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 tA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function nA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mw(e,t){let n=e;if(typeof n!="string"||!G2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(hw)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ca(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{yr(!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 pw=["POST","PUT","PATCH","DELETE"];new Set(pw);var rA=["GET",...pw];new Set(rA);var Ys=x.createContext(null);Ys.displayName="DataRouter";var Kd=x.createContext(null);Kd.displayName="DataRouterState";var aA=x.createContext(!1),gw=x.createContext({isTransitioning:!1});gw.displayName="ViewTransition";var iA=x.createContext(new Map);iA.displayName="Fetchers";var lA=x.createContext(null);lA.displayName="Await";var tr=x.createContext(null);tr.displayName="Navigation";var Au=x.createContext(null);Au.displayName="Location";var vr=x.createContext({outlet:null,matches:[],isDataRoute:!1});vr.displayName="Route";var Cg=x.createContext(null);Cg.displayName="RouteError";var yw="REACT_ROUTER_ERROR",sA="REDIRECT",oA="ROUTE_ERROR_RESPONSE";function uA(e){if(e.startsWith(`${yw}:${sA}:{`))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 cA(e){if(e.startsWith(`${yw}:${oA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new eA(t.status,t.statusText,t.data)}catch{}}function dA(e,{relative:t}={}){At(Xs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(tr),{hash:l,pathname:o,search:u}=Tu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:qr([n,o])),a.createHref({pathname:f,search:u,hash:l})}function Xs(){return x.useContext(Au)!=null}function br(){return At(Xs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Au).location}var vw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bw(e){x.useContext(tr).static||x.useLayoutEffect(e)}function Vr(){let{isDataRoute:e}=x.useContext(vr);return e?NA():fA()}function fA(){At(Xs(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ys),{basename:t,navigator:n}=x.useContext(tr),{matches:a}=x.useContext(vr),{pathname:l}=br(),o=JSON.stringify(jg(a)),u=x.useRef(!1);return bw(()=>{u.current=!0}),x.useCallback((m,h={})=>{if(yr(u.current,vw),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=Gd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:qr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var hA=x.createContext(null);function mA(e){let t=x.useContext(vr).outlet;return x.useMemo(()=>t&&x.createElement(hA.Provider,{value:e},t),[t,e])}function pA(){let{matches:e}=x.useContext(vr),t=e[e.length-1];return t?t.params:{}}function Tu(e,{relative:t}={}){let{matches:n}=x.useContext(vr),{pathname:a}=br(),l=JSON.stringify(jg(n));return x.useMemo(()=>Gd(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function gA(e,t){return xw(e,t)}function xw(e,t,n){var E;At(Xs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(tr),{matches:l}=x.useContext(vr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";ww(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=br(),g;if(t){let C=typeof t=="string"?Ks(t):t;At(m==="/"||((E=C.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=y;let b=g.pathname||"/",S=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=cw(e,{pathname:S});yr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),yr(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=SA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:qr([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:qr([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(Au.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function yA(){let e=EA(),t=tA(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},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=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,u)}var vA=x.createElement(yA,null),Sw=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=cA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(vr.Provider,{value:this.props.routeContext},x.createElement(Cg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(bA,{error:e},t):t}};Sw.contextType=aA;var Im=new WeakMap;function bA({children:e,error:t}){let{basename:n}=x.useContext(tr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=uA(t.digest);if(a){let l=Im.get(t);if(l)throw l;let o=mw(a.location,n);if(hw&&!Im.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw Im.set(t,u),u}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function xA({routeContext:e,match:t,children:n}){let a=x.useContext(Ys);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(vr.Provider,{value:e},n)}function SA(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);At(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 u=!1,f=-1;if(n&&a){u=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:S}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!S||S[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(u=!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,S;m(y,{location:a.location,params:((S=(b=a.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:nA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let S,k=!1,j=null,E=null;a&&(S=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||vA,u&&(f<0&&b===0?(ww("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=g.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),T=()=>{let O;return S?O=j:k?O=E:g.route.Component?O=x.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,x.createElement(xA,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(Sw,{location:a.location,revalidation:a.revalidation,component:j,error:S,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):T()},null)}function Eg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wA(e){let t=x.useContext(Ys);return At(t,Eg(e)),t}function kA(e){let t=x.useContext(Kd);return At(t,Eg(e)),t}function jA(e){let t=x.useContext(vr);return At(t,Eg(e)),t}function Ng(e){let t=jA(e),n=t.matches[t.matches.length-1];return At(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function CA(){return Ng("useRouteId")}function EA(){var a;let e=x.useContext(Cg),t=kA("useRouteError"),n=Ng("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function NA(){let{router:e}=wA("useNavigate"),t=Ng("useNavigate"),n=x.useRef(!1);return bw(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{yr(n.current,vw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var U0={};function ww(e,t,n){!t&&!U0[e]&&(U0[e]=!0,yr(!1,n))}x.memo(_A);function _A({routes:e,future:t,state:n,isStatic:a,onError:l}){return xw(e,void 0,{state:n,isStatic:a,onError:l})}function _g({to:e,replace:t,state:n,relative:a}){At(Xs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(tr);yr(!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(vr),{pathname:u}=br(),f=Vr(),m=Gd(e,jg(o),u,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 Pp(e){return mA(e.context)}function Lr(e){At(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function AA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){At(!Xs(),"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:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Ks(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:S="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Ca(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:S,unstable_mask:k},navigationType:a}},[f,h,y,g,b,S,a,k]);return yr(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(tr.Provider,{value:m},x.createElement(Au.Provider,{children:t,value:j}))}function TA({children:e,location:t}){return gA($p(e),t)}function $p(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,$p(a.props.children,o));return}At(a.type===Lr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={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&&(u.children=$p(a.props.children,o)),n.push(u)}),n}var kd="get",jd="application/x-www-form-urlencoded";function Yd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function RA(e){return Yd(e)&&e.tagName.toLowerCase()==="button"}function zA(e){return Yd(e)&&e.tagName.toLowerCase()==="form"}function OA(e){return Yd(e)&&e.tagName.toLowerCase()==="input"}function MA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function DA(e,t){return e.button===0&&(!t||t==="_self")&&!MA(e)}function Fp(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 LA(e,t){let n=Fp(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var ad=null;function IA(){if(ad===null)try{new FormData(document.createElement("form"),0),ad=!1}catch{ad=!0}return ad}var UA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Um(e){return e!=null&&!UA.has(e)?(yr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jd}"`),null):e}function BA(e,t){let n,a,l,o,u;if(zA(e)){let f=e.getAttribute("action");a=f?Ca(f,t):null,n=e.getAttribute("method")||kd,l=Um(e.getAttribute("enctype"))||jd,o=new FormData(e)}else if(RA(e)||OA(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?Ca(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||kd,l=Um(e.getAttribute("formenctype"))||Um(f.getAttribute("enctype"))||jd,o=new FormData(f,e),!IA()){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(Yd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=kd,a=null,l=jd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ag(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function PA(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&&Ca(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function $A(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 FA(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 qA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await $A(o,n);return u.links?u.links():[]}return[]}));return QA(a.flat(1).filter(FA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function B0(e,t,n,a,l,o){let u=(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)=>u(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(u(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 HA(e,t,{includeHydrateFallback:n}={}){return ZA(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 ZA(e){return[...new Set(e)]}function VA(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function QA(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(VA(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function kw(){let e=x.useContext(Ys);return Ag(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function GA(){let e=x.useContext(Kd);return Ag(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tg=x.createContext(void 0);Tg.displayName="FrameworkContext";function jw(){let e=x.useContext(Tg);return Ag(e,"You must render this element inside a <HydratedRouter> element"),e}function KA(e,t){let n=x.useContext(Tg),[a,l]=x.useState(!1),[o,u]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=C=>{C.forEach(T=>{u(T.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let S=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:Go(f,S),onBlur:Go(m,k),onMouseEnter:Go(h,S),onMouseLeave:Go(y,k),onTouchStart:Go(g,S)}]:[!1,b,{}]}function Go(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YA({page:e,...t}){let{router:n}=kw(),a=x.useMemo(()=>cw(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(JA,{page:e,matches:a,...t}):null}function XA(e){let{manifest:t,routeModules:n}=jw(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return qA(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function JA({page:e,matches:t,...n}){let a=br(),{future:l,manifest:o,routeModules:u}=jw(),{basename:f}=kw(),{loaderData:m,matches:h}=GA(),y=x.useMemo(()=>B0(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>B0(e,t,h,o,a,"assets"),[e,t,h,o,a]),b=x.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(T=>{var P;let O=o.routes[T.route.id];!O||!O.hasLoader||(!y.some(L=>L.route.id===T.route.id)&&T.route.id in m&&((P=u[T.route.id])!=null&&P.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(T.route.id))}),j.size===0)return[];let C=PA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,u]),S=x.useMemo(()=>HA(g,o),[g,o]),k=XA(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),S.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function WA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var eT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{eT&&(window.__reactRouterVersion="7.13.1")}catch{}function tT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=R2({window:a,v5Compat:!0}));let o=l.current,[u,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(AA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var Cw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ew=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},j){let{basename:E,navigator:C,unstable_useTransitions:T}=x.useContext(tr),O=typeof y=="string"&&Cw.test(y),P=mw(y,E);y=P.to;let L=dA(y,{relative:l}),R=br(),M=null;if(f){let ee=Gd(f,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);E!=="/"&&(ee.pathname=ee.pathname==="/"?E:qr([E,ee.pathname])),M=C.createHref(ee)}let[Z,re,F]=KA(a,k),de=aT(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:T});function W(ee){t&&t(ee),ee.defaultPrevented||de(ee)}let ge=!(P.isExternal||o),fe=x.createElement("a",{...k,...F,href:(ge?M:void 0)||P.absoluteURL||L,onClick:ge?W:t,ref:WA(j,re),target:h,"data-discover":!O&&n==="render"?"true":void 0});return Z&&!O?x.createElement(x.Fragment,null,fe,x.createElement(YA,{page:L})):fe});Ew.displayName="Link";var Nw=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},y){let g=Tu(u,{relative:h.relative}),b=br(),S=x.useContext(Kd),{navigator:k,basename:j}=x.useContext(tr),E=S!=null&&uT(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,T=b.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;n||(T=T.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=Ca(O,j)||O);const P=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let L=T===C||!l&&T.startsWith(C)&&T.charAt(P)==="/",R=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),M={isActive:L,isPending:R,isTransitioning:E},Z=L?t:void 0,re;typeof a=="function"?re=a(M):re=[a,L?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(M):o;return x.createElement(Ew,{...h,"aria-current":Z,className:re,ref:y,style:F,to:u,viewTransition:f},typeof m=="function"?m(M):m)});Nw.displayName="NavLink";var nT=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=kd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:j}=x.useContext(tr),E=sT(),C=oT(f,{relative:h}),T=u.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&Cw.test(f),P=L=>{if(m&&m(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=(R==null?void 0:R.getAttribute("formmethod"))||u,Z=()=>E(R||L.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>Z()):Z()};return x.createElement("form",{ref:k,method:T,action:C,onSubmit:a?m:P,...S,"data-discover":!O&&e==="render"?"true":void 0})});nT.displayName="Form";function rT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _w(e){let t=x.useContext(Ys);return At(t,rT(e)),t}function aT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=Vr(),g=br(),b=Tu(e,{relative:u});return x.useCallback(S=>{if(DA(S,t)){S.preventDefault();let k=n!==void 0?n:mu(g)===mu(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,u,f,m,h])}function Rg(e){yr(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(Fp(e)),n=x.useRef(!1),a=br(),l=x.useMemo(()=>LA(a.search,n.current?null:t.current),[a.search]),o=Vr(),u=x.useCallback((f,m)=>{const h=Fp(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var iT=0,lT=()=>`__${String(++iT)}__`;function sT(){let{router:e}=_w("useSubmit"),{basename:t}=x.useContext(tr),n=CA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=BA(o,t);if(u.navigate===!1){let b=u.fetcherKey||lT();await a(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,n])}function oT(e,{relative:t}={}){let{basename:n}=x.useContext(tr),a=x.useContext(vr);At(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Tu(e||".",{relative:t})},u=br();if(e==null){o.search=u.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:qr([n,o.pathname])),mu(o)}function uT(e,{relative:t}={}){let n=x.useContext(gw);At(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=_w("useViewTransitionState"),l=Tu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ca(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=Ca(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Od(l.pathname,u)!=null||Od(l.pathname,o)!=null}const cT="/api/v1";async function dT(e,t){const n=await fetch(`${cT}/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 Aw="/api/v1",zg="first-tree-hub:tokens";function Og(){const e=localStorage.getItem(zg);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Tw(e){localStorage.setItem(zg,JSON.stringify(e))}function Rw(){localStorage.removeItem(zg)}class Xd extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let Ko=null;async function fT(e){return Ko||(Ko=(async()=>{try{const t=await fetch(`${Aw}/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 Tw(a),a}catch{return null}finally{Ko=null}})(),Ko)}async function id(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${Aw}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=Og();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await fT(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(Rw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new Xd(u.status,m,h)}if(u.status!==204)return await u.json()}const Ue={get:e=>id(e),post:(e,t)=>id(e,{method:"POST",body:t}),patch:(e,t)=>id(e,{method:"PATCH",body:t}),delete:e=>id(e,{method:"DELETE"})},zw=x.createContext(null);function hT({children:e}){const[t,n]=x.useState(()=>!!Og()),[a,l]=x.useState(null),[o,u]=x.useState(null),[f,m]=x.useState(null),h=x.useCallback(()=>{Rw(),n(!1),l(null),u(null),m(null)},[]),y=x.useCallback(async()=>{try{const b=await Ue.get("/me");l(b.member.role),u(b.member.id),m(b.member.agentId)}catch{}},[]),g=x.useCallback(async(b,S)=>{const k=await dT(b,S);Tw({accessToken:k.accessToken,refreshToken:k.refreshToken}),n(!0),await Ue.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return x.useEffect(()=>{t&&!a&&y()},[t,a,y]),x.useEffect(()=>{const b=()=>h();return window.addEventListener("auth:logout",b),()=>window.removeEventListener("auth:logout",b)},[h]),d.jsx(zw.Provider,{value:{isAuthenticated:t,role:a,memberId:o,agentId:f,login:g,logout:h},children:e})}function Aa(){const e=x.useContext(zw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function mT(){const{isAuthenticated:e}=Aa();return e?d.jsx(Pp,{}):d.jsx(_g,{to:"/login",replace:!0})}/**
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 Ow=(...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 pT=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 gT=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 P0=e=>{const t=gT(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 yT={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 vT=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 bT=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>x.createElement("svg",{ref:m,...yT,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ow("lucide",l),...!o&&!vT(f)&&{"aria-hidden":"true"},...f},[...u.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 ut=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(bT,{ref:o,iconNode:t,className:Ow(`lucide-${pT(P0(e))}`,`lucide-${e}`,a),...l}));return n.displayName=P0(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 xT=[["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"}]],ST=ut("bell",xT);/**
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 wT=[["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"}]],kT=ut("bot",wT);/**
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 jT=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],CT=ut("cable",jT);/**
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 ET=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ru=ut("check",ET);/**
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 NT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_T=ut("chevron-down",NT);/**
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 AT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],TT=ut("chevron-right",AT);/**
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 RT=[["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"}]],Mg=ut("copy",RT);/**
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 zT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],OT=ut("ellipsis",zT);/**
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 MT=[["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"}]],DT=ut("eye-off",MT);/**
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 LT=[["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"}]],IT=ut("eye",LT);/**
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 UT=[["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"}]],BT=ut("layout-dashboard",UT);/**
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 PT=[["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"}]],Dg=ut("link-2",PT);/**
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 $T=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],FT=ut("loader-circle",$T);/**
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 qT=[["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"}]],Mw=ut("lock",qT);/**
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 HT=[["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"}]],ZT=ut("log-out",HT);/**
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 VT=[["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"}]],Lg=ut("message-square",VT);/**
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 QT=[["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"}]],GT=ut("moon",QT);/**
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 KT=[["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"}]],YT=ut("paperclip",KT);/**
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 XT=[["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"}]],JT=ut("pause",XT);/**
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 WT=[["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"}]],Jd=ut("pencil",WT);/**
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 eR=[["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"}]],Dw=ut("play",eR);/**
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 tR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Sl=ut("plus",tR);/**
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 nR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wd=ut("search",nR);/**
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 rR=[["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"}]],aR=ut("send",rR);/**
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 iR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lR=ut("square",iR);/**
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 sR=[["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"}]],oR=ut("sun",sR);/**
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 uR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],cR=ut("terminal",uR);/**
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 dR=[["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"}]],pu=ut("trash-2",dR);/**
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 fR=[["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"}]],hR=ut("triangle-alert",fR);/**
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 mR=[["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"}]],pR=ut("undo-2",mR);/**
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 gR=[["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"}]],yR=ut("unplug",gR);/**
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 vR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qp=ut("x",vR);function Lw(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=Lw(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Iw(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Lw(e))&&(a&&(a+=" "),a+=t);return a}const bR=(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},xR=(e,t)=>({classGroupId:e,validator:t}),Uw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Md="-",$0=[],SR="arbitrary..",wR=e=>{const t=jR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return kR(u);const f=u.split(Md),m=f[0]===""&&f.length>1?1:0;return Bw(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?bR(h,m):m:h||$0}return n[u]||$0}}},Bw=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Bw(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(Md):e.slice(t).join(Md),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},kR=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?SR+a:void 0})(),jR=e=>{const{theme:t,classGroups:n}=e;return CR(n,t)},CR=(e,t)=>{const n=Uw();for(const a in e){const l=e[a];Ig(l,n,a,t)}return n},Ig=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];ER(u,t,n,a)}},ER=(e,t,n,a)=>{if(typeof e=="string"){NR(e,t,n);return}if(typeof e=="function"){_R(e,t,n,a);return}AR(e,t,n,a)},NR=(e,t,n)=>{const a=e===""?t:Pw(t,e);a.classGroupId=n},_R=(e,t,n,a)=>{if(TR(e)){Ig(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(xR(n,e))},AR=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];Ig(m,Pw(t,f),n,a)}},Pw=(e,t)=>{let n=e;const a=t.split(Md),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Uw(),n.nextPart.set(u,f)),n=f}return n},TR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,RR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},Hp="!",F0=":",zR=[],q0=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),OR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(u===0&&f===0){if(E===F0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,S=!1;g.endsWith(Hp)?(b=g.slice(0,-1),S=!0):g.startsWith(Hp)&&(b=g.slice(1),S=!0);const k=h&&h>m?h-m:void 0;return q0(o,S,b,k)};if(t){const l=t+F0,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):q0(zR,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},MR=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 u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},DR=e=>({cache:RR(e.cacheSize),parseClassName:OR(e),sortModifiers:MR(e),...wR(e)}),LR=/\s+/,IR=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(LR);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=y+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=y+(m.length>0?" "+m:m);continue}E=!1}const T=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=S?T+Hp:T,P=O+C;if(u.indexOf(P)>-1)continue;u.push(P);const L=l(C,E);for(let R=0;R<L.length;++R){const M=L[R];u.push(O+M)}m=y+(m.length>0?" "+m:m)}return m},UR=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=$w(n))&&(l&&(l+=" "),l+=a);return l},$w=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=$w(e[a]))&&(n&&(n+=" "),n+=t);return n},BR=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=DR(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=IR(m,n);return l(m,y),y};return o=u,(...m)=>o(UR(...m))},PR=[],Xt=e=>{const t=n=>n[e]||PR;return t.isThemeGetter=!0,t},Fw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$R=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qR=/\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$/,HR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ZR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>$R.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),Bm=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),ya=e=>FR.test(e),Hw=()=>!0,QR=e=>qR.test(e)&&!HR.test(e),Ug=()=>!1,GR=e=>ZR.test(e),KR=e=>VR.test(e),YR=e=>!je(e)&&!Ce(e),XR=e=>Ri(e,Qw,Ug),je=e=>Fw.test(e),al=e=>Ri(e,Gw,QR),H0=e=>Ri(e,iz,Ge),JR=e=>Ri(e,Yw,Hw),WR=e=>Ri(e,Kw,Ug),Z0=e=>Ri(e,Zw,Ug),ez=e=>Ri(e,Vw,KR),ld=e=>Ri(e,Xw,GR),Ce=e=>qw.test(e),Yo=e=>wl(e,Gw),tz=e=>wl(e,Kw),V0=e=>wl(e,Zw),nz=e=>wl(e,Qw),rz=e=>wl(e,Vw),sd=e=>wl(e,Xw,!0),az=e=>wl(e,Yw,!0),Ri=(e,t,n)=>{const a=Fw.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},wl=(e,t,n=!1)=>{const a=qw.exec(e);return a?a[1]?t(a[1]):n:!1},Zw=e=>e==="position"||e==="percentage",Vw=e=>e==="image"||e==="url",Qw=e=>e==="length"||e==="size"||e==="bg-size",Gw=e=>e==="length",iz=e=>e==="number",Kw=e=>e==="family-name",Yw=e=>e==="number"||e==="weight",Xw=e=>e==="shadow",lz=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),a=Xt("font-weight"),l=Xt("tracking"),o=Xt("leading"),u=Xt("breakpoint"),f=Xt("container"),m=Xt("spacing"),h=Xt("radius"),y=Xt("shadow"),g=Xt("inset-shadow"),b=Xt("text-shadow"),S=Xt("drop-shadow"),k=Xt("blur"),j=Xt("perspective"),E=Xt("aspect"),C=Xt("ease"),T=Xt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...P(),Ce,je],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],Z=()=>[Ce,je,m],re=()=>[oi,"full","auto",...Z()],F=()=>[ui,"none","subgrid",Ce,je],de=()=>["auto",{span:["full",ui,Ce,je]},ui,Ce,je],W=()=>[ui,"auto",Ce,je],ge=()=>["auto","min","max","fr",Ce,je],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...Z()],oe=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],K=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],he=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],A=()=>[e,Ce,je],U=()=>[...P(),V0,Z0,{position:[Ce,je]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",nz,XR,{size:[Ce,je]}],te=()=>[Bm,Yo,al],V=()=>["","none","full",h,Ce,je],le=()=>["",Ge,Yo,al],xe=()=>["solid","dashed","dotted","double"],Oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Ge,Bm,V0,Z0],xt=()=>["","none",k,Ce,je],ce=()=>["none",Ge,Ce,je],De=()=>["none",Ge,Ce,je],lt=()=>[Ge,Ce,je],Be=()=>[oi,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ya],breakpoint:[ya],color:[Hw],container:[ya],"drop-shadow":[ya],ease:["in","out","in-out"],font:[YR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ya],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ya],shadow:[ya],spacing:["px",Ge],text:[ya],"text-shadow":[ya],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,je,Ce,E]}],container:["container"],columns:[{columns:[Ge,je,Ce,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",Ce,je]}],basis:[{basis:[oi,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,oi,"auto","initial","none",je]}],grow:[{grow:["",Ge,Ce,je]}],shrink:[{shrink:["",Ge,Ce,je]}],order:[{order:[ui,"first","last","none",Ce,je]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:de()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ge()}],"auto-rows":[{"auto-rows":ge()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[f,"screen",...oe()]}],"min-w":[{"min-w":[f,"screen","none",...oe()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",n,Yo,al]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,az,JR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Bm,je]}],"font-family":[{font:[tz,WR,t]}],"font-features":[{"font-features":[je]}],"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,Ce,je]}],"line-clamp":[{"line-clamp":[Ge,"none",Ce,H0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",Ce,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ce,al]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ge,"auto",Ce,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,je]}],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",Ce,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,Ce,je],radial:["",Ce,je],conic:[ui,Ce,je]},rz,ez]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ce,je]}],"outline-w":[{outline:["",Ge,Yo,al]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,sd,ld]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,sd,ld]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ge,al]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,sd,ld]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ge,Ce,je]}],"mix-blend":[{"mix-blend":[...Oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ce,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,je]}],filter:[{filter:["","none",Ce,je]}],blur:[{blur:xt()}],brightness:[{brightness:[Ge,Ce,je]}],contrast:[{contrast:[Ge,Ce,je]}],"drop-shadow":[{"drop-shadow":["","none",S,sd,ld]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ge,Ce,je]}],"hue-rotate":[{"hue-rotate":[Ge,Ce,je]}],invert:[{invert:["",Ge,Ce,je]}],saturate:[{saturate:[Ge,Ce,je]}],sepia:[{sepia:["",Ge,Ce,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,je]}],"backdrop-blur":[{"backdrop-blur":xt()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ce,je]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ce,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ce,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ce,je]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ce,je]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ce,je]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ce,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ce,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Ce,je]}],ease:[{ease:["linear","initial",C,Ce,je]}],delay:[{delay:[Ge,Ce,je]}],animate:[{animate:["none",T,Ce,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ce,je]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[Ce,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Ce,je]}],"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":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"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",Ce,je]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ge,Yo,al,H0]}],stroke:[{stroke:["none",...A()]}],"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"]}},sz=BR(lz);function _e(...e){return sz(Iw(e))}function Hr(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 oz(e){return Ue.delete(`/clients/${encodeURIComponent(e)}`)}function zu(){return Ue.get("/admin/agents/activity")}function gu(){return Ue.get("/clients")}function uz(e){return Ue.post(`/clients/${e}/disconnect`)}function Jw(){return Ue.post("/connect-tokens")}const Ww=(e,t)=>["session",e,t],Zp=e=>["agent-sessions",e];function cz(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 dz(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 fz(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Js(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 Ue.get(`/admin/sessions/agents/${e}${a?`?${a}`:""}`)}function hz(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 Ue.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function mz(e,t){return Ue.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function pz(e,t){return Ue.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var Q0=1,gz=.9,yz=.8,vz=.17,Pm=.1,$m=.999,bz=.9999,xz=.99,Sz=/[\\\/_+.#"@\[\(\{&]/,wz=/[\\\/_+.#"@\[\(\{&]/g,kz=/[\s-]/,ek=/[\s-]/g;function Vp(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?Q0:xz;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,S,k;h>=0;)g=Vp(e,t,n,a,h+1,o+1,u),g>y&&(h===l?g*=Q0:Sz.test(e.charAt(h-1))?(g*=yz,S=e.slice(l,h-1).match(wz),S&&l>0&&(g*=Math.pow($m,S.length))):kz.test(e.charAt(h-1))?(g*=gz,k=e.slice(l,h-1).match(ek),k&&l>0&&(g*=Math.pow($m,k.length))):(g*=vz,l>0&&(g*=Math.pow($m,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=bz)),(g<Pm&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Vp(e,t,n,a,h+1,o+2,u),b*Pm>g&&(g=b*Pm)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function G0(e){return e.toLowerCase().replace(ek," ")}function jz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Vp(e,t,G0(e),G0(t),0,0,{})}function Ci(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 K0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ei(...e){return t=>{let n=!1;const a=e.map(l=>{const o=K0(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():K0(e[l],null)}}}}function kl(...e){return x.useCallback(Ei(...e),e)}function Cz(e,t){const n=x.createContext(t),a=o=>{const{children:u,...f}=o,m=x.useMemo(()=>f,Object.values(f));return d.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=x.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function Ez(e,t=[]){let n=[];function a(o,u){const f=x.createContext(u),m=n.length;n=[...n,u];const h=g=>{var C;const{scope:b,children:S,...k}=g,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:E,children:S})};h.displayName=o+"Provider";function y(g,b){var j;const S=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(S);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>x.createContext(u));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,Nz(l,...t)]}function Nz(...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 u=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var yu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},_z=vg[" useId ".trim().toString()]||(()=>{}),Az=0;function ka(e){const[t,n]=x.useState(_z());return yu(()=>{n(a=>a??String(Az++))},[e]),t?`radix-${t}`:""}var Tz=vg[" useInsertionEffect ".trim().toString()]||yu;function Rz({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=zz({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=Oz(y)?y(e):y;b!==e&&((g=u.current)==null||g.call(u,b))}else o(y)},[f,e,o,u]);return[m,h]}function zz({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return Tz(()=>{o.current=t},[t]),x.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function Oz(e){return typeof e=="function"}var tk=XS();const Mz=Qd(tk);function nk(e){const t=Dz(e),n=x.forwardRef((a,l)=>{const{children:o,...u}=a,f=x.Children.toArray(o),m=f.find(Iz);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 d.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function Dz(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const u=Bz(l),f=Uz(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ei(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lz=Symbol("radix.slottable");function Iz(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lz}function Uz(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 Bz(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 Pz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=Pz.reduce((e,t)=>{const n=nk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function $z(e,t){e&&tk.flushSync(()=>e.dispatchEvent(t))}function vu(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 Fz(e,t=globalThis==null?void 0:globalThis.document){const n=vu(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 qz="DismissableLayer",Qp="dismissableLayer.update",Hz="dismissableLayer.pointerDownOutside",Zz="dismissableLayer.focusOutside",Y0,rk=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ak=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=x.useContext(rk),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),k=kl(t,M=>g(M)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),T=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,P=T>=C,L=Gz(M=>{const Z=M.target,re=[...h.branches].some(F=>F.contains(Z));!P||re||(l==null||l(M),u==null||u(M),M.defaultPrevented||f==null||f())},b),R=Kz(M=>{const Z=M.target;[...h.branches].some(F=>F.contains(Z))||(o==null||o(M),u==null||u(M),M.defaultPrevented||f==null||f())},b);return Fz(M=>{T===h.layers.size-1&&(a==null||a(M),!M.defaultPrevented&&f&&(M.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Y0=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),X0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Y0)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),X0())},[y,h]),x.useEffect(()=>{const M=()=>S({});return document.addEventListener(Qp,M),()=>document.removeEventListener(Qp,M)},[]),d.jsx(Ta.div,{...m,ref:k,style:{pointerEvents:O?P?"auto":"none":void 0,...e.style},onFocusCapture:Ci(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Ci(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ci(e.onPointerDownCapture,L.onPointerDownCapture)})});ak.displayName=qz;var Vz="DismissableLayerBranch",Qz=x.forwardRef((e,t)=>{const n=x.useContext(rk),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]),d.jsx(Ta.div,{...e,ref:l})});Qz.displayName=Vz;function Gz(e,t=globalThis==null?void 0:globalThis.document){const n=vu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){ik(Hz,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},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function Kz(e,t=globalThis==null?void 0:globalThis.document){const n=vu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&ik(Zz,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 X0(){const e=new CustomEvent(Qp);document.dispatchEvent(e)}function ik(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?$z(l,o):l.dispatchEvent(o)}var Fm="focusScope.autoFocusOnMount",qm="focusScope.autoFocusOnUnmount",J0={bubbles:!1,cancelable:!0},Yz="FocusScope",lk=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=x.useState(null),h=vu(l),y=vu(o),g=x.useRef(null),b=kl(t,j=>m(j)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(S.paused||!f)return;const P=O.target;f.contains(P)?g.current=P:fi(g.current,{select:!0})},E=function(O){if(S.paused||!f)return;const P=O.relatedTarget;P!==null&&(f.contains(P)||fi(g.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const L of O)L.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const T=new MutationObserver(C);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),T.disconnect()}}},[a,f,S.paused]),x.useEffect(()=>{if(f){e1.add(S);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(Fm,J0);f.addEventListener(Fm,h),f.dispatchEvent(C),C.defaultPrevented||(Xz(nO(sk(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(Fm,h),setTimeout(()=>{const C=new CustomEvent(qm,J0);f.addEventListener(qm,y),f.dispatchEvent(C),C.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(qm,y),e1.remove(S)},0)}}},[f,h,y,S]);const k=x.useCallback(j=>{if(!n&&!a||S.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const T=j.currentTarget,[O,P]=Jz(T);O&&P?!j.shiftKey&&C===P?(j.preventDefault(),n&&fi(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&fi(P,{select:!0})):C===T&&j.preventDefault()}},[n,a,S.paused]);return d.jsx(Ta.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});lk.displayName=Yz;function Xz(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function Jz(e){const t=sk(e),n=W0(t,e),a=W0(t.reverse(),e);return[n,a]}function sk(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 W0(e,t){for(const n of e)if(!Wz(n,{upTo:t}))return n}function Wz(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 eO(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&&eO(e)&&t&&e.select()}}var e1=tO();function tO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=t1(e,t),e.unshift(t)},remove(t){var n;e=t1(e,t),(n=e[0])==null||n.resume()}}}function t1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function nO(e){return e.filter(t=>t.tagName!=="A")}var rO="Portal",ok=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);yu(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?Mz.createPortal(d.jsx(Ta.div,{...a,ref:t}),u):null});ok.displayName=rO;function aO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var ef=e=>{const{present:t,children:n}=e,a=iO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=kl(a.ref,lO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};ef.displayName="Presence";function iO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),u=e?"mounted":"unmounted",[f,m]=aO(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=od(a.current);o.current=f==="mounted"?h:"none"},[f]),yu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,S=od(h);e?m("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),yu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=S=>{const j=od(a.current).includes(CSS.escape(S.animationName));if(S.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=S=>{S.target===t&&(o.current=od(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 od(e){return(e==null?void 0:e.animationName)||"none"}function lO(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 Hm=0;function sO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??n1()),document.body.insertAdjacentElement("beforeend",e[1]??n1()),Hm++,()=>{Hm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hm--}},[])}function n1(){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 $r=function(){return $r=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},$r.apply(this,arguments)};function uk(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 oO(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 Cd="right-scroll-bar-position",Ed="width-before-scroll-bar",uO="with-scroll-bars-hidden",cO="--removed-body-scroll-bar-size";function Zm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dO(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 fO=typeof window<"u"?x.useLayoutEffect:x.useEffect,r1=new WeakMap;function hO(e,t){var n=dO(null,function(a){return e.forEach(function(l){return Zm(l,a)})});return fO(function(){var a=r1.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||Zm(f,null)}),o.forEach(function(f){l.has(f)||Zm(f,u)})}r1.set(n,e)},[e]),n}function mO(e){return e}function pO(e,t){t===void 0&&(t=mO);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 u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var y=u;u=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){u.push(y),h()},filter:function(y){return u=u.filter(y),n}}}};return l}function gO(e){e===void 0&&(e={});var t=pO(null);return t.options=$r({async:!0,ssr:!1},e),t}var ck=function(e){var t=e.sideCar,n=uk(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,$r({},n))};ck.isSideCarExport=!0;function yO(e,t){return e.useMedium(t),ck}var dk=gO(),Vm=function(){},tf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:Vm,onWheelCapture:Vm,onTouchMoveCapture:Vm}),l=a[0],o=a[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,T=C===void 0?"div":C,O=e.gapMode,P=uk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=b,R=hO([n,t]),M=$r($r({},P),l);return x.createElement(x.Fragment,null,y&&x.createElement(L,{sideCar:dk,removeScrollBar:h,shards:g,noRelative:S,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),u?x.cloneElement(x.Children.only(f),$r($r({},M),{ref:R})):x.createElement(T,$r({},M,{className:m,ref:R}),f))});tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tf.classNames={fullWidth:Ed,zeroRight:Cd};var vO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vO();return t&&e.setAttribute("nonce",t),e}function xO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bO())&&(xO(t,n),SO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kO=function(){var e=wO();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fk=function(){var e=kO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},jO={left:0,top:0,right:0,gap:0},Qm=function(e){return parseInt(e||"",10)||0},CO=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[Qm(n),Qm(a),Qm(l)]},EO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jO;var t=CO(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])}},NO=fk(),_s="data-scroll-locked",_O=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
261
- .`.concat(uO,` {
262
- overflow: hidden `).concat(a,`;
263
- padding-right: `).concat(f,"px ").concat(a,`;
264
- }
265
- body[`).concat(_s,`] {
266
- overflow: hidden `).concat(a,`;
267
- overscroll-behavior: contain;
268
- `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
269
- padding-left: `.concat(l,`px;
270
- padding-top: `).concat(o,`px;
271
- padding-right: `).concat(u,`px;
272
- margin-left:0;
273
- margin-top:0;
274
- margin-right: `).concat(f,"px ").concat(a,`;
275
- `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
276
- }
277
-
278
- .`).concat(Cd,` {
279
- right: `).concat(f,"px ").concat(a,`;
280
- }
281
-
282
- .`).concat(Ed,` {
283
- margin-right: `).concat(f,"px ").concat(a,`;
284
- }
285
-
286
- .`).concat(Cd," .").concat(Cd,` {
287
- right: 0 `).concat(a,`;
288
- }
289
-
290
- .`).concat(Ed," .").concat(Ed,` {
291
- margin-right: 0 `).concat(a,`;
292
- }
293
-
294
- body[`).concat(_s,`] {
295
- `).concat(cO,": ").concat(f,`px;
296
- }
297
- `)},a1=function(){var e=parseInt(document.body.getAttribute(_s)||"0",10);return isFinite(e)?e:0},AO=function(){x.useEffect(function(){return document.body.setAttribute(_s,(a1()+1).toString()),function(){var e=a1()-1;e<=0?document.body.removeAttribute(_s):document.body.setAttribute(_s,e.toString())}},[])},TO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;AO();var o=x.useMemo(function(){return EO(l)},[l]);return x.createElement(NO,{styles:_O(o,!t,l,n?"":"!important")})},Gp=!1;if(typeof window<"u")try{var ud=Object.defineProperty({},"passive",{get:function(){return Gp=!0,!0}});window.addEventListener("test",ud,ud),window.removeEventListener("test",ud,ud)}catch{Gp=!1}var ps=Gp?{passive:!1}:!1,RO=function(e){return e.tagName==="TEXTAREA"},hk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!RO(e)&&n[t]==="visible")},zO=function(e){return hk(e,"overflowY")},OO=function(e){return hk(e,"overflowX")},i1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=mk(e,a);if(l){var o=pk(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},MO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},DO=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},mk=function(e,t){return e==="v"?zO(t):OO(t)},pk=function(e,t){return e==="v"?MO(t):DO(t)},LO=function(e,t){return e==="h"&&t==="rtl"?-1:1},IO=function(e,t,n,a,l){var o=LO(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,m=t.contains(f),h=!1,y=u>0,g=0,b=0;do{if(!f)break;var S=pk(e,f),k=S[0],j=S[1],E=S[2],C=j-E-o*k;(k||C)&&mk(e,f)&&(g+=C,b+=k);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}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},cd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},l1=function(e){return[e.deltaX,e.deltaY]},s1=function(e){return e&&"current"in e?e.current:e},UO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},BO=function(e){return`
298
- .block-interactivity-`.concat(e,` {pointer-events: none;}
299
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
300
- `)},PO=0,gs=[];function $O(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(PO++)[0],o=x.useState(fk)[0],u=x.useRef(e);x.useEffect(function(){u.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=oO([e.lockRef.current],(e.shards||[]).map(s1),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var C=cd(j),T=n.current,O="deltaX"in j?j.deltaX:T[0]-C[0],P="deltaY"in j?j.deltaY:T[1]-C[1],L,R=j.target,M=Math.abs(O)>Math.abs(P)?"h":"v";if("touches"in j&&M==="h"&&R.type==="range")return!1;var Z=window.getSelection(),re=Z&&Z.anchorNode,F=re?re===R||re.contains(R):!1;if(F)return!1;var de=i1(M,R);if(!de)return!0;if(de?L=M:(L=M==="v"?"h":"v",de=i1(M,R)),!de)return!1;if(!a.current&&"changedTouches"in j&&(O||P)&&(a.current=L),!L)return!0;var W=a.current||L;return IO(W,E,j,W==="h"?O:P)},[]),m=x.useCallback(function(j){var E=j;if(!(!gs.length||gs[gs.length-1]!==o)){var C="deltaY"in E?l1(E):cd(E),T=t.current.filter(function(L){return L.name===E.type&&(L.target===E.target||E.target===L.shadowParent)&&UO(L.delta,C)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(s1).filter(Boolean).filter(function(L){return L.contains(E.target)}),P=O.length>0?f(E,O[0]):!u.current.noIsolation;P&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,T){var O={name:j,delta:E,target:C,should:T,shadowParent:FO(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(P){return P!==O})},1)},[]),y=x.useCallback(function(j){n.current=cd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,l1(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,cd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return gs.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ps),document.addEventListener("touchmove",m,ps),document.addEventListener("touchstart",y,ps),function(){gs=gs.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ps),document.removeEventListener("touchmove",m,ps),document.removeEventListener("touchstart",y,ps)}},[]);var S=e.removeScrollBar,k=e.inert;return x.createElement(x.Fragment,null,k?x.createElement(o,{styles:BO(l)}):null,S?x.createElement(TO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function FO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qO=yO(dk,$O);var gk=x.forwardRef(function(e,t){return x.createElement(tf,$r({},e,{ref:t,sideCar:qO}))});gk.classNames=tf.classNames;var HO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ys=new WeakMap,dd=new WeakMap,fd={},Gm=0,yk=function(e){return e&&(e.host||yk(e.parentNode))},ZO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=yk(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})},VO=function(e,t,n,a){var l=ZO(t,Array.isArray(e)?e:[e]);fd[n]||(fd[n]=new WeakMap);var o=fd[n],u=[],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 S=b.getAttribute(a),k=S!==null&&S!=="false",j=(ys.get(b)||0)+1,E=(o.get(b)||0)+1;ys.set(b,j),o.set(b,E),u.push(b),j===1&&k&&dd.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return y(t),f.clear(),Gm++,function(){u.forEach(function(g){var b=ys.get(g)-1,S=o.get(g)-1;ys.set(g,b),o.set(g,S),b||(dd.has(g)||g.removeAttribute(a),dd.delete(g)),S||g.removeAttribute(n)}),Gm--,Gm||(ys=new WeakMap,ys=new WeakMap,dd=new WeakMap,fd={})}},QO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=HO(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),VO(a,l,n,"aria-hidden")):function(){return null}},nf="Dialog",[vk]=Ez(nf),[GO,_r]=vk(nf),bk=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=Rz({prop:a,defaultProp:l??!1,onChange:o,caller:nf});return d.jsx(GO,{scope:t,triggerRef:f,contentRef:m,contentId:ka(),titleId:ka(),descriptionId:ka(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};bk.displayName=nf;var xk="DialogTrigger",Sk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=_r(xk,n),o=kl(t,l.triggerRef);return d.jsx(Ta.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":$g(l.open),...a,ref:o,onClick:Ci(e.onClick,l.onOpenToggle)})});Sk.displayName=xk;var Bg="DialogPortal",[KO,wk]=vk(Bg,{forceMount:void 0}),kk=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=_r(Bg,t);return d.jsx(KO,{scope:t,forceMount:n,children:x.Children.map(a,u=>d.jsx(ef,{present:n||o.open,children:d.jsx(ok,{asChild:!0,container:l,children:u})}))})};kk.displayName=Bg;var Dd="DialogOverlay",jk=x.forwardRef((e,t)=>{const n=wk(Dd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=_r(Dd,e.__scopeDialog);return o.modal?d.jsx(ef,{present:a||o.open,children:d.jsx(XO,{...l,ref:t})}):null});jk.displayName=Dd;var YO=nk("DialogOverlay.RemoveScroll"),XO=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=_r(Dd,n);return d.jsx(gk,{as:YO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Ta.div,{"data-state":$g(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),yl="DialogContent",Ck=x.forwardRef((e,t)=>{const n=wk(yl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=_r(yl,e.__scopeDialog);return d.jsx(ef,{present:a||o.open,children:o.modal?d.jsx(JO,{...l,ref:t}):d.jsx(WO,{...l,ref:t})})});Ck.displayName=yl;var JO=x.forwardRef((e,t)=>{const n=_r(yl,e.__scopeDialog),a=x.useRef(null),l=kl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return QO(o)},[]),d.jsx(Ek,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ci(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ci(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Ci(e.onFocusOutside,o=>o.preventDefault())})}),WO=x.forwardRef((e,t)=>{const n=_r(yl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return d.jsx(Ek,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.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 u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Ek=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=_r(yl,n),m=x.useRef(null),h=kl(t,m);return sO(),d.jsxs(d.Fragment,{children:[d.jsx(lk,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx(ak,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":$g(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(e3,{titleId:f.titleId}),d.jsx(n3,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Pg="DialogTitle",Nk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=_r(Pg,n);return d.jsx(Ta.h2,{id:l.titleId,...a,ref:t})});Nk.displayName=Pg;var _k="DialogDescription",Ak=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=_r(_k,n);return d.jsx(Ta.p,{id:l.descriptionId,...a,ref:t})});Ak.displayName=_k;var Tk="DialogClose",Rk=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=_r(Tk,n);return d.jsx(Ta.button,{type:"button",...a,ref:t,onClick:Ci(e.onClick,()=>l.onOpenChange(!1))})});Rk.displayName=Tk;function $g(e){return e?"open":"closed"}var zk="DialogTitleWarning",[zq,Ok]=Cz(zk,{contentName:yl,titleName:Pg,docsSlug:"dialog"}),e3=({titleId:e})=>{const t=Ok(zk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
301
-
302
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
303
-
304
- 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},t3="DialogDescriptionWarning",n3=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ok(t3).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},Mk=bk,r3=Sk,Dk=kk,Lk=jk,Ik=Ck,a3=Nk,i3=Ak,l3=Rk,s3=Symbol.for("react.lazy"),Ld=vg[" use ".trim().toString()];function o3(e){return typeof e=="object"&&e!==null&&"then"in e}function Uk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===s3&&"_payload"in e&&o3(e._payload)}function Bk(e){const t=c3(e),n=x.forwardRef((a,l)=>{let{children:o,...u}=a;Uk(o)&&typeof Ld=="function"&&(o=Ld(o._payload));const f=x.Children.toArray(o),m=f.find(f3);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 d.jsx(t,{...u,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var u3=Bk("Slot");function c3(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(Uk(l)&&typeof Ld=="function"&&(l=Ld(l._payload)),x.isValidElement(l)){const u=m3(l),f=h3(o,l.props);return l.type!==x.Fragment&&(f.ref=a?Ei(a,u):u),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d3=Symbol("radix.slottable");function f3(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d3}function h3(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 m3(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 p3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ra=p3.reduce((e,t)=>{const n=Bk(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Xo='[cmdk-group=""]',Km='[cmdk-group-items=""]',g3='[cmdk-group-heading=""]',Pk='[cmdk-item=""]',o1=`${Pk}:not([aria-disabled="true"])`,Kp="cmdk-item-select",Ss="data-value",y3=(e,t,n)=>jz(e,t,n),$k=x.createContext(void 0),Ou=()=>x.useContext($k),Fk=x.createContext(void 0),Fg=()=>x.useContext(Fk),qk=x.createContext(void 0),Hk=x.forwardRef((e,t)=>{let n=ws(()=>{var B,_;return{search:"",value:(_=(B=e.value)!=null?B:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=ws(()=>new Set),l=ws(()=>new Map),o=ws(()=>new Map),u=ws(()=>new Set),f=Zk(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:S,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,T=ka(),O=ka(),P=ka(),L=x.useRef(null),R=_3();vl(()=>{if(y!==void 0){let B=y.trim();n.current.value=B,M.emit()}},[y]),vl(()=>{R(6,ge)},[]);let M=x.useMemo(()=>({subscribe:B=>(u.current.add(B),()=>u.current.delete(B)),snapshot:()=>n.current,setState:(B,_,te)=>{var V,le,xe,Oe;if(!Object.is(n.current[B],_)){if(n.current[B]=_,B==="search")W(),F(),R(1,de);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Se=document.getElementById(P);Se?Se.focus():(V=document.getElementById(T))==null||V.focus()}if(R(7,()=>{var Se;n.current.selectedItemId=(Se=fe())==null?void 0:Se.id,M.emit()}),te||R(5,ge),((le=f.current)==null?void 0:le.value)!==void 0){let Se=_??"";(Oe=(xe=f.current).onValueChange)==null||Oe.call(xe,Se);return}}M.emit()}},emit:()=>{u.current.forEach(B=>B())}}),[]),Z=x.useMemo(()=>({value:(B,_,te)=>{var V;_!==((V=o.current.get(B))==null?void 0:V.value)&&(o.current.set(B,{value:_,keywords:te}),n.current.filtered.items.set(B,re(_,te)),R(2,()=>{F(),M.emit()}))},item:(B,_)=>(a.current.add(B),_&&(l.current.has(_)?l.current.get(_).add(B):l.current.set(_,new Set([B]))),R(3,()=>{W(),F(),n.current.value||de(),M.emit()}),()=>{o.current.delete(B),a.current.delete(B),n.current.filtered.items.delete(B);let te=fe();R(4,()=>{W(),(te==null?void 0:te.getAttribute("id"))===B&&de(),M.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:T,inputId:P,labelId:O,listInnerRef:L}),[]);function re(B,_){var te,V;let le=(V=(te=f.current)==null?void 0:te.filter)!=null?V:y3;return B?le(B,n.current.search,_):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let B=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(V=>{let le=l.current.get(V),xe=0;le.forEach(Oe=>{let Se=B.get(Oe);xe=Math.max(Se,xe)}),_.push([V,xe])});let te=L.current;ee().sort((V,le)=>{var xe,Oe;let Se=V.getAttribute("id"),xt=le.getAttribute("id");return((xe=B.get(xt))!=null?xe:0)-((Oe=B.get(Se))!=null?Oe:0)}).forEach(V=>{let le=V.closest(Km);le?le.appendChild(V.parentElement===le?V:V.closest(`${Km} > *`)):te.appendChild(V.parentElement===te?V:V.closest(`${Km} > *`))}),_.sort((V,le)=>le[1]-V[1]).forEach(V=>{var le;let xe=(le=L.current)==null?void 0:le.querySelector(`${Xo}[${Ss}="${encodeURIComponent(V[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function de(){let B=ee().find(te=>te.getAttribute("aria-disabled")!=="true"),_=B==null?void 0:B.getAttribute(Ss);M.setState("value",_||void 0)}function W(){var B,_,te,V;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let xe of a.current){let Oe=(_=(B=o.current.get(xe))==null?void 0:B.value)!=null?_:"",Se=(V=(te=o.current.get(xe))==null?void 0:te.keywords)!=null?V:[],xt=re(Oe,Se);n.current.filtered.items.set(xe,xt),xt>0&&le++}for(let[xe,Oe]of l.current)for(let Se of Oe)if(n.current.filtered.items.get(Se)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=le}function ge(){var B,_,te;let V=fe();V&&(((B=V.parentElement)==null?void 0:B.firstChild)===V&&((te=(_=V.closest(Xo))==null?void 0:_.querySelector(g3))==null||te.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function fe(){var B;return(B=L.current)==null?void 0:B.querySelector(`${Pk}[aria-selected="true"]`)}function ee(){var B;return Array.from(((B=L.current)==null?void 0:B.querySelectorAll(o1))||[])}function q(B){let _=ee()[B];_&&M.setState("value",_.getAttribute(Ss))}function oe(B){var _;let te=fe(),V=ee(),le=V.findIndex(Oe=>Oe===te),xe=V[le+B];(_=f.current)!=null&&_.loop&&(xe=le+B<0?V[V.length-1]:le+B===V.length?V[0]:V[le+B]),xe&&M.setState("value",xe.getAttribute(Ss))}function K(B){let _=fe(),te=_==null?void 0:_.closest(Xo),V;for(;te&&!V;)te=B>0?E3(te,Xo):N3(te,Xo),V=te==null?void 0:te.querySelector(o1);V?M.setState("value",V.getAttribute(Ss)):oe(B)}let he=()=>q(ee().length-1),A=B=>{B.preventDefault(),B.metaKey?he():B.altKey?K(1):oe(1)},U=B=>{B.preventDefault(),B.metaKey?q(0):B.altKey?K(-1):oe(-1)};return x.createElement(Ra.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:B=>{var _;(_=C.onKeyDown)==null||_.call(C,B);let te=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||te))switch(B.key){case"n":case"j":{E&&B.ctrlKey&&A(B);break}case"ArrowDown":{A(B);break}case"p":case"k":{E&&B.ctrlKey&&U(B);break}case"ArrowUp":{U(B);break}case"Home":{B.preventDefault(),q(0);break}case"End":{B.preventDefault(),he();break}case"Enter":{B.preventDefault();let V=fe();if(V){let le=new Event(Kp);V.dispatchEvent(le)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:T3},m),rf(e,B=>x.createElement(Fk.Provider,{value:M},x.createElement($k.Provider,{value:Z},B))))}),v3=x.forwardRef((e,t)=>{var n,a;let l=ka(),o=x.useRef(null),u=x.useContext(qk),f=Ou(),m=Zk(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;vl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=Vk(l,o,[e.value,e.children,o],e.keywords),g=Fg(),b=Ni(R=>R.value&&R.value===y.current),S=Ni(R=>h||f.filter()===!1?!0:R.search?R.filtered.items.get(l)>0:!0);x.useEffect(()=>{let R=o.current;if(!(!R||e.disabled))return R.addEventListener(Kp,k),()=>R.removeEventListener(Kp,k)},[S,e.onSelect,e.disabled]);function k(){var R,M;j(),(M=(R=m.current).onSelect)==null||M.call(R,y.current)}function j(){g.setState("value",y.current,!0)}if(!S)return null;let{disabled:E,value:C,onSelect:T,forceMount:O,keywords:P,...L}=e;return x.createElement(Ra.div,{ref:Ei(o,t),...L,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),b3=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=ka(),f=x.useRef(null),m=x.useRef(null),h=ka(),y=Ou(),g=Ni(S=>l||y.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);vl(()=>y.group(u),[]),Vk(u,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:u,forceMount:l}),[l]);return x.createElement(Ra.div,{ref:Ei(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),rf(e,S=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(qk.Provider,{value:b},S))))}),x3=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ni(u=>!u.search);return!n&&!o?null:x.createElement(Ra.div,{ref:Ei(l,t),...a,"cmdk-separator":"",role:"separator"})}),S3=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=Fg(),u=Ni(h=>h.search),f=Ni(h=>h.selectedItemId),m=Ou();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Ra.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:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),w3=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),u=x.useRef(null),f=Ni(h=>h.selectedItemId),m=Ou();return x.useEffect(()=>{if(u.current&&o.current){let h=u.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let S=h.offsetHeight;y.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Ra.div,{ref:Ei(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},rf(e,h=>x.createElement("div",{ref:Ei(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),k3=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return x.createElement(Mk,{open:n,onOpenChange:a},x.createElement(Dk,{container:u},x.createElement(Lk,{"cmdk-overlay":"",className:l}),x.createElement(Ik,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(Hk,{ref:t,...f}))))}),j3=x.forwardRef((e,t)=>Ni(n=>n.filtered.count===0)?x.createElement(Ra.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),C3=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Ra.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},rf(e,u=>x.createElement("div",{"aria-hidden":!0},u)))}),Pn=Object.assign(Hk,{List:w3,Item:v3,Input:S3,Group:b3,Separator:x3,Dialog:k3,Empty:j3,Loading:C3});function E3(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function N3(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Zk(e){let t=x.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function ws(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ni(e){let t=Fg(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Vk(e,t,n,a=[]){let l=x.useRef(),o=Ou();return vl(()=>{var u;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),(u=t.current)==null||u.setAttribute(Ss,f),l.current=f}),l}var _3=()=>{let[e,t]=x.useState(),n=ws(()=>new Map);return vl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function A3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function rf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(A3(t),{ref:t.ref},n(t.props.children)):n(t)}var T3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const yn=Mk,R3=r3,z3=Dk,Qk=x.forwardRef(({className:e,...t},n)=>d.jsx(Lk,{ref:n,className:_e("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Qk.displayName="DialogOverlay";const hn=x.forwardRef(({className:e,children:t,...n},a)=>d.jsxs(z3,{children:[d.jsx(Qk,{}),d.jsxs(Ik,{ref:a,className:_e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,d.jsxs(l3,{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:[d.jsx(qp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hn.displayName="DialogContent";function _n({className:e,...t}){return d.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function vn({className:e,...t}){return d.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const bn=x.forwardRef(({className:e,...t},n)=>d.jsx(a3,{ref:n,className:_e("text-subtitle leading-none tracking-tight",e),...t}));bn.displayName="DialogTitle";const O3=x.forwardRef(({className:e,...t},n)=>d.jsx(i3,{ref:n,className:_e("text-body text-muted-foreground",e),...t}));O3.displayName="DialogDescription";const Gk=x.forwardRef(({className:e,...t},n)=>d.jsx(Pn,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Gk.displayName=Pn.displayName;function M3({open:e,onOpenChange:t,children:n}){return d.jsx(yn,{open:e,onOpenChange:t,children:d.jsx(hn,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Gk,{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 Kk=x.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(Wd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(Pn.Input,{ref:n,className:_e("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Kk.displayName=Pn.Input.displayName;const Yk=x.forwardRef(({className:e,...t},n)=>d.jsx(Pn.List,{ref:n,className:_e("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Yk.displayName=Pn.List.displayName;const Xk=x.forwardRef((e,t)=>d.jsx(Pn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Xk.displayName=Pn.Empty.displayName;const Nd=x.forwardRef(({className:e,...t},n)=>d.jsx(Pn.Group,{ref:n,className:_e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Nd.displayName=Pn.Group.displayName;const Yp=x.forwardRef(({className:e,...t},n)=>d.jsx(Pn.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));Yp.displayName=Pn.Separator.displayName;const _d=x.forwardRef(({className:e,...t},n)=>d.jsx(Pn.Item,{ref:n,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));_d.displayName=Pn.Item.displayName;function af(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 Ue.get(`/admin/agents${n?`?${n}`:""}`)}function D3(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return Ue.get(`/admin/agents/all${n?`?${n}`:""}`)}function Jk(e){return Ue.get(`/admin/agents/${encodeURIComponent(e)}`)}function L3(e){return Ue.post("/admin/agents",e)}function I3(e){return Ue.get(`/admin/agents/names/${encodeURIComponent(e)}/availability`)}function u1(e,t){return Ue.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function U3(e){return Ue.delete(`/admin/agents/${encodeURIComponent(e)}`)}function B3(e){return Ue.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function P3(e){return Ue.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function $3(e){return Ue.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function jl(){const{data:e}=Qe({queryKey:["agents","name-map"],queryFn:()=>af({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName);return n=>n?t.get(n)??n:"—"},[e])}function qg(){const{data:e}=Qe({queryKey:["agents","name-map"],queryFn:()=>af({limit:100}),staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,{name:n.name,displayName:n.displayName});return n=>n?t.get(n)??null:null},[e])}const F3=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function q3({open:e,onOpenChange:t}){const n=Vr(),a=jl(),{data:l}=Qe({queryKey:["activity"],queryFn:zu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Qe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await Js(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 d.jsxs(M3,{open:e,onOpenChange:t,children:[d.jsx(Kk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(Yk,{children:[d.jsx(Xk,{children:"No results"}),o.length>0&&d.jsx(Nd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return d.jsxs(_d,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(kT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:y}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Yp,{}),d.jsx(Nd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return d.jsxs(_d,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[d.jsx(Lg,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:g}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),d.jsx(Yp,{}),d.jsx(Nd,{heading:"Pages",children:F3.map(h=>d.jsxs(_d,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(BT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function Mu(e){return d.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[d.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),d.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),d.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),d.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),d.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),d.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function Xp(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 Ue.get(`/admin/notifications${n?`?${n}`:""}`)}function Wk(e){return Ue.post(`/admin/notifications/${e}/read`)}function H3(){return Ue.post("/admin/notifications/read-all")}const Z3={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 V3(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function ej({notification:e,onClick:t,clickable:n}){const a=(Z3[e.type]??e.type).toString(),l=V3(e.severity),o=n??!0;return d.jsxs("button",{type:"button",onClick:t,className:_e("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[d.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[d.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Hr(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function Q3(){var S;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=Vr(),u=er(),{data:f}=Qe({queryKey:["notifications","bell"],queryFn:()=>Xp({limit:8}),refetchInterval:1e4}),{data:m}=Qe({queryKey:["notifications","unread-count"],queryFn:()=>Xp({read:!1,limit:100}),refetchInterval:1e4}),h=((S=m==null?void 0:m.items)==null?void 0:S.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(Wk(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),b=x.useCallback(async()=>{a(null);try{await H3(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return d.jsxs("div",{className:"relative",children:[d.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:[d.jsx(ST,{className:"h-4 w-4"}),y&&d.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&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),d.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:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&d.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&d.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}),d.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?d.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=>d.jsx(ej,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function G3(){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 K3(){const[e,t]=x.useState(G3);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),d.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",children:e==="dark"?d.jsx(oR,{className:"h-4 w-4"}):d.jsx(GT,{className:"h-4 w-4"})})}const c1=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],Y3={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function X3(){const{role:e,logout:t}=Aa(),n=e==="admin",[a,l]=x.useState(!1),o=n?[...c1,Y3]:c1,u=br(),f=u.pathname==="/"||u.search.includes("a=");return x.useEffect(()=>{const m=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),l(y=>!y))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),d.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[d.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(Mu,{width:16,height:18,style:{color:"var(--fg)"}}),d.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",d.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(Nw,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>_e("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.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:h?"var(--fg)":"var(--fg-3)",background:h?"var(--bg-hover)":"transparent"},children:[m.label,h&&d.jsx("span",{className:"kbd",children:m.kbd})]})},m.to))}),d.jsxs("div",{className:"flex items-center",style:{gap:6},children:[d.jsxs("button",{type:"button",onClick:()=>l(!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:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(Wd,{className:"h-4 w-4"}),d.jsx("span",{children:"Jump to…"}),d.jsx("span",{className:"kbd",children:"⌘K"})]}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx(Q3,{}),d.jsx(K3,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)] text-body",style:{padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",borderRadius:"var(--radius-input)",gap:6},"aria-label":"Log out",children:d.jsx(ZT,{className:"h-4 w-4"})})]})]}),d.jsx(q3,{open:a,onOpenChange:l}),f?d.jsx(Pp,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:d.jsx(Pp,{})})})]})}function ie(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.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 u(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(u,"init",{value:a}),Object.defineProperty(u,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(u,"name",{value:e}),u}class As extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const nj={};function _i(e){return nj}function rj(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 Jp(e,t){return typeof t=="bigint"?t.toString():t}function lf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hg(e){return e==null}function Zg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function J3(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,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const d1=Symbol("evaluating");function ft(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==d1)return a===void 0&&(a=d1,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function Cl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function f1(e){return JSON.stringify(e)}function W3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const aj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const eM=lf(()=>{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(bu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(bu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ij(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const tM=new Set(["string","number","symbol"]);function Hs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Ae(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function nM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const rM={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 aM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=zi(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return Cl(this,"shape",u),u},checks:[]});return Oi(e,o)}function iM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=zi(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Cl(this,"shape",u),u},checks:[]});return Oi(e,o)}function lM(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 u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=zi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Cl(this,"shape",o),o}});return Oi(e,l)}function sM(e,t){if(!qs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Cl(this,"shape",a),a}});return Oi(e,n)}function oM(e,t){const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Cl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Oi(e,n)}function uM(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 u=zi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return Cl(this,"shape",m),m},checks:[]});return Oi(t,u)}function cM(e,t,n){const a=zi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return Cl(this,"shape",o),o}});return Oi(t,a)}function js(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 Cs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function hd(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ai(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=hd((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??hd((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??hd((m=n.customError)==null?void 0:m.call(n,e))??hd((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 Vg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const lj=(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,Jp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},sj=ie("$ZodError",lj),oj=ie("$ZodError",lj,{Parent:Error});function dM(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 fM(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(u=>a({issues:u}));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 u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),n}const Qg=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new As;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ai(m,o,_i())));throw aj(f,l==null?void 0:l.callee),f}return u.value},Gg=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ai(m,o,_i())));throw aj(f,l==null?void 0:l.callee),f}return u.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 As;return o.issues.length?{success:!1,error:new(e??sj)(o.issues.map(u=>Ai(u,l,_i())))}:{success:!0,data:o.value}},hM=sf(oj),of=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(u=>Ai(u,l,_i())))}:{success:!0,data:o.value}},mM=of(oj),pM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qg(e)(t,n,l)},gM=e=>(t,n,a)=>Qg(e)(t,n,a),yM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gg(e)(t,n,l)},vM=e=>async(t,n,a)=>Gg(e)(t,n,a),bM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return sf(e)(t,n,l)},xM=e=>(t,n,a)=>sf(e)(t,n,a),SM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return of(e)(t,n,l)},wM=e=>async(t,n,a)=>of(e)(t,n,a),kM=/^[cC][^\s-]{8,}$/,jM=/^[0-9a-z]+$/,CM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,EM=/^[0-9a-vA-V]{20}$/,NM=/^[A-Za-z0-9]{27}$/,_M=/^[a-zA-Z0-9_-]{21}$/,AM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,TM=/^([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})$/,h1=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)$/,RM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OM(){return new RegExp(zM,"u")}const MM=/^(?:(?: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])$/,DM=/^(([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}|:))$/,LM=/^((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])$/,IM=/^(([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])$/,UM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uj=/^[A-Za-z0-9_-]*$/,BM=/^\+[1-9]\d{6,14}$/,cj="(?:(?:\\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])))",PM=new RegExp(`^${cj}$`);function dj(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 $M(e){return new RegExp(`^${dj(e)}$`)}function FM(e){const t=dj({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(`^${cj}T(?:${a})$`)}const qM=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}$`)},HM=/^-?\d+$/,fj=/^-?\d+(?:\.\d+)?$/,ZM=/^(?:true|false)$/i,VM=/^[^A-Z]*$/,QM=/^[^a-z]*$/,$n=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hj={number:"number",bigint:"bigint",object:"date"},mj=ie("$ZodCheckLessThan",(e,t)=>{$n.init(e,t);const n=hj[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})}}),pj=ie("$ZodCheckGreaterThan",(e,t)=>{$n.init(e,t);const n=hj[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})}}),GM=ie("$ZodCheckMultipleOf",(e,t)=>{$n.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):J3(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})}}),KM=ie("$ZodCheckNumberFormat",(e,t)=>{var u;$n.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),a=n?"int":"number",[l,o]=rM[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=HM)}),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})}}),YM=ie("$ZodCheckMaxLength",(e,t)=>{var n;$n.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(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 u=Vg(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),XM=ie("$ZodCheckMinLength",(e,t)=>{var n;$n.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(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 u=Vg(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),JM=ie("$ZodCheckLengthEquals",(e,t)=>{var n;$n.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Hg(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 u=Vg(l),f=o>t.length;a.issues.push({origin:u,...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})}}),uf=ie("$ZodCheckStringFormat",(e,t)=>{var n,a;$n.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=()=>{})}),WM=ie("$ZodCheckRegex",(e,t)=>{uf.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})}}),eD=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=VM),uf.init(e,t)}),tD=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=QM),uf.init(e,t)}),nD=ie("$ZodCheckIncludes",(e,t)=>{$n.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})}}),rD=ie("$ZodCheckStartsWith",(e,t)=>{$n.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})}}),aD=ie("$ZodCheckEndsWith",(e,t)=>{$n.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})}}),iD=ie("$ZodCheckOverwrite",(e,t)=>{$n.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class lD{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(`
305
- `).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}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(`
306
- `))}}const sD={major:4,minor:3,patch:6},zt=ie("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sD;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(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=js(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const S=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new As;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==S&&(y||(y=js(f,S)))});else{if(f.issues.length===S)continue;y||(y=js(f,S))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(js(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new As;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=>u(g,f,m)):u(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new As;return h.then(y=>o(y,a,m))}return o(h,a,m)}}ft(e,"~standard",()=>({validate:o=>{var u;try{const f=hM(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return mM(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}))}),Kg=ie("$ZodString",(e,t)=>{var n;zt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??qM(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Tt=ie("$ZodStringFormat",(e,t)=>{uf.init(e,t),Kg.init(e,t)}),oD=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=TM),Tt.init(e,t)}),uD=ie("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=h1(a))}else t.pattern??(t.pattern=h1());Tt.init(e,t)}),cD=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=RM),Tt.init(e,t)}),dD=ie("$ZodURL",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),fD=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=OM()),Tt.init(e,t)}),hD=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_M),Tt.init(e,t)}),mD=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=kM),Tt.init(e,t)}),pD=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jM),Tt.init(e,t)}),gD=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=CM),Tt.init(e,t)}),yD=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=EM),Tt.init(e,t)}),vD=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=NM),Tt.init(e,t)}),bD=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=FM(t)),Tt.init(e,t)}),xD=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=PM),Tt.init(e,t)}),SD=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$M(t)),Tt.init(e,t)}),wD=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=AM),Tt.init(e,t)}),kD=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=MM),Tt.init(e,t),e._zod.bag.format="ipv4"}),jD=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=DM),Tt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),CD=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=LM),Tt.init(e,t)}),ED=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=IM),Tt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>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 gj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const ND=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=UM),Tt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{gj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function _D(e){if(!uj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return gj(n)}const AD=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=uj),Tt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{_D(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),TD=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=BM),Tt.init(e,t)});function RD(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 zD=ie("$ZodJWT",(e,t)=>{Tt.init(e,t),e._zod.check=n=>{RD(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),yj=ie("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??fj,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}}),OD=ie("$ZodNumberFormat",(e,t)=>{KM.init(e,t),yj.init(e,t)}),MD=ie("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=ZM,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}}),DD=ie("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),LD=ie("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function m1(e,t,n){e.issues.length&&t.issues.push(...Cs(n,e.issues)),t.value[n]=e.value}const ID=ie("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>m1(h,n,u))):m1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function Id(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...Cs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function vj(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=nM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bj(e,t,n,a,l,o){const u=[],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"){u.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(S=>Id(S,n,g,t,y))):Id(b,n,g,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const UD=ie("$ZodObject",(e,t)=>{zt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=lf(()=>vj(t));ft(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=bu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=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=u.shape;for(const b of u.keys){const S=g[b],k=S._zod.optout==="optional",j=S._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>Id(E,f,b,h,k))):Id(j,f,b,h,k)}return o?bj(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),BD=ie("$ZodObjectJIT",(e,t)=>{UD.init(e,t);const n=e._zod.parse,a=lf(()=>vj(t)),l=b=>{var O;const S=new lD(["shape","payload","ctx"]),k=a.value,j=P=>{const L=f1(P);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};S.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const P of k.keys)E[P]=`key_${C++}`;S.write("const newResult = {};");for(const P of k.keys){const L=E[P],R=f1(P),M=b[P],Z=((O=M==null?void 0:M._zod)==null?void 0:O.optout)==="optional";S.write(`const ${L} = ${j(P)};`),Z?S.write(`
307
- if (${L}.issues.length) {
308
- if (${R} in input) {
309
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
310
- ...iss,
311
- path: iss.path ? [${R}, ...iss.path] : [${R}]
312
- })));
313
- }
314
- }
315
-
316
- if (${L}.value === undefined) {
317
- if (${R} in input) {
318
- newResult[${R}] = undefined;
319
- }
320
- } else {
321
- newResult[${R}] = ${L}.value;
322
- }
323
-
324
- `):S.write(`
325
- if (${L}.issues.length) {
326
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
327
- ...iss,
328
- path: iss.path ? [${R}, ...iss.path] : [${R}]
329
- })));
330
- }
331
-
332
- if (${L}.value === undefined) {
333
- if (${R} in input) {
334
- newResult[${R}] = undefined;
335
- }
336
- } else {
337
- newResult[${R}] = ${L}.value;
338
- }
339
-
340
- `)}S.write("payload.value = newResult;"),S.write("return payload;");const T=S.compile();return(P,L)=>T(b,P,L)};let o;const u=bu,f=!nj.jitless,h=f&&eM.value,y=t.catchall;let g;e._zod.parse=(b,S)=>{g??(g=a.value);const k=b.value;return u(k)?f&&h&&(S==null?void 0:S.async)===!1&&S.jitless!==!0?(o||(o=l(t.shape)),b=o(b,S),y?bj([],k,b,S,g,e):b):n(b,S):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function p1(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=>!js(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(u=>Ai(u,a,_i())))}),t)}const xj=ie("$ZodUnion",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ft(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ft(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ft(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>Zg(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 u=!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),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>p1(m,l,e,o)):p1(f,l,e,o)}}),PD=ie("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xj.init(e,t);const n=e._zod.parse;ft(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=lf(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[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 u=l.value;if(!bu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[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:u,path:[t.discriminator],inst:e}),l)}}),$D=ie("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>g1(n,m,h)):g1(n,o,u)}});function Wp(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 u=Wp(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.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],u=Wp(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function g1(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}),js(e))return e;const u=Wp(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const FD=ie("$ZodRecord",(e,t)=>{zt.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=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)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(...Cs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...Cs(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"&&fj.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=>Ai(g,a,_i())),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(...Cs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...Cs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),qD=ie("$ZodEnum",(e,t)=>{zt.init(e,t);const n=rj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>tM.has(typeof l)).map(l=>typeof l=="string"?Hs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),HD=ie("$ZodLiteral",(e,t)=>{if(zt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?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}}),ZD=ie("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new tj(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new As;return n.value=l,n}});function y1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Sj=ie("$ZodOptional",(e,t)=>{zt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zg(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=>y1(o,n.value)):y1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),VD=ie("$ZodExactOptional",(e,t)=>{Sj.init(e,t),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),QD=ie("$ZodNullable",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zg(n.source)}|null)$`):void 0}),ft(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),GD=ie("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>v1(o,t)):v1(l,t)}});function v1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const KD=ie("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),YD=ie("$ZodNonOptional",(e,t)=>{zt.init(e,t),ft(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>b1(o,e)):b1(l,e)}});function b1(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 XD=ie("$ZodCatch",(e,t)=>{zt.init(e,t),ft(e._zod,"optin",()=>t.innerType._zod.optin),ft(e._zod,"optout",()=>t.innerType._zod.optout),ft(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>Ai(u,a,_i()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ai(o,a,_i()))},input:n.value}),n.issues=[]),n)}}),JD=ie("$ZodPipe",(e,t)=>{zt.init(e,t),ft(e._zod,"values",()=>t.in._zod.values),ft(e._zod,"optin",()=>t.in._zod.optin),ft(e._zod,"optout",()=>t.out._zod.optout),ft(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(u=>md(u,t.in,a)):md(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>md(o,t.out,a)):md(l,t.out,a)}});function md(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const WD=ie("$ZodReadonly",(e,t)=>{zt.init(e,t),ft(e._zod,"propValues",()=>t.innerType._zod.propValues),ft(e._zod,"values",()=>t.innerType._zod.values),ft(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ft(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(x1):x1(l)}});function x1(e){return e.value=Object.freeze(e.value),e}const e4=ie("$ZodCustom",(e,t)=>{$n.init(e,t),zt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>S1(o,n,a,e));S1(l,n,a,e)}});function S1(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(xu(l))}}var w1;class t4{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 n4(){return new t4}(w1=globalThis).__zod_globalRegistry??(w1.__zod_globalRegistry=n4());const au=globalThis.__zod_globalRegistry;function r4(e,t){return new e({type:"string",...Ae(t)})}function a4(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(t)})}function k1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(t)})}function i4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(t)})}function l4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(t)})}function s4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(t)})}function o4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(t)})}function u4(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(t)})}function c4(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(t)})}function d4(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(t)})}function f4(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(t)})}function h4(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(t)})}function m4(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(t)})}function p4(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(t)})}function g4(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(t)})}function y4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(t)})}function v4(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(t)})}function b4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(t)})}function x4(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(t)})}function S4(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(t)})}function w4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(t)})}function k4(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(t)})}function j4(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(t)})}function C4(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(t)})}function E4(e,t){return new e({type:"string",format:"date",check:"string_format",...Ae(t)})}function N4(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(t)})}function _4(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ae(t)})}function A4(e,t){return new e({type:"number",checks:[],...Ae(t)})}function T4(e,t){return new e({type:"number",coerce:!0,checks:[],...Ae(t)})}function R4(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(t)})}function z4(e,t){return new e({type:"boolean",...Ae(t)})}function O4(e){return new e({type:"unknown"})}function M4(e,t){return new e({type:"never",...Ae(t)})}function j1(e,t){return new mj({check:"less_than",...Ae(t),value:e,inclusive:!1})}function Ym(e,t){return new mj({check:"less_than",...Ae(t),value:e,inclusive:!0})}function C1(e,t){return new pj({check:"greater_than",...Ae(t),value:e,inclusive:!1})}function Xm(e,t){return new pj({check:"greater_than",...Ae(t),value:e,inclusive:!0})}function E1(e,t){return new GM({check:"multiple_of",...Ae(t),value:e})}function wj(e,t){return new YM({check:"max_length",...Ae(t),maximum:e})}function Ud(e,t){return new XM({check:"min_length",...Ae(t),minimum:e})}function kj(e,t){return new JM({check:"length_equals",...Ae(t),length:e})}function D4(e,t){return new WM({check:"string_format",format:"regex",...Ae(t),pattern:e})}function L4(e){return new eD({check:"string_format",format:"lowercase",...Ae(e)})}function I4(e){return new tD({check:"string_format",format:"uppercase",...Ae(e)})}function U4(e,t){return new nD({check:"string_format",format:"includes",...Ae(t),includes:e})}function B4(e,t){return new rD({check:"string_format",format:"starts_with",...Ae(t),prefix:e})}function P4(e,t){return new aD({check:"string_format",format:"ends_with",...Ae(t),suffix:e})}function Ws(e){return new iD({check:"overwrite",tx:e})}function $4(e){return Ws(t=>t.normalize(e))}function F4(){return Ws(e=>e.trim())}function q4(){return Ws(e=>e.toLowerCase())}function H4(){return Ws(e=>e.toUpperCase())}function Z4(){return Ws(e=>W3(e))}function V4(e,t,n){return new e({type:"array",element:t,...Ae(n)})}function Q4(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ae(n)})}function G4(e){const t=K4(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(xu(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(xu(l))}},e(n.value,n)));return t}function K4(e,t){const n=new $n({check:"custom",...Ae(t)});return n._zod.check=e,n}function jj(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)??au,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 Gt(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 u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)u.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,b);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const S=e._zod.parent;S&&(u.ref||(u.ref=S),Gt(S,t,b),t.seen.get(S).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&kn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function Cj(e,t){var u,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=(u=e.metadataRegistry.get(y[0]))==null?void 0:u.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 E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const T=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=T,{defId:T,ref:`${C("__shared")}#/${g}/${T}`}}if(y[1]===n)return{ref:"#"};const S=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:S+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:S}=l(y);g.def={...g.schema},S&&(g.defId=S);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>
341
-
342
- 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 S=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&S){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 Ej(e,t){var u,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},S=y.ref;if(y.ref=null,S){a(S);const j=e.seen.get(S),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,b),h._zod.parent===S)for(const T in g)T==="$ref"||T==="allOf"||T in b||delete g[T];if(E.$ref&&j.def)for(const T in g)T==="$ref"||T==="allOf"||T in j.def&&JSON.stringify(g[T])===JSON.stringify(j.def[T])&&delete g[T]}const k=h._zod.parent;if(k&&k!==S){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}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,(u=e.external)!=null&&u.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:Bd(t,"input",e.processors),output:Bd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function kn(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 kn(a.element,n);if(a.type==="set")return kn(a.valueType,n);if(a.type==="lazy")return kn(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 kn(a.innerType,n);if(a.type==="intersection")return kn(a.left,n)||kn(a.right,n);if(a.type==="record"||a.type==="map")return kn(a.keyType,n)||kn(a.valueType,n);if(a.type==="pipe")return kn(a.in,n)||kn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(kn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(kn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(kn(l,n))return!0;return!!(a.rest&&kn(a.rest,n))}return!1}const Y4=(e,t={})=>n=>{const a=jj({...n,processors:t});return Gt(e,a),Cj(a,e),Ej(a,e)},Bd=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=jj({...l??{},target:o,io:t,processors:n});return Gt(e,u),Cj(u,e),Ej(u,e)},X4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},J4=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=X4[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}))])}},W4=(e,t,n,a)=>{const l=n,{minimum:o,maximum:u,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 u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},e5=(e,t,n,a)=>{n.type="boolean"},t5=(e,t,n,a)=>{n.not={}},n5=(e,t,n,a)=>{},r5=(e,t,n,a)=>{const l=e._zod.def,o=rj(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},a5=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},i5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},l5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},s5=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Gt(o.element,t,{...a,path:[...a.path,"items"]})},o5=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const y in u)l.properties[y]=Gt(u[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(u)),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=Gt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},u5=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Gt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},c5=(e,t,n,a)=>{const l=e._zod.def,o=Gt(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Gt(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(u)?u.allOf:[u]];n.allOf=m},d5=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Gt(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=Gt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Gt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},f5=(e,t,n,a)=>{const l=e._zod.def,o=Gt(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},h5=(e,t,n,a)=>{const l=e._zod.def;Gt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},m5=(e,t,n,a)=>{const l=e._zod.def;Gt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},p5=(e,t,n,a)=>{const l=e._zod.def;Gt(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)))},g5=(e,t,n,a)=>{const l=e._zod.def;Gt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},y5=(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;Gt(o,t,a);const u=t.seen.get(e);u.ref=o},v5=(e,t,n,a)=>{const l=e._zod.def;Gt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},Nj=(e,t,n,a)=>{const l=e._zod.def;Gt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},b5=ie("ZodISODateTime",(e,t)=>{bD.init(e,t),Mt.init(e,t)});function x5(e){return C4(b5,e)}const S5=ie("ZodISODate",(e,t)=>{xD.init(e,t),Mt.init(e,t)});function w5(e){return E4(S5,e)}const k5=ie("ZodISOTime",(e,t)=>{SD.init(e,t),Mt.init(e,t)});function j5(e){return N4(k5,e)}const C5=ie("ZodISODuration",(e,t)=>{wD.init(e,t),Mt.init(e,t)});function E5(e){return _4(C5,e)}const N5=(e,t)=>{sj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>fM(e,n)},flatten:{value:n=>dM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Jp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Jp,2)}},isEmpty:{get(){return e.issues.length===0}}})},xr=ie("ZodError",N5,{Parent:Error}),_5=Qg(xr),A5=Gg(xr),T5=sf(xr),R5=of(xr),z5=pM(xr),O5=gM(xr),M5=yM(xr),D5=vM(xr),L5=bM(xr),I5=xM(xr),U5=SM(xr),B5=wM(xr),Ot=ie("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bd(e,"input"),output:Bd(e,"output")}}),e.toJSONSchema=Y4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(zi(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Oi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>_5(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>T5(e,n,a),e.parseAsync=async(n,a)=>A5(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>R5(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>z5(e,n,a),e.decode=(n,a)=>O5(e,n,a),e.encodeAsync=async(n,a)=>M5(e,n,a),e.decodeAsync=async(n,a)=>D5(e,n,a),e.safeEncode=(n,a)=>L5(e,n,a),e.safeDecode=(n,a)=>I5(e,n,a),e.safeEncodeAsync=async(n,a)=>U5(e,n,a),e.safeDecodeAsync=async(n,a)=>B5(e,n,a),e.refine=(n,a)=>e.check(z6(n,a)),e.superRefine=n=>e.check(O6(n)),e.overwrite=n=>e.check(Ws(n)),e.optional=()=>A1(e),e.exactOptional=()=>b6(e),e.nullable=()=>T1(e),e.nullish=()=>A1(T1(e)),e.nonoptional=n=>C6(e,n),e.array=()=>Bn(e),e.or=n=>Tj([e,n]),e.and=n=>h6(e,n),e.transform=n=>R1(e,y6(n)),e.default=n=>w6(e,n),e.prefault=n=>j6(e,n),e.catch=n=>N6(e,n),e.pipe=n=>R1(e,n),e.readonly=()=>T6(e),e.describe=n=>{const a=e.clone();return au.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=au.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return au.get(e);const a=e.clone();return au.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),_j=ie("_ZodString",(e,t)=>{Kg.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>J4(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(D4(...a)),e.includes=(...a)=>e.check(U4(...a)),e.startsWith=(...a)=>e.check(B4(...a)),e.endsWith=(...a)=>e.check(P4(...a)),e.min=(...a)=>e.check(Ud(...a)),e.max=(...a)=>e.check(wj(...a)),e.length=(...a)=>e.check(kj(...a)),e.nonempty=(...a)=>e.check(Ud(1,...a)),e.lowercase=a=>e.check(L4(a)),e.uppercase=a=>e.check(I4(a)),e.trim=()=>e.check(F4()),e.normalize=(...a)=>e.check($4(...a)),e.toLowerCase=()=>e.check(q4()),e.toUpperCase=()=>e.check(H4()),e.slugify=()=>e.check(Z4())}),P5=ie("ZodString",(e,t)=>{Kg.init(e,t),_j.init(e,t),e.email=n=>e.check(a4($5,n)),e.url=n=>e.check(u4(F5,n)),e.jwt=n=>e.check(j4(r6,n)),e.emoji=n=>e.check(c4(q5,n)),e.guid=n=>e.check(k1(N1,n)),e.uuid=n=>e.check(i4(pd,n)),e.uuidv4=n=>e.check(l4(pd,n)),e.uuidv6=n=>e.check(s4(pd,n)),e.uuidv7=n=>e.check(o4(pd,n)),e.nanoid=n=>e.check(d4(H5,n)),e.guid=n=>e.check(k1(N1,n)),e.cuid=n=>e.check(f4(Z5,n)),e.cuid2=n=>e.check(h4(V5,n)),e.ulid=n=>e.check(m4(Q5,n)),e.base64=n=>e.check(S4(e6,n)),e.base64url=n=>e.check(w4(t6,n)),e.xid=n=>e.check(p4(G5,n)),e.ksuid=n=>e.check(g4(K5,n)),e.ipv4=n=>e.check(y4(Y5,n)),e.ipv6=n=>e.check(v4(X5,n)),e.cidrv4=n=>e.check(b4(J5,n)),e.cidrv6=n=>e.check(x4(W5,n)),e.e164=n=>e.check(k4(n6,n)),e.datetime=n=>e.check(x5(n)),e.date=n=>e.check(w5(n)),e.time=n=>e.check(j5(n)),e.duration=n=>e.check(E5(n))});function z(e){return r4(P5,e)}const Mt=ie("ZodStringFormat",(e,t)=>{Tt.init(e,t),_j.init(e,t)}),$5=ie("ZodEmail",(e,t)=>{cD.init(e,t),Mt.init(e,t)}),N1=ie("ZodGUID",(e,t)=>{oD.init(e,t),Mt.init(e,t)}),pd=ie("ZodUUID",(e,t)=>{uD.init(e,t),Mt.init(e,t)}),F5=ie("ZodURL",(e,t)=>{dD.init(e,t),Mt.init(e,t)}),q5=ie("ZodEmoji",(e,t)=>{fD.init(e,t),Mt.init(e,t)}),H5=ie("ZodNanoID",(e,t)=>{hD.init(e,t),Mt.init(e,t)}),Z5=ie("ZodCUID",(e,t)=>{mD.init(e,t),Mt.init(e,t)}),V5=ie("ZodCUID2",(e,t)=>{pD.init(e,t),Mt.init(e,t)}),Q5=ie("ZodULID",(e,t)=>{gD.init(e,t),Mt.init(e,t)}),G5=ie("ZodXID",(e,t)=>{yD.init(e,t),Mt.init(e,t)}),K5=ie("ZodKSUID",(e,t)=>{vD.init(e,t),Mt.init(e,t)}),Y5=ie("ZodIPv4",(e,t)=>{kD.init(e,t),Mt.init(e,t)}),X5=ie("ZodIPv6",(e,t)=>{jD.init(e,t),Mt.init(e,t)}),J5=ie("ZodCIDRv4",(e,t)=>{CD.init(e,t),Mt.init(e,t)}),W5=ie("ZodCIDRv6",(e,t)=>{ED.init(e,t),Mt.init(e,t)}),e6=ie("ZodBase64",(e,t)=>{ND.init(e,t),Mt.init(e,t)}),t6=ie("ZodBase64URL",(e,t)=>{AD.init(e,t),Mt.init(e,t)}),n6=ie("ZodE164",(e,t)=>{TD.init(e,t),Mt.init(e,t)}),r6=ie("ZodJWT",(e,t)=>{zD.init(e,t),Mt.init(e,t)}),Yg=ie("ZodNumber",(e,t)=>{yj.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>W4(e,a,l),e.gt=(a,l)=>e.check(C1(a,l)),e.gte=(a,l)=>e.check(Xm(a,l)),e.min=(a,l)=>e.check(Xm(a,l)),e.lt=(a,l)=>e.check(j1(a,l)),e.lte=(a,l)=>e.check(Ym(a,l)),e.max=(a,l)=>e.check(Ym(a,l)),e.int=a=>e.check(_1(a)),e.safe=a=>e.check(_1(a)),e.positive=a=>e.check(C1(0,a)),e.nonnegative=a=>e.check(Xm(0,a)),e.negative=a=>e.check(j1(0,a)),e.nonpositive=a=>e.check(Ym(0,a)),e.multipleOf=(a,l)=>e.check(E1(a,l)),e.step=(a,l)=>e.check(E1(a,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ke(e){return A4(Yg,e)}const a6=ie("ZodNumberFormat",(e,t)=>{OD.init(e,t),Yg.init(e,t)});function _1(e){return R4(a6,e)}const i6=ie("ZodBoolean",(e,t)=>{MD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>e5(e,n,a)});function Du(e){return z4(i6,e)}const l6=ie("ZodUnknown",(e,t)=>{DD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>n5()});function bt(){return O4(l6)}const s6=ie("ZodNever",(e,t)=>{LD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>t5(e,n,a)});function o6(e){return M4(s6,e)}const u6=ie("ZodArray",(e,t)=>{ID.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>s5(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Ud(n,a)),e.nonempty=n=>e.check(Ud(1,n)),e.max=(n,a)=>e.check(wj(n,a)),e.length=(n,a)=>e.check(kj(n,a)),e.unwrap=()=>e.element});function Bn(e,t){return V4(u6,e,t)}const c6=ie("ZodObject",(e,t)=>{BD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>o5(e,n,a,l),ft(e,"shape",()=>t.shape),e.keyof=()=>tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bt()}),e.loose=()=>e.clone({...e._zod.def,catchall:bt()}),e.strict=()=>e.clone({...e._zod.def,catchall:o6()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>lM(e,n),e.safeExtend=n=>sM(e,n),e.merge=n=>oM(e,n),e.pick=n=>aM(e,n),e.omit=n=>iM(e,n),e.partial=(...n)=>uM(zj,e,n[0]),e.required=(...n)=>cM(Oj,e,n[0])});function me(e,t){const n={type:"object",shape:e??{},...Ae(t)};return new c6(n)}const Aj=ie("ZodUnion",(e,t)=>{xj.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>u5(e,n,a,l),e.options=t.options});function Tj(e,t){return new Aj({type:"union",options:e,...Ae(t)})}const d6=ie("ZodDiscriminatedUnion",(e,t)=>{Aj.init(e,t),PD.init(e,t)});function Rj(e,t,n){return new d6({type:"union",options:t,discriminator:e,...Ae(n)})}const f6=ie("ZodIntersection",(e,t)=>{$D.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>c5(e,n,a,l)});function h6(e,t){return new f6({type:"intersection",left:e,right:t})}const m6=ie("ZodRecord",(e,t)=>{FD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>d5(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function $t(e,t,n){return new m6({type:"record",keyType:e,valueType:t,...Ae(n)})}const eg=ie("ZodEnum",(e,t)=>{qD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(a,l,o)=>r5(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 u of a)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new eg({...t,checks:[],...Ae(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new eg({...t,checks:[],...Ae(l),entries:o})}});function tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new eg({type:"enum",entries:n,...Ae(t)})}const p6=ie("ZodLiteral",(e,t)=>{HD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>a5(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 En(e,t){return new p6({type:"literal",values:Array.isArray(e)?e:[e],...Ae(t)})}const g6=ie("ZodTransform",(e,t)=>{ZD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>l5(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new tj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(xu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(xu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function y6(e){return new g6({type:"transform",transform:e})}const zj=ie("ZodOptional",(e,t)=>{Sj.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Nj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function A1(e){return new zj({type:"optional",innerType:e})}const v6=ie("ZodExactOptional",(e,t)=>{VD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>Nj(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function b6(e){return new v6({type:"optional",innerType:e})}const x6=ie("ZodNullable",(e,t)=>{QD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>f5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function T1(e){return new x6({type:"nullable",innerType:e})}const S6=ie("ZodDefault",(e,t)=>{GD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>m5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function w6(e,t){return new S6({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ij(t)}})}const k6=ie("ZodPrefault",(e,t)=>{KD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>p5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function j6(e,t){return new k6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ij(t)}})}const Oj=ie("ZodNonOptional",(e,t)=>{YD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>h5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function C6(e,t){return new Oj({type:"nonoptional",innerType:e,...Ae(t)})}const E6=ie("ZodCatch",(e,t)=>{XD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>g5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function N6(e,t){return new E6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _6=ie("ZodPipe",(e,t)=>{JD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>y5(e,n,a,l),e.in=t.in,e.out=t.out});function R1(e,t){return new _6({type:"pipe",in:e,out:t})}const A6=ie("ZodReadonly",(e,t)=>{WD.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>v5(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function T6(e){return new A6({type:"readonly",innerType:e})}const R6=ie("ZodCustom",(e,t)=>{e4.init(e,t),Ot.init(e,t),e._zod.processJSONSchema=(n,a,l)=>i5(e,n)});function z6(e,t={}){return Q4(R6,e,t)}function O6(e){return G4(e)}const Jm={custom:"custom"};function cf(e){return T4(Yg,e)}const M6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function D6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function L6(e,t){const n=D6(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(M6)){const u=o[1];if(!u)continue;const f=a.get(u.toLowerCase());f&&l.add(f)}return[...l]}const I6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},Mj=tt(["feishu","slack","kael"]),Dj=tt(["active","inactive"]);me({platform:Mj,agentId:z().min(1),credentials:$t(z(),bt()),status:Dj.default("active")});me({agentId:z().min(1).optional(),credentials:$t(z(),bt()).optional(),status:Dj.optional()});me({id:Ke(),platform:z(),agentId:z(),hasCredentials:Du(),status:z(),createdAt:z(),updatedAt:z()});const U6=tt(["code","reverse_token","oauth","manual"]);me({appId:z().min(1),appSecret:z().min(1)});me({platform:Mj,externalUserId:z().min(1),agentId:z().min(1),boundVia:U6.default("manual"),displayName:z().max(200).optional()});me({id:Ke(),platform:z(),externalUserId:z(),agentId:z(),boundVia:z().nullable(),displayName:z().nullable(),createdAt:z()});me({feishuUserId:z().min(1),displayName:z().max(200).optional()});me({configId:Ke(),platform:z(),agentId:z(),appId:z(),connected:Du(),lastActiveAt:z().nullable()});const Lj=tt(["online","offline"]),Ij=tt(["idle","working","blocked","error"]);tt(["active","suspended","evicted"]);const B6=tt(["active","suspended"]);me({chatId:z().min(1),state:B6});me({runtimeState:Ij});me({agentId:z().min(1),runtimeType:z().max(50),runtimeVersion:z().max(50).optional()});tt(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);me({agentId:z(),status:Lj,connectedAt:z().nullable(),lastSeenAt:z(),clientId:z().nullable().optional(),runtimeType:z().nullable().optional(),runtimeVersion:z().nullable().optional(),runtimeState:Ij.nullable().optional(),activeSessions:Ke().int().nullable().optional(),totalSessions:Ke().int().nullable().optional(),runtimeUpdatedAt:z().nullable().optional()});me({total:Ke().int(),running:Ke().int(),byState:me({idle:Ke().int(),working:Ke().int(),blocked:Ke().int(),error:Ke().int()}),clients:Ke().int()});const P6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},df=tt(["human","personal_assistant","autonomous_agent"]),z1={PRIVATE:"private",ORGANIZATION:"organization"},Xg=tt(["private","organization"]),$6=tt(["admin-api","portal"]);tt(["active","suspended"]);const tg=/^[a-z0-9][a-z0-9_-]{0,63}$/,Es=64,F6=["admin","agent","first-tree","hub","me","null","system","undefined"],q6=new Set(F6);function ng(e){return q6.has(e)}me({name:z().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=>!ng(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:df,displayName:z().min(1).max(200).optional(),delegateMention:z().max(100).optional(),organizationId:z().max(100).optional(),source:$6.optional(),visibility:Xg.optional(),metadata:$t(z(),bt()).optional(),managerId:z().optional(),clientId:z().min(1).max(100).optional()});me({type:df.optional(),displayName:z().min(1).max(200).optional(),delegateMention:z().max(100).nullable().optional(),visibility:Xg.optional(),metadata:$t(z(),bt()).optional(),managerId:z().nullable().optional(),clientId:z().min(1).max(100).nullable().optional()});me({uuid:z(),name:z().nullable(),organizationId:z(),type:df,displayName:z(),delegateMention:z().nullable(),inboxId:z(),status:z(),source:z().nullable().optional(),visibility:Xg,metadata:$t(z(),bt()),managerId:z().nullable(),clientId:z().nullable(),presenceStatus:Lj.optional(),createdAt:z(),updatedAt:z()});me({repo:z().nullable(),branch:z().nullable()});me({type:En("agent:pinned"),agentId:z(),name:z().nullable(),displayName:z(),agentType:df});const H6=32e3,Jg=/^[a-z0-9][a-z0-9_-]{0,63}$/i,Z6=/^[A-Z][A-Z0-9_]*$/,V6=me({append:z().max(H6).default("")}),Q6=me({name:z().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:En("stdio"),command:z().min(1),args:Bn(z()).optional()}),G6=me({name:z().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:En("http"),url:z().url(),headers:$t(z(),z()).optional()}),K6=me({name:z().regex(Jg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:En("sse"),url:z().url(),headers:$t(z(),z()).optional()}),Y6=Rj("transport",[Q6,G6,K6]),X6=me({key:z().regex(Z6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:z(),sensitive:Du().default(!1)}),J6=me({url:z().min(1),ref:z().min(1).optional(),localPath:z().min(1).optional()}),Wg=me({prompt:V6.default({append:""}),model:z().default("opus"),mcpServers:Bn(Y6).default([]),env:Bn(X6).default([]),gitRepos:Bn(J6).default([])}),W6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:Jm.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:Jm.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??$d(o.url);f&&(l.has(f)&&t.addIssue({code:Jm.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},Uj=Wg.superRefine(W6),eL=me({agentId:z(),version:Ke().int().positive(),payload:Uj,updatedAt:z(),updatedBy:z()});me({expectedVersion:Ke().int().positive(),payload:Wg.partial()});me({payload:Wg.partial()});me({current:eL,next:Uj,diff:Bn(me({path:z(),op:tt(["add","remove","replace"]),before:bt().optional(),after:bt().optional()}))});const Pd="***";function $d(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}me({username:z().min(1),password:z().min(1)});me({accessToken:z(),refreshToken:z()});me({refreshToken:z().min(1)});me({token:z().min(1)});me({token:z(),expiresIn:Ke(),command:z()});const tL=tt(["direct","group","thread"]);me({type:tL,topic:z().max(500).optional(),participantIds:Bn(z()).min(1),metadata:$t(z(),bt()).optional()});const Bj=me({agentId:z(),role:z(),mode:z(),joinedAt:z()});Bj.extend({name:z().nullable(),displayName:z(),type:z()});const nL=me({id:z(),organizationId:z(),type:z(),topic:z().nullable(),lifecyclePolicy:z().nullable().optional(),metadata:$t(z(),bt()),createdAt:z(),updatedAt:z()});nL.extend({participants:Bn(Bj)});me({topic:z().trim().max(500).nullable()});me({agentId:z().min(1),mode:tt(["full","mention_only"]).default("full")});me({agentId:z().min(1)});const rL=tt(["connected","disconnected"]);me({id:z(),userId:z().nullable(),status:rL,sdkVersion:z().max(50).nullable(),hostname:z().max(100).nullable(),os:z().max(50).nullable(),agentCount:Ke().int().min(0),connectedAt:z().nullable(),lastSeenAt:z(),metadata:$t(z(),bt()).nullable()});me({clientId:z().min(1).max(100),hostname:z().max(100).optional(),os:z().max(50).optional(),sdkVersion:z().max(50).optional()});me({limit:cf().int().min(1).max(100).default(20),cursor:z().optional()});const aL=["image/png","image/jpeg","image/gif","image/webp"],ey=tt(aL);me({data:z().min(1),mimeType:ey,filename:z().min(1),size:Ke().int().nonnegative().optional(),imageId:z().uuid().optional()});me({imageId:z().uuid(),mimeType:ey,filename:z().min(1),size:Ke().int().nonnegative().optional()});me({type:En("image_payload"),imageId:z().uuid(),chatId:z(),base64:z().min(1),mimeType:ey,filename:z().min(1),size:Ke().int().nonnegative().optional()});const ty=tt(["hub_ui","cli","feishu","github","api"]),Pj=tt(["text","markdown","card","reference","file","task"]);me({format:Pj.default("text"),content:bt(),metadata:$t(z(),bt()).optional(),inReplyTo:z().optional(),replyToInbox:z().optional(),replyToChat:z().optional(),source:ty.optional()});me({format:Pj.default("text"),content:bt(),metadata:$t(z(),bt()).optional(),replyToInbox:z().optional(),replyToChat:z().optional(),source:ty.optional()});const iL=me({id:z(),chatId:z(),senderId:z(),format:z(),content:bt(),metadata:$t(z(),bt()),replyToInbox:z().nullable(),replyToChat:z().nullable(),inReplyTo:z().nullable(),source:ty.nullable(),createdAt:z()}),lL=me({senderId:z(),chatId:z(),replyToChat:z().nullable()}).nullable(),sL=tt(["full","mention_only"]),oL=me({id:z(),senderId:z(),format:z(),content:bt(),metadata:$t(z(),bt()).default({}),createdAt:z()}),uL=iL.extend({configVersion:Ke().int().positive(),recipientMode:sL.default("full"),inReplyToSnapshot:lL.default(null),precedingMessages:Bn(oL).default([])});tt(["pending","delivered","acked","failed"]);const cL=me({id:Ke(),inboxId:z(),messageId:z(),chatId:z().nullable(),status:z(),retryCount:Ke(),createdAt:z(),deliveredAt:z().nullable(),ackedAt:z().nullable()});cL.extend({message:uL});me({limit:cf().int().min(1).max(50).default(10)});const dL={ADMIN:"admin",MEMBER:"member"},ny=tt(["admin","member"]),fL=me({id:z(),userId:z(),organizationId:z(),agentId:z(),role:ny,createdAt:z()});me({username:z().min(1).max(100),displayName:z().min(1).max(200),role:ny.default("member")});me({role:ny.optional(),displayName:z().min(1).max(200).optional()});fL.extend({username:z(),displayName:z(),password:z()});const hL=tt(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),$j=tt(["high","medium","low"]);me({id:z(),organizationId:z(),type:hL,severity:$j,agentId:z().nullable(),chatId:z().nullable(),message:z(),read:Du(),createdAt:z()});me({limit:cf().int().min(1).max(100).default(20),cursor:z().optional(),severity:$j.optional(),read:tt(["true","false"]).transform(e=>e==="true").optional(),agentId:z().optional()});const Fj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;me({name:z().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=>!Fj.test(e),"Name must not be a UUID format"),displayName:z().min(1).max(200),maxAgents:Ke().int().min(0).default(0),maxMessagesPerMinute:Ke().int().min(0).default(0),features:$t(z(),bt()).default({})});me({name:z().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=>!Fj.test(e),"Name must not be a UUID format").optional(),displayName:z().min(1).max(200).optional(),maxAgents:Ke().int().min(0).optional(),maxMessagesPerMinute:Ke().int().min(0).optional(),features:$t(z(),bt()).optional()});me({id:z(),name:z(),displayName:z(),maxAgents:Ke(),maxMessagesPerMinute:Ke(),features:$t(z(),bt()),createdAt:z(),updatedAt:z()});const mL=me({workingCount:Ke().int().nonnegative(),errorMask:Du()}),pL=me({type:En("pulse:tick"),organizationId:z(),agents:$t(z(),Bn(mL).length(32))}),gL=tt(["tool_call","error","assistant_text","thinking","turn_end"]),qj=me({toolUseId:z(),name:z(),args:bt(),status:tt(["pending","ok","error"]),durationMs:Ke().int().nonnegative().optional(),resultPreview:z().max(400).optional()}),Hj=me({source:tt(["sdk","runtime","tool"]),message:z().max(2e3)}),Zj=me({text:z().max(8e3)}),Vj=me({}),Qj=me({status:tt(["success","error"])}),yL=Rj("kind",[me({kind:En("tool_call"),payload:qj}),me({kind:En("error"),payload:Hj}),me({kind:En("assistant_text"),payload:Zj}),me({kind:En("thinking"),payload:Vj}),me({kind:En("turn_end"),payload:Qj})]);me({id:z(),agentId:z(),chatId:z(),seq:Ke().int().positive(),kind:gL,payload:Tj([qj,Hj,Zj,Vj,Qj]),createdAt:z()});me({agentId:z(),chatId:z(),event:yL});me({agentId:z(),chatId:z()});me({type:En("session:reconcile"),agentId:z().min(1),chatIds:Bn(z().min(1)).max(500)});me({type:En("session:reconcile:result"),agentId:z().min(1),staleChatIds:Bn(z().min(1))});const vL=me({organizationId:z(),agentCount:Ke(),chatCount:Ke(),messageCount:Ke()});me({totalAgents:Ke(),totalChats:Ke(),totalMessages:Ke(),byOrganization:Bn(vL)});me({key:z(),value:bt(),updatedAt:z()});$t(z(),bt());const ki={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Ad={[ki.INBOX_TIMEOUT_SECONDS]:300,[ki.MAX_RETRY_COUNT]:3,[ki.POLLING_INTERVAL_SECONDS]:5,[ki.PRESENCE_CLEANUP_SECONDS]:60},Su=tt(["pending","assigned","working","completed","failed","cancelled"]),O1=tt(["agent","admin"]),bL=tt(["assigned","status_changed","cancelled"]);me({taskId:z(),event:bL,title:z(),body:z().default(""),status:Su,fromStatus:Su.optional(),originRef:z().nullable().optional()});const xL=me({title:z().min(1).max(500),body:z().optional(),assigneeAgentId:z().optional(),originRef:z().max(500).optional(),metadata:$t(z(),bt()).optional()});xL.extend({organizationId:z().optional()});me({status:tt(["working","completed","failed"]),result:z().optional()});me({assigneeAgentId:z().nullable().optional(),status:Su.optional(),result:z().optional()});me({chatId:z().min(1)});const SL=me({id:z(),organizationId:z(),title:z(),body:z(),status:Su,assigneeAgentId:z().nullable(),createdByType:O1,createdById:z(),originRef:z().nullable(),result:z().nullable(),metadata:$t(z(),bt()),createdAt:z(),updatedAt:z(),cancelledAt:z().nullable(),cancelledByType:O1.nullable(),cancelledById:z().nullable()}),wL=me({taskId:z(),chatId:z(),linkedByAgentId:z().nullable(),linkedAt:z()});SL.extend({chats:Bn(wL)});me({status:Su.optional(),assigneeAgentId:z().optional(),originRef:z().optional(),limit:cf().int().min(1).max(100).default(20),cursor:z().optional()});const kL=tt(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);me({taskId:z(),signal:kL,reason:z()});const jL=tt(["active","suspended"]);me({id:z(),username:z(),displayName:z(),avatarUrl:z().nullable(),status:jL,createdAt:z(),updatedAt:z()});me({username:z().min(1).max(100),displayName:z().min(1).max(200),password:z().min(8).max(200)});me({displayName:z().min(1).max(200).optional(),password:z().min(8).max(200).optional()});me({type:En("auth"),token:z().min(1)});me({type:En("server:welcome"),serverCommandVersion:z().min(1),serverTimeMs:Ke().int().nonnegative()}).passthrough();const Gj=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function CL(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 EL=2e3,NL=3e4;let hi=null,Fd=!1,Wm=0,su=null;const rg=new Set;let iu=null,Ns=0;function _L(e){for(const t of rg)try{t(e)}catch{}iu&&(e.type==="notification"?iu.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(iu.invalidateQueries({queryKey:["activity"]}),iu.invalidateQueries({queryKey:["sessions"]})))}function Kj(){const e=Og();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);_L(o)}catch{}},a.onopen=()=>{a===hi&&(Wm=0)},a.onclose=()=>{if(a!==hi||(hi=null,Fd||Ns===0))return;Wm++;const l=Math.min(EL*2**(Wm-1),NL);su=setTimeout(()=>{su=null,!Fd&&Ns>0&&Kj()},l)}}function AL(){Fd=!0,su&&(clearTimeout(su),su=null),hi&&(hi.close(1e3,"unmount"),hi=null)}function Yj(e){const{onMessage:t,enabled:n=!0}=e??{},a=er(),l=x.useRef(t);l.current=t,x.useEffect(()=>{iu=a},[a]),x.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return rg.add(o),Ns++,Ns===1&&(Fd=!1,Kj()),()=>{rg.delete(o),Ns--,Ns===0&&AL()}},[n])}const Xj=x.createContext({aggregated:Gj,agents:{},receivedAtMs:null,stale:!0});function TL({children:e}){const[t,n]=x.useState({aggregated:Gj,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());Yj({onMessage:u=>{const f=pL.safeParse(u);f.success&&n({aggregated:CL(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return d.jsx(Xj.Provider,{value:o,children:e})}function RL(){return x.useContext(Xj)}function ff({title:e,subtitle:t,right:n,className:a,style:l,...o}){return d.jsxs("div",{className:_e("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[d.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),d.jsx("div",{style:{flex:1}}),n]})}function Jj({className:e,style:t,...n}){return d.jsx("div",{className:_e("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function Wj({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:a=>{e||(a.currentTarget.style.color="var(--fg)")},onMouseLeave:a=>{e||(a.currentTarget.style.color="var(--fg-3)")},children:n})}const zL={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 en({tone:e="neutral",className:t,style:n,...a}){const l=zL[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return d.jsx("span",{className:_e("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}const Ea=x.forwardRef(({className:e,...t},n)=>d.jsx("table",{ref:n,className:_e("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));Ea.displayName="DenseTable";const Na=x.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:e,...t}));Na.displayName="DenseTableHeader";const _a=x.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:e,...t}));_a.displayName="DenseTableBody";const Wt=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>d.jsx("tr",{ref:o,className:_e("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));Wt.displayName="DenseTableRow";const ze=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("th",{ref:a,className:_e("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));ze.displayName="DenseTableHead";const Ne=x.forwardRef(({className:e,style:t,...n},a)=>d.jsx("td",{ref:a,className:_e("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ne.displayName="DenseTableCell";const Zr=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},...t}));Zr.displayName="Panel";const eC=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},...t}));eC.displayName="PanelHeader";const tC=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)"},...t}));tC.displayName="PanelTitle";const OL=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e(e),style:{padding:"var(--sp-3) var(--sp-3_5)"},...t}));OL.displayName="PanelBody";function Zs({children:e,right:t,className:n,style:a,...l}){return d.jsxs("div",{className:_e("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[d.jsx("span",{children:e}),t]})}function hf({className:e,style:t,...n}){return d.jsx("span",{className:_e("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function ry(){return Ue.get("/members")}function ML(e){return Ue.post("/members",e)}function DL(e,t){return Ue.patch(`/members/${encodeURIComponent(e)}`,t)}function LL(e){return Ue.delete(`/members/${encodeURIComponent(e)}`)}function ay(){const{data:e}=Qe({queryKey:["members","name-map"],queryFn:ry,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 IL(){const e=Vr(),t=ay(),{data:n,isLoading:a,error:l}=Qe({queryKey:["admin-all-agents"],queryFn:()=>D3({limit:100})});return d.jsxs("div",{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),d.jsxs(Zr,{children:[d.jsxs(Zs,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),a?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Agent name"}),d.jsx(ze,{children:"Type"}),d.jsx(ze,{children:"Visibility"}),d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(_a,{children:n.items.map(o=>d.jsxs(Wt,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"font-medium",children:o.displayName})}),d.jsx(Ne,{children:o.name?d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",o.name]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:o.uuid.slice(0,8)})}),d.jsx(Ne,{children:d.jsx(en,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),d.jsx(Ne,{children:d.jsx(en,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),d.jsx(Ne,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),d.jsx(Ne,{children:d.jsx(en,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(o.createdAt)})]},o.uuid))})]})]})]})}const M1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,D1=Iw,UL=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return D1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=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=M1(y)||M1(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,...S}=y;return Object.entries(S).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return D1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},BL=UL("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"}}),be=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?u3:"button";return d.jsx(u,{className:_e(BL({variant:t,size:n,className:e})),ref:o,...l})});be.displayName="Button";const kt=x.forwardRef(({className:e,type:t,...n},a)=>d.jsx("input",{type:t,className:_e("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));kt.displayName="Input";var PL="Label",nC=x.forwardRef((e,t)=>d.jsx(Ra.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())}}));nC.displayName=PL;var $L=nC;const at=x.forwardRef(({className:e,...t},n)=>d.jsx($L,{ref:n,className:_e("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));at.displayName="Label";const rC=Object.values(dL);function FL(e,t){const n=(e==null?void 0:e.trim())||t,a=n.split(/[\s._-]+/).filter(Boolean);if(a.length>=2){const l=a[0]??"",o=a[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function qL(){const e=er(),{memberId:t}=Aa(),[n,a]=x.useState(!1),[l,o]=x.useState({username:"",displayName:"",role:"member"}),[u,f]=x.useState(null),[m,h]=x.useState(null),{data:y,isLoading:g,error:b}=Qe({queryKey:["members"],queryFn:ry}),S=wt({mutationFn:()=>ML({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:T=>{e.invalidateQueries({queryKey:["members"]}),f(T.password)}}),k=wt({mutationFn:LL,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){a(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(T){T.preventDefault(),S.mutate()}function C(T){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(T)}return d.jsxs(d.Fragment,{children:[d.jsxs(Zr,{children:[d.jsxs(Zs,{right:d.jsxs(yn,{open:n,onOpenChange:T=>T?a(!0):j(),children:[d.jsx(R3,{asChild:!0,children:d.jsxs(be,{size:"xs",className:"normal-case tracking-normal",children:[d.jsx(Sl,{className:"h-3 w-3"}),"Add member"]})}),d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:u?"Member Created":"Create Member"})}),u?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("code",{className:"flex-1 text-body mono",children:u}),d.jsx(be,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:d.jsx(Mg,{className:"h-4 w-4"})})]}),d.jsx(vn,{children:d.jsx(be,{onClick:j,children:"Done"})})]}):d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"member-username",children:"Username"}),d.jsx(kt,{id:"member-username",type:"text",value:l.username,onChange:T=>o({...l,username:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"member-name",children:"Display Name"}),d.jsx(kt,{id:"member-name",value:l.displayName,onChange:T=>o({...l,displayName:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:l.role,onChange:T=>o({...l,role:T.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:rC.map(T=>d.jsx("option",{value:T,children:T},T))})]}),S.error instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:S.error.message}),d.jsx(vn,{children:d.jsx(be,{type:"submit",disabled:S.isPending,children:S.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(y==null?void 0:y.length)===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{style:{width:30}}),d.jsx(ze,{children:"Username"}),d.jsx(ze,{children:"Name"}),d.jsx(ze,{children:"Role"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:1}})]})}),d.jsx(_a,{children:y==null?void 0:y.map(T=>{const O=t===T.id;return d.jsxs(Wt,{children:[d.jsx(Ne,{children:d.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:FL(T.displayName,T.username)})}),d.jsxs(Ne,{children:[d.jsx("span",{className:"mono font-medium",children:T.username}),O&&d.jsx(hf,{style:{marginLeft:6},children:"you"})]}),d.jsx(Ne,{style:{color:"var(--fg-2)"},children:T.displayName}),d.jsx(Ne,{children:d.jsx(en,{tone:T.role==="admin"?"accent":"neutral",children:T.role})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(T.createdAt)}),d.jsx(Ne,{style:{whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-0.5 justify-end",children:[d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:T.id,username:T.username,displayName:T.displayName,role:T.role}),title:"Edit",children:d.jsx(Jd,{className:"h-3.5 w-3.5"})}),d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>C(T.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:d.jsx(pu,{className:"h-3.5 w-3.5"})})]})})]},T.id)})})]})]}),d.jsx(HL,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function HL({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,u]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=wt({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:DL(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 d.jsx(yn,{open:g,onOpenChange:b=>b?void 0:t(),children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{children:"Username"}),d.jsx(kt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(kt,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:b=>u(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:rC.map(b=>d.jsx("option",{value:b,children:b},b))}),d.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&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function ZL(){return Ue.get("/admin/system/config")}function VL(e){return Ue.patch("/admin/system/config",e)}const aC=[{key:ki.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:ki.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:ki.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:ki.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],L1=aC.map(e=>e.key);function QL(){const e=er(),{data:t,isLoading:n}=Qe({queryKey:["system-config"],queryFn:ZL}),[a,l]=x.useState({}),[o,u]=x.useState(!1);x.useEffect(()=>{if(!t)return;const y={};for(const g of L1){const b=t[g]??Ad[g]??"";y[g]=String(b)}l(y)},[t]);const f=wt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(a)){const S=b.trim();if(S==="")y[g]=Ad[g]??0;else{const k=Number(S);y[g]=Number.isNaN(k)?S:k}}return VL(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const y={};for(const g of L1)y[g]=String(Ad[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return d.jsx("form",{onSubmit:h,children:d.jsxs(Zr,{children:[d.jsxs(eC,{children:[d.jsx(tC,{children:"System configuration"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),d.jsx(be,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),d.jsxs(be,{type:"submit",size:"xs",disabled:f.isPending,children:[d.jsx(Ru,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),d.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?d.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):aC.map(y=>d.jsx(GL,{field:y,value:a[y.key]??"",onChange:g=>l({...a,[y.key]:g})},y.key)),f.error instanceof Error&&d.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})}function GL({field:e,value:t,onChange:n}){const a=String(Ad[e.key]??"—");return d.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),d.jsxs(hf,{style:{marginTop:4,display:"block"},children:["default"," ",d.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:a})]})]}),d.jsxs("div",{style:{position:"relative"},children:[d.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&&d.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const I1=[{key:"members",label:"Members"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function KL(){const{role:e}=Aa(),t=br(),n=Vr();if(e===null)return d.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return d.jsx(_g,{to:"/settings",replace:!0});const a=t.hash.replace("#",""),l=I1.some(u=>u.key===a)?a:"members",o=u=>{n({hash:u},{replace:!0})};return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Admin",subtitle:"Organization-wide controls"}),d.jsx(Jj,{children:I1.map(u=>d.jsx(Wj,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),d.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&d.jsx(qL,{}),l==="all-agents"&&d.jsx(IL,{}),l==="settings"&&d.jsx(QL,{})]})]})}function iC(){return Ue.get("/admin/adapter-mappings")}function YL(e){return Ue.post("/admin/adapter-mappings",e)}function XL(e){return Ue.delete(`/admin/adapter-mappings/${e}`)}function lC(){return Ue.get("/admin/adapters/status")}function sC(){return Ue.get("/admin/adapters")}function JL(e){return Ue.post("/admin/adapters",e)}function WL(e,t){return Ue.patch(`/admin/adapters/${e}`,t)}function eI(e){return Ue.delete(`/admin/adapters/${e}`)}function tI(e){return Ue.get(`/admin/agents/${e}/config`)}function nI(e,t){return Ue.patch(`/admin/agents/${e}/config`,t)}function rI(e,t){return Ue.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function aI(e){return Ue.get(`/admin/agents/${e}/client-status`)}function iI({className:e,style:t,...n}){return d.jsx("div",{className:_e("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function lI({onClick:e,children:t}){return d.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 sI(){return d.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function oI({children:e,mono:t}){return d.jsx("span",{className:_e("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function bl({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:_e("shrink-0",n),style:a,role:"img","aria-label":"working",children:[d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),d.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"?d.jsx("span",{className:_e("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:d.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?d.jsx("span",{className:_e("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?d.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.jsx("span",{className:_e("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function uI(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Ti({state:e,className:t}){const n=e!==null&&uI(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return d.jsxs("span",{className:_e("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[d.jsx(bl,{state:n,size:7}),n]})}function gd({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:1},children:t})]})}function cI({runtimeLabel:e,computerLabel:t,modelLabel:n,visible:a=!0}){return a?d.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:d.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[d.jsxs("span",{children:["Runs on ",d.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),d.jsx("span",{style:{color:"var(--fg-2)"},children:t})]}),d.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{children:["model ",d.jsx("span",{style:{color:"var(--fg-2)"},children:n})]})]})}):null}function dI(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),u=t.displayName||t.name||t.uuid;return d.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:6},children:[d.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[d.jsx(hR,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),d.jsxs("div",{children:[t.status==="active"?d.jsx(ep,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(be,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx(ep,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(be,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx(ep,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(be,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[d.jsx(pu,{className:"h-3 w-3"}),"Delete"]})})]}),d.jsx(fI,{open:l,onOpenChange:o,label:u,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),d.jsx(hI,{open:n,onOpenChange:a,expected:u,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function ep(e){return d.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:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),d.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),d.jsx("div",{children:e.action})]})}function fI({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return d.jsx(yn,{open:e,onOpenChange:t,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsxs(bn,{children:['Suspend "',n,'"?']})}),d.jsx("div",{className:"space-y-3",children:d.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."})}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(be,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function hI({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return d.jsx(yn,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsxs(bn,{children:['Delete "',n,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),d.jsx(kt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(be,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const mI={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 iy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=mI[e],f=e==="deleted";return d.jsxs("div",{className:_e("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:_e("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(be,{size:"sm",variant:"ghost",onClick:a,children:[d.jsx(pR,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsx(pI,{onEdit:t,onDelete:n}))]})}function pI({onEdit:e,onDelete:t}){return d.jsxs("div",{className:"flex gap-1",children:[d.jsx(be,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),d.jsxs(be,{size:"sm",variant:"ghost",onClick:t,title:"Delete",children:[d.jsx(OT,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function gI(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}),u=e.items.filter(f=>f.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Environment Variables (",u,")"]}),!e.disabled&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(Sl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.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===Pd,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||d.jsx("em",{children:"(empty)"}),d.jsxs(iy,{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:[d.jsx("span",{className:"font-mono font-medium",children:f.value.key}),d.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&d.jsx(Mw,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&d.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?d.jsx(DT,{className:"h-3.5 w-3.5"}):d.jsx(IT,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&d.jsx(yI,{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 yI({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=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&&(u((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 S(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=Pd),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(yn,{open:e,onOpenChange:t,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:n?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:S,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"env-key",children:"Key"}),d.jsx(kt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&d.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"env-value",children:"Value"}),d.jsx(kt,{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"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-body",children:[d.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)"]}),d.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&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function vI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Git Repositories (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(Sl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??$d(l.value.url);return d.jsxs(iy,{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:[d.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(bI,{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 bI({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=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&&(u((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 S(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||$d(j);if(E&&a.has(E)){b(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(C)}return d.jsx(yn,{open:e,onOpenChange:t,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:n?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:S,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"git-url",children:"URL"}),d.jsx(kt,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(kt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(kt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:$d(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function oC({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:u,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return d.jsx("span",{className:_e("mono text-label",o),style:{color:"var(--fg-4)",...u},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"?d.jsxs("span",{className:_e("inline-flex flex-col leading-tight",o),style:{gap:1,...u},title:y??void 0,children:[h&&d.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&d.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):d.jsxs("span",{className:_e("inline-flex items-baseline gap-1.5",o),style:u,title:y??void 0,children:[h&&d.jsx("span",{style:{color:g},children:t}),m&&d.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function xI({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=qg(),o=ay(),u=e.metadata,f=u==null?void 0:u.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 d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("h2",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:"Profile"}),e.status==="active"&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[d.jsx(Jd,{className:"h-3 w-3"})," Edit"]})]}),d.jsxs("div",{className:"px-4 py-3 text-body space-y-1",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&d.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsxs("span",{className:"text-muted-foreground",children:["delegate ",d.jsx(oC,{name:g.name,displayName:g.displayName})]})]})]}),d.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsxs("span",{children:["owner ",d.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-foreground",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(en,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(en,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&d.jsxs("span",{children:["domains"," ",d.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>d.jsx(en,{tone:"outline",children:b},b))})]})]})]}),d.jsx(SI,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function SI({agent:e,open:t,onOpenChange:n,onSave:a}){var P;const{memberId:l,role:o}=Aa(),[u,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,S]=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 E=e.type==="human",C=o==="admin"||e.managerId===l,T=Qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await af({limit:100})).items.filter(R=>R.type==="personal_assistant"&&R.status==="active"),enabled:t&&E});async function O(L){L.preventDefault(),j(null);const R=u.trim();if(!R){j("Display name is required.");return}S(!0);try{const M={displayName:R,delegateMention:m||null};y!==e.visibility&&(M.visibility=y),await a(M),n(!1)}catch(M){j(M instanceof Error?M.message:String(M))}finally{S(!1)}}return d.jsx(yn,{open:t,onOpenChange:n,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:O,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{children:"Agent name"}),d.jsx(kt,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"id-display",children:"Display Name"}),d.jsx(kt,{id:"id-display",value:u,onChange:L=>f(L.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:y,onChange:L=>g(L.target.value),disabled:!C,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:z1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:z1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:C?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:L=>h(L.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:[d.jsx("option",{value:"",children:"None"}),(P=T.data)==null?void 0:P.map(L=>d.jsx("option",{value:L.uuid,children:L.displayName?`${L.displayName} (@${L.name??L.uuid})`:L.name?`@${L.name}`:L.uuid},L.uuid))]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-body text-destructive",children:k}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),d.jsx(be,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function wI(e){return e==="working"?"accent":e==="error"?"error":"outline"}function kI(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["MCP Servers (",a,")"]}),!e.disabled&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(Sl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.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 d.jsxs(iy,{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:[d.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),d.jsx("span",{className:"font-medium font-mono",children:l.value.name}),d.jsx(en,{tone:wI(o),children:o}),d.jsx("span",{className:"text-caption text-muted-foreground truncate",children:jI(l.value)})]},l.key)})}),t&&d.jsx(CI,{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 jI(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 CI({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=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(" "):""),[S,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(u((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:""),E(null))},[e,n]);function C(T){if(T.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const P=g.trim().split(/\s+/).filter(L=>L.length>0);O={name:f,transport:"stdio",command:h.trim(),...P.length?{args:P}:{}}}else{const P=S.trim();try{new URL(P)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:P}}l(O)}return d.jsx(yn,{open:e,onOpenChange:t,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:n?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:C,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:T=>u(T.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:[d.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),d.jsx("option",{value:"http",children:"http"}),d.jsx("option",{value:"sse",children:"sse"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"mcp-name",children:"Name"}),d.jsx(kt,{id:"mcp-name",value:f,onChange:T=>m(T.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"mcp-command",children:"Command"}),d.jsx(kt,{id:"mcp-command",value:h,onChange:T=>y(T.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(kt,{id:"mcp-args",value:g,onChange:T=>b(T.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"mcp-url",children:"URL"}),d.jsx(kt,{id:"mcp-url",value:S,onChange:T=>k(T.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-body text-destructive",children:j}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(be,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const U1=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}];function EI({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const o=e!==t,u=!U1.some(f=>f.value===e)&&e!=="";return d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${o?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Model",o&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),o&&d.jsx(be,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md 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:[e===""&&d.jsx("option",{value:"",children:"(unset — inherits local)"}),U1.map(f=>d.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&d.jsxs("option",{value:e,children:[e," — custom"]})]}),d.jsxs("p",{className:"text-caption text-muted-foreground",children:["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 ",d.jsx("code",{children:"~/.claude/settings.json"})," model preference, then the CLI default."]})]})]})}function NI(e){const{agent:t,isHuman:n}=e;return d.jsxs("div",{className:"space-y-3",children:[e.profileSlot,e.bindingsSlot,d.jsx(_I,{state:e.health.runtimeState,model:e.health.model,activeSessions:e.health.activeSessions,totalSessions:e.health.totalSessions,offlineSince:e.health.offlineSince,agentActive:t.status==="active",isHuman:n,onOpenChat:e.onOpenChat,onTest:e.onTest,testPending:e.testPending??!1})]})}function _I(e){return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Status & health",d.jsx(Ti,{state:e.state})]}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsxs(be,{variant:"ghost",size:"xs",onClick:e.onOpenChat,children:[d.jsx(Lg,{className:"h-3 w-3"})," Open chat"]}),!e.isHuman&&e.agentActive&&e.onTest&&d.jsxs(be,{variant:"outline",size:"xs",onClick:e.onTest,disabled:e.testPending,children:[d.jsx(Dw,{className:"h-3 w-3"}),e.testPending?"Testing…":"Test"]})]})]}),d.jsxs("div",{className:"px-4 py-3 text-body grid gap-2",style:{gridTemplateColumns:"repeat(2, minmax(0, 1fr))"},children:[d.jsx(tp,{label:"Model",value:d.jsx("span",{className:"mono",children:e.model})}),d.jsx(tp,{label:"Sessions",value:d.jsxs("span",{className:"mono tnum",children:[d.jsx("span",{style:{color:"var(--fg-2)"},children:e.activeSessions}),d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",e.totalSessions]})," ",d.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:"active / total"})]})}),d.jsx(tp,{label:"Offline since",value:e.offlineSince?d.jsx("span",{className:"mono text-label",children:Hr(e.offlineSince)}):d.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:"— (online)"})})]})]})}function tp({label:e,value:t}){return d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-caption shrink-0",style:{color:"var(--fg-4)",minWidth:86},children:e}),d.jsx("span",{className:"min-w-0 truncate",children:t})]})}function AI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zI={};function B1(e,t){return(zI.jsx?RI:TI).test(e)}const OI=/[ \t\n\f\r]/g;function MI(e){return typeof e=="object"?e.type==="text"?P1(e.value):!1:P1(e)}function P1(e){return e.replace(OI,"")===""}class Lu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Lu.prototype.normal={};Lu.prototype.property={};Lu.prototype.space=void 0;function uC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Lu(n,a,t)}function ag(e){return e.toLowerCase()}class Fn{constructor(t,n){this.attribute=n,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let DI=0;const Ve=El(),Qt=El(),ig=El(),pe=El(),Ct=El(),Ts=El(),Xn=El();function El(){return 2**++DI}const lg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Qt,commaOrSpaceSeparated:Xn,commaSeparated:Ts,number:pe,overloadedBoolean:ig,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),np=Object.keys(lg);class ly extends Fn{constructor(t,n,a,l){let o=-1;if(super(t,n),$1(this,"space",l),typeof a=="number")for(;++o<np.length;){const u=np[o];$1(this,np[o],(a&lg[u])===lg[u])}}}ly.prototype.defined=!0;function $1(e,t,n){n&&(e[t]=n)}function eo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new ly(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[ag(a)]=a,n[ag(o.attribute)]=a}return new Lu(t,n,e.space)}const cC=eo({properties:{ariaActiveDescendant:null,ariaAtomic:Qt,ariaAutoComplete:null,ariaBusy:Qt,ariaChecked:Qt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Qt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Qt,ariaFlowTo:Ct,ariaGrabbed:Qt,ariaHasPopup:null,ariaHidden:Qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:pe,ariaLive:null,ariaModal:Qt,ariaMultiLine:Qt,ariaMultiSelectable:Qt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Qt,ariaReadOnly:Qt,ariaRelevant:null,ariaRequired:Qt,ariaRoleDescription:Ct,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Qt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dC(e,t){return t in e?e[t]:t}function fC(e,t){return dC(e,t.toLowerCase())}const LI=eo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ts,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:pe,colSpan:null,content:null,contentEditable:Qt,controls:Ve,controlsList:Ct,coords:pe|Ts,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:ig,draggable:Qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:Ct,height:pe,hidden:ig,high:pe,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:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:pe,pattern:null,ping: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:pe,rowSpan:pe,sandbox:Ct,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Qt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Qt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:fC}),II=eo({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:Xn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className: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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ts,g2:Ts,glyphName:Ts,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dC}),hC=eo({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()}}),mC=eo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fC}),pC=eo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),UI={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"},BI=/[A-Z]/g,F1=/-[a-z]/g,PI=/^data[-\w.:]+$/i;function $I(e,t){const n=ag(t);let a=t,l=Fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&PI.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(F1,qI);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!F1.test(o)){let u=o.replace(BI,FI);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=ly}return new l(a,t)}function FI(e){return"-"+e.toLowerCase()}function qI(e){return e.charAt(1).toUpperCase()}const HI=uC([cC,LI,hC,mC,pC],"html"),sy=uC([cC,II,hC,mC,pC],"svg");function ZI(e){return e.join(" ").trim()}var vs={},rp,q1;function VI(){if(q1)return rp;q1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
343
- `,h="/",y="*",g="",b="comment",S="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var T=1,O=1;function P(fe){var ee=fe.match(t);ee&&(T+=ee.length);var q=fe.lastIndexOf(m);O=~q?fe.length-q:O+fe.length}function L(){var fe={line:T,column:O};return function(ee){return ee.position=new R(fe),re(),ee}}function R(fe){this.start=fe,this.end={line:T,column:O},this.source=C.source}R.prototype.content=E;function M(fe){var ee=new Error(C.source+":"+T+":"+O+": "+fe);if(ee.reason=fe,ee.filename=C.source,ee.line=T,ee.column=O,ee.source=E,!C.silent)throw ee}function Z(fe){var ee=fe.exec(E);if(ee){var q=ee[0];return P(q),E=E.slice(q.length),ee}}function re(){Z(n)}function F(fe){var ee;for(fe=fe||[];ee=de();)ee!==!1&&fe.push(ee);return fe}function de(){var fe=L();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var ee=2;g!=E.charAt(ee)&&(y!=E.charAt(ee)||h!=E.charAt(ee+1));)++ee;if(ee+=2,g===E.charAt(ee-1))return M("End of comment missing");var q=E.slice(2,ee-2);return O+=2,P(q),E=E.slice(ee),O+=2,fe({type:b,comment:q})}}function W(){var fe=L(),ee=Z(a);if(ee){if(de(),!Z(l))return M("property missing ':'");var q=Z(o),oe=fe({type:S,property:j(ee[0].replace(e,g)),value:q?j(q[0].replace(e,g)):g});return Z(u),oe}}function ge(){var fe=[];F(fe);for(var ee;ee=W();)ee!==!1&&(fe.push(ee),F(fe));return fe}return re(),ge()}function j(E){return E?E.replace(f,g):g}return rp=k,rp}var H1;function QI(){if(H1)return vs;H1=1;var e=vs&&vs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(vs,"__esModule",{value:!0}),vs.default=n;const t=e(VI());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.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 vs}var Jo={},Z1;function GI(){if(Z1)return Jo;Z1=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.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)},u=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,u))};return Jo.camelCase=m,Jo}var Wo,V1;function KI(){if(V1)return Wo;V1=1;var e=Wo&&Wo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(QI()),n=GI();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return a.default=a,Wo=a,Wo}var YI=KI();const XI=Qd(YI),gC=yC("end"),oy=yC("start");function yC(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 JI(e){const t=oy(e),n=gC(e);if(t&&n)return{start:t,end:n}}function ou(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Q1(e.position):"start"in e||"end"in e?Q1(e):"line"in e||"column"in e?sg(e):""}function sg(e){return G1(e&&e.line)+":"+G1(e&&e.column)}function Q1(e){return sg(e&&e.start)+"-"+sg(e&&e.end)}function G1(e){return e&&typeof e=="number"?e:1}class xn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},u=!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&&(u=!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=ou(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=u&&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}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const uy={}.hasOwnProperty,WI=new Map,eU=/[A-Z]/g,tU=new Set(["table","tbody","thead","tfoot","tr"]),nU=new Set(["td","th"]),vC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rU(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=dU(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=cU(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"?sy:HI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bC(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function bC(e,t,n){if(t.type==="element")return aU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sU(e,t,n);if(t.type==="mdxjsEsm")return lU(e,t);if(t.type==="root")return oU(e,t,n);if(t.type==="text")return uU(e,t)}function aU(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=sy,e.schema=l),e.ancestors.push(t);const o=SC(e,t.tagName,!1),u=fU(e,t);let f=dy(e,t);return tU.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!MI(m):!0})),xC(e,u,o,t),cy(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function iU(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)}wu(e,t.position)}function lU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wu(e,t.position)}function sU(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=sy,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:SC(e,t.name,!0),u=hU(e,t),f=dy(e,t);return xC(e,u,o,t),cy(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function oU(e,t,n){const a={};return cy(a,dy(e,t)),e.create(t,e.Fragment,a,n)}function uU(e,t){return t.value}function xC(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function cy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function cU(e,t,n){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function dU(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=oy(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function fU(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&uy.call(t.properties,l)){const o=mU(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&nU.has(t.tagName)?a=f:n[u]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function hU(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 u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else wu(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 wu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function dy(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:WI;for(;++a<t.children.length;){const o=t.children[a];let u;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;u=m+"-"+h,l.set(m,h+1)}}const f=bC(e,o,u);f!==void 0&&n.push(f)}return n}function mU(e,t,n){const a=$I(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?AI(n):ZI(n)),a.property==="style"){let l=typeof n=="object"?n:pU(e,String(n));return e.stylePropertyNameCase==="css"&&(l=gU(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?UI[a.property]||a.property:a.attribute,n]}}function pU(e,t){try{return XI(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new xn("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=vC+"#cannot-parse-style-attribute",l}}function SC(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=B1(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=B1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return uy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);wu(e)}function wu(e,t){const n=new xn("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=vC+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gU(e){const t={};let n;for(n in e)uy.call(e,n)&&(t[yU(n)]=e[n]);return t}function yU(e){let t=e.replace(eU,vU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function vU(e){return"-"+e.toLowerCase()}const ap={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"]},bU={};function fy(e,t){const n=bU,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wC(e,a,l)}function wC(e,t,n){if(xU(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 K1(e.children,t,n)}return Array.isArray(e)?K1(e,t,n):""}function K1(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=wC(e[l],t,n);return a.join("")}function xU(e){return!!(e&&typeof e=="object")}const Y1=document.createElement("i");function hy(e){const t="&"+e+";";Y1.innerHTML=t;const n=Y1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wn(e,t,n,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function gr(e,t){return e.length>0?(Wn(e,e.length,0,t),e):t}const X1={}.hasOwnProperty;function kC(e){const t={};let n=-1;for(;++n<e.length;)SU(t,e[n]);return t}function SU(e,t){let n;for(n in t){const l=(X1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){X1.call(l,u)||(l[u]=[]);const f=o[u];wU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function wU(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Wn(e,0,0,a)}function jC(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 Nr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Nn=Mi(/[A-Za-z]/),gn=Mi(/[\dA-Za-z]/),kU=Mi(/[#-'*+\--9=?A-Z^-~]/);function qd(e){return e!==null&&(e<32||e===127)}const og=Mi(/\d/),jU=Mi(/[\dA-Fa-f]/),CU=Mi(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const mf=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 to(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&gn(e.charCodeAt(n+1))&&gn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function it(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Je(m)?(e.enter(n),f(m)):t(m)}function f(m){return Je(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const EU={tokenize:NU};function NU(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"),it(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,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Me(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const _U={tokenize:AU},J1={tokenize:TU};function AU(e){const t=this,n=[];let a=0,l,o,u;return f;function f(O){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&T();const P=t.events.length;let L=P,R;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){R=t.events[L][1].end;break}C(a);let M=P;for(;M<t.events.length;)t.events[M][1].end={...R},M++;return Wn(t.events,L+1,0,t.events.slice(P)),t.events.length=M,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(J1,y,g)(O)}function y(O){return l&&T(),C(a),b(O)}function g(O){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(J1,S,k)(O)}function S(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&T(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return Me(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,P){const L=t.sliceStream(O);if(P&&L.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(L),t.parser.lazy[O.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const M=t.events.length;let Z=M,re,F;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(re){F=t.events[Z][1].end;break}re=!0}for(C(a),R=M;R<t.events.length;)t.events[R][1].end={...F},R++;Wn(t.events,Z+1,0,t.events.slice(M)),t.events.length=R}}function C(O){let P=n.length;for(;P-- >O;){const L=n[P];t.containerState=L[1],L[0].exit.call(t,e)}n.length=O}function T(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function TU(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vs(e){if(e===null||jt(e)||xl(e))return 1;if(mf(e))return 2}function pf(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:RU,tokenize:zU};function RU(e,t){let n=-1,a,l,o,u,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};W1(g,-m),W1(b,m),u={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:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=gr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=gr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=gr(h,pf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=gr(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=gr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,Wn(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 zU(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Vs(a);let o;return u;function u(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=Vs(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 W1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OU={name:"autolink",tokenize:MU};function MU(e,t,n){let a=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(S){return Nn(S)?(e.consume(S),u):S===64?n(S):h(S)}function u(S){return S===43||S===45||S===46||gn(S)?(a=1,f(S)):h(S)}function f(S){return S===58?(e.consume(S),a=0,m):(S===43||S===45||S===46||gn(S))&&a++<32?(e.consume(S),f):(a=0,h(S))}function m(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):S===null||S===32||S===60||qd(S)?n(S):(e.consume(S),m)}function h(S){return S===64?(e.consume(S),y):kU(S)?(e.consume(S),h):n(S)}function y(S){return gn(S)?g(S):n(S)}function g(S){return S===46?(e.consume(S),a=0,y):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),t):b(S)}function b(S){if((S===45||gn(S))&&a++<63){const k=S===45?b:g;return e.consume(S),k}return n(S)}}const Iu={partial:!0,tokenize:DU};function DU(e,t,n){return a;function a(o){return Je(o)?it(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Me(o)?t(o):n(o)}}const CC={continuation:{tokenize:IU},exit:UU,name:"blockQuote",tokenize:LU};function LU(e,t,n){const a=this;return l;function l(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function IU(e,t,n){const a=this;return l;function l(u){return Je(u)?it(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(CC,t,n)(u)}}function UU(e){e.exit("blockQuote")}const EC={name:"characterEscape",tokenize:BU};function BU(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 CU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const NC={name:"characterReference",tokenize:PU};function PU(e,t,n){const a=this;let l=0,o,u;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,u=gn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=jU,y):(e.enter("characterReferenceValue"),o=7,u=og,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return u===gn&&!hy(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),y):n(g)}}const eS={partial:!0,tokenize:FU},tS={concrete:!0,name:"codeFenced",tokenize:$U};function $U(e,t,n){const a=this,l={partial:!0,tokenize:L};let o=0,u=0,f;return m;function m(R){return h(R)}function h(R){const M=a.events[a.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(R)}function y(R){return R===f?(u++,e.consume(R),y):u<3?n(R):(e.exit("codeFencedFenceSequence"),Je(R)?it(e,g,"whitespace")(R):g(R))}function g(R){return R===null||Me(R)?(e.exit("codeFencedFence"),a.interrupt?t(R):e.check(eS,j,P)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Me(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,S,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),b)}function S(R){return R===null||Me(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Me(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===f?n(R):(e.consume(R),k)}function j(R){return e.attempt(l,P,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),C}function C(R){return o>0&&Je(R)?it(e,T,"linePrefix",o+1)(R):T(R)}function T(R){return R===null||Me(R)?e.check(eS,j,P)(R):(e.enter("codeFlowValue"),O(R))}function O(R){return R===null||Me(R)?(e.exit("codeFlowValue"),T(R)):(e.consume(R),O)}function P(R){return e.exit("codeFenced"),t(R)}function L(R,M,Z){let re=0;return F;function F(ee){return R.enter("lineEnding"),R.consume(ee),R.exit("lineEnding"),de}function de(ee){return R.enter("codeFencedFence"),Je(ee)?it(R,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):W(ee)}function W(ee){return ee===f?(R.enter("codeFencedFenceSequence"),ge(ee)):Z(ee)}function ge(ee){return ee===f?(re++,R.consume(ee),ge):re>=u?(R.exit("codeFencedFenceSequence"),Je(ee)?it(R,fe,"whitespace")(ee):fe(ee)):Z(ee)}function fe(ee){return ee===null||Me(ee)?(R.exit("codeFencedFence"),M(ee)):Z(ee)}}}function FU(e,t,n){const a=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const ip={name:"codeIndented",tokenize:HU},qU={partial:!0,tokenize:ZU};function HU(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),it(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?u(h):n(h)}function u(h){return h===null?m(h):Me(h)?e.attempt(qU,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Me(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function ZU(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):it(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Me(u)?l(u):n(u)}}const VU={name:"codeText",previous:GU,resolve:QU,tokenize:KU};function QU(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 GU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KU(e,t,n){let a=0,l,o;return u;function u(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)):Me(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||Me(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 YU{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&&eu(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),eu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),eu(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);eu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);eu(this.left,n.reverse())}}}function eu(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 _C(e){const t={};let n=-1,a,l,o,u,f,m,h;const y=new YU(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,XU(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[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 Wn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function XU(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let y,g,b=-1,S=n,k=0,j=0;const E=[j];for(;S;){for(;e.get(++l)[1]!==S;);o.push(l),S._tokenizer||(y=a.sliceStream(S),S.next||y.push(null),g&&u.defineSkip(S.start),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=S,S=S.next}for(S=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(u.events=[],S?(S._tokenizer=void 0,S.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),T=o.pop();m.push([T,T+C.length-1]),e.splice(T,2,C)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const JU={resolve:e9,tokenize:t9},WU={partial:!0,tokenize:n9};function e9(e){return _C(e),e}function t9(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):Me(f)?e.check(WU,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function n9(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,o,"linePrefix")}function o(u){if(u===null||Me(u))return n(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function AC(e,t,n,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||qd(C)?n(C):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),S(C))}function S(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||Me(C)?n(C):(e.consume(C),C===92?k:S)}function k(C){return C===60||C===62||C===92?(e.consume(C),S):S(C)}function j(C){return!y&&(C===null||C===41||jt(C))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(C)):y<h&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||qd(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function TC(e,t,n,a,l,o){const u=this;let f=0,m;return h;function h(S){return e.enter(a),e.enter(l),e.consume(S),e.exit(l),e.enter(o),y}function y(S){return f>999||S===null||S===91||S===93&&!m||S===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(S):S===93?(e.exit(o),e.enter(l),e.consume(S),e.exit(l),e.exit(a),t):Me(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||S===91||S===93||Me(S)||f++>999?(e.exit("chunkString"),y(S)):(e.consume(S),m||(m=!Je(S)),S===92?b:g)}function b(S){return S===91||S===92||S===93?(e.consume(S),f++,g):g(S)}}function RC(e,t,n,a,l,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,m):n(b)}function m(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===u?(e.exit(o),m(u)):b===null?n(b):Me(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),it(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===u||b===null||Me(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===u||b===92?(e.consume(b),y):y(b)}}function uu(e,t){let n;return a;function a(l){return Me(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Je(l)?it(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const r9={name:"definition",tokenize:i9},a9={partial:!0,tokenize:l9};function i9(e,t,n){const a=this;let l;return o;function o(S){return e.enter("definition"),u(S)}function u(S){return TC.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function f(S){return l=Nr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),m):n(S)}function m(S){return jt(S)?uu(e,h)(S):h(S)}function h(S){return AC(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function y(S){return e.attempt(a9,g,g)(S)}function g(S){return Je(S)?it(e,b,"whitespace")(S):b(S)}function b(S){return S===null||Me(S)?(e.exit("definition"),a.parser.defined.push(l),t(S)):n(S)}}function l9(e,t,n){return a;function a(f){return jt(f)?uu(e,l)(f):n(f)}function l(f){return RC(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Je(f)?it(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Me(f)?t(f):n(f)}}const s9={name:"hardBreakEscape",tokenize:o9};function o9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Me(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const u9={name:"headingAtx",resolve:c9,tokenize:d9};function c9(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"},Wn(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function d9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&a++<6?(e.consume(y),u):y===null||jt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Me(y)?(e.exit("atxHeading"),t(y)):Je(y)?it(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 f9=["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"],nS=["pre","script","style","textarea"],h9={concrete:!0,name:"htmlFlow",resolveTo:g9,tokenize:y9},m9={partial:!0,tokenize:b9},p9={partial:!0,tokenize:v9};function g9(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 y9(e,t,n){const a=this;let l,o,u,f,m;return h;function h(_){return y(_)}function y(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),g}function g(_){return _===33?(e.consume(_),b):_===47?(e.consume(_),o=!0,j):_===63?(e.consume(_),l=3,a.interrupt?t:A):Nn(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function b(_){return _===45?(e.consume(_),l=2,S):_===91?(e.consume(_),l=5,f=0,k):Nn(_)?(e.consume(_),l=4,a.interrupt?t:A):n(_)}function S(_){return _===45?(e.consume(_),a.interrupt?t:A):n(_)}function k(_){const te="CDATA[";return _===te.charCodeAt(f++)?(e.consume(_),f===te.length?a.interrupt?t:W:k):n(_)}function j(_){return Nn(_)?(e.consume(_),u=String.fromCharCode(_),E):n(_)}function E(_){if(_===null||_===47||_===62||jt(_)){const te=_===47,V=u.toLowerCase();return!te&&!o&&nS.includes(V)?(l=1,a.interrupt?t(_):W(_)):f9.includes(u.toLowerCase())?(l=6,te?(e.consume(_),C):a.interrupt?t(_):W(_)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(_):o?T(_):O(_))}return _===45||gn(_)?(e.consume(_),u+=String.fromCharCode(_),E):n(_)}function C(_){return _===62?(e.consume(_),a.interrupt?t:W):n(_)}function T(_){return Je(_)?(e.consume(_),T):F(_)}function O(_){return _===47?(e.consume(_),F):_===58||_===95||Nn(_)?(e.consume(_),P):Je(_)?(e.consume(_),O):F(_)}function P(_){return _===45||_===46||_===58||_===95||gn(_)?(e.consume(_),P):L(_)}function L(_){return _===61?(e.consume(_),R):Je(_)?(e.consume(_),L):O(_)}function R(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),m=_,M):Je(_)?(e.consume(_),R):Z(_)}function M(_){return _===m?(e.consume(_),m=null,re):_===null||Me(_)?n(_):(e.consume(_),M)}function Z(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||jt(_)?L(_):(e.consume(_),Z)}function re(_){return _===47||_===62||Je(_)?O(_):n(_)}function F(_){return _===62?(e.consume(_),de):n(_)}function de(_){return _===null||Me(_)?W(_):Je(_)?(e.consume(_),de):n(_)}function W(_){return _===45&&l===2?(e.consume(_),q):_===60&&l===1?(e.consume(_),oe):_===62&&l===4?(e.consume(_),U):_===63&&l===3?(e.consume(_),A):_===93&&l===5?(e.consume(_),he):Me(_)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(m9,B,ge)(_)):_===null||Me(_)?(e.exit("htmlFlowData"),ge(_)):(e.consume(_),W)}function ge(_){return e.check(p9,fe,B)(_)}function fe(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ee}function ee(_){return _===null||Me(_)?ge(_):(e.enter("htmlFlowData"),W(_))}function q(_){return _===45?(e.consume(_),A):W(_)}function oe(_){return _===47?(e.consume(_),u="",K):W(_)}function K(_){if(_===62){const te=u.toLowerCase();return nS.includes(te)?(e.consume(_),U):W(_)}return Nn(_)&&u.length<8?(e.consume(_),u+=String.fromCharCode(_),K):W(_)}function he(_){return _===93?(e.consume(_),A):W(_)}function A(_){return _===62?(e.consume(_),U):_===45&&l===2?(e.consume(_),A):W(_)}function U(_){return _===null||Me(_)?(e.exit("htmlFlowData"),B(_)):(e.consume(_),U)}function B(_){return e.exit("htmlFlow"),t(_)}}function v9(e,t,n){const a=this;return l;function l(u){return Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function b9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Iu,t,n)}}const x9={name:"htmlText",tokenize:S9};function S9(e,t,n){const a=this;let l,o,u;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),L):A===63?(e.consume(A),O):Nn(A)?(e.consume(A),Z):n(A)}function h(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),o=0,k):Nn(A)?(e.consume(A),T):n(A)}function y(A){return A===45?(e.consume(A),S):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),b):Me(A)?(u=g,oe(A)):(e.consume(A),g)}function b(A){return A===45?(e.consume(A),S):g(A)}function S(A){return A===62?q(A):A===45?b(A):g(A)}function k(A){const U="CDATA[";return A===U.charCodeAt(o++)?(e.consume(A),o===U.length?j:k):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):Me(A)?(u=j,oe(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),C):j(A)}function C(A){return A===62?q(A):A===93?(e.consume(A),C):j(A)}function T(A){return A===null||A===62?q(A):Me(A)?(u=T,oe(A)):(e.consume(A),T)}function O(A){return A===null?n(A):A===63?(e.consume(A),P):Me(A)?(u=O,oe(A)):(e.consume(A),O)}function P(A){return A===62?q(A):O(A)}function L(A){return Nn(A)?(e.consume(A),R):n(A)}function R(A){return A===45||gn(A)?(e.consume(A),R):M(A)}function M(A){return Me(A)?(u=M,oe(A)):Je(A)?(e.consume(A),M):q(A)}function Z(A){return A===45||gn(A)?(e.consume(A),Z):A===47||A===62||jt(A)?re(A):n(A)}function re(A){return A===47?(e.consume(A),q):A===58||A===95||Nn(A)?(e.consume(A),F):Me(A)?(u=re,oe(A)):Je(A)?(e.consume(A),re):q(A)}function F(A){return A===45||A===46||A===58||A===95||gn(A)?(e.consume(A),F):de(A)}function de(A){return A===61?(e.consume(A),W):Me(A)?(u=de,oe(A)):Je(A)?(e.consume(A),de):re(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,ge):Me(A)?(u=W,oe(A)):Je(A)?(e.consume(A),W):(e.consume(A),fe)}function ge(A){return A===l?(e.consume(A),l=void 0,ee):A===null?n(A):Me(A)?(u=ge,oe(A)):(e.consume(A),ge)}function fe(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||jt(A)?re(A):(e.consume(A),fe)}function ee(A){return A===47||A===62||jt(A)?re(A):n(A)}function q(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function oe(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),K}function K(A){return Je(A)?it(e,he,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):he(A)}function he(A){return e.enter("htmlTextData"),u(A)}}const my={name:"labelEnd",resolveAll:C9,resolveTo:E9,tokenize:N9},w9={tokenize:_9},k9={tokenize:A9},j9={tokenize:T9};function C9(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&&Wn(e,0,e.length,n),e}function E9(e,t){let n=e.length,a=0,l,o,u,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(u){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"&&(u=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[u][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=gr(f,e.slice(o+1,o+a+3)),f=gr(f,[["enter",y,t]]),f=gr(f,pf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=gr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=gr(f,e.slice(u+1)),f=gr(f,[["exit",m,t]]),Wn(e,o,e.length,f),e}function N9(e,t,n){const a=this;let l=a.events.length,o,u;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):(u=a.parser.defined.includes(Nr(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(w9,y,u?y:g)(b):b===91?e.attempt(k9,y,u?h:g)(b):u?y(b):g(b)}function h(b){return e.attempt(j9,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function _9(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)?uu(e,o)(g):o(g)}function o(g){return g===41?y(g):AC(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return jt(g)?uu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?RC(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return jt(g)?uu(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 A9(e,t,n){const a=this;return l;function l(f){return TC.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Nr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function T9(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 R9={name:"labelStartImage",resolveAll:my.resolveAll,tokenize:z9};function z9(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"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const O9={name:"labelStartLink",resolveAll:my.resolveAll,tokenize:M9};function M9(e,t,n){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const lp={name:"lineEnding",tokenize:D9};function D9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),it(e,t,"linePrefix")}}const Td={name:"thematicBreak",tokenize:L9};function L9(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Me(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Je(h)?it(e,f,"whitespace")(h):f(h))}}const Ln={continuation:{tokenize:P9},exit:F9,name:"list",tokenize:B9},I9={partial:!0,tokenize:q9},U9={partial:!0,tokenize:$9};function B9(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,u=0;return f;function f(S){const k=a.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||S===a.containerState.marker:og(S)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(Td,n,h)(S):h(S);if(!a.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(S)}return n(S)}function m(S){return og(S)&&++u<10?(e.consume(S),m):(!a.interrupt||u<2)&&(a.containerState.marker?S===a.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),h(S)):n(S)}function h(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||S,e.check(Iu,a.interrupt?n:y,e.attempt(I9,b,g))}function y(S){return a.containerState.initialBlankLine=!0,o++,b(S)}function g(S){return Je(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):n(S)}function b(S){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(S)}}function P9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Iu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,it(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Je(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(U9,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,it(e,e.attempt(Ln,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function $9(e,t,n){const a=this;return it(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):n(o)}}function F9(e){e.exit(this.containerState.type)}function q9(e,t,n){const a=this;return it(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Je(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const rS={name:"setextUnderline",resolveTo:H9,tokenize:Z9};function H9(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 u={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",u,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function Z9(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,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Je(h)?it(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Me(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const V9={tokenize:Q9};function Q9(e){const t=this,n=e.attempt(Iu,a,e.attempt(this.parser.constructs.flowInitial,l,it(e,e.attempt(this.parser.constructs.flow,l,e.attempt(JU,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 G9={resolveAll:OC()},K9=zC("string"),Y9=zC("text");function zC(e){return{resolveAll:OC(e==="text"?X9:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(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 S=g[b];if(!S.previous||S.previous.call(a,a.previous))return!0}return!1}}}function OC(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 X9(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,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-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?u:a.start._bufferIndex+u,_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 J9={42:Ln,43:Ln,45:Ln,48:Ln,49:Ln,50:Ln,51:Ln,52:Ln,53:Ln,54:Ln,55:Ln,56:Ln,57:Ln,62:CC},W9={91:r9},eB={[-2]:ip,[-1]:ip,32:ip},tB={35:u9,42:Td,45:[rS,Td],60:h9,61:rS,95:Td,96:tS,126:tS},nB={38:NC,92:EC},rB={[-5]:lp,[-4]:lp,[-3]:lp,33:R9,38:NC,42:ug,60:[OU,x9],91:O9,92:[s9,EC],93:my,95:ug,96:VU},aB={null:[ug,G9]},iB={null:[42,95]},lB={null:[]},sB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iB,contentInitial:W9,disable:lB,document:J9,flow:tB,flowInitial:eB,insideSpan:aB,string:nB,text:rB},Symbol.toStringTag,{value:"Module"}));function oB(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 u=[],f=[];const m={attempt:M(L),check:M(R),consume:T,enter:O,exit:P,interrupt:M(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(de){return u=gr(u,de),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=pf(o,h.events,h),h.events)}function b(de,W){return cB(S(de),W)}function S(de){return uB(u,de)}function k(){const{_bufferIndex:de,_index:W,line:ge,column:fe,offset:ee}=a;return{_bufferIndex:de,_index:W,line:ge,column:fe,offset:ee}}function j(de){l[de.line]=de.column,F()}function E(){let de;for(;a._index<u.length;){const W=u[a._index];if(typeof W=="string")for(de=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===de&&a._bufferIndex<W.length;)C(W.charCodeAt(a._bufferIndex));else C(W)}}function C(de){y=y(de)}function T(de){Me(de)?(a.line++,a.column=1,a.offset+=de===-3?2:1,F()):de!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=de}function O(de,W){const ge=W||{};return ge.type=de,ge.start=k(),h.events.push(["enter",ge,h]),f.push(ge),ge}function P(de){const W=f.pop();return W.end=k(),h.events.push(["exit",W,h]),W}function L(de,W){Z(de,W.from)}function R(de,W){W.restore()}function M(de,W){return ge;function ge(fe,ee,q){let oe,K,he,A;return Array.isArray(fe)?B(fe):"tokenize"in fe?B([fe]):U(fe);function U(le){return xe;function xe(Oe){const Se=Oe!==null&&le[Oe],xt=Oe!==null&&le.null,ce=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(xt)?xt:xt?[xt]:[]];return B(ce)(Oe)}}function B(le){return oe=le,K=0,le.length===0?q:_(le[K])}function _(le){return xe;function xe(Oe){return A=re(),he=le,le.partial||(h.currentConstruct=le),le.name&&h.parser.constructs.disable.null.includes(le.name)?V():le.tokenize.call(W?Object.assign(Object.create(h),W):h,m,te,V)(Oe)}}function te(le){return de(he,A),ee}function V(le){return A.restore(),++K<oe.length?_(oe[K]):q}}}function Z(de,W){de.resolveAll&&!o.includes(de)&&o.push(de),de.resolve&&Wn(h.events,W,h.events.length-W,de.resolve(h.events.slice(W),h)),de.resolveTo&&(h.events=de.resolveTo(h.events,h))}function re(){const de=k(),W=h.previous,ge=h.currentConstruct,fe=h.events.length,ee=Array.from(f);return{from:fe,restore:q};function q(){a=de,h.previous=W,h.currentConstruct=ge,h.events.length=fe,f=ee,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function uB(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(a,o)];else{if(u=e.slice(n,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function cB(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
344
- `;break}case-3:{u=`\r
345
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function dB(e){const a={constructs:kC([sB,...(e||{}).extensions||[]]),content:l(EU),defined:[],document:l(_U),flow:l(V9),lazy:{},string:l(K9),text:l(Y9)};return a;function l(o){return u;function u(f){return oB(a,o,f)}}}function fB(e){for(;!_C(e););return e}const aS=/[\0\t\n\r]/g;function hB(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,y,g,b,S;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(aS.lastIndex=g,h=aS.exec(o),b=h&&h.index!==void 0?h.index:o.length,S=o.charCodeAt(b),!h){t=o.slice(g);break}if(S===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),S){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 mB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pB(e){return e.replace(mB,gB)}function gB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return jC(n.slice(o?2:1),o?16:10)}return hy(n)||e}const MC={}.hasOwnProperty;function yB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),vB(n)(fB(dB(n).document().write(hB()(e,t,!0))))}function vB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ar),autolinkProtocol:re,autolinkEmail:re,atxHeading:o(Dt),blockQuote:o(xt),characterEscape:re,characterReference:re,codeFenced:o(ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(ce,u),codeText:o(De,u),codeTextData:re,data:re,codeFlowValue:re,definition:o(lt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Be),hardBreakEscape:o(Kt),hardBreakTrailing:o(Kt),htmlFlow:o(Oa,u),htmlFlowData:re,htmlText:o(Oa,u),htmlTextData:re,image:o(Ma),label:u,link:o(Ar),listItem:o(Da),listItemValue:b,listOrdered:o(Gr,g),listUnordered:o(Gr),paragraph:o(Di),reference:_,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Dt),strong:o(La),thematicBreak:o(Nl)},exit:{atxHeading:m(),atxHeadingSequence:L,autolink:m(),autolinkEmail:Se,autolinkProtocol:Oe,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:le,characterReference:xe,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(C),codeText:m(ee),codeTextData:F,data:F,definition:m(),definitionDestinationString:P,definitionLabelString:T,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(W),hardBreakTrailing:m(W),htmlFlow:m(ge),htmlFlowData:F,htmlText:m(fe),htmlTextData:F,image:m(oe),label:he,labelText:K,lineEnding:de,link:m(q),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:te,resourceDestinationString:A,resourceTitleString:U,resource:B,setextHeading:m(Z),setextHeadingLineSequence:M,setextHeadingText:R,strong:m(),thematicBreak:m()}};DC(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ae){let ye={type:"root",children:[]};const we={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},Le=[];let $e=-1;for(;++$e<ae.length;)if(ae[$e][1].type==="listOrdered"||ae[$e][1].type==="listUnordered")if(ae[$e][0]==="enter")Le.push($e);else{const an=Le.pop();$e=l(ae,an,$e)}for($e=-1;++$e<ae.length;){const an=t[ae[$e][0]];MC.call(an,ae[$e][1].type)&&an[ae[$e][1].type].call(Object.assign({sliceSerialize:ae[$e][2].sliceSerialize},we),ae[$e][1])}if(we.tokenStack.length>0){const an=we.tokenStack[we.tokenStack.length-1];(an[1]||iS).call(we,void 0,an[0])}for(ye.position={start:ci(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:ci(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<t.transforms.length;)ye=t.transforms[$e](ye)||ye;return ye}function l(ae,ye,we){let Le=ye-1,$e=-1,an=!1,nr,ln,Rt,sn;for(;++Le<=we;){const ct=ae[Le];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?$e++:$e--,sn=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(nr&&!sn&&!$e&&!Rt&&(Rt=Le),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!$e&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||$e===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(nr){let Tr=Le;for(ln=void 0;Tr--;){const Sn=ae[Tr];if(Sn[1].type==="lineEnding"||Sn[1].type==="lineEndingBlank"){if(Sn[0]==="exit")continue;ln&&(ae[ln][1].type="lineEndingBlank",an=!0),Sn[1].type="lineEnding",ln=Tr}else if(!(Sn[1].type==="linePrefix"||Sn[1].type==="blockQuotePrefix"||Sn[1].type==="blockQuotePrefixWhitespace"||Sn[1].type==="blockQuoteMarker"||Sn[1].type==="listItemIndent"))break}Rt&&(!ln||Rt<ln)&&(nr._spread=!0),nr.end=Object.assign({},ln?ae[ln][1].start:ct[1].end),ae.splice(ln||Le,0,["exit",nr,ct[2]]),Le++,we++}if(ct[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};nr=Tr,ae.splice(Le,0,["enter",Tr,ct[2]]),Le++,we++,Rt=void 0,sn=!0}}}return ae[ye][1]._spread=an,we}function o(ae,ye){return we;function we(Le){f.call(this,ae(Le),Le),ye&&ye.call(this,Le)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,ye,we){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ye,we||void 0]),ae.position={start:ci(ye.start),end:void 0}}function m(ae){return ye;function ye(we){ae&&ae.call(this,we),h.call(this,we)}}function h(ae,ye){const we=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==ae.type&&(ye?ye.call(this,ae,Le[0]):(Le[1]||iS).call(this,ae,Le[0]));else throw new Error("Cannot close `"+ae.type+"` ("+ou({start:ae.start,end:ae.end})+"): it’s not open");we.position.end=ci(ae.end)}function y(){return fy(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(ae){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function S(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ae}function k(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ae}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae.replace(/(\r?\n|\r)$/g,"")}function T(ae){const ye=this.resume(),we=this.stack[this.stack.length-1];we.label=ye,we.identifier=Nr(this.sliceSerialize(ae)).toLowerCase()}function O(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ae}function P(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ae}function L(ae){const ye=this.stack[this.stack.length-1];if(!ye.depth){const we=this.sliceSerialize(ae).length;ye.depth=we}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function M(ae){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function re(ae){const we=this.stack[this.stack.length-1].children;let Le=we[we.length-1];(!Le||Le.type!=="text")&&(Le=rn(),Le.position={start:ci(ae.start),end:void 0},we.push(Le)),this.stack.push(Le)}function F(ae){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ae),ye.position.end=ci(ae.end)}function de(ae){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=ye.children[ye.children.length-1];we.position.end=ci(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(re.call(this,ae),F.call(this,ae))}function W(){this.data.atHardBreak=!0}function ge(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae}function fe(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae}function ee(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae}function q(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ye,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function oe(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ye,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function K(ae){const ye=this.sliceSerialize(ae),we=this.stack[this.stack.length-2];we.label=pB(ye),we.identifier=Nr(ye).toLowerCase()}function he(){const ae=this.stack[this.stack.length-1],ye=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Le=ae.children;we.children=Le}else we.alt=ye}function A(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ae}function U(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ae}function B(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function te(ae){const ye=this.resume(),we=this.stack[this.stack.length-1];we.label=ye,we.identifier=Nr(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function V(ae){this.data.characterReferenceType=ae.type}function le(ae){const ye=this.sliceSerialize(ae),we=this.data.characterReferenceType;let Le;we?(Le=jC(ye,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=hy(ye);const $e=this.stack[this.stack.length-1];$e.value+=Le}function xe(ae){const ye=this.stack.pop();ye.position.end=ci(ae.end)}function Oe(ae){F.call(this,ae);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ae)}function Se(ae){F.call(this,ae);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ae)}function xt(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function lt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Dt(){return{type:"heading",depth:0,children:[]}}function Kt(){return{type:"break"}}function Oa(){return{type:"html",value:""}}function Ma(){return{type:"image",title:null,url:"",alt:null}}function Ar(){return{type:"link",title:null,url:"",children:[]}}function Gr(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Da(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Di(){return{type:"paragraph",children:[]}}function La(){return{type:"strong",children:[]}}function rn(){return{type:"text",value:""}}function Nl(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function DC(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?DC(e,a):bB(e,a)}}function bB(e,t){let n;for(n in t)if(MC.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 iS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ou({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ou({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ou({start:t.start,end:t.end})+") is still open")}function xB(e){const t=this;t.parser=n;function n(a){return yB(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function SB(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 wB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
346
- `}]}function kB(e,t){const n=t.value?t.value+`
347
- `:"",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 jB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=to(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=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(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function NB(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 _B(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LC(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 u=l[l.length-1];return u&&u.type==="text"?u.value+=a:l.push({type:"text",value:a}),l}function AB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return LC(e,t);const l={src:to(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 TB(e,t){const n={src:to(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 RB(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 zB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return LC(e,t);const l={href:to(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 OB(e,t){const n={href:to(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 MB(e,t,n){const a=e.all(t),l=n?DB(n):IC(t),o={},u=[];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")&&u.push({type:"text",value:`
348
- `}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
349
- `});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function DB(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=IC(n[a])}return t}function IC(e){const t=e.spread;return t??e.children.length>1}function LB(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 u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function IB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=oy(t.children[1]),m=gC(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function $B(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},S=u?u[m]:void 0;S&&(b.align=S);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 FB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lS=9,sS=32;function qB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(oS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(oS(t.slice(l),l>0,!1)),o.join("")}function oS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===lS||o===sS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===lS||o===sS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function HB(e,t){const n={type:"text",value:qB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ZB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const VB={blockquote:SB,break:wB,code:kB,delete:jB,emphasis:CB,footnoteReference:EB,heading:NB,html:_B,imageReference:AB,image:TB,inlineCode:RB,linkReference:zB,link:OB,listItem:MB,list:LB,paragraph:IB,root:UB,strong:BB,table:PB,tableCell:FB,tableRow:$B,text:HB,thematicBreak:ZB,toml:yd,yaml:yd,definition:yd,footnoteDefinition:yd};function yd(){}const UC=-1,gf=0,cu=1,Hd=2,py=3,gy=4,yy=5,vy=6,BC=7,PC=8,uS=typeof self=="object"?self:globalThis,QB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case gf:case UC:return n(u,l);case cu:{const f=n([],l);for(const m of u)f.push(a(m));return f}case Hd:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case py:return n(new Date(u),l);case gy:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case yy:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case vy:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case BC:{const{name:f,message:m}=u;return n(new uS[f](m),l)}case PC:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new uS[o](u),l)};return a},cS=e=>QB(new Map,e)(0),bs="",{toString:GB}={},{keys:KB}=Object,tu=e=>{const t=typeof e;if(t!=="object"||!e)return[gf,t];const n=GB.call(e).slice(8,-1);switch(n){case"Array":return[cu,bs];case"Object":return[Hd,bs];case"Date":return[py,bs];case"RegExp":return[gy,bs];case"Map":return[yy,bs];case"Set":return[vy,bs];case"DataView":return[cu,n]}return n.includes("Array")?[cu,n]:n.includes("Error")?[BC,n]:[Hd,n]},vd=([e,t])=>e===gf&&(t==="function"||t==="symbol"),YB=(e,t,n,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=tu(u);switch(f){case gf:{let y=u;switch(m){case"bigint":f=PC,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([UC],u)}return l([f,y],u)}case cu:{if(m){let b=u;return m==="DataView"?b=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(u)),l([m,[...b]],u)}const y=[],g=l([f,y],u);for(const b of u)y.push(o(b));return g}case Hd:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],g=l([f,y],u);for(const b of KB(u))(e||!vd(tu(u[b])))&&y.push([o(b),o(u[b])]);return g}case py:return l([f,u.toISOString()],u);case gy:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case yy:{const y=[],g=l([f,y],u);for(const[b,S]of u)(e||!(vd(tu(b))||vd(tu(S))))&&y.push([o(b),o(S)]);return g}case vy:{const y=[],g=l([f,y],u);for(const b of u)(e||!vd(tu(b)))&&y.push(o(b));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},dS=(e,{json:t,lossy:n}={})=>{const a=[];return YB(!(t||n),!!t,new Map,a)(e),a},Zd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?cS(dS(e,t)):structuredClone(e):(e,t)=>cS(dS(e,t));function XB(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 JB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function WB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||XB,a=e.options.footnoteBackLabel||JB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=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=to(g.toLowerCase());let S=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++S<=j;){k.length>0&&k.push({type:"text",value:" "});let T=typeof n=="string"?n:n(m,S);typeof T=="string"&&(T={type:"text",value:T}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,S),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const T=E.children[E.children.length-1];T&&T.type==="text"?T.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Zd(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
350
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
351
- `}]}}const yf=(function(e){if(e==null)return r8;if(typeof e=="function")return vf(e);if(typeof e=="object")return Array.isArray(e)?e8(e):t8(e);if(typeof e=="string")return n8(e);throw new Error("Expected function, string, or object as test")});function e8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=yf(e[n]);return vf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function t8(e){const t=e;return vf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function n8(e){return vf(t);function t(n){return n&&n.type===e}}function vf(e){return t;function t(n,a,l){return!!(a8(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function r8(){return!0}function a8(e){return e!==null&&typeof e=="object"&&"type"in e}const $C=[],i8=!0,cg=!1,l8="skip";function FC(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=yf(l),u=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 S=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=$C,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(S=s8(n(m,y)),S[0]===cg))return S;if("children"in m&&m.children){const C=m;if(C.children&&S[0]!==l8)for(j=(a?C.children.length:-1)+u,E=y.concat(C);j>-1&&j<C.children.length;){const T=C.children[j];if(k=f(T,j,E)(),k[0]===cg)return k;j=typeof k[1]=="number"?k[1]:j+u}}return S}}}function s8(e){return Array.isArray(e)?e:typeof e=="number"?[i8,e]:e==null?$C:[e]}function by(e,t,n,a){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=a),FC(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return u(m,g,y)}}const dg={}.hasOwnProperty,o8={};function u8(e,t){const n=t||o8,a=new Map,l=new Map,o=new Map,u={...VB,...n.handlers},f={all:h,applyData:d8,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:c8,wrap:h8};return by(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,S=f.handlers[b];if(dg.call(f.handlers,b)&&S)return S(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,C=Zd(E);return C.children=f.all(y),C}return Zd(y)}return(f.options.unknownHandler||f8)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let S=-1;for(;++S<b.length;){const k=f.one(b[S],y);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=fS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=fS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function c8(e,t){e.position&&(t.position=JI(e))}function d8(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 u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Zd(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function f8(e,t){const n=t.data||{},a="value"in t&&!(dg.call(n,"hProperties")||dg.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 h8(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
352
- `});++a<e.length;)a&&n.push({type:"text",value:`
353
- `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
354
- `}),n}function fS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hS(e,t){const n=u8(e,t),a=n.one(e,void 0),l=WB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
355
- `},l),o}function m8(e,t){return e&&"run"in e?async function(n,a){const l=hS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return hS(n,{file:a,...e||t})}}function mS(e){if(e)throw e}var sp,pS;function p8(){if(pS)return sp;pS=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)},u=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 sp=function m(){var h,y,g,b,S,k,j=arguments[0],E=1,C=arguments.length,T=!1;for(typeof j=="boolean"&&(T=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(T&&b&&(o(b)||(S=l(b)))?(S?(S=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(T,k,b)})):typeof b<"u"&&u(j,{name:y,newValue:b}));return j},sp}var g8=p8();const op=Qd(g8);function fg(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 y8(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){u(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?v8(y,f)(...h):u(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 v8(e,t){let n;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}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(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Ir={basename:b8,dirname:x8,extname:S8,join:w8,sep:"/"};function b8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Uu(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 u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function x8(e){if(Uu(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 S8(e){Uu(e);let t=e.length,n=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!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 w8(...e){let t=-1,n;for(;++t<e.length;)Uu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":k8(n)}function k8(e){Uu(e);const t=e.codePointAt(0)===47;let n=j8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function j8(e,t){let n="",a=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-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=u,o=0;continue}}else if(n.length>0){n="",a=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Uu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const C8={cwd:E8};function E8(){return"/"}function hg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function N8(e){if(typeof e=="string")e=new URL(e);else if(!hg(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 _8(e)}function _8(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 up=["history","path","basename","stem","extname","dirname"];class qC{constructor(t){let n;t?hg(t)?n={path:t}:typeof t=="string"||A8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":C8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<up.length;){const o=up[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)up.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Ir.basename(this.path):void 0}set basename(t){dp(t,"basename"),cp(t,"basename"),this.path=Ir.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ir.dirname(this.path):void 0}set dirname(t){gS(this.basename,"dirname"),this.path=Ir.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ir.extname(this.path):void 0}set extname(t){if(cp(t,"extname"),gS(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=Ir.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hg(t)&&(t=N8(t)),dp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ir.basename(this.path,this.extname):void 0}set stem(t){dp(t,"stem"),cp(t,"stem"),this.path=Ir.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 xn(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 cp(e,t){if(e&&e.includes(Ir.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ir.sep+"`")}function dp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function gS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function A8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const T8=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),R8={}.hasOwnProperty;class xy extends T8{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=y8()}copy(){const t=new xy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(op(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mp("data",this.frozen),this.namespace[t]=n,this):R8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mp("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=bd(t),a=this.parser||this.Parser;return fp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),fp("process",this.parser||this.Parser),hp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=bd(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const S=g,k=a.stringify(S,b);M8(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?u(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),fp("processSync",this.parser||this.Parser),hp("processSync",this.compiler||this.Compiler),this.process(t,l),vS("processSync","process",n),a;function l(o,u){n=!0,mS(o),a=u}}run(t,n,a){yS(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(u,f){const m=bd(n);l.run(t,m,h);function h(y,g,b){const S=g||t;y?f(y):u?u(S):a(void 0,S,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),vS("runSync","run",a),l;function o(u,f){mS(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=bd(n),l=this.compiler||this.Compiler;return hp("stringify",l),yS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(mp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(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 u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(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=op(!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[S,...k]=y;const j=a[b][1];fg(j)&&fg(S)&&(S=op(!0,j,S)),a[b]=[h,S,...k]}}}}const z8=new xy().freeze();function fp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mp(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 yS(e){if(!fg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bd(e){return O8(e)?e:new qC(e)}function O8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function M8(e){return typeof e=="string"||D8(e)}function D8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const L8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bS=[],xS={allowDangerousHtml:!0},I8=/^(https?|ircs?|mailto|xmpp)$/i,U8=[{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 B8(e){const t=P8(e),n=$8(e);return F8(t.runSync(t.parse(n),n),e)}function P8(e){const t=e.rehypePlugins||bS,n=e.remarkPlugins||bS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xS}:xS;return z8().use(xB).use(n).use(m8,a).use(t)}function $8(e){const t=e.children||"",n=new qC;return typeof t=="string"&&(n.value=t),n}function F8(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||q8;for(const y of U8)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+L8+y.id,void 0);return by(e,h),rU(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return u?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let S;for(S in ap)if(Object.hasOwn(ap,S)&&Object.hasOwn(y.properties,S)){const k=y.properties[S],j=ap[S];(j===null||j.includes(y.tagName))&&(y.properties[S]=m(String(k||""),S,y))}}if(y.type==="element"){let S=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!S&&a&&typeof g=="number"&&(S=!a(y,g,b)),S&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function q8(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||I8.test(e.slice(0,t))?e:""}function H8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HC(e,t,n){const l=yf((n||{}).ignore||[]),o=Z8(t);let u=-1;for(;++u<o.length;)FC(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const S=y[g],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[u][0],S=o[u][1];let k=0;const E=g.children.indexOf(h);let C=!1,T=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const P=O.index,L={index:O.index,input:O.input,stack:[...y,h]};let R=S(...O,L);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=P+1:(k!==P&&T.push({type:"text",value:h.value.slice(k,P)}),Array.isArray(R)?T.push(...R):R&&T.push(R),k=P+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&T.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...T)):T=[h],E+T.length}}function Z8(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([V8(l[0]),Q8(l[1])])}return t}function V8(e){return typeof e=="string"?new RegExp(H8(e),"g"):e}function Q8(e){return typeof e=="function"?e:function(){return e}}function G8(e){HC(e,[/\r?\n|\r/g,K8])}function K8(){return{type:"break"}}function Y8(){return function(e){G8(e)}}function SS(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 pp="phrasing",gp=["autolink","link","image","label"];function X8(){return{transforms:[aP],enter:{literalAutolink:W8,literalAutolinkEmail:yp,literalAutolinkHttp:yp,literalAutolinkWww:yp},exit:{literalAutolink:rP,literalAutolinkEmail:nP,literalAutolinkHttp:eP,literalAutolinkWww:tP}}}function J8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:gp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:gp},{character:":",before:"[ps]",after:"\\/",inConstruct:pp,notInConstruct:gp}]}}function W8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function yp(e){this.config.enter.autolinkProtocol.call(this,e)}function eP(e){this.config.exit.autolinkProtocol.call(this,e)}function tP(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 nP(e){this.config.exit.autolinkEmail.call(this,e)}function rP(e){this.exit(e)}function aP(e){HC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lP]],{ignore:["link","linkReference"]})}function iP(e,t,n,a,l){let o="";if(!ZC(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!sP(n)))return!1;const u=oP(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function lP(e,t,n,a){return!ZC(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sP(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 oP(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=SS(e,"(");let o=SS(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 ZC(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xl(n)||mf(n))&&(!t||n!==47)}VC.peek=yP;function uP(){this.buffer()}function cP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function dP(){this.buffer()}function fP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mP(e){this.exit(e)}function pP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gP(e){this.exit(e)}function yP(){return"["}function VC(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function vP(){return{enter:{gfmFootnoteCallString:uP,gfmFootnoteCall:cP,gfmFootnoteDefinitionLabelString:dP,gfmFootnoteDefinition:fP},exit:{gfmFootnoteCallString:hP,gfmFootnoteCall:mP,gfmFootnoteDefinitionLabelString:pP,gfmFootnoteDefinition:gP}}}function bP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,u){const f=o.createTracker(u);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?`
356
- `:" ")+o.indentLines(o.containerFlow(a,f.current()),t?QC:xP))),h(),m}}function xP(e,t,n){return t===0?e:QC(e,t,n)}function QC(e,t,n){return(n?"":" ")+e}const SP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GC.peek=EP;function wP(){return{canContainEols:["delete"],enter:{strikethrough:jP},exit:{strikethrough:CP}}}function kP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:SP}],handlers:{delete:GC}}}function jP(e){this.enter({type:"delete",children:[]},e)}function CP(e){this.exit(e)}function GC(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function EP(){return"~"}function NP(e){return e.length}function _P(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||NP,o=[],u=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let C=-1;for(e[y].length>h&&(h=e[y].length);++C<e[y].length;){const T=AP(e[y][C]);if(n.alignDelimiters!==!1){const O=l(T);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(T)}u[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=wS(a[g]);else{const j=wS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],S=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let T=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const O=E+"-".repeat(T)+C;n.alignDelimiters!==!1&&(T=E.length+T+C.length,T>m[g]&&(m[g]=T),S[g]=T),b[g]=O}u.splice(1,0,b),f.splice(1,0,S),y=-1;const k=[];for(;++y<u.length;){const j=u[y],E=f[y];g=-1;const C=[];for(;++g<h;){const T=j[g]||"";let O="",P="";if(n.alignDelimiters!==!1){const L=m[g]-(E[g]||0),R=o[g];R===114?O=" ".repeat(L):R===99?L%2?(O=" ".repeat(L/2+.5),P=" ".repeat(L/2-.5)):(O=" ".repeat(L/2),P=O):P=" ".repeat(L)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(T),n.alignDelimiters!==!1&&C.push(P),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
357
- `)}function AP(e){return e==null?"":String(e)}function wS(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 TP(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),RP);return l(),u}function RP(e,t,n){return">"+(n?"":" ")+e}function zP(e,t){return kS(e,t.inConstruct,!0)&&!kS(e,t.notInConstruct,!1)}function kS(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 jS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
358
- `&&zP(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
359
- `}function OP(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=n.indexOf(t,l);return u}function MP(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 DP(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 LP(e,t,n,a){const l=DP(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(MP(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,IP);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(OP(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
360
- `,encode:["`"],...f.current()})),g()}return y+=f.move(`
361
- `),o&&(y+=f.move(o+`
362
- `)),y+=f.move(m),h(),y}function IP(e,t,n){return(n?"":" ")+e}function Sy(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 UP(e,t,n,a){const l=Sy(n),o=l==='"'?"Quote":"Apostrophe",u=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?" ":`
363
- `,...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()),u(),h}function BP(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 ku(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vd(e,t,n){const a=Vs(e),l=Vs(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}}KC.peek=PP;function KC(e,t,n,a){const l=BP(n),o=n.enter("emphasis"),u=n.createTracker(a),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=Vd(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=ku(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Vd(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+ku(g));const S=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function PP(e,t,n){return n.options.emphasis||"*"}function $P(e,t){let n=!1;return by(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,cg}),!!((!e.depth||e.depth<3)&&fy(e)&&(t.options.setext||n))}function FP(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if($P(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
364
- `,after:`
365
- `});return g(),y(),b+`
366
- `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
367
- `))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
368
- `,...o.current()});return/^[\t ]/.test(h)&&(h=ku(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}YC.peek=qP;function YC(e){return e.value||""}function qP(){return"<"}XC.peek=HP;function XC(e,t,n,a){const l=Sy(n),o=l==='"'?"Quote":"Apostrophe",u=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(")"),u(),h}function HP(){return"!"}JC.peek=ZP;function JC(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let u=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+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),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 ZP(){return"!"}WC.peek=VP;function WC(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 u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.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 VP(){return"`"}function eE(e,t){const n=fy(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))}tE.peek=QP;function tE(e,t,n,a){const l=Sy(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if(eE(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=u.move("<");return g+=u.move(n.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function QP(e,t,n){return eE(e,n)?"<":"["}nE.peek=GP;function nE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let u=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+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),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 GP(){return"["}function wy(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 KP(e){const t=wy(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 YP(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 rE(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 XP(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?YP(n):wy(n);const f=e.ordered?u==="."?")":".":KP(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&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),rE(n)===u&&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&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function JP(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 WP(e,t,n,a){const l=JP(n);let o=n.bulletCurrent||wy(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 u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,S){return b?(S?"":" ".repeat(u))+g:(S?o:o+" ".repeat(u-o.length))+g}}function e$(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const t$=yf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function n$(e,t,n,a){return(e.children.some(function(u){return t$(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function r$(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aE.peek=a$;function aE(e,t,n,a){const l=r$(n),o=n.enter("strong"),u=n.createTracker(a),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=Vd(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=ku(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Vd(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+ku(g));const S=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+S}function a$(e,t,n){return n.options.strong||"*"}function i$(e,t,n,a){return n.safe(e.value,a)}function l$(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 s$(e,t,n){const a=(rE(n)+(n.options.ruleSpaces?" ":"")).repeat(l$(n));return n.options.ruleSpaces?a.slice(0,-1):a}const iE={blockquote:TP,break:jS,code:LP,definition:UP,emphasis:KC,hardBreak:jS,heading:FP,html:YC,image:XC,imageReference:JC,inlineCode:WC,link:tE,linkReference:nE,list:XP,listItem:WP,paragraph:e$,root:n$,strong:aE,text:i$,thematicBreak:s$};function o$(){return{enter:{table:u$,tableData:CS,tableHeader:CS,tableRow:d$},exit:{codeText:f$,table:c$,tableData:vp,tableHeader:vp,tableRow:vp}}}function u$(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 c$(e){this.exit(e),this.data.inTable=void 0}function d$(e){this.enter({type:"tableRow",children:[]},e)}function vp(e){this.exit(e)}function CS(e){this.enter({type:"tableCell",children:[]},e)}function f$(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,h$));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function h$(e,t){return t==="|"?t:e}function m$(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
369
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:m,tableRow:f}};function u(S,k,j,E){return h(y(S,j,E),S.align)}function f(S,k,j,E){const C=g(S,j,E),T=h([C]);return T.slice(0,T.indexOf(`
370
- `))}function m(S,k,j,E){const C=j.enter("tableCell"),T=j.enter("phrasing"),O=j.containerPhrasing(S,{...E,before:o,after:o});return T(),C(),O}function h(S,k){return _P(S,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(S,k,j){const E=S.children;let C=-1;const T=[],O=k.enter("table");for(;++C<E.length;)T[C]=g(E[C],k,j);return O(),T}function g(S,k,j){const E=S.children;let C=-1;const T=[],O=k.enter("tableRow");for(;++C<E.length;)T[C]=m(E[C],S,k,j);return O(),T}function b(S,k,j){let E=iE.inlineCode(S,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function p$(){return{exit:{taskListCheckValueChecked:ES,taskListCheckValueUnchecked:ES,paragraph:y$}}}function g$(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:v$}}}function ES(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function y$(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,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===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 v$(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(u);let m=iE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+u}}function b$(){return[X8(),vP(),wP(),o$(),p$()]}function x$(e){return{extensions:[J8(),bP(e),kP(),m$(e),g$()]}}const S$={tokenize:N$,partial:!0},lE={tokenize:_$,partial:!0},sE={tokenize:A$,partial:!0},oE={tokenize:T$,partial:!0},w$={tokenize:R$,partial:!0},uE={name:"wwwAutolink",tokenize:C$,previous:dE},cE={name:"protocolAutolink",tokenize:E$,previous:fE},za={name:"emailAutolink",tokenize:j$,previous:hE},Qr={};function k$(){return{text:Qr}}let il=48;for(;il<123;)Qr[il]=za,il++,il===58?il=65:il===91&&(il=97);Qr[43]=za;Qr[45]=za;Qr[46]=za;Qr[95]=za;Qr[72]=[za,cE];Qr[104]=[za,cE];Qr[87]=[za,uE];Qr[119]=[za,uE];function j$(e,t,n){const a=this;let l,o;return u;function u(g){return!mg(g)||!hE.call(a,a.previous)||ky(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return mg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(w$,y,h)(g):g===45||g===95||gn(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&&Nn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function C$(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!dE.call(a,a.previous)||ky(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(S$,e.attempt(lE,e.attempt(sE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function E$(e,t,n){const a=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&fE.call(a,a.previous)&&!ky(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(Nn(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||qd(g)||jt(g)||xl(g)||mf(g)?n(g):e.attempt(lE,e.attempt(sE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function N$(e,t,n){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function _$(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(oE,m,f)(h):h===null||jt(h)||xl(h)||h!==45&&mf(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?n(h):t(h)}}function A$(e,t){let n=0,a=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&a<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(oE,t,o)(u):u===null||jt(u)||xl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function T$(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 Nn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):Nn(f)?(e.consume(f),u):n(f)}}function R$(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return gn(o)?n(o):t(o)}}function dE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function fE(e){return!Nn(e)}function hE(e){return!(e===47||mg(e))}function mg(e){return e===43||e===45||e===46||e===95||gn(e)}function ky(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 z$={tokenize:P$,partial:!0};function O$(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:I$,continuation:{tokenize:U$},exit:B$}},text:{91:{name:"gfmFootnoteCall",tokenize:L$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:M$,resolveTo:D$}}}}function M$(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){u=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(!u||!u._balanced)return n(m);const h=Nr(a.sliceSerialize({start:u.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 D$(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)},u={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",u,t],["exit",u,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 L$(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;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&&!u||g===null||g===91||jt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Nr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return jt(g)||(u=!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 I$(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=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(u>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=Nr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return jt(k)||(f=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),it(e,S,"gfmFootnoteDefinitionWhitespace")):n(k)}function S(k){return t(k)}}function U$(e,t,n){return e.check(Iu,t,e.attempt(z$,t,n))}function B$(e){e.exit("gfmFootnoteDefinition")}function P$(e,t,n){const a=this;return it(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function $$(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(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},g={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},b=[["enter",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",g,f]],S=f.parser.constructs.insideSpan.null;S&&Wn(b,b.length,0,pf(S,u.slice(h+1,m),f)),Wn(b,b.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),Wn(u,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,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):(u.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const j=Vs(h);if(k===126)return g>1?m(k):(u.consume(k),g++,S);if(g<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),C=Vs(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class F${constructor(){this.map=[]}add(t,n,a){q$(this,t,n,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[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 q$(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 H$(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 Z$(){return{flow:{null:{name:"table",tokenize:V$,resolveAll:Q$}}}}function V$(e,t,n){const a=this;let l=0,o=0,u;return f;function f(F){let de=a.events.length-1;for(;de>-1;){const fe=a.events[de][1].type;if(fe==="lineEnding"||fe==="linePrefix")de--;else break}const W=de>-1?a.events[de][1].type:null,ge=W==="tableHead"||W==="tableRow"?R:m;return ge===R&&a.parser.lazy[a.now().line]?n(F):ge(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(u=!0,o+=1),y(F)}function y(F){return F===null?n(F):Me(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),S):n(F):Je(F)?it(e,y,"whitespace")(F):(o+=1,u&&(u=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),u=!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 S(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),u=!1,Je(F)?it(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?E(F):F===124?(u=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):L(F)}function j(F){return Je(F)?it(e,E,"whitespace")(F):E(F)}function E(F){return F===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),C):F===45?(o+=1,C(F)):F===null||Me(F)?P(F):L(F)}function C(F){return F===45?(e.enter("tableDelimiterFiller"),T(F)):L(F)}function T(F){return F===45?(e.consume(F),T):F===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(F))}function O(F){return Je(F)?it(e,P,"whitespace")(F):P(F)}function P(F){return F===124?k(F):F===null||Me(F)?!u||l!==o?L(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):L(F)}function L(F){return n(F)}function R(F){return e.enter("tableRow"),M(F)}function M(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),M):F===null||Me(F)?(e.exit("tableRow"),t(F)):Je(F)?it(e,M,"whitespace")(F):(e.enter("data"),Z(F))}function Z(F){return F===null||F===124||jt(F)?(e.exit("data"),M(F)):(e.consume(F),F===92?re:Z)}function re(F){return F===92||F===124?(e.consume(F),Z):Z(F)}}function Q$(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,y,g;const b=new F$;for(;++n<e.length;){const S=e[n],k=S[1];S[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(NS(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],u=[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,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=xd(b,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],g=xd(b,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],g=xd(b,t,o,l,n,g)):u[1]!==0&&(g=xd(b,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&NS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const S=t.events[n];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=H$(t.events,n))}return e}function xd(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ks(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ks(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ks(t.events,n[2]),y=ks(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]],S=t.events[n[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ks(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function NS(e,t,n,a,l){const o=[],u=ks(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(n+1,0,o)}function ks(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const G$={name:"tasklistCheck",tokenize:Y$};function K$(){return{text:{91:G$}}}function Y$(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"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Me(m)?t(m):Je(m)?e.check({tokenize:X$},t,n)(m):n(m)}}function X$(e,t,n){return it(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function J$(e){return kC([k$(),O$(),$$(e),Z$(),K$()])}const W$={};function eF(e){const t=this,n=e||W$,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(J$(n)),o.push(b$()),u.push(x$(n))}function mE({children:e,className:t}){return d.jsx("div",{className:_e("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:d.jsx(B8,{remarkPlugins:[eF,Y8],children:e})})}function tF({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${m?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["System Prompt Append",m&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),d.jsx("div",{className:"flex gap-2",children:!o&&!l&&d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[d.jsx(Jd,{className:"h-3 w-3"})," Edit"]})})]}),d.jsx("div",{className:"px-4 py-3",children:o?d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!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}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(be,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),d.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."})]}):d.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?d.jsx(mE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}const nF={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function rF(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved?null:d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-warn-soft/95 px-6 py-3 backdrop-blur",children:d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-body",children:[e.summary.anyDirty&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{"aria-hidden":!0,children:"🟡"}),d.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),d.jsx("span",{className:"text-muted-foreground",children:"·"}),d.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(t=>d.jsx("button",{type:"button",className:"rounded bg-card px-2 py-0.5 text-caption border hover:bg-warn-soft",onClick:()=>e.onJumpTo(t),children:nF[t]},t))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&d.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[d.jsx(Ru,{className:"h-3.5 w-3.5"}),"Saved"]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-caption text-warn font-medium",children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-caption text-error font-medium",children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&d.jsx(be,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(be,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(be,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(FT,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function du(e){return`agent-cfg-${e}`}function nu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:u}){return d.jsxs("section",{id:e,className:_e("space-y-3",o),...u,children:[d.jsxs("div",{className:"flex items-end justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&d.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),d.jsx("div",{className:"space-y-3",children:l})]})}function aF(){return d.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const iF={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Fixed after creation — create a new agent to switch."},kael:{name:"Kael",caption:"Kael runtime (coming soon). Fixed after creation — create a new agent to switch."}};function lF(e){const t=iF[e.runtimeKind];return d.jsxs("div",{className:"space-y-3",children:[d.jsx(sF,{name:t.name,caption:t.caption,locked:!0}),d.jsx(oF,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer}),e.modelSlot]})}function sF({name:e,caption:t,locked:n}){return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsx("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Where it runs",n&&d.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx(Mw,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),d.jsxs("div",{className:"px-4 py-3 text-body space-y-1",children:[d.jsxs("div",{className:"inline-flex items-center gap-2",children:[d.jsx(Dw,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),d.jsx("span",{className:"font-medium",children:e})]}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function oF(e){const t=!!e.computerLabel;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&d.jsxs(be,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[d.jsx(Dg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]})]}),d.jsx("div",{className:"px-4 py-3 text-body",children:t?d.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):d.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 uF(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 cF(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function dF(e,t){return JSON.stringify(e)===JSON.stringify(t)}function bp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function _S(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:dF(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function xp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=cF(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:_S(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:_S(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function fF(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:bp(e.payload.mcpServers,"mcp"),env:bp(e.payload.env,"env"),git:bp(e.payload.gitRepos,"git")}}function hF(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(fF(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)??"",u=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],P=Z=>Z.reduce((re,F)=>F.status==="unchanged"?re:re+1,0),L=P(a.mcp),R=P(a.env),M=P(a.git);return u&&O.push("prompt"),f&&O.push("model"),L>0&&O.push("mcp"),R>0&&O.push("env"),M>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:u?1:0,model:f?1:0,mcp:L,env:R,git:M}}},[a,u,f]),h=x.useCallback(O=>{n(P=>P&&O(P))},[]),y=x.useCallback(O=>h(P=>({...P,promptAppend:O})),[h]),g=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(P=>({...P,model:O})),[h]),S=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>xp("mcp",h),[h]),j=x.useMemo(()=>xp("env",h),[h]),E=x.useMemo(()=>xp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),T=x.useCallback(()=>{if(!t||!e)return{};const O={};u&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const P=m.counts.mcp>0,L=m.counts.env>0,R=m.counts.git>0;return P&&(O.mcpServers=t.mcp.filter(M=>M.status!=="deleted").map(M=>M.value)),L&&(O.env=t.env.filter(M=>M.status!=="deleted").map(M=>{const Z=M.value;return Z.sensitive&&Z.value===Pd?{key:Z.key,value:Pd,sensitive:!0}:Z})),R&&(O.gitRepos=t.git.filter(M=>M.status!=="deleted").map(M=>M.value)),O},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:S,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:C,buildPayloadPatch:T}}const mF=Object.values(I6),Er={overview:"ad-overview",setup:"ad-setup",prompt:du("prompt"),tools:du("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function pF(e){const t=[{key:"overview",label:"Overview",anchor:Er.overview}];return e||t.push({key:"setup",label:"Setup",anchor:Er.setup},{key:"prompt",label:"Prompt",anchor:Er.prompt},{key:"tools",label:"Tools",anchor:Er.tools},{key:"advanced",label:"Advanced",anchor:Er.advanced}),t.push({key:"danger",label:"Danger zone",anchor:Er.danger,divider:!0,danger:!0}),t}function gF(){var Sr,Ft,on,Kr,Ml,Fu,qu,ro,Ia,Dl,Yr,Xr,Ua,Jr;const t=pA().uuid??"",n=Vr(),a=er(),l=Qe({queryKey:["agent",t],queryFn:()=>Jk(t),enabled:!!t}),o=Qe({queryKey:["agent-config",t],queryFn:()=>tI(t),enabled:!!t&&((Sr=l.data)==null?void 0:Sr.type)!=="human"}),u=Qe({queryKey:["agent-client-status",t],queryFn:()=>aI(t),enabled:!!t&&((Ft=l.data)==null?void 0:Ft.type)!=="human"}),f=Qe({queryKey:["agent-sessions-active",t],queryFn:()=>Js(t,{state:"active"}),enabled:!!t&&((on=l.data)==null?void 0:on.type)!=="human"}),m=Qe({queryKey:["adapters"],queryFn:sC}),h=Qe({queryKey:["adapter-mappings"],queryFn:iC}),{data:y}=Qe({queryKey:["adapter-statuses"],queryFn:lC,refetchInterval:15e3}),g=((Kr=m.data)==null?void 0:Kr.filter(X=>X.agentId===t))??[],b=((Ml=h.data)==null?void 0:Ml.filter(X=>X.agentId===t))??[],S=Qe({queryKey:["clients"],queryFn:gu,enabled:!!t&&((Fu=l.data)==null?void 0:Fu.type)!=="human",refetchInterval:3e4}),k=hF(o.data),[j,E]=x.useState(null),[C,T]=x.useState(null),[O,P]=x.useState(!1),L=wt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const X=k.buildPayloadPatch();return nI(t,{expectedVersion:o.data.version,payload:X})},onSuccess:X=>{a.setQueryData(["agent-config",t],X),E(null),T(null),P(!0)},onError:X=>{if(P(!1),X instanceof Xd&&X.status===409){T("Someone else saved a newer version while you were editing."),E(null);return}E(X instanceof Error?X.message:String(X))}});x.useEffect(()=>{if(!O)return;const X=setTimeout(()=>P(!1),2500);return()=>clearTimeout(X)},[O]),x.useEffect(()=>{k.summary.anyDirty&&P(!1)},[k.summary.anyDirty]);const R=x.useCallback(()=>{T(null),E(null),a.invalidateQueries({queryKey:["agent-config",t]}),k.resetAll()},[a,t,k]),M=x.useCallback(X=>{const Fe=document.getElementById(X);Fe&&Fe.scrollIntoView({behavior:"smooth",block:"start"})},[]),Z=wt({mutationFn:X=>u1(t,X),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),re=wt({mutationFn:()=>B3(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),F=wt({mutationFn:()=>P3(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),de=wt({mutationFn:()=>U3(t),onSuccess:()=>n("/agents")}),W=wt({mutationFn:()=>$3(t)}),[ge,fe]=x.useState(!1),[ee,q]=x.useState(""),[oe,K]=x.useState(null),he=Qe({queryKey:["clients"],queryFn:gu,enabled:ge}),A=wt({mutationFn:X=>u1(t,{clientId:X}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),fe(!1),q(""),K(null)},onError:X=>K(X instanceof Error?X.message:String(X))}),[U,B]=x.useState(!1),[_,te]=x.useState(null),[V,le]=x.useState(wp),[xe,Oe]=x.useState(""),[Se,xt]=x.useState(null),[ce,De]=x.useState(null),[lt,Be]=x.useState(!1),Dt=wt({mutationFn:async()=>{const X=AS(V);if(!X)throw new Error("Credentials are required");return JL({platform:V.platform,agentId:t,credentials:X,status:V.status})},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),_l()}}),Kt=wt({mutationFn:()=>{if(!_)throw new Error("No adapter selected");const X={status:V.status},Fe=AS(V);return Fe&&(X.credentials=Fe),WL(_,X)},onSuccess:()=>{a.invalidateQueries({queryKey:["adapters"]}),_l()}}),Oa=wt({mutationFn:eI,onSuccess:()=>a.invalidateQueries({queryKey:["adapters"]})}),Ma=wt({mutationFn:()=>YL({platform:V.platform,externalUserId:V.externalUserId,agentId:t,boundVia:"manual",displayName:V.displayName||void 0}),onSuccess:()=>{a.invalidateQueries({queryKey:["adapter-mappings"]}),_l()}}),Ar=wt({mutationFn:XL,onSuccess:()=>a.invalidateQueries({queryKey:["adapter-mappings"]})}),[Gr,Da]=x.useState(null),Di=wt({mutationFn:()=>rI(t,k.buildPayloadPatch()),onSuccess:X=>{const Fe=X.diff.length?X.diff.map(qn=>`${qn.op} ${qn.path}`).join(`
371
- `):"(no changes)";Da(Fe)},onError:X=>Da(`Dry run failed: ${X instanceof Error?X.message:String(X)}`)});x.useEffect(()=>{if(!k.summary.anyDirty)return;const X=Fe=>{Fe.preventDefault(),Fe.returnValue=""};return window.addEventListener("beforeunload",X),()=>window.removeEventListener("beforeunload",X)},[k.summary.anyDirty]);const La=((qu=l.data)==null?void 0:qu.type)==="human",rn=x.useMemo(()=>pF(La),[La]),Nl=x.useRef(null),[ae,ye]=x.useState(!1);if(x.useEffect(()=>{if(La)return;const X=Nl.current;if(!X||typeof IntersectionObserver>"u")return;const Fe=new IntersectionObserver(qn=>{const An=qn[0];An&&ye(!An.isIntersecting&&An.boundingClientRect.top<0)},{threshold:0});return Fe.observe(X),()=>Fe.disconnect()},[La]),l.isLoading)return d.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:d.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return d.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 we=l.data;if(!we)return d.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Le=we.type==="human",$e=u.data,an=((ro=f.data)==null?void 0:ro.length)??0,nr=!Le&&!($e!=null&&$e.clientId),ln=!Le&&$e?!$e.online&&!!$e.clientId:!1,Rt=we,sn=Rt.runtimeState??null,ct=Rt.runtimeType??null,Tr=Rt.totalSessions??null,Sn=we.uuid.slice(0,8);function _l(){B(!1),te(null),le(wp),Oe("")}function Al(X){te(X.id),le({...wp,platform:X.platform,status:X.status}),B(!0)}function Tl(X){if(X.preventDefault(),Oe(""),Le){if(!V.externalUserId)return;Ma.mutate();return}if(V.platform==="feishu"){if(!_&&(!V.feishuAppId||!V.feishuAppSecret)){Oe("App ID and App Secret are required");return}}else if(V.platform==="kael"){if(!_&&(!V.kaelUserId||!V.kaelProjectId)){Oe("User ID and Project ID are required");return}}else{const Fe=V.credentialsJson.trim();if(!_&&!Fe){Oe("Credentials are required");return}if(Fe)try{JSON.parse(Fe)}catch{Oe("Invalid JSON");return}}_?Kt.mutate():Dt.mutate()}const Li=Dt.error??Kt.error??Ma.error,Rr=Dt.isPending||Kt.isPending||Ma.isPending,Rl=uF({activeSessions:an,isUnclaimed:nr,isOffline:ln}),Ii=k.draft.mcp.filter(X=>X.status!=="deleted"),xf=k.draft.env.filter(X=>X.status!=="deleted"),Bu=k.draft.git.filter(X=>X.status!=="deleted"),no=X=>new Set(Ii.filter(Fe=>Fe.key!==X).map(Fe=>Fe.value.name.toLowerCase())),Ui=X=>new Set(xf.filter(Fe=>Fe.key!==X).map(Fe=>Fe.value.key)),Sf=X=>new Set(Bu.filter(Fe=>Fe.key!==X).map(Fe=>{const{value:qn}=Fe;return qn.localPath?qn.localPath:((qn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),rr={sessions:Tr??"—",active:an,runtime:ct??(Le?"human":"—"),model:((Dl=(Ia=o.data)==null?void 0:Ia.payload.model)==null?void 0:Dl.trim())||"—"},Bi=($e==null?void 0:$e.clientId)??null,zl=Bi?((Yr=S.data)==null?void 0:Yr.find(X=>X.id===Bi))??null:null,Ol=Bi?(zl==null?void 0:zl.hostname)??Bi:null,Pi=ct==="kael"?"kael":"claude-code",Pu=Pi==="kael"?"Kael":Pi==="claude-code"?"Claude Code":ct??"—",$u=d.jsxs(Zr,{children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"inline-flex items-center gap-2 text-body font-semibold",children:[Le?d.jsx(Dg,{className:"h-3.5 w-3.5"}):d.jsx(CT,{className:"h-3.5 w-3.5"}),"Platform bindings"]}),d.jsxs(be,{size:"xs",variant:"outline",onClick:()=>B(!0),children:[d.jsx(Sl,{className:"h-3 w-3"}),Le?"Bind user":"Bind bot"]})]}),Le?d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"External user ID"}),d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Bound via"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:32}})]})}),d.jsx(_a,{children:b.length===0?d.jsx(Wt,{children:d.jsx(Ne,{colSpan:6,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):b.map(X=>d.jsxs(Wt,{children:[d.jsx(Ne,{children:d.jsx(en,{children:X.platform})}),d.jsx(Ne,{className:"mono text-label",children:X.externalUserId}),d.jsx(Ne,{children:X.displayName??"—"}),d.jsx(Ne,{children:d.jsx(en,{tone:"outline",children:X.boundVia??"—"})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(X.createdAt)}),d.jsx(Ne,{children:d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>xt(X.id),disabled:Ar.isPending,children:d.jsx(pu,{className:"h-3.5 w-3.5"})})})]},X.id))})]}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Connection"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{style:{width:64}})]})}),d.jsx(_a,{children:g.length===0?d.jsx(Wt,{children:d.jsx(Ne,{colSpan:5,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):g.map(X=>{const Fe=y==null?void 0:y.find(An=>An.configId===X.id),qn=X.platform==="kael"?X.status==="active":!!(Fe!=null&&Fe.connected);return d.jsxs(Wt,{children:[d.jsx(Ne,{children:d.jsx(en,{children:X.platform})}),d.jsx(Ne,{children:d.jsx(en,{tone:X.status==="active"?"accent":"outline",children:X.status})}),d.jsx(Ne,{children:d.jsx(Ti,{state:qn?"idle":"offline"})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(X.createdAt)}),d.jsx(Ne,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Al(X),title:"Edit",children:"…"}),d.jsx(be,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>De(X.id),disabled:Oa.isPending,title:"Delete",children:d.jsx(pu,{className:"h-3.5 w-3.5"})})]})})]},X.id)})})]})]});return d.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[d.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:[d.jsx(hf,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),rn.map(X=>d.jsxs("div",{children:[X.divider&&d.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),d.jsx("button",{type:"button",onClick:()=>M(X.anchor),className:"block w-full text-left bg-transparent text-body",style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",color:X.danger?"var(--state-error)":"var(--fg-3)",border:"none",borderLeft:"var(--hairline-bold) solid transparent",cursor:"pointer"},onMouseEnter:Fe=>{Fe.currentTarget.style.color=X.danger?"var(--state-error)":"var(--fg)",Fe.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:Fe=>{Fe.currentTarget.style.color=X.danger?"var(--state-error)":"var(--fg-3)",Fe.currentTarget.style.background="transparent"},children:X.label})]},X.key))]}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[d.jsxs(iI,{style:{marginBottom:8},children:[d.jsx(lI,{onClick:()=>n("/agents"),children:"Agents"}),d.jsx(sI,{}),d.jsx(oI,{mono:!0,children:we.name??Sn})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.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:d.jsx(Mu,{width:18,height:20,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-title",children:we.displayName}),d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",we.name??Sn]})]}),d.jsxs("div",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:["agt_",Sn," · ",we.type,we.visibility?` · ${we.visibility}`:""]})]}),d.jsx(Ti,{state:sn})]}),d.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[d.jsx(gd,{label:"sessions",value:rr.sessions}),d.jsx(gd,{label:"active",value:rr.active,accent:typeof rr.active=="number"&&rr.active>0?"var(--accent)":void 0}),d.jsx(gd,{label:"runtime",value:rr.runtime}),d.jsx(gd,{label:"model",value:rr.model})]})]}),!Le&&d.jsx(cI,{runtimeLabel:Pu,computerLabel:Ol,modelLabel:rr.model,visible:ae}),d.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:[(W.data||W.error)&&d.jsx(SF,{result:W.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>W.reset()}),d.jsx(nu,{anchorId:Er.overview,title:"Overview",children:d.jsx(NI,{agent:we,isHuman:Le,profileSlot:d.jsx(xI,{agent:we,onSave:async X=>{await Z.mutateAsync(X)}}),bindingsSlot:$u,health:{runtimeState:sn,model:rr.model,activeSessions:an,totalSessions:rr.sessions,offlineSince:($e==null?void 0:$e.offlineSince)??null},onOpenChat:()=>n(`/?a=${we.uuid}`),onTest:()=>{W.reset(),W.mutate()},testPending:W.isPending})}),d.jsx("div",{ref:Nl,"aria-hidden":!0,style:{height:0}}),!Le&&d.jsxs(d.Fragment,{children:[d.jsxs(nu,{anchorId:Er.setup,title:"Setup",caption:((Xr=o.data)==null?void 0:Xr.version)!=null?d.jsxs("span",{className:"mono",children:["config v",o.data.version,k.summary.anyDirty&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&d.jsx(lF,{runtimeKind:Pi,computerLabel:Ol,canBindComputer:nr&&we.status==="active",bindComputerPending:A.isPending,onBindComputer:()=>fe(!0),modelSlot:d.jsx(EI,{value:k.draft.model,baseline:((Ua=o.data)==null?void 0:Ua.payload.model)??"",onChange:k.setModel,onRevert:k.revertModel,disabled:we.status!=="active"})})]}),d.jsx(nu,{anchorId:Er.prompt,title:"Prompt",children:o.data?d.jsx(tF,{value:k.draft.promptAppend,baseline:((Jr=o.data)==null?void 0:Jr.payload.prompt.append)??"",onChange:k.setPromptAppend,onRevert:k.revertPrompt,disabled:we.status!=="active"}):null}),d.jsx(nu,{anchorId:Er.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?d.jsx(kI,{items:k.draft.mcp,otherNames:no,onAdd:k.addMcp,onUpdate:k.updateMcp,onDelete:k.deleteMcp,onUndoDelete:k.undoDeleteMcp,disabled:we.status!=="active"}):null}),d.jsx(nu,{anchorId:Er.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{id:du("env"),className:"space-y-2",children:[d.jsx("h3",{className:"text-body font-medium",style:{color:"var(--fg)"},children:"Environment variables"}),d.jsx(gI,{items:k.draft.env,otherKeys:Ui,onAdd:k.addEnv,onUpdate:k.updateEnv,onDelete:k.deleteEnv,onUndoDelete:k.undoDeleteEnv,disabled:we.status!=="active"})]}),d.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border-faint)"}}),d.jsxs("div",{id:du("git"),className:"space-y-2",children:[d.jsx("h3",{className:"text-body font-medium",style:{color:"var(--fg)"},children:"Git repositories"}),d.jsx(vI,{items:k.draft.git,otherPaths:Sf,onAdd:k.addGit,onUpdate:k.updateGit,onDelete:k.deleteGit,onUndoDelete:k.undoDeleteGit,disabled:we.status!=="active"})]}),Gr&&d.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:8,borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:Gr}),k.summary.anyDirty&&d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:d.jsx("button",{type:"button",onClick:()=>Di.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:Di.isPending,children:Di.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),d.jsx(aF,{}),d.jsx(dI,{agent:we,suspendPending:re.isPending,reactivatePending:F.isPending,deletePending:de.isPending,onSuspend:()=>re.mutate(),onReactivate:()=>F.mutate(),onDelete:()=>de.mutate()})]}),!Le&&d.jsx(rF,{summary:k.summary,saveHint:Rl,conflictMessage:C,errorMessage:j,saving:L.isPending,justSaved:O,onSave:()=>L.mutate(),onDiscard:()=>{k.summary.anyDirty&&Be(!0)},onReloadRemote:R,onJumpTo:X=>M(du(X))})]}),d.jsx(Sp,{open:Se!=null,onOpenChange:X=>!X&&xt(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:Ar.isPending,onConfirm:()=>{Se!=null&&(Ar.mutate(Se),xt(null))}}),d.jsx(Sp,{open:ce!=null,onOpenChange:X=>!X&&De(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:Oa.isPending,onConfirm:()=>{ce!=null&&(Oa.mutate(ce),De(null))}}),d.jsx(Sp,{open:lt,onOpenChange:Be,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:()=>{k.resetAll(),E(null),T(null),Be(!1)}}),d.jsx(yn,{open:ge,onOpenChange:X=>{fe(X),X||(q(""),K(null),A.reset())},children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.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."}),he.isLoading?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):he.error?d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",he.error instanceof Error?he.error.message:"Unknown"]}):d.jsx(yF,{clients:he.data??[],selected:ee,onSelect:q}),oe&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:oe})]}),d.jsxs(vn,{children:[d.jsx(be,{variant:"outline",onClick:()=>fe(!1),children:"Cancel"}),d.jsx(be,{disabled:!ee||A.isPending,onClick:()=>{K(null),A.mutate(ee)},children:A.isPending?"Binding…":"Bind"})]})]})}),d.jsx(yn,{open:U,onOpenChange:X=>X?B(!0):_l(),children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:Le?"Bind External User":_?"Edit Bot Binding":"Bind Bot"})}),d.jsxs("form",{onSubmit:Tl,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:V.platform,onChange:X=>le({...V,platform:X.target.value}),disabled:!!_,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:mF.map(X=>d.jsx("option",{value:X,children:X},X))})]}),Le?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"binding-ext-id",children:"External User ID"}),d.jsx(kt,{id:"binding-ext-id",value:V.externalUserId,onChange:X=>le({...V,externalUserId:X.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"binding-name",children:"Display Name (optional)"}),d.jsx(kt,{id:"binding-name",value:V.displayName,onChange:X=>le({...V,displayName:X.target.value})})]})]}):d.jsxs(d.Fragment,{children:[V.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(at,{htmlFor:"feishu-app-id",children:["App ID",_?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"feishu-app-id",value:V.feishuAppId,onChange:X=>le({...V,feishuAppId:X.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(at,{htmlFor:"feishu-app-secret",children:["App Secret",_?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:V.feishuAppSecret,onChange:X=>le({...V,feishuAppSecret:X.target.value}),placeholder:"••••••••"})]})]}):V.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(at,{htmlFor:"kael-user-id",children:["User ID",_?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"kael-user-id",value:V.kaelUserId,onChange:X=>le({...V,kaelUserId:X.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(at,{htmlFor:"kael-project-id",children:["Project ID",_?" — leave empty to keep existing":""]}),d.jsx(kt,{id:"kael-project-id",value:V.kaelProjectId,onChange:X=>le({...V,kaelProjectId:X.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!_&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(at,{htmlFor:"binding-creds",children:["Credentials (JSON)",_?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:V.credentialsJson,onChange:X=>le({...V,credentialsJson:X.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": "..."}'})]}),xe&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:xe}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:V.status,onChange:X=>le({...V,status:X.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:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),Li instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:Li.message}),d.jsx(vn,{children:d.jsx(be,{type:"submit",disabled:Rr,children:Rr?"Saving...":_?"Update":"Create"})})]})]})})]})}function Sp(e){return d.jsx(yn,{open:e.open,onOpenChange:e.onOpenChange,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:e.title})}),d.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),d.jsx(be,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}const wp={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function AS(e){if(e.platform==="feishu"){if(!e.feishuAppId&&!e.feishuAppSecret)return null;if(!e.feishuAppId||!e.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:e.feishuAppId,app_secret:e.feishuAppSecret}}if(e.platform==="kael"){if(!e.kaelUserId&&!e.kaelProjectId)return null;if(!e.kaelUserId||!e.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId}}const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function yF({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?d.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"," ",d.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."]}):d.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,u=l.status==="online"||l.status==="active";return d.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("button",{type:"button",onClick:()=>n(l.id),className:_e("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[d.jsx("span",{className:_e("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),d.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}`:""]})]}),d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const vF={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},bF={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},xF={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function SF({result:e,onDismiss:t}){const n=bF[e.status],a=xF[e.status],l=e.connection;return d.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:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(en,{tone:a,children:vF[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&d.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[d.jsx("div",{children:l.runtimeState&&d.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?d.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.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})]}),d.jsx(be,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function wF(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function kF({agent:e,open:t,onClose:n,onBound:a}){var g;const[l,o]=x.useState(!1),u=Qe({queryKey:["connect-token",e.uuid],queryFn:()=>Jw(),enabled:t,staleTime:6e4}),f=Qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Jk(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});x.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&a(b)},[f.data,a]);const m=((g=u.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${wF(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(yn,{open:t,onOpenChange:b=>!b&&n(),children:d.jsxs(hn,{className:"max-w-lg",children:[d.jsx(_n,{children:d.jsx(bn,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[d.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(be,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?d.jsx(Ru,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(Mg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[d.jsx(bl,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),d.jsx(vn,{children:d.jsx(be,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const kp=200;function jF(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 TS(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,Es)}function CF(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,Es)}function EF(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 NF({open:e,onOpenChange:t,onCreated:n}){const a=er(),[l,o]=x.useState(""),[u,f]=x.useState(""),[m,h]=x.useState(!1),[y,g]=x.useState("claude-code"),[b,S]=x.useState("form"),[k,j]=x.useState([]),[E,C]=x.useState(null),[T,O]=x.useState(!1),[P,L]=x.useState({}),[R,M]=x.useState({status:"idle"});x.useEffect(()=>{e&&(o(""),f(""),h(!1),g("claude-code"),S("form"),j([]),C(null),O(!1),L({}),M({status:"idle"}))},[e]),x.useEffect(()=>{m||f(TS(l))},[l,m]);const Z=x.useRef(0);x.useEffect(()=>{if(!e||!u){M({status:"idle"});return}if(!tg.test(u)){M({status:"bad",reason:"invalid"});return}if(ng(u)){M({status:"bad",reason:"reserved"});return}const K=++Z.current;M({status:"checking"});const he=window.setTimeout(()=>{I3(u).then(A=>{K===Z.current&&(A.available?M({status:"ok"}):M({status:"bad",reason:A.reason}))}).catch(()=>{K===Z.current&&M({status:"idle"})})},300);return()=>window.clearTimeout(he)},[u,e]);const re=wt({mutationFn:async K=>{const he=l.trim()||u.trim()||"Untitled assistant";return L3({name:u||void 0,type:"personal_assistant",displayName:he,clientId:K.clientId})},onSuccess:K=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),n(K,y)}}),F=x.useMemo(()=>{const K=re.error;if(!K)return{};if(K instanceof Xd){const he=jF(K.issues);return Object.keys(he).length>0?he:K.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:K.message}}return K instanceof Error?{_root:K.message}:{}},[re.error]),de=R.status==="bad"?EF(R.reason):void 0,W={...de?{name:de}:{},...F,...P};function ge(){const K={};return u?u.length>Es?K.name=`Agent name must be at most ${Es} characters (got ${u.length}).`:tg.test(u)?ng(u)&&(K.name="That agent name is reserved — pick a different one."):K.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":l.trim().length>0&&(K.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),l.length>kp&&(K.displayName=`Display name must be at most ${kp} characters (got ${l.length}).`),K}async function fe(K){var A,U;K.preventDefault();const he=ge();if(L(he),!(Object.keys(he).length>0)&&R.status!=="bad"){if(y!=="claude-code"){re.mutate({clientId:void 0});return}O(!0);try{const _=(await gu()).filter(V=>V.status==="connected");if(_.length===0){re.mutate({clientId:void 0});return}if(_.length===1){re.mutate({clientId:(A=_[0])==null?void 0:A.id});return}const te=[..._].sort((V,le)=>le.lastSeenAt.localeCompare(V.lastSeenAt));j(te),C(((U=te[0])==null?void 0:U.id)??null),S("pick-computer")}catch{re.mutate({clientId:void 0})}finally{O(!1)}}}function ee(){E&&re.mutate({clientId:E})}const q=R.status==="bad",oe=l.trim().length>0&&!q&&!re.isPending&&!T;return b==="pick-computer"?d.jsx(yn,{open:e,onOpenChange:t,children:d.jsxs(hn,{className:"max-w-lg",children:[d.jsx(_n,{children:d.jsx(bn,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",d.jsx("span",{className:"font-medium",children:l||u})," ","should run:"]}),d.jsx("div",{className:"space-y-2",children:k.map(K=>{const he=E===K.id;return d.jsxs("label",{className:he?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"target-computer",checked:he,onChange:()=>C(K.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-body font-medium truncate",children:K.hostname??K.id}),d.jsxs("div",{className:"text-caption text-muted-foreground",children:[K.os??"unknown OS"," · last seen ",new Date(K.lastSeenAt).toLocaleString()]})]})]},K.id)})}),W.clientId&&d.jsx("p",{className:"text-body text-destructive",children:W.clientId}),W._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root})]}),d.jsxs(vn,{children:[d.jsx(be,{variant:"outline",onClick:()=>S("form"),disabled:re.isPending,children:"Back"}),d.jsx(be,{onClick:ee,disabled:!E||re.isPending,children:re.isPending?"Creating…":"Create"})]})]})}):d.jsx(yn,{open:e,onOpenChange:t,children:d.jsxs(hn,{className:"max-w-lg",children:[d.jsx(_n,{children:d.jsx(bn,{children:"New Agent"})}),d.jsxs("form",{onSubmit:fe,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(kt,{id:"new-agent-display-name",value:l,onChange:K=>{o(K.target.value),P.displayName&&L(he=>({...he,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:kp,"aria-invalid":W.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),d.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."}),W.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:W.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"new-agent-name",children:"Agent name"}),d.jsxs("div",{className:"flex items-stretch",children:[d.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:"@"}),d.jsx(kt,{id:"new-agent-name",value:u,onChange:K=>{const he=CF(K.target.value);f(he),h(!0),P.name&&L(A=>({...A,name:void 0}))},onBlur:K=>{const he=TS(K.target.value);he!==u&&f(he)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:Es,"aria-invalid":W.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),d.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"," ",Es," characters. Permanent after creation."]}),u&&!W.name&&R.status!=="idle"&&d.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:R.status==="ok"?"var(--state-idle)":R.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[R.status==="checking"&&"Checking availability…",R.status==="ok"&&"Available."]}),W.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:W.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:y==="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:[d.jsx("input",{type:"radio",name:"runtime",checked:y==="claude-code",onChange:()=>g("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),d.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[d.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),d.jsxs("div",{children:[d.jsxs("div",{className:"text-body font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-caption font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),W._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:W._root}),d.jsx(vn,{children:d.jsx(be,{type:"submit",disabled:!oe,children:T?"Checking computers…":re.isPending?"Creating…":"Create"})})]})]})})}function lu({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return d.jsxs("button",{type:"button",className:_e("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&d.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const _F=Object.values(P6);function RS(e){return[...e].sort((t,n)=>{const a=(t.displayName||t.name||"").toLowerCase(),l=(n.displayName||n.name||"").toLowerCase();return a.localeCompare(l)})}function AF(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null}}function xs(e,t,n){var l;let a=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&a++;return a}function TF(){const e=Vr(),{memberId:t}=Aa(),[n,a]=x.useState(),[l,o]=x.useState(""),[u,f]=x.useState(!1),[m,h]=x.useState(null),[y,g]=x.useState("all"),[b,S]=x.useState(""),k=jl(),j=qg(),E=ay(),{data:C,isLoading:T,error:O}=Qe({queryKey:["agents",n,l],queryFn:()=>af({limit:100,cursor:n,type:l||void 0})}),{data:P}=Qe({queryKey:["activity"],queryFn:zu,refetchInterval:1e4}),L=x.useMemo(()=>{const K=new Map;for(const he of(P==null?void 0:P.agents)??[])K.set(he.agentId,he);return K},[P==null?void 0:P.agents]),{myAgents:R,teamAgents:M}=x.useMemo(()=>{if(!(C!=null&&C.items))return{myAgents:[],teamAgents:[]};const K=[],he=[];for(const A of C.items)t&&A.managerId===t?K.push(A):he.push(A);return{myAgents:RS(K),teamAgents:RS(he)}},[C,t]),Z=(C==null?void 0:C.items.length)??0,re=R.length,F=M.length,de=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var he;return((he=L.get(K.uuid))==null?void 0:he.runtimeState)==="working"}).length,[C==null?void 0:C.items,L]),W=x.useMemo(()=>((C==null?void 0:C.items)??[]).filter(K=>{var A;const he=(A=L.get(K.uuid))==null?void 0:A.runtimeState;return he==="blocked"||he==="error"}).length,[C==null?void 0:C.items,L]);function ge(K){var A;const he=(A=L.get(K.uuid))==null?void 0:A.runtimeState;return y==="mine"?t!=null&&K.managerId===t:y==="running"?he==="working":y==="attn"?he==="blocked"||he==="error":!0}function fe(K){if(!b.trim())return!0;const he=b.toLowerCase(),A=K.delegateMention?k(K.delegateMention):"",U=E(K.managerId);return(K.name??"").toLowerCase().includes(he)||K.displayName.toLowerCase().includes(he)||A.toLowerCase().includes(he)||U.toLowerCase().includes(he)}const ee=R.filter(K=>ge(K)&&fe(K)),q=M.filter(K=>ge(K)&&fe(K));function oe(K,he){if(f(!1),K.clientId){e(`/?a=${K.uuid}`);return}if(he==="claude-code"){h(K);return}e(`/?a=${K.uuid}`)}return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Agents",subtitle:Z>0?d.jsxs(d.Fragment,{children:[Z," total · ",re," mine · ",F," team"]}):null,right:d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsxs(be,{size:"xs",onClick:()=>f(!0),children:[d.jsx(Sl,{className:"h-3 w-3"}),"New agent"]})})}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("div",{className:"relative",style:{width:240},children:[d.jsx(Wd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),d.jsx("input",{value:b,onChange:K=>S(K.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(lu,{active:y==="all",count:Z,onClick:()=>g("all"),children:"all"}),d.jsx(lu,{active:y==="mine",count:re,onClick:()=>g("mine"),children:"mine"}),d.jsx(lu,{active:y==="running",count:de,onClick:()=>g("running"),children:"running"}),d.jsx(lu,{active:y==="attn",count:W,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),d.jsx("div",{style:{flex:1}}),d.jsxs("select",{value:l,onChange:K=>{o(K.target.value),a(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[d.jsx("option",{value:"",children:"all types"}),_F.map(K=>d.jsx("option",{value:K,children:K},K))]})]}),T?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):O?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",O instanceof Error?O.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsx(zS,{title:`My agents · ${ee.length}`,agents:ee,runtimeMap:L,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!1,emptyLabel:R.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:d.jsx(OS,{items:[{state:"working",count:xs(R,L,"working")},{state:"blocked",count:xs(R,L,"blocked")},{state:"error",count:xs(R,L,"error")}]}),className:"mb-4"}),M.length>0&&d.jsx(zS,{title:`Team agents · ${q.length}`,agents:q,runtimeMap:L,resolveAgentIdentity:j,resolveMemberName:E,navigate:e,showOwner:!0,emptyLabel:"No agents match the current filter",breakdown:d.jsx(OS,{items:[{state:"working",count:xs(M,L,"working")},{state:"blocked",count:xs(M,L,"blocked")},{state:"error",count:xs(M,L,"error")}]})})]}),(C==null?void 0:C.nextCursor)&&d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(be,{variant:"outline",size:"xs",onClick:()=>a(C.nextCursor??void 0),children:"Next page"})})]}),d.jsx(NF,{open:u,onOpenChange:f,onCreated:oe}),m&&d.jsx(kF,{agent:m,open:m!==null,onClose:()=>{const K=m.uuid;h(null),e(`/?a=${K}`)},onBound:K=>{h(null),e(`/?a=${K.uuid}`)}})]})}function zS({title:e,agents:t,runtimeMap:n,resolveAgentIdentity:a,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m,showOwner:h}){return d.jsxs(Zr,{className:m,children:[d.jsx(Zs,{right:f,children:e}),t.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:u}):d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Agent name"}),d.jsx(ze,{children:"Type"}),d.jsx(ze,{children:"Delegate"}),h&&d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"Runtime"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(_a,{children:t.map(y=>d.jsx(RF,{agent:y,runtime:AF(y,n),resolveAgentIdentity:a,resolveMemberName:l,navigate:o,showOwner:h},y.uuid))})]})]})}function OS({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center",children:t.map((n,a)=>d.jsxs("span",{className:"inline-flex items-center",children:[a>0&&d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function RF({agent:e,runtime:t,resolveAgentIdentity:n,resolveMemberName:a,navigate:l,showOwner:o}){const{runtimeState:u}=t,f=u==="idle"||u==="working"||u==="blocked"||u==="error"||u==="offline",m=e.delegateMention?n(e.delegateMention):null;return d.jsxs(Wt,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"font-medium",children:e.displayName})}),d.jsx(Ne,{children:e.name?d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",e.name]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Ne,{children:d.jsx(en,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),d.jsx(Ne,{children:e.delegateMention?d.jsx(oC,{name:(m==null?void 0:m.name)??null,displayName:(m==null?void 0:m.displayName)??null,tone:"accent"}):d.jsx("span",{style:{color:"var(--fg-4)"},children:"—"})}),o&&d.jsx(Ne,{className:"text-label",style:{color:"var(--fg-2)"},children:a(e.managerId)}),d.jsx(Ne,{children:u&&f?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(bl,{state:u,size:7}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:u})]}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Ne,{children:d.jsx(en,{tone:e.status==="active"?"accent":"outline",children:e.status})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(e.createdAt)})]})}function zF(){const{data:e}=Qe({queryKey:["members","user-name-map"],queryFn:ry,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function OF(){const[e,t]=x.useState(null),[n,a]=x.useState(!1),l=wt({mutationFn:Jw,onSuccess:u=>{t(u),a(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),a(!0),setTimeout(()=>a(!1),2e3))};return d.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[d.jsx(cR,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?d.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",d.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),d.jsxs(be,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?d.jsx(Ru,{className:"h-3 w-3"}):d.jsx(Mg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),d.jsx(be,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function MF(){const e=er(),t=jl(),n=zF(),{role:a}=Aa(),l=a==="admin",[o,u]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(null),{data:S}=Qe({queryKey:["clients"],queryFn:gu,refetchInterval:1e4}),{data:k}=Qe({queryKey:["activity"],queryFn:zu,refetchInterval:1e4}),j=wt({mutationFn:uz,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=wt({mutationFn:oz,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:L=>{L instanceof Xd?b(L.message):b(L instanceof Error?L.message:String(L))}}),C=x.useMemo(()=>{const L=new Map;for(const R of(k==null?void 0:k.agents)??[]){if(!R.clientId)continue;const M=L.get(R.clientId)??[];M.push(R),L.set(R.clientId,M)}return L},[k==null?void 0:k.agents]),T=L=>C.get(L)??[],O=(S??[]).filter(L=>L.status==="connected").length,P=(S??[]).reduce((L,R)=>L+R.agentCount,0);return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Computers",subtitle:S&&S.length>0?d.jsxs(d.Fragment,{children:[S.length," total · ",O," connected · ",P," agents bound"]}):null}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsx(OF,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.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:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),T(h.id).length>0&&d.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:[d.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-body space-y-0.5",children:T(h.id).map(L=>d.jsx("li",{className:"font-medium",children:t(L.agentId)},L.agentId))})]}),g&&d.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:g}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),d.jsx(be,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.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:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:T(f.id).length===0?d.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):T(f.id).map(L=>d.jsxs("li",{className:"text-body flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(L.agentId)}),d.jsx(Ti,{state:L.runtimeState})]},L.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(be,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(be,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!S||S.length===0?d.jsx(Zr,{children:d.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):d.jsxs(Zr,{children:[d.jsxs(Zs,{right:d.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",S.length]}),d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{style:{width:16}}),d.jsx(ze,{children:"Hostname"}),l&&d.jsx(ze,{children:"Owner"}),d.jsx(ze,{children:"OS"}),d.jsx(ze,{children:"SDK"}),d.jsx(ze,{children:"Agents"}),d.jsx(ze,{children:"Connected"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{})]})}),d.jsx(_a,{children:S.map(L=>{const R=o===L.id,M=T(L.id);return d.jsx(DF,{client:L,boundAgents:M,isExpanded:R,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(R?null:L.id),onDisconnect:()=>m(L),onRetire:()=>{b(null),y(L)}},L.id)})})]})]})]})]})}function DF({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return d.jsxs(d.Fragment,{children:[d.jsxs(Wt,{interactive:!0,selected:n,onClick:u,children:[d.jsx(Ne,{style:{width:16},children:d.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?d.jsx(_T,{className:"h-3.5 w-3.5"}):d.jsx(TT,{className:"h-3.5 w-3.5"})})}),d.jsx(Ne,{className:"font-medium",children:e.hostname??"—"}),l&&d.jsx(Ne,{style:{color:"var(--fg-2)"},children:o(e.userId)}),d.jsx(Ne,{style:{color:"var(--fg-3)"},children:e.os??"—"}),d.jsx(Ne,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),d.jsx(Ne,{children:d.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Hr(e.connectedAt):"—"}),d.jsx(Ne,{children:d.jsx(Ti,{state:y})}),d.jsx(Ne,{style:{width:1,whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-1 justify-end",children:[d.jsxs(be,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[d.jsx(yR,{className:"h-3 w-3"})," Disconnect"]}),d.jsxs(be,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[d.jsx(pu,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&d.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[d.jsx(Ne,{}),d.jsxs(Ne,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[d.jsxs(hf,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):d.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>d.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[d.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(g.agentId)}),d.jsx(Ti,{state:g.runtimeState}),g.activeSessions!==null&&d.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}const pE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));pE.displayName="Card";const gE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));gE.displayName="CardHeader";const yE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("text-subtitle leading-none",e),...t}));yE.displayName="CardTitle";const vE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("text-body text-muted-foreground",e),...t}));vE.displayName="CardDescription";const bE=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));bE.displayName="CardContent";const LF=x.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));LF.displayName="CardFooter";function IF(){const{isAuthenticated:e,login:t}=Aa(),[n,a]=x.useState(""),[l,o]=x.useState(""),[u,f]=x.useState(null),[m,h]=x.useState(!1);if(e)return d.jsx(_g,{to:"/",replace:!0});const y=async g=>{g.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(b){f(b instanceof Error?b.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(pE,{className:"w-full max-w-sm",children:[d.jsxs(gE,{className:"text-center",children:[d.jsx(yE,{className:"text-title",children:"First Tree"}),d.jsx(vE,{children:"Sign in to your workspace"})]}),d.jsx(bE,{children:d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-body text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"username",children:"Username"}),d.jsx(kt,{id:"username",value:n,onChange:g=>a(g.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(at,{htmlFor:"password",children:"Password"}),d.jsx(kt,{id:"password",type:"password",value:l,onChange:g=>o(g.target.value),required:!0})]}),d.jsx(be,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function UF(){const e=Vr(),t=jl(),{data:n,isLoading:a}=Qe({queryKey:["adapters"],queryFn:sC}),{data:l,isLoading:o}=Qe({queryKey:["adapter-mappings"],queryFn:iC}),{data:u}=Qe({queryKey:["adapter-statuses"],queryFn:lC,refetchInterval:15e3}),f=a||o,m=x.useMemo(()=>{const g=new Map;for(const b of u??[])g.set(b.configId,b);return g},[u]),{onlineBots:h,offlineBots:y}=x.useMemo(()=>{var S;let g=0,b=0;for(const k of n??[])(S=m.get(k.id))!=null&&S.connected?g++:b++;return{onlineBots:g,offlineBots:b}},[n,m]);return d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Overview of platform bindings for agents you can manage. Configure each binding from the Agent detail page."}),d.jsxs(Zr,{className:"mb-3.5",children:[d.jsxs(Zs,{right:d.jsxs("span",{className:"inline-flex items-center",children:[d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),h," online"]}),d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx("span",{"aria-hidden":!0,children:"○"}),y," offline"]})]}),children:["Bot bindings · ",(n==null?void 0:n.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n!=null&&n.length?d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{children:"Agent"}),d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"Status"}),d.jsx(ze,{children:"Connection"}),d.jsx(ze,{children:"Created"}),d.jsx(ze,{})]})}),d.jsx(_a,{children:n.map(g=>{var S;const b=((S=m.get(g.id))==null?void 0:S.connected)??!1;return d.jsxs(Wt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"mono font-medium",children:t(g.agentId)})}),d.jsx(Ne,{children:d.jsx(en,{children:g.platform})}),d.jsx(Ne,{children:d.jsx(en,{tone:g.status==="active"?"accent":"outline",children:g.status})}),d.jsx(Ne,{children:d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[d.jsx(bl,{state:b?"idle":"offline",size:7}),d.jsx("span",{style:{color:"var(--fg-3)"},children:b?"Online":"Offline"})]})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(g.createdAt)}),d.jsx(Ne,{style:{textAlign:"right",whiteSpace:"nowrap"},children:d.jsxs(be,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),e(`/agents/${g.agentId}`)},children:[d.jsx(Dg,{className:"h-3 w-3"}),"Manage"]})})]},g.id)})})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No bot bindings"})]}),d.jsxs(Zr,{children:[d.jsxs(Zs,{children:["User bindings · ",(l==null?void 0:l.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l!=null&&l.length?d.jsxs(Ea,{children:[d.jsx(Na,{children:d.jsxs(Wt,{children:[d.jsx(ze,{children:"Agent"}),d.jsx(ze,{children:"Platform"}),d.jsx(ze,{children:"External user ID"}),d.jsx(ze,{children:"Display name"}),d.jsx(ze,{children:"Bound via"}),d.jsx(ze,{children:"Created"})]})}),d.jsx(_a,{children:l.map(g=>d.jsxs(Wt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ne,{children:d.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:t(g.agentId)})}),d.jsx(Ne,{children:d.jsx(en,{children:g.platform})}),d.jsx(Ne,{children:d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:g.externalUserId})}),d.jsx(Ne,{style:{color:"var(--fg-2)"},children:g.displayName??"—"}),d.jsx(Ne,{children:d.jsx(en,{tone:"outline",children:g.boundVia??"—"})}),d.jsx(Ne,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Hr(g.createdAt)})]},g.id))})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No user bindings"})]})]})}function BF(){return d.jsxs("div",{className:"-m-6",children:[d.jsx(ff,{title:"Settings",subtitle:"Per-member controls"}),d.jsx(Jj,{children:d.jsx(Wj,{active:!0,children:"Bindings"})}),d.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:d.jsx(UF,{})})]})}function PF(e){return Ue.get(`/admin/chats/${encodeURIComponent(e)}`)}function $F(e,t){return Ue.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function MS(e,t){return Ue.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function FF(e,t){return Ue.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function qF(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 HF(e){return Ue.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function ZF(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 Ue.get(`/admin/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}const VF="first-tree-hub-images",QF=1,Qs="images";let Sd=null;function xE(){return Sd||(Sd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(VF,QF);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Qs)||n.createObjectStore(Qs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Sd)}async function GF(e){const t=await xE();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Qs,"readwrite"),o=l.objectStore(Qs),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),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 KF(e){const t=await xE();return t?new Promise(n=>{const o=t.transaction(Qs,"readonly").objectStore(Qs).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function YF(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 XF(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 u=1/0;l.startsWith(t)?u=0:o.startsWith(t)?u=1:o.includes(t)&&(u=2),u!==1/0&&n.push({c:a,score:u})}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 JF(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),u=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${u}${m}`,y=l.length+u.length+(f?1:0);return{text:h,cursor:y}}function WF({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,u]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:YF(e,t),[e,t,l]),y=x.useMemo(()=>h?XF(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{u(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,S=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const T=JF(e,h,t,C);T&&a(T)}return{trigger:S?h:null,results:S?y:[],highlightIndex:o,handleKey:C=>{if(!S||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),u(T=>y.length===0?0:(T+1)%y.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),u(T=>y.length===0?0:(T-1+y.length)%y.length),!0;if(C.key==="Enter"||C.key==="Tab"){const T=y[o]??y[0];return T?(C.preventDefault(),j(T),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function eq({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:d.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:_e("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,right:0,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return d.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:[d.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&d.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function SE(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function tq(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=DS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=DS(l.payload);return o?a.get(o)===l.seq:!0})}function DS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function bf(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(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function wE(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 nq(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function LS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function rq({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function aq({agentId:e,chatId:t,session:n}){const a=er(),[,l]=Rg(),[o,u]=x.useState(!1),[f,m]=x.useState(null),h=Ww(e,t),y=Zp(e),g=E=>{a.setQueryData(h,C=>C&&{...C,state:E}),a.setQueryData(y,C=>C&&C.map(T=>T.chatId===t?{...T,state:E}:T))},b=wt({mutationFn:()=>mz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),C=a.getQueryData(y);return g("suspended"),{previousSession:E,previousList:C}},onError:(E,C,T)=>{T!=null&&T.previousSession&&a.setQueryData(h,T.previousSession),T!=null&&T.previousList&&a.setQueryData(y,T.previousList)},onSuccess:E=>{g(E.state)}}),S=wt({mutationFn:()=>pz(e,t),onMutate:async()=>{await a.cancelQueries({queryKey:h}),await a.cancelQueries({queryKey:y});const E=a.getQueryData(h),C=a.getQueryData(y);return a.setQueryData(y,T=>T&&T.filter(O=>O.chatId!==t)),{previousSession:E,previousList:C}},onError:(E,C,T)=>{T!=null&&T.previousSession&&a.setQueryData(h,T.previousSession),T!=null&&T.previousList&&a.setQueryData(y,T.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,C,T)=>{if(E.state!=="evicted"){T!=null&&T.previousList&&a.setQueryData(y,T.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:d.jsxs(d.Fragment,{children:[d.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&&d.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[d.jsx(JT,{className:"h-3 w-3"})," Suspend",d.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&d.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},disabled:S.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(lR,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(iq,{open:o,onOpenChange:E=>{S.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:S.isPending,onConfirm:()=>S.mutate()})]})}function iq(e){const{open:t,onOpenChange:n,session:a,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(yn,{open:t,onOpenChange:n,children:d.jsxs(hn,{children:[d.jsx(_n,{children:d.jsx(bn,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.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."}),d.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:[d.jsxs("span",{children:["chat: ",d.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(a==null?void 0:a.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",wE(a.lastActivityAt)]}),typeof(a==null?void 0:a.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",a.messageCount]})]}),u&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:u}),d.jsxs(vn,{children:[d.jsx(be,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),d.jsx(be,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function lq({event:e}){const t=cz(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 d.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?d.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}}):d.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?LS(t.args):void 0,children:[d.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",d.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?d.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",LS(t.args),")"]}):null,t.durationMs!==void 0&&!a?d.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",nq(t.durationMs)]}):null]})]})}function sq({event:e,agentNameFn:t,agentId:n}){const a=fz(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[d.jsx(kE,{name:l,isSelf:!1}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bf(e.createdAt)}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function oq({event:e}){return d.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:[d.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}}),d.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bf(e.createdAt)})]})}function uq({event:e}){const t=dz(e.payload),n=bf(e.createdAt);return d.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:[d.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),d.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 kE({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return d.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:d.jsx(Mu,{width:9,height:10,style:{color:"var(--accent)"}})})}function cq({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[d.jsx(kE,{name:a,isSelf:l}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bf(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(rq,{msg:e,myAgentId:t})})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&dq(e.content)?d.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"&&fq(e.content)?d.jsx(hq,{content:e.content}):e.format==="text"?d.jsx(mE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.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 dq(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 fq(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 hq({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return KF(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"?d.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?d.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):d.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function mq({agentId:e,chatId:t}){var xt;const n=er(),a=jl(),l=qg(),{agentId:o}=Aa(),[u,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState([]),[b,S]=x.useState(!1),[k,j]=x.useState(null),E=x.useRef(null),C=x.useRef(null),T=x.useRef(null),O=x.useRef(!1);x.useEffect(()=>{O.current=!1},[t]);const{data:P}=Qe({queryKey:["chat-messages",t],queryFn:()=>ZF(t,{limit:50}),refetchInterval:5e3}),{data:L}=Qe({queryKey:["session-events",e,t],queryFn:()=>hz(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:R}=Qe({queryKey:Ww(e,t),queryFn:()=>Js(e).then(ce=>ce.find(De=>De.chatId===t)??null),refetchInterval:5e3}),{data:M}=Qe({queryKey:["chat-detail",t],queryFn:()=>PF(t),enabled:!!t}),Z=wt({mutationFn:ce=>MS(t,ce),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),re=x.useCallback(ce=>{const lt=ce.filter(Kt=>Kt.type.startsWith("image/"));if(lt.length===0)return;const Be=lt.find(Kt=>Kt.size>5242880);if(Be){j(`Image too large (${(Be.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Dt=lt.map(Kt=>({id:crypto.randomUUID(),file:Kt,previewUrl:URL.createObjectURL(Kt)}));g(Kt=>[...Kt,...Dt]),j(null)},[]),F=x.useCallback(ce=>{g(De=>{const lt=De.find(Be=>Be.id===ce);return lt&&URL.revokeObjectURL(lt.previewUrl),De.filter(Be=>Be.id!==ce)})},[]),de=async()=>{const ce=u.trim(),De=y;if(!(!ce&&De.length===0)&&!b&&!(te&&V.length===0)){if(De.length>0){S(!0),j(null);try{for(const lt of De){const Be=await qF(lt.file),Dt=crypto.randomUUID();await GF({imageId:Dt,base64:Be,mimeType:lt.file.type}),await FF(t,{data:Be,mimeType:lt.file.type,filename:lt.file.name,size:lt.file.size,imageId:Dt}),URL.revokeObjectURL(lt.previewUrl)}g([]),ce&&await MS(t,ce),f(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(lt){j(lt instanceof Error?lt.message:"Failed to send image")}finally{S(!1)}return}Z.mutate(ce)}},[W,ge]=x.useState(!1),[fe,ee]=x.useState(""),q=x.useRef(null);x.useEffect(()=>{var ce;W&&((ce=q.current)==null||ce.focus())},[W]);const oe=wt({mutationFn:ce=>$F(t,ce),onSuccess:()=>{ge(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),K=()=>{const ce=fe.trim();oe.mutate(ce.length>0?ce:null)},he=x.useMemo(()=>{const ce=(P==null?void 0:P.items)??[],De=tq((L==null?void 0:L.items)??[]),lt=[...ce.map(Be=>({kind:"message",at:Be.createdAt,key:`m-${Be.id}`,data:Be})),...De.map(Be=>({kind:"event",at:Be.createdAt,key:`e-${Be.id}`,data:Be}))];return lt.sort((Be,Dt)=>Be.at.localeCompare(Dt.at)),lt},[P,L]),A=he.length;x.useEffect(()=>{var ce;A>0&&((ce=T.current)==null||ce.scrollIntoView({behavior:"smooth"}))},[A]);const U=M!=null&&M.participants?M.participants.map(ce=>{const De=a(ce.agentId);return`@${De.length>20?`${De.slice(0,17)}…`:De}`}).join(" "):`@${a(e)}`,B=a(e),_=x.useMemo(()=>{var lt;const ce=((lt=M==null?void 0:M.participants)==null?void 0:lt.map(Be=>Be.agentId))??[e],De=[];for(const Be of ce){if(Be===o)continue;const Dt=l(Be);!Dt||!Dt.name||De.push({agentId:Be,name:Dt.name,displayName:Dt.displayName})}return De},[M==null?void 0:M.participants,e,l,o]),te=x.useMemo(()=>{if(!M)return!1;if(M.type==="group")return!0;const ce=M.participants.some(De=>De.agentId===o);return M.type==="direct"&&!ce&&M.participants.length>=2},[M,o]),V=x.useMemo(()=>{if(!te)return[];const ce=_.map(De=>({agentId:De.agentId,name:De.name}));return L6(u,ce)},[u,_,te]),le=WF({value:u,cursor:m,candidates:_,disabled:Z.isPending||b,onSelect:ce=>{f(ce.text),h(ce.cursor),requestAnimationFrame(()=>{const De=C.current;De&&(De.focus(),De.setSelectionRange(ce.cursor,ce.cursor))})}}),xe=(R==null?void 0:R.runtimeState)??"idle",Oe=SE((R==null?void 0:R.runtimeState)??null,e?"connected":null),Se=(R==null?void 0:R.messageCount)??((xt=P==null?void 0:P.items)==null?void 0:xt.length)??0;return d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.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:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center",style:{gap:8},children:[d.jsx(bl,{state:Oe,size:8}),W?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:q,value:fe,onChange:ce=>ee(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"?(ce.preventDefault(),K()):ce.key==="Escape"&&(ce.preventDefault(),ge(!1))},disabled:oe.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)"}}),d.jsx("button",{type:"button",onClick:K,disabled:oe.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(Ru,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>ge(!1),disabled:oe.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(qp,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(M==null?void 0:M.topic)||(R==null?void 0:R.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{ee((M==null?void 0:M.topic)??""),ge(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:ce=>ce.currentTarget.style.color="var(--fg-2)",onMouseLeave:ce=>ce.currentTarget.style.color="var(--fg-4)",children:d.jsx(Jd,{className:"h-3 w-3"})})]}),d.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})]}),d.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[d.jsx("span",{className:"mono",children:U}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["started ",wE((R==null?void 0:R.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[Se," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:Oe==="error"?"var(--state-error)":"var(--fg-2)"},children:xe})]})]})]}),d.jsx(aq,{agentId:e,chatId:t,session:R??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[A===0&&d.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[d.jsx(Lg,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),d.jsx("div",{className:"flex flex-col",style:{gap:4},children:he.map(ce=>{if(ce.kind==="event"){const De=ce.data;switch(De.kind){case"tool_call":return d.jsx(lq,{event:De},ce.key);case"assistant_text":return d.jsx(sq,{event:De,agentId:e,agentNameFn:a},ce.key);case"thinking":return d.jsx(oq,{event:De},ce.key);case"error":return d.jsx(uq,{event:De},ce.key);default:return null}}return d.jsx(cq,{msg:ce.data,myAgentId:o,agentNameFn:a},ce.key)})}),d.jsx("div",{ref:T})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ce=>ce.preventDefault(),onDrop:ce=>{ce.preventDefault(),re(Array.from(ce.dataTransfer.files))},children:[y.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(ce=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:ce.previewUrl,alt:ce.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>F(ce.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:d.jsx(qp,{className:"h-2 w-2"})})]},ce.id))}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx(eq,{trigger:le.trigger,results:le.results,highlightIndex:le.highlightIndex,anchorRef:C,onPick:le.pick}),d.jsx("textarea",{ref:C,value:u,onChange:ce=>{f(ce.target.value),h(ce.target.selectionStart??ce.target.value.length)},onSelect:ce=>{h(ce.currentTarget.selectionStart??u.length)},onFocus:()=>{te&&(O.current||u.length>0||_.length===0||(O.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ce=C.current;ce&&ce.setSelectionRange(1,1)})))},onPaste:ce=>{const De=Array.from(ce.clipboardData.files);De.length>0&&(ce.preventDefault(),re(De))},placeholder:te?"Type @ to pick a recipient, then your message":`Message @${B} · / for commands · @ to mention`,rows:2,onKeyDown:ce=>{le.handleKey(ce)||ce.key==="Enter"&&!ce.shiftKey&&(ce.preventDefault(),de())},disabled:Z.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)"}})]}),d.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[d.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[d.jsx("button",{type:"button",onClick:()=>{var ce;return(ce=E.current)==null?void 0:ce.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:d.jsx(YT,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:E,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ce=>{ce.target.files&&(re(Array.from(ce.target.files)),ce.target.value="")}}),d.jsx("span",{children:"/suspend"}),d.jsx("span",{children:"/resume"}),d.jsx("span",{children:"/branch"}),d.jsx("span",{children:"/promote"})]}),d.jsxs("span",{className:"flex items-center",style:{gap:8},children:[b&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),d.jsxs("span",{children:[d.jsx("span",{className:"kbd",children:"⏎"})," send ",d.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),d.jsxs("button",{type:"button",onClick:de,disabled:Z.isPending||b||!u.trim()&&y.length===0||te&&V.length===0,title:te&&V.length===0?"Pick at least one recipient with @ before sending in a group chat":void 0,className:_e("inline-flex items-center transition-colors text-label font-semibold",(Z.isPending||b||!u.trim()&&y.length===0||te&&V.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:[d.jsx(aR,{className:"h-3 w-3"})," Send"]})]})]})]}),(Z.isError||k)&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(Z.error instanceof Error?Z.error.message:"Failed to send")})]})]})}function pq(){return d.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx(Mu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),d.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function gq({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(mq,{agentId:e,chatId:t}):d.jsx(pq,{})}function jE(){const{data:e}=Qe({queryKey:["clients"],queryFn:gu,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 pg({children:e}){return d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function CE({children:e}){return d.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Fr({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{color:"var(--fg-3)"},children:e}),d.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function IS(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 US(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 jp({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[d.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function yq({notifications:e,agentId:t}){const[,n]=Rg(),a=er(),l=wt({mutationFn:o=>Wk(o),onSuccess:()=>{a.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(ej,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function EE({agentId:e}){var h;const t=jl(),{resolve:n}=jE(),{data:a}=Qe({queryKey:["activity"],queryFn:zu,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:u}=Qe({queryKey:["notifications","agent",e],queryFn:()=>Xp({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.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:d.jsx(Mu,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),d.jsx(Ti,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(jp,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),d.jsx(jp,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),d.jsx(jp,{label:"uptime",value:US((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(pg,{children:"Computer · runtime"}),d.jsxs(CE,{children:[d.jsx(Fr,{label:"host",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),d.jsx(Fr,{label:"os",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),d.jsx(Fr,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx(Fr,{label:"sdk",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx(Fr,{label:"connected",children:d.jsx("span",{className:"mono text-label",children:US((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[d.jsx(pg,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):d.jsx(yq,{notifications:u.items,agentId:e})]})]})}function vq({agentId:e,chatId:t}){const{data:n}=Qe({queryKey:["session",e,t],queryFn:()=>Js(e).then(a=>a.find(l=>l.chatId===t)??null),refetchInterval:5e3});return d.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(pg,{children:"Session"}),d.jsxs(CE,{children:[d.jsx(Fr,{label:"state",children:d.jsx(Ti,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),d.jsx(Fr,{label:"chat",children:d.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),d.jsx(Fr,{label:"started",children:IS((n==null?void 0:n.startedAt)??null)}),d.jsx(Fr,{label:"last",children:IS((n==null?void 0:n.lastActivityAt)??null)}),d.jsx(Fr,{label:"messages",children:d.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),d.jsx(EE,{agentId:e})]})}function bq({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(vq,{agentId:e,chatId:t}):e?d.jsx(EE,{agentId:e}):null}const xq=32;function Sq({aggregated:e,stale:t,className:n}){const a=Math.max(1,...e.map(l=>l.workingCount));return d.jsx("div",{className:_e("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:xq}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/a,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return d.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const wq={error:0,blocked:1,working:2,idle:3};function kq(e,t){return t?e?wq[e]??4:4:5}function jq(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function Cq({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:a}){const l=jl(),{resolve:o}=jE(),u=er(),f=RL(),[m,h]=x.useState(""),[y,g]=x.useState("all"),{data:b}=Qe({queryKey:["activity"],queryFn:zu,refetchInterval:1e4}),{data:S}=Qe({queryKey:e?Zp(e):["agent-sessions",null],queryFn:()=>e?Js(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=wt({mutationFn:R=>HF(R),onSuccess:(R,M)=>{u.invalidateQueries({queryKey:Zp(M)}),a(M,R.id)}}),{humans:j,agents:E,totalAll:C}=x.useMemo(()=>{const R=(b==null?void 0:b.agents)??[],M=m.trim().toLowerCase(),Z=R.filter(W=>{var ee;if(!jq(W,y))return!1;if(!M)return!0;const ge=l(W.agentId).toLowerCase(),fe=W.clientId?(((ee=o(W.clientId))==null?void 0:ee.hostname)??"").toLowerCase():"";return ge.includes(M)||fe.includes(M)||W.agentId.toLowerCase().includes(M)}),re=W=>kq(W.runtimeState,W.clientId),F=[],de=[];for(const W of Z)(W.type==="human"?F:de).push(W);return F.sort((W,ge)=>re(W)-re(ge)),de.sort((W,ge)=>re(W)-re(ge)),{humans:F,agents:de,totalAll:R.length}},[b,m,y,l,o]),T=x.useMemo(()=>{const R=(b==null?void 0:b.agents)??[];return{working:R.filter(M=>M.runtimeState==="working").length,blocked:R.filter(M=>M.runtimeState==="blocked").length,error:R.filter(M=>M.runtimeState==="error").length}},[b]),O=[{value:"all",label:"all",count:C},{value:"active",label:"active",count:T.working},{value:"attn",label:"attn",count:T.blocked+T.error,warn:T.blocked+T.error>0}],P=R=>{var W;const M=e===R.agentId,Z=SE(R.runtimeState,R.clientId),re=R.clientId?((W=o(R.clientId))==null?void 0:W.hostname)??R.clientId.slice(0,8):null,F=R.activeSessions??0,de=R.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>n(M?null:R.agentId),className:_e("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:M?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${M?"var(--accent)":"transparent"}`},children:[d.jsx(bl,{state:Z,size:8}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(R.agentId)}),R.type==="human"&&d.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"})]}),d.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:Z==="offline"?"disconnected":re||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:de>0&&d.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[F,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",de]})]})})]}),M&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!S||S.length===0)&&d.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"}),S==null?void 0:S.filter(ge=>ge.state!=="evicted").map(ge=>{const fe=ge.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>a(R.agentId,ge.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===ge.chatId?"var(--bg-hover)":"transparent",color:ge.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:ee=>{t!==ge.chatId&&(ee.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:ee=>{t!==ge.chatId&&(ee.currentTarget.style.background="transparent")},children:[d.jsx(bl,{state:fe,size:6}),d.jsx("span",{className:"truncate text-body",style:{color:ge.topic||ge.summary?"var(--fg-2)":"var(--fg-4)"},children:ge.topic||ge.summary||`Chat · ${ge.chatId.slice(0,8)}`})]},ge.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(R.agentId),disabled:k.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:ge=>{ge.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ge=>{ge.currentTarget.style.background="transparent"},children:[d.jsx(Sl,{className:"h-3 w-3"}),"New chat"]})]})]},R.agentId)},L=j.length+E.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[d.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:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[C," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(Wd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),d.jsx("input",{value:m,onChange:R=>h(R.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)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:O.map(R=>d.jsx(lu,{active:y===R.value,count:R.count,warn:R.warn,onClick:()=>g(R.value),children:R.label},R.value))})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[d.jsx(Eq,{}),"5m"]}),d.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(Sq,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[T.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[T.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[T.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[L===0&&d.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:m||y!=="all"?"No matches":"No agents"}),E.length>0&&d.jsxs("div",{children:[d.jsx(BS,{label:"Agents",count:E.length}),E.map(P)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(BS,{label:"Humans",count:j.length}),j.map(P)]})]})]})}function BS({label:e,count:t}){return d.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 Eq(){return d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[d.jsx("title",{children:"pulse"}),d.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 Nq(){const[e,t]=Rg(),n=e.get("a"),a=e.get("c");Yj();const l=x.useCallback(f=>{t(f?{a:f}:{})},[t]),o=x.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=Qe({queryKey:["agent-sessions",n],queryFn:()=>n?Js(n):Promise.resolve([]),enabled:!!n&&!a});return x.useEffect(()=>{if(!n||a||!u||u.length===0)return;const f=[...u].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,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(Cq,{selectedAgentId:n,selectedChatId:a,onSelectAgent:l,onSelectChat:o}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:d.jsx(gq,{selectedAgentId:n,selectedChatId:a})}),n&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(bq,{selectedAgentId:n,selectedChatId:a})})]})}const _q=new v2({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function Aq(){return d.jsx(b2,{client:_q,children:d.jsx(hT,{children:d.jsx(tT,{children:d.jsxs(TA,{children:[d.jsx(Lr,{path:"/login",element:d.jsx(IF,{})}),d.jsx(Lr,{element:d.jsx(mT,{}),children:d.jsxs(Lr,{element:d.jsx(TL,{children:d.jsx(X3,{})}),children:[d.jsx(Lr,{index:!0,element:d.jsx(Nq,{})}),d.jsx(Lr,{path:"agents",element:d.jsx(TF,{})}),d.jsx(Lr,{path:"agents/:uuid",element:d.jsx(gF,{})}),d.jsx(Lr,{path:"clients",element:d.jsx(MF,{})}),d.jsx(Lr,{path:"settings",element:d.jsx(BF,{})}),d.jsx(Lr,{path:"admin",element:d.jsx(KL,{})})]})})]})})})})}const NE=document.getElementById("root");if(!NE)throw new Error("Root element not found");Q_.createRoot(NE).render(d.jsx(x.StrictMode,{children:d.jsx(Aq,{})}));