@agent-team-foundation/first-tree-hub 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +3 -7
- package/dist/{core-VW2Qfs73.mjs → core-e1-NPfEC.mjs} +3324 -205
- package/dist/{feishu-OezhDY7x.mjs → feishu-n9Y2yGTT.mjs} +21 -4
- package/dist/index.mjs +2 -2
- package/dist/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/web/assets/geist-mono-cyrillic-wght-normal-BZdD_g9V.woff2 +0 -0
- package/dist/web/assets/geist-mono-latin-ext-wght-normal-b6lpi8_2.woff2 +0 -0
- package/dist/web/assets/geist-mono-latin-wght-normal-Cjtb1TV-.woff2 +0 -0
- package/dist/web/assets/index-D9iKLIsB.css +1 -0
- package/dist/web/assets/index-nMyXPMPC.js +361 -0
- package/dist/web/favicon.svg +8 -20
- package/dist/web/index.html +5 -3
- package/package.json +1 -1
- package/dist/web/assets/index-9xygtFGL.css +0 -1
- package/dist/web/assets/index-DpobwdHT.js +0 -333
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
var Hy=e=>{throw TypeError(e)};var tm=(e,a,r)=>a.has(e)||Hy("Cannot "+r);var k=(e,a,r)=>(tm(e,a,"read from private field"),r?r.call(e):a.get(e)),ye=(e,a,r)=>a.has(e)?Hy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,r),ie=(e,a,r,l)=>(tm(e,a,"write to private field"),l?l.call(e,r):a.set(e,r),r),Oe=(e,a,r)=>(tm(e,a,"access private method"),r);var Bu=(e,a,r,l)=>({set _(o){ie(e,a,o,r)},get _(){return k(e,a,l)}});function cN(e,a){for(var r=0;r<a.length;r++){const l=a[r];if(typeof l!="string"&&!Array.isArray(l)){for(const o in l)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(l,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>l[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const m of c.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&l(m)}).observe(document,{childList:!0,subtree:!0});function r(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();function Dx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nm={exports:{}},Qi={};/**
|
|
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 Iy;function dN(){if(Iy)return Qi;Iy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(l,o,c){var m=null;if(c!==void 0&&(m=""+c),o.key!==void 0&&(m=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:e,type:l,key:m,ref:o!==void 0?o:null,props:c}}return Qi.Fragment=a,Qi.jsx=r,Qi.jsxs=r,Qi}var Qy;function fN(){return Qy||(Qy=1,nm.exports=dN()),nm.exports}var u=fN(),am={exports:{}},ke={};/**
|
|
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 Py;function mN(){if(Py)return ke;Py=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function N(T){return T===null||typeof T!="object"?null:(T=j&&T[j]||T["@@iterator"],typeof T=="function"?T:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function M(T,A,V){this.props=T,this.context=A,this.refs=E,this.updater=V||z}M.prototype.isReactComponent={},M.prototype.setState=function(T,A){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,A,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function B(){}B.prototype=M.prototype;function D(T,A,V){this.props=T,this.context=A,this.refs=E,this.updater=V||z}var O=D.prototype=new B;O.constructor=D,w(O,M.prototype),O.isPureReactComponent=!0;var P=Array.isArray;function I(){}var L={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function le(T,A,V){var ee=V.ref;return{$$typeof:e,type:T,key:A,ref:ee!==void 0?ee:null,props:V}}function Se(T,A){return le(T.type,A,T.props)}function _e(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function se(T){var A={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(V){return A[V]})}var ve=/\/+/g;function Te(T,A){return typeof T=="object"&&T!==null&&T.key!=null?se(""+T.key):A.toString(36)}function we(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(I,I):(T.status="pending",T.then(function(A){T.status==="pending"&&(T.status="fulfilled",T.value=A)},function(A){T.status==="pending"&&(T.status="rejected",T.reason=A)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function Q(T,A,V,ee,H){var ne=typeof T;(ne==="undefined"||ne==="boolean")&&(T=null);var fe=!1;if(T===null)fe=!0;else switch(ne){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(T.$$typeof){case e:case a:fe=!0;break;case b:return fe=T._init,Q(fe(T._payload),A,V,ee,H)}}if(fe)return H=H(T),fe=ee===""?"."+Te(T,0):ee,P(H)?(V="",fe!=null&&(V=fe.replace(ve,"$&/")+"/"),Q(H,A,V,"",function(Dt){return Dt})):H!=null&&(_e(H)&&(H=Se(H,V+(H.key==null||T&&T.key===H.key?"":(""+H.key).replace(ve,"$&/")+"/")+fe)),A.push(H)),1;fe=0;var Me=ee===""?".":ee+":";if(P(T))for(var pe=0;pe<T.length;pe++)ee=T[pe],ne=Me+Te(ee,pe),fe+=Q(ee,A,V,ne,H);else if(pe=N(T),typeof pe=="function")for(T=pe.call(T),pe=0;!(ee=T.next()).done;)ee=ee.value,ne=Me+Te(ee,pe++),fe+=Q(ee,A,V,ne,H);else if(ne==="object"){if(typeof T.then=="function")return Q(we(T),A,V,ee,H);throw A=String(T),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.")}return fe}function te(T,A,V){if(T==null)return T;var ee=[],H=0;return Q(T,ee,"","",function(ne){return A.call(V,ne,H++)}),ee}function ce(T){if(T._status===-1){var A=T._result;A=A(),A.then(function(V){(T._status===0||T._status===-1)&&(T._status=1,T._result=V)},function(V){(T._status===0||T._status===-1)&&(T._status=2,T._result=V)}),T._status===-1&&(T._status=0,T._result=A)}if(T._status===1)return T._result.default;throw T._result}var Ce=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},re={map:te,forEach:function(T,A,V){te(T,function(){A.apply(this,arguments)},V)},count:function(T){var A=0;return te(T,function(){A++}),A},toArray:function(T){return te(T,function(A){return A})||[]},only:function(T){if(!_e(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return ke.Activity=x,ke.Children=re,ke.Component=M,ke.Fragment=r,ke.Profiler=o,ke.PureComponent=D,ke.StrictMode=l,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ke.__COMPILER_RUNTIME={__proto__:null,c:function(T){return L.H.useMemoCache(T)}},ke.cache=function(T){return function(){return T.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(T,A,V){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ee=w({},T.props),H=T.key;if(A!=null)for(ne in A.key!==void 0&&(H=""+A.key),A)!K.call(A,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&A.ref===void 0||(ee[ne]=A[ne]);var ne=arguments.length-2;if(ne===1)ee.children=V;else if(1<ne){for(var fe=Array(ne),Me=0;Me<ne;Me++)fe[Me]=arguments[Me+2];ee.children=fe}return le(T.type,H,ee)},ke.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},ke.createElement=function(T,A,V){var ee,H={},ne=null;if(A!=null)for(ee in A.key!==void 0&&(ne=""+A.key),A)K.call(A,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(H[ee]=A[ee]);var fe=arguments.length-2;if(fe===1)H.children=V;else if(1<fe){for(var Me=Array(fe),pe=0;pe<fe;pe++)Me[pe]=arguments[pe+2];H.children=Me}if(T&&T.defaultProps)for(ee in fe=T.defaultProps,fe)H[ee]===void 0&&(H[ee]=fe[ee]);return le(T,ne,H)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(T){return{$$typeof:h,render:T}},ke.isValidElement=_e,ke.lazy=function(T){return{$$typeof:b,_payload:{_status:-1,_result:T},_init:ce}},ke.memo=function(T,A){return{$$typeof:p,type:T,compare:A===void 0?null:A}},ke.startTransition=function(T){var A=L.T,V={};L.T=V;try{var ee=T(),H=L.S;H!==null&&H(V,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(I,Ce)}catch(ne){Ce(ne)}finally{A!==null&&V.types!==null&&(A.types=V.types),L.T=A}},ke.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ke.use=function(T){return L.H.use(T)},ke.useActionState=function(T,A,V){return L.H.useActionState(T,A,V)},ke.useCallback=function(T,A){return L.H.useCallback(T,A)},ke.useContext=function(T){return L.H.useContext(T)},ke.useDebugValue=function(){},ke.useDeferredValue=function(T,A){return L.H.useDeferredValue(T,A)},ke.useEffect=function(T,A){return L.H.useEffect(T,A)},ke.useEffectEvent=function(T){return L.H.useEffectEvent(T)},ke.useId=function(){return L.H.useId()},ke.useImperativeHandle=function(T,A,V){return L.H.useImperativeHandle(T,A,V)},ke.useInsertionEffect=function(T,A){return L.H.useInsertionEffect(T,A)},ke.useLayoutEffect=function(T,A){return L.H.useLayoutEffect(T,A)},ke.useMemo=function(T,A){return L.H.useMemo(T,A)},ke.useOptimistic=function(T,A){return L.H.useOptimistic(T,A)},ke.useReducer=function(T,A,V){return L.H.useReducer(T,A,V)},ke.useRef=function(T){return L.H.useRef(T)},ke.useState=function(T){return L.H.useState(T)},ke.useSyncExternalStore=function(T,A,V){return L.H.useSyncExternalStore(T,A,V)},ke.useTransition=function(){return L.H.useTransition()},ke.version="19.2.4",ke}var Gy;function dh(){return Gy||(Gy=1,am.exports=mN()),am.exports}var v=dh();const hN=Dx(v),fh=cN({__proto__:null,default:hN},[v]);var rm={exports:{}},Pi={},sm={exports:{}},lm={};/**
|
|
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 Vy;function pN(){return Vy||(Vy=1,(function(e){function a(Q,te){var ce=Q.length;Q.push(te);e:for(;0<ce;){var Ce=ce-1>>>1,re=Q[Ce];if(0<o(re,te))Q[Ce]=te,Q[ce]=re,ce=Ce;else break e}}function r(Q){return Q.length===0?null:Q[0]}function l(Q){if(Q.length===0)return null;var te=Q[0],ce=Q.pop();if(ce!==te){Q[0]=ce;e:for(var Ce=0,re=Q.length,T=re>>>1;Ce<T;){var A=2*(Ce+1)-1,V=Q[A],ee=A+1,H=Q[ee];if(0>o(V,ce))ee<re&&0>o(H,V)?(Q[Ce]=H,Q[ee]=ce,Ce=ee):(Q[Ce]=V,Q[A]=ce,Ce=A);else if(ee<re&&0>o(H,ce))Q[Ce]=H,Q[ee]=ce,Ce=ee;else break e}}return te}function o(Q,te){var ce=Q.sortIndex-te.sortIndex;return ce!==0?ce:Q.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var m=Date,h=m.now();e.unstable_now=function(){return m.now()-h}}var g=[],p=[],b=1,x=null,j=3,N=!1,z=!1,w=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function O(Q){for(var te=r(p);te!==null;){if(te.callback===null)l(p);else if(te.startTime<=Q)l(p),te.sortIndex=te.expirationTime,a(g,te);else break;te=r(p)}}function P(Q){if(w=!1,O(Q),!z)if(r(g)!==null)z=!0,I||(I=!0,se());else{var te=r(p);te!==null&&we(P,te.startTime-Q)}}var I=!1,L=-1,K=5,le=-1;function Se(){return E?!0:!(e.unstable_now()-le<K)}function _e(){if(E=!1,I){var Q=e.unstable_now();le=Q;var te=!0;try{e:{z=!1,w&&(w=!1,B(L),L=-1),N=!0;var ce=j;try{t:{for(O(Q),x=r(g);x!==null&&!(x.expirationTime>Q&&Se());){var Ce=x.callback;if(typeof Ce=="function"){x.callback=null,j=x.priorityLevel;var re=Ce(x.expirationTime<=Q);if(Q=e.unstable_now(),typeof re=="function"){x.callback=re,O(Q),te=!0;break t}x===r(g)&&l(g),O(Q)}else l(g);x=r(g)}if(x!==null)te=!0;else{var T=r(p);T!==null&&we(P,T.startTime-Q),te=!1}}break e}finally{x=null,j=ce,N=!1}te=void 0}}finally{te?se():I=!1}}}var se;if(typeof D=="function")se=function(){D(_e)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Te=ve.port2;ve.port1.onmessage=_e,se=function(){Te.postMessage(null)}}else se=function(){M(_e,0)};function we(Q,te){L=M(function(){Q(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(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"):K=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(Q){switch(j){case 1:case 2:case 3:var te=3;break;default:te=j}var ce=j;j=te;try{return Q()}finally{j=ce}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(Q,te){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var ce=j;j=Q;try{return te()}finally{j=ce}},e.unstable_scheduleCallback=function(Q,te,ce){var Ce=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?Ce+ce:Ce):ce=Ce,Q){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=ce+re,Q={id:b++,callback:te,priorityLevel:Q,startTime:ce,expirationTime:re,sortIndex:-1},ce>Ce?(Q.sortIndex=ce,a(p,Q),r(g)===null&&Q===r(p)&&(w?(B(L),L=-1):w=!0,we(P,ce-Ce))):(Q.sortIndex=re,a(g,Q),z||N||(z=!0,I||(I=!0,se()))),Q},e.unstable_shouldYield=Se,e.unstable_wrapCallback=function(Q){var te=j;return function(){var ce=j;j=te;try{return Q.apply(this,arguments)}finally{j=ce}}}})(lm)),lm}var Ky;function gN(){return Ky||(Ky=1,sm.exports=pN()),sm.exports}var im={exports:{}},Ht={};/**
|
|
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 Fy;function vN(){if(Fy)return Ht;Fy=1;var e=dh();function a(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(a(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(g,p,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:g,containerInfo:p,implementation:b}}var m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Ht.createPortal=function(g,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(a(299));return c(g,p,null,b)},Ht.flushSync=function(g){var p=m.T,b=l.p;try{if(m.T=null,l.p=2,g)return g()}finally{m.T=p,l.p=b,l.d.f()}},Ht.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},Ht.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},Ht.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var b=p.as,x=h(b,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:N}):b==="script"&&l.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ht.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=h(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},Ht.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,x=h(b,p.crossOrigin);l.d.L(g,b,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ht.preloadModule=function(g,p){if(typeof g=="string")if(p){var b=h(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},Ht.requestFormReset=function(g){l.d.r(g)},Ht.unstable_batchedUpdates=function(g,p){return g(p)},Ht.useFormState=function(g,p,b){return m.H.useFormState(g,p,b)},Ht.useFormStatus=function(){return m.H.useHostTransitionStatus()},Ht.version="19.2.4",Ht}var Yy;function Ux(){if(Yy)return im.exports;Yy=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(a){console.error(a)}}return e(),im.exports=vN(),im.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 Xy;function yN(){if(Xy)return Pi;Xy=1;var e=gN(),a=dh(),r=Ux();function l(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function m(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(l(188))}function p(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(l(188));return n!==t?null:t}for(var s=t,i=n;;){var d=s.return;if(d===null)break;var f=d.alternate;if(f===null){if(i=d.return,i!==null){s=i;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===s)return g(d),t;if(f===i)return g(d),n;f=f.sibling}throw Error(l(188))}if(s.return!==i.return)s=d,i=f;else{for(var y=!1,S=d.child;S;){if(S===s){y=!0,s=d,i=f;break}if(S===i){y=!0,i=d,s=f;break}S=S.sibling}if(!y){for(S=f.child;S;){if(S===s){y=!0,s=f,i=d;break}if(S===i){y=!0,i=f,s=d;break}S=S.sibling}if(!y)throw Error(l(189))}}if(s.alternate!==i)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),D=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),Se=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function se(t){return t===null||typeof t!="object"?null:(t=_e&&t[_e]||t["@@iterator"],typeof t=="function"?t:null)}var ve=Symbol.for("react.client.reference");function Te(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ve?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case M:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case I:return"SuspenseList";case le:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case D:return t.displayName||"Context";case B:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return n=t.displayName||null,n!==null?n:Te(t.type)||"Memo";case K:n=t._payload,t=t._init;try{return Te(t(n))}catch{}}return null}var we=Array.isArray,Q=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},Ce=[],re=-1;function T(t){return{current:t}}function A(t){0>re||(t.current=Ce[re],Ce[re]=null,re--)}function V(t,n){re++,Ce[re]=t.current,t.current=n}var ee=T(null),H=T(null),ne=T(null),fe=T(null);function Me(t,n){switch(V(ne,n),V(H,t),V(ee,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?dy(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=dy(n),t=fy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}A(ee),V(ee,t)}function pe(){A(ee),A(H),A(ne)}function Dt(t){t.memoizedState!==null&&V(fe,t);var n=ee.current,s=fy(n,t.type);n!==s&&(V(H,t),V(ee,s))}function jn(t){H.current===t&&(A(ee),A(H)),fe.current===t&&(A(fe),Bi._currentValue=ce)}var wn,fa;function Qt(t){if(wn===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);wn=n&&n[1]||"",fa=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+wn+t+fa}var Ms=!1;function Ir(t,n){if(!t||Ms)return"";Ms=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(G){var Z=G}Reflect.construct(t,[],J)}else{try{J.call()}catch(G){Z=G}t.call(J.prototype)}}else{try{throw Error()}catch(G){Z=G}(J=t())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(G){if(G&&Z&&typeof G.stack=="string")return[G.stack,Z.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),y=f[0],S=f[1];if(y&&S){var C=y.split(`
|
|
44
|
-
`),q=S.split(`
|
|
45
|
-
`);for(d=i=0;i<C.length&&!C[i].includes("DetermineComponentFrameRoot");)i++;for(;d<q.length&&!q[d].includes("DetermineComponentFrameRoot");)d++;if(i===C.length||d===q.length)for(i=C.length-1,d=q.length-1;1<=i&&0<=d&&C[i]!==q[d];)d--;for(;1<=i&&0<=d;i--,d--)if(C[i]!==q[d]){if(i!==1||d!==1)do if(i--,d--,0>d||C[i]!==q[d]){var F=`
|
|
46
|
-
`+C[i].replace(" at new "," at ");return t.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",t.displayName)),F}while(1<=i&&0<=d);break}}}finally{Ms=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Qt(s):""}function xt(t,n){switch(t.tag){case 26:case 27:case 5:return Qt(t.type);case 16:return Qt("Lazy");case 13:return t.child!==n&&n!==null?Qt("Suspense Fallback"):Qt("Suspense");case 19:return Qt("SuspenseList");case 0:case 15:return Ir(t.type,!1);case 11:return Ir(t.type.render,!1);case 1:return Ir(t.type,!0);case 31:return Qt("Activity");default:return""}}function Zt(t){try{var n="",s=null;do n+=xt(t,s),s=t,t=t.return;while(t);return n}catch(i){return`
|
|
47
|
-
Error generating stack: `+i.message+`
|
|
48
|
-
`+i.stack}}var Qn=Object.prototype.hasOwnProperty,Ds=e.unstable_scheduleCallback,Us=e.unstable_cancelCallback,Lc=e.unstable_shouldYield,So=e.unstable_requestPaint,Pt=e.unstable_now,$c=e.unstable_getCurrentPriorityLevel,Qr=e.unstable_ImmediatePriority,jo=e.unstable_UserBlockingPriority,Ls=e.unstable_NormalPriority,wo=e.unstable_LowPriority,ei=e.unstable_IdlePriority,qc=e.log,Bc=e.unstable_setDisableYieldValue,Pr=null,Gt=null;function Wn(t){if(typeof qc=="function"&&Bc(t),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(Pr,t)}catch{}}var Vt=Math.clz32?Math.clz32:Eo,Zc=Math.log,No=Math.LN2;function Eo(t){return t>>>=0,t===0?32:31-(Zc(t)/No|0)|0}var Gr=256,Vr=262144,Kr=4194304;function ea(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Fr(t,n,s){var i=t.pendingLanes;if(i===0)return 0;var d=0,f=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=i&134217727;return S!==0?(i=S&~f,i!==0?d=ea(i):(y&=S,y!==0?d=ea(y):s||(s=S&~t,s!==0&&(d=ea(s))))):(S=i&~f,S!==0?d=ea(S):y!==0?d=ea(y):s||(s=i&~t,s!==0&&(d=ea(s)))),d===0?0:n!==0&&n!==d&&(n&f)===0&&(f=d&-d,s=n&-n,f>=s||f===32&&(s&4194048)!==0)?n:d}function Fa(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function _o(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 W(){var t=Kr;return Kr<<=1,(Kr&62914560)===0&&(Kr=4194304),t}function $e(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function Kt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Co(t,n,s,i,d,f){var y=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var S=t.entanglements,C=t.expirationTimes,q=t.hiddenUpdates;for(s=y&~s;0<s;){var F=31-Vt(s),J=1<<F;S[F]=0,C[F]=-1;var Z=q[F];if(Z!==null)for(q[F]=null,F=0;F<Z.length;F++){var G=Z[F];G!==null&&(G.lane&=-536870913)}s&=~J}i!==0&&Hc(t,i,0),f!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=f&~(y&~n))}function Hc(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var i=31-Vt(n);t.entangledLanes|=n,t.entanglements[i]=t.entanglements[i]|1073741824|s&261930}function Kh(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var i=31-Vt(s),d=1<<i;d&n|t[i]&n&&(t[i]|=n),s&=~d}}function Fh(t,n){var s=n&-n;return s=(s&42)!==0?1:Ic(s),(s&(t.suspendedLanes|n))!==0?0:s}function Ic(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Qc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Yh(){var t=te.p;return t!==0?t:(t=window.event,t===void 0?32:Dy(t.type))}function Xh(t,n){var s=te.p;try{return te.p=t,n()}finally{te.p=s}}var Ya=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Ya,en="__reactProps$"+Ya,$s="__reactContainer$"+Ya,Pc="__reactEvents$"+Ya,W1="__reactListeners$"+Ya,ej="__reactHandles$"+Ya,Jh="__reactResources$"+Ya,ti="__reactMarker$"+Ya;function Gc(t){delete t[Ut],delete t[en],delete t[Pc],delete t[W1],delete t[ej]}function qs(t){var n=t[Ut];if(n)return n;for(var s=t.parentNode;s;){if(n=s[$s]||s[Ut]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=by(t);t!==null;){if(s=t[Ut])return s;t=by(t)}return n}t=s,s=t.parentNode}return null}function Bs(t){if(t=t[Ut]||t[$s]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ni(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(l(33))}function Zs(t){var n=t[Jh];return n||(n=t[Jh]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Rt(t){t[ti]=!0}var Wh=new Set,ep={};function Yr(t,n){Hs(t,n),Hs(t+"Capture",n)}function Hs(t,n){for(ep[t]=n,t=0;t<n.length;t++)Wh.add(n[t])}var tj=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]*$"),tp={},np={};function nj(t){return Qn.call(np,t)?!0:Qn.call(tp,t)?!1:tj.test(t)?np[t]=!0:(tp[t]=!0,!1)}function ko(t,n,s){if(nj(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function Ao(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function ma(t,n,s,i){if(i===null)t.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+i)}}function Nn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ap(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function aj(t,n,s){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,f=i.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return d.call(this)},set:function(y){s=""+y,f.call(this,y)}}),Object.defineProperty(t,n,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Vc(t){if(!t._valueTracker){var n=ap(t)?"checked":"value";t._valueTracker=aj(t,n,""+t[n])}}function rp(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return t&&(i=ap(t)?t.checked?"true":"false":t.value),t=i,t!==s?(n.setValue(t),!0):!1}function zo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var rj=/[\n"\\]/g;function En(t){return t.replace(rj,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Kc(t,n,s,i,d,f,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Nn(n)):t.value!==""+Nn(n)&&(t.value=""+Nn(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?Fc(t,y,Nn(n)):s!=null?Fc(t,y,Nn(s)):i!=null&&t.removeAttribute("value"),d==null&&f!=null&&(t.defaultChecked=!!f),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+Nn(S):t.removeAttribute("name")}function sp(t,n,s,i,d,f,y,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),n!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Vc(t);return}s=s!=null?""+Nn(s):"",n=n!=null?""+Nn(n):s,S||n===t.value||(t.value=n),t.defaultValue=n}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=S?t.checked:!!i,t.defaultChecked=!!i,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Vc(t)}function Fc(t,n,s){n==="number"&&zo(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Is(t,n,s,i){if(t=t.options,n){n={};for(var d=0;d<s.length;d++)n["$"+s[d]]=!0;for(s=0;s<t.length;s++)d=n.hasOwnProperty("$"+t[s].value),t[s].selected!==d&&(t[s].selected=d),d&&i&&(t[s].defaultSelected=!0)}else{for(s=""+Nn(s),n=null,d=0;d<t.length;d++){if(t[d].value===s){t[d].selected=!0,i&&(t[d].defaultSelected=!0);return}n!==null||t[d].disabled||(n=t[d])}n!==null&&(n.selected=!0)}}function lp(t,n,s){if(n!=null&&(n=""+Nn(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Nn(s):""}function ip(t,n,s,i){if(n==null){if(i!=null){if(s!=null)throw Error(l(92));if(we(i)){if(1<i.length)throw Error(l(93));i=i[0]}s=i}s==null&&(s=""),n=s}s=Nn(n),t.defaultValue=s,i=t.textContent,i===s&&i!==""&&i!==null&&(t.value=i),Vc(t)}function Qs(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var sj=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 op(t,n,s){var i=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":i?t.setProperty(n,s):typeof s!="number"||s===0||sj.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function up(t,n,s){if(n!=null&&typeof n!="object")throw Error(l(62));if(t=t.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var d in n)i=n[d],n.hasOwnProperty(d)&&s[d]!==i&&op(t,d,i)}else for(var f in n)n.hasOwnProperty(f)&&op(t,f,n[f])}function Yc(t){if(t.indexOf("-")===-1)return!1;switch(t){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 lj=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"]]),ij=/^[\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 To(t){return ij.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ha(){}var Xc=null;function Jc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ps=null,Gs=null;function cp(t){var n=Bs(t);if(n&&(t=n.stateNode)){var s=t[en]||null;e:switch(t=n.stateNode,n.type){case"input":if(Kc(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+En(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var i=s[n];if(i!==t&&i.form===t.form){var d=i[en]||null;if(!d)throw Error(l(90));Kc(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<s.length;n++)i=s[n],i.form===t.form&&rp(i)}break e;case"textarea":lp(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Is(t,!!s.multiple,n,!1)}}}var Wc=!1;function dp(t,n,s){if(Wc)return t(n,s);Wc=!0;try{var i=t(n);return i}finally{if(Wc=!1,(Ps!==null||Gs!==null)&&(yu(),Ps&&(n=Ps,t=Gs,Gs=Ps=null,cp(n),t)))for(n=0;n<t.length;n++)cp(t[n])}}function ai(t,n){var s=t.stateNode;if(s===null)return null;var i=s[en]||null;if(i===null)return null;s=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(l(231,n,typeof s));return s}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ed=!1;if(pa)try{var ri={};Object.defineProperty(ri,"passive",{get:function(){ed=!0}}),window.addEventListener("test",ri,ri),window.removeEventListener("test",ri,ri)}catch{ed=!1}var Xa=null,td=null,Ro=null;function fp(){if(Ro)return Ro;var t,n=td,s=n.length,i,d="value"in Xa?Xa.value:Xa.textContent,f=d.length;for(t=0;t<s&&n[t]===d[t];t++);var y=s-t;for(i=1;i<=y&&n[s-i]===d[f-i];i++);return Ro=d.slice(t,1<i?1-i:void 0)}function Oo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Mo(){return!0}function mp(){return!1}function tn(t){function n(s,i,d,f,y){this._reactName=s,this._targetInst=d,this.type=i,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var S in t)t.hasOwnProperty(S)&&(s=t[S],this[S]=s?s(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Mo:mp,this.isPropagationStopped=mp,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Mo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Mo)},persist:function(){},isPersistent:Mo}),n}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Do=tn(Xr),si=x({},Xr,{view:0,detail:0}),oj=tn(si),nd,ad,li,Uo=x({},si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==li&&(li&&t.type==="mousemove"?(nd=t.screenX-li.screenX,ad=t.screenY-li.screenY):ad=nd=0,li=t),nd)},movementY:function(t){return"movementY"in t?t.movementY:ad}}),hp=tn(Uo),uj=x({},Uo,{dataTransfer:0}),cj=tn(uj),dj=x({},si,{relatedTarget:0}),rd=tn(dj),fj=x({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0}),mj=tn(fj),hj=x({},Xr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),pj=tn(hj),gj=x({},Xr,{data:0}),pp=tn(gj),vj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yj={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"},bj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xj(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=bj[t])?!!n[t]:!1}function sd(){return xj}var Sj=x({},si,{key:function(t){if(t.key){var n=vj[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Oo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?yj[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sd,charCode:function(t){return t.type==="keypress"?Oo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Oo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),jj=tn(Sj),wj=x({},Uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=tn(wj),Nj=x({},si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sd}),Ej=tn(Nj),_j=x({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Cj=tn(_j),kj=x({},Uo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Aj=tn(kj),zj=x({},Xr,{newState:0,oldState:0}),Tj=tn(zj),Rj=[9,13,27,32],ld=pa&&"CompositionEvent"in window,ii=null;pa&&"documentMode"in document&&(ii=document.documentMode);var Oj=pa&&"TextEvent"in window&&!ii,vp=pa&&(!ld||ii&&8<ii&&11>=ii),yp=" ",bp=!1;function xp(t,n){switch(t){case"keyup":return Rj.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Vs=!1;function Mj(t,n){switch(t){case"compositionend":return Sp(n);case"keypress":return n.which!==32?null:(bp=!0,yp);case"textInput":return t=n.data,t===yp&&bp?null:t;default:return null}}function Dj(t,n){if(Vs)return t==="compositionend"||!ld&&xp(t,n)?(t=fp(),Ro=td=Xa=null,Vs=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return vp&&n.locale!=="ko"?null:n.data;default:return null}}var Uj={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 jp(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Uj[t.type]:n==="textarea"}function wp(t,n,s,i){Ps?Gs?Gs.push(i):Gs=[i]:Ps=i,n=Eu(n,"onChange"),0<n.length&&(s=new Do("onChange","change",null,s,i),t.push({event:s,listeners:n}))}var oi=null,ui=null;function Lj(t){sy(t,0)}function Lo(t){var n=ni(t);if(rp(n))return t}function Np(t,n){if(t==="change")return n}var Ep=!1;if(pa){var id;if(pa){var od="oninput"in document;if(!od){var _p=document.createElement("div");_p.setAttribute("oninput","return;"),od=typeof _p.oninput=="function"}id=od}else id=!1;Ep=id&&(!document.documentMode||9<document.documentMode)}function Cp(){oi&&(oi.detachEvent("onpropertychange",kp),ui=oi=null)}function kp(t){if(t.propertyName==="value"&&Lo(ui)){var n=[];wp(n,ui,t,Jc(t)),dp(Lj,n)}}function $j(t,n,s){t==="focusin"?(Cp(),oi=n,ui=s,oi.attachEvent("onpropertychange",kp)):t==="focusout"&&Cp()}function qj(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lo(ui)}function Bj(t,n){if(t==="click")return Lo(n)}function Zj(t,n){if(t==="input"||t==="change")return Lo(n)}function Hj(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var fn=typeof Object.is=="function"?Object.is:Hj;function ci(t,n){if(fn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),i=Object.keys(n);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var d=s[i];if(!Qn.call(n,d)||!fn(t[d],n[d]))return!1}return!0}function Ap(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zp(t,n){var s=Ap(t);t=0;for(var i;s;){if(s.nodeType===3){if(i=t+s.textContent.length,t<=n&&i>=n)return{node:s,offset:n-t};t=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ap(s)}}function Tp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Tp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Rp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=zo(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=zo(t.document)}return n}function ud(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Ij=pa&&"documentMode"in document&&11>=document.documentMode,Ks=null,cd=null,di=null,dd=!1;function Op(t,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;dd||Ks==null||Ks!==zo(i)||(i=Ks,"selectionStart"in i&&ud(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),di&&ci(di,i)||(di=i,i=Eu(cd,"onSelect"),0<i.length&&(n=new Do("onSelect","select",null,n,s),t.push({event:n,listeners:i}),n.target=Ks)))}function Jr(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var Fs={animationend:Jr("Animation","AnimationEnd"),animationiteration:Jr("Animation","AnimationIteration"),animationstart:Jr("Animation","AnimationStart"),transitionrun:Jr("Transition","TransitionRun"),transitionstart:Jr("Transition","TransitionStart"),transitioncancel:Jr("Transition","TransitionCancel"),transitionend:Jr("Transition","TransitionEnd")},fd={},Mp={};pa&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function Wr(t){if(fd[t])return fd[t];if(!Fs[t])return t;var n=Fs[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Mp)return fd[t]=n[s];return t}var Dp=Wr("animationend"),Up=Wr("animationiteration"),Lp=Wr("animationstart"),Qj=Wr("transitionrun"),Pj=Wr("transitionstart"),Gj=Wr("transitioncancel"),$p=Wr("transitionend"),qp=new Map,md="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(" ");md.push("scrollEnd");function Pn(t,n){qp.set(t,n),Yr(n,[t])}var $o=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_n=[],Ys=0,hd=0;function qo(){for(var t=Ys,n=hd=Ys=0;n<t;){var s=_n[n];_n[n++]=null;var i=_n[n];_n[n++]=null;var d=_n[n];_n[n++]=null;var f=_n[n];if(_n[n++]=null,i!==null&&d!==null){var y=i.pending;y===null?d.next=d:(d.next=y.next,y.next=d),i.pending=d}f!==0&&Bp(s,d,f)}}function Bo(t,n,s,i){_n[Ys++]=t,_n[Ys++]=n,_n[Ys++]=s,_n[Ys++]=i,hd|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function pd(t,n,s,i){return Bo(t,n,s,i),Zo(t)}function es(t,n){return Bo(t,null,null,n),Zo(t)}function Bp(t,n,s){t.lanes|=s;var i=t.alternate;i!==null&&(i.lanes|=s);for(var d=!1,f=t.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(t=f.stateNode,t===null||t._visibility&1||(d=!0)),t=f,f=f.return;return t.tag===3?(f=t.stateNode,d&&n!==null&&(d=31-Vt(s),t=f.hiddenUpdates,i=t[d],i===null?t[d]=[n]:i.push(n),n.lane=s|536870912),f):null}function Zo(t){if(50<Oi)throw Oi=0,Ef=null,Error(l(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Xs={};function Vj(t,n,s,i){this.tag=t,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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(t,n,s,i){return new Vj(t,n,s,i)}function gd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ga(t,n){var s=t.alternate;return s===null?(s=mn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Zp(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Ho(t,n,s,i,d,f){var y=0;if(i=t,typeof t=="function")gd(t)&&(y=1);else if(typeof t=="string")y=Jw(t,s,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case le:return t=mn(31,s,n,d),t.elementType=le,t.lanes=f,t;case w:return ts(s.children,d,f,n);case E:y=8,d|=24;break;case M:return t=mn(12,s,n,d|2),t.elementType=M,t.lanes=f,t;case P:return t=mn(13,s,n,d),t.elementType=P,t.lanes=f,t;case I:return t=mn(19,s,n,d),t.elementType=I,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case D:y=10;break e;case B:y=9;break e;case O:y=11;break e;case L:y=14;break e;case K:y=16,i=null;break e}y=29,s=Error(l(130,t===null?"null":typeof t,"")),i=null}return n=mn(y,s,n,d),n.elementType=t,n.type=i,n.lanes=f,n}function ts(t,n,s,i){return t=mn(7,t,i,n),t.lanes=s,t}function vd(t,n,s){return t=mn(6,t,null,n),t.lanes=s,t}function Hp(t){var n=mn(18,null,null,0);return n.stateNode=t,n}function yd(t,n,s){return n=mn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Ip=new WeakMap;function Cn(t,n){if(typeof t=="object"&&t!==null){var s=Ip.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Zt(n)},Ip.set(t,n),n)}return{value:t,source:n,stack:Zt(n)}}var Js=[],Ws=0,Io=null,fi=0,kn=[],An=0,Ja=null,ta=1,na="";function va(t,n){Js[Ws++]=fi,Js[Ws++]=Io,Io=t,fi=n}function Qp(t,n,s){kn[An++]=ta,kn[An++]=na,kn[An++]=Ja,Ja=t;var i=ta;t=na;var d=32-Vt(i)-1;i&=~(1<<d),s+=1;var f=32-Vt(n)+d;if(30<f){var y=d-d%5;f=(i&(1<<y)-1).toString(32),i>>=y,d-=y,ta=1<<32-Vt(n)+d|s<<d|i,na=f+t}else ta=1<<f|s<<d|i,na=t}function bd(t){t.return!==null&&(va(t,1),Qp(t,1,0))}function xd(t){for(;t===Io;)Io=Js[--Ws],Js[Ws]=null,fi=Js[--Ws],Js[Ws]=null;for(;t===Ja;)Ja=kn[--An],kn[An]=null,na=kn[--An],kn[An]=null,ta=kn[--An],kn[An]=null}function Pp(t,n){kn[An++]=ta,kn[An++]=na,kn[An++]=Ja,ta=n.id,na=n.overflow,Ja=t}var Lt=null,ot=null,Ze=!1,Wa=null,zn=!1,Sd=Error(l(519));function er(t){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mi(Cn(n,t)),Sd}function Gp(t){var n=t.stateNode,s=t.type,i=t.memoizedProps;switch(n[Ut]=t,n[en]=i,s){case"dialog":Le("cancel",n),Le("close",n);break;case"iframe":case"object":case"embed":Le("load",n);break;case"video":case"audio":for(s=0;s<Di.length;s++)Le(Di[s],n);break;case"source":Le("error",n);break;case"img":case"image":case"link":Le("error",n),Le("load",n);break;case"details":Le("toggle",n);break;case"input":Le("invalid",n),sp(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Le("invalid",n);break;case"textarea":Le("invalid",n),ip(n,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||i.suppressHydrationWarning===!0||uy(n.textContent,s)?(i.popover!=null&&(Le("beforetoggle",n),Le("toggle",n)),i.onScroll!=null&&Le("scroll",n),i.onScrollEnd!=null&&Le("scrollend",n),i.onClick!=null&&(n.onclick=ha),n=!0):n=!1,n||er(t,!0)}function Vp(t){for(Lt=t.return;Lt;)switch(Lt.tag){case 5:case 31:case 13:zn=!1;return;case 27:case 3:zn=!0;return;default:Lt=Lt.return}}function el(t){if(t!==Lt)return!1;if(!Ze)return Vp(t),Ze=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Bf(t.type,t.memoizedProps)),s=!s),s&&ot&&er(t),Vp(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));ot=yy(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));ot=yy(t)}else n===27?(n=ot,hr(t.type)?(t=Pf,Pf=null,ot=t):ot=n):ot=Lt?Rn(t.stateNode.nextSibling):null;return!0}function ns(){ot=Lt=null,Ze=!1}function jd(){var t=Wa;return t!==null&&(sn===null?sn=t:sn.push.apply(sn,t),Wa=null),t}function mi(t){Wa===null?Wa=[t]:Wa.push(t)}var wd=T(null),as=null,ya=null;function tr(t,n,s){V(wd,n._currentValue),n._currentValue=s}function ba(t){t._currentValue=wd.current,A(wd)}function Nd(t,n,s){for(;t!==null;){var i=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),t===s)break;t=t.return}}function Ed(t,n,s,i){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var f=d.dependencies;if(f!==null){var y=d.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=d;for(var C=0;C<n.length;C++)if(S.context===n[C]){f.lanes|=s,S=f.alternate,S!==null&&(S.lanes|=s),Nd(f.return,s,t),i||(y=null);break e}f=S.next}}else if(d.tag===18){if(y=d.return,y===null)throw Error(l(341));y.lanes|=s,f=y.alternate,f!==null&&(f.lanes|=s),Nd(y,s,t),y=null}else y=d.child;if(y!==null)y.return=d;else for(y=d;y!==null;){if(y===t){y=null;break}if(d=y.sibling,d!==null){d.return=y.return,y=d;break}y=y.return}d=y}}function tl(t,n,s,i){t=null;for(var d=n,f=!1;d!==null;){if(!f){if((d.flags&524288)!==0)f=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var y=d.alternate;if(y===null)throw Error(l(387));if(y=y.memoizedProps,y!==null){var S=d.type;fn(d.pendingProps.value,y.value)||(t!==null?t.push(S):t=[S])}}else if(d===fe.current){if(y=d.alternate,y===null)throw Error(l(387));y.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(Bi):t=[Bi])}d=d.return}t!==null&&Ed(n,t,s,i),n.flags|=262144}function Qo(t){for(t=t.firstContext;t!==null;){if(!fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function rs(t){as=t,ya=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function $t(t){return Kp(as,t)}function Po(t,n){return as===null&&rs(t),Kp(t,n)}function Kp(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},ya===null){if(t===null)throw Error(l(308));ya=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else ya=ya.next=n;return s}var Kj=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,i){t.push(i)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},Fj=e.unstable_scheduleCallback,Yj=e.unstable_NormalPriority,wt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _d(){return{controller:new Kj,data:new Map,refCount:0}}function hi(t){t.refCount--,t.refCount===0&&Fj(Yj,function(){t.controller.abort()})}var pi=null,Cd=0,nl=0,al=null;function Xj(t,n){if(pi===null){var s=pi=[];Cd=0,nl=Tf(),al={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Cd++,n.then(Fp,Fp),n}function Fp(){if(--Cd===0&&pi!==null){al!==null&&(al.status="fulfilled");var t=pi;pi=null,nl=0,al=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Jj(t,n){var s=[],i={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return t.then(function(){i.status="fulfilled",i.value=n;for(var d=0;d<s.length;d++)(0,s[d])(n)},function(d){for(i.status="rejected",i.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),i}var Yp=Q.S;Q.S=function(t,n){Ov=Pt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Xj(t,n),Yp!==null&&Yp(t,n)};var ss=T(null);function kd(){var t=ss.current;return t!==null?t:rt.pooledCache}function Go(t,n){n===null?V(ss,ss.current):V(ss,n.pool)}function Xp(){var t=kd();return t===null?null:{parent:wt._currentValue,pool:t}}var rl=Error(l(460)),Ad=Error(l(474)),Vo=Error(l(542)),Ko={then:function(){}};function Jp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Wp(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(ha,ha),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,tg(t),t;default:if(typeof n.status=="string")n.then(ha,ha);else{if(t=rt,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=n,t.status="pending",t.then(function(i){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=i}},function(i){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,tg(t),t}throw is=n,rl}}function ls(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(is=s,rl):s}}var is=null;function eg(){if(is===null)throw Error(l(459));var t=is;return is=null,t}function tg(t){if(t===rl||t===Vo)throw Error(l(483))}var sl=null,gi=0;function Fo(t){var n=gi;return gi+=1,sl===null&&(sl=[]),Wp(sl,t,n)}function vi(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Yo(t,n){throw n.$$typeof===j?Error(l(525)):(t=Object.prototype.toString.call(n),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function ng(t){function n(U,R){if(t){var $=U.deletions;$===null?(U.deletions=[R],U.flags|=16):$.push(R)}}function s(U,R){if(!t)return null;for(;R!==null;)n(U,R),R=R.sibling;return null}function i(U){for(var R=new Map;U!==null;)U.key!==null?R.set(U.key,U):R.set(U.index,U),U=U.sibling;return R}function d(U,R){return U=ga(U,R),U.index=0,U.sibling=null,U}function f(U,R,$){return U.index=$,t?($=U.alternate,$!==null?($=$.index,$<R?(U.flags|=67108866,R):$):(U.flags|=67108866,R)):(U.flags|=1048576,R)}function y(U){return t&&U.alternate===null&&(U.flags|=67108866),U}function S(U,R,$,X){return R===null||R.tag!==6?(R=vd($,U.mode,X),R.return=U,R):(R=d(R,$),R.return=U,R)}function C(U,R,$,X){var be=$.type;return be===w?F(U,R,$.props.children,X,$.key):R!==null&&(R.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===K&&ls(be)===R.type)?(R=d(R,$.props),vi(R,$),R.return=U,R):(R=Ho($.type,$.key,$.props,null,U.mode,X),vi(R,$),R.return=U,R)}function q(U,R,$,X){return R===null||R.tag!==4||R.stateNode.containerInfo!==$.containerInfo||R.stateNode.implementation!==$.implementation?(R=yd($,U.mode,X),R.return=U,R):(R=d(R,$.children||[]),R.return=U,R)}function F(U,R,$,X,be){return R===null||R.tag!==7?(R=ts($,U.mode,X,be),R.return=U,R):(R=d(R,$),R.return=U,R)}function J(U,R,$){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=vd(""+R,U.mode,$),R.return=U,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case N:return $=Ho(R.type,R.key,R.props,null,U.mode,$),vi($,R),$.return=U,$;case z:return R=yd(R,U.mode,$),R.return=U,R;case K:return R=ls(R),J(U,R,$)}if(we(R)||se(R))return R=ts(R,U.mode,$,null),R.return=U,R;if(typeof R.then=="function")return J(U,Fo(R),$);if(R.$$typeof===D)return J(U,Po(U,R),$);Yo(U,R)}return null}function Z(U,R,$,X){var be=R!==null?R.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return be!==null?null:S(U,R,""+$,X);if(typeof $=="object"&&$!==null){switch($.$$typeof){case N:return $.key===be?C(U,R,$,X):null;case z:return $.key===be?q(U,R,$,X):null;case K:return $=ls($),Z(U,R,$,X)}if(we($)||se($))return be!==null?null:F(U,R,$,X,null);if(typeof $.then=="function")return Z(U,R,Fo($),X);if($.$$typeof===D)return Z(U,R,Po(U,$),X);Yo(U,$)}return null}function G(U,R,$,X,be){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return U=U.get($)||null,S(R,U,""+X,be);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case N:return U=U.get(X.key===null?$:X.key)||null,C(R,U,X,be);case z:return U=U.get(X.key===null?$:X.key)||null,q(R,U,X,be);case K:return X=ls(X),G(U,R,$,X,be)}if(we(X)||se(X))return U=U.get($)||null,F(R,U,X,be,null);if(typeof X.then=="function")return G(U,R,$,Fo(X),be);if(X.$$typeof===D)return G(U,R,$,Po(R,X),be);Yo(R,X)}return null}function oe(U,R,$,X){for(var be=null,Ge=null,me=R,Re=R=0,Be=null;me!==null&&Re<$.length;Re++){me.index>Re?(Be=me,me=null):Be=me.sibling;var Ve=Z(U,me,$[Re],X);if(Ve===null){me===null&&(me=Be);break}t&&me&&Ve.alternate===null&&n(U,me),R=f(Ve,R,Re),Ge===null?be=Ve:Ge.sibling=Ve,Ge=Ve,me=Be}if(Re===$.length)return s(U,me),Ze&&va(U,Re),be;if(me===null){for(;Re<$.length;Re++)me=J(U,$[Re],X),me!==null&&(R=f(me,R,Re),Ge===null?be=me:Ge.sibling=me,Ge=me);return Ze&&va(U,Re),be}for(me=i(me);Re<$.length;Re++)Be=G(me,U,Re,$[Re],X),Be!==null&&(t&&Be.alternate!==null&&me.delete(Be.key===null?Re:Be.key),R=f(Be,R,Re),Ge===null?be=Be:Ge.sibling=Be,Ge=Be);return t&&me.forEach(function(br){return n(U,br)}),Ze&&va(U,Re),be}function Ee(U,R,$,X){if($==null)throw Error(l(151));for(var be=null,Ge=null,me=R,Re=R=0,Be=null,Ve=$.next();me!==null&&!Ve.done;Re++,Ve=$.next()){me.index>Re?(Be=me,me=null):Be=me.sibling;var br=Z(U,me,Ve.value,X);if(br===null){me===null&&(me=Be);break}t&&me&&br.alternate===null&&n(U,me),R=f(br,R,Re),Ge===null?be=br:Ge.sibling=br,Ge=br,me=Be}if(Ve.done)return s(U,me),Ze&&va(U,Re),be;if(me===null){for(;!Ve.done;Re++,Ve=$.next())Ve=J(U,Ve.value,X),Ve!==null&&(R=f(Ve,R,Re),Ge===null?be=Ve:Ge.sibling=Ve,Ge=Ve);return Ze&&va(U,Re),be}for(me=i(me);!Ve.done;Re++,Ve=$.next())Ve=G(me,U,Re,Ve.value,X),Ve!==null&&(t&&Ve.alternate!==null&&me.delete(Ve.key===null?Re:Ve.key),R=f(Ve,R,Re),Ge===null?be=Ve:Ge.sibling=Ve,Ge=Ve);return t&&me.forEach(function(uN){return n(U,uN)}),Ze&&va(U,Re),be}function at(U,R,$,X){if(typeof $=="object"&&$!==null&&$.type===w&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case N:e:{for(var be=$.key;R!==null;){if(R.key===be){if(be=$.type,be===w){if(R.tag===7){s(U,R.sibling),X=d(R,$.props.children),X.return=U,U=X;break e}}else if(R.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===K&&ls(be)===R.type){s(U,R.sibling),X=d(R,$.props),vi(X,$),X.return=U,U=X;break e}s(U,R);break}else n(U,R);R=R.sibling}$.type===w?(X=ts($.props.children,U.mode,X,$.key),X.return=U,U=X):(X=Ho($.type,$.key,$.props,null,U.mode,X),vi(X,$),X.return=U,U=X)}return y(U);case z:e:{for(be=$.key;R!==null;){if(R.key===be)if(R.tag===4&&R.stateNode.containerInfo===$.containerInfo&&R.stateNode.implementation===$.implementation){s(U,R.sibling),X=d(R,$.children||[]),X.return=U,U=X;break e}else{s(U,R);break}else n(U,R);R=R.sibling}X=yd($,U.mode,X),X.return=U,U=X}return y(U);case K:return $=ls($),at(U,R,$,X)}if(we($))return oe(U,R,$,X);if(se($)){if(be=se($),typeof be!="function")throw Error(l(150));return $=be.call($),Ee(U,R,$,X)}if(typeof $.then=="function")return at(U,R,Fo($),X);if($.$$typeof===D)return at(U,R,Po(U,$),X);Yo(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,R!==null&&R.tag===6?(s(U,R.sibling),X=d(R,$),X.return=U,U=X):(s(U,R),X=vd($,U.mode,X),X.return=U,U=X),y(U)):s(U,R)}return function(U,R,$,X){try{gi=0;var be=at(U,R,$,X);return sl=null,be}catch(me){if(me===rl||me===Vo)throw me;var Ge=mn(29,me,null,U.mode);return Ge.lanes=X,Ge.return=U,Ge}finally{}}}var os=ng(!0),ag=ng(!1),nr=!1;function zd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Td(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ar(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function rr(t,n,s){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Ke&2)!==0){var d=i.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),i.pending=n,n=Zo(t),Bp(t,null,s),n}return Bo(t,i,n,s),Zo(t)}function yi(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var i=n.lanes;i&=t.pendingLanes,s|=i,n.lanes=s,Kh(t,s)}}function Rd(t,n){var s=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var d=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?d=f=y:f=f.next=y,s=s.next}while(s!==null);f===null?d=f=n:f=f.next=n}else d=f=n;s={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var Od=!1;function bi(){if(Od){var t=al;if(t!==null)throw t}}function xi(t,n,s,i){Od=!1;var d=t.updateQueue;nr=!1;var f=d.firstBaseUpdate,y=d.lastBaseUpdate,S=d.shared.pending;if(S!==null){d.shared.pending=null;var C=S,q=C.next;C.next=null,y===null?f=q:y.next=q,y=C;var F=t.alternate;F!==null&&(F=F.updateQueue,S=F.lastBaseUpdate,S!==y&&(S===null?F.firstBaseUpdate=q:S.next=q,F.lastBaseUpdate=C))}if(f!==null){var J=d.baseState;y=0,F=q=C=null,S=f;do{var Z=S.lane&-536870913,G=Z!==S.lane;if(G?(qe&Z)===Z:(i&Z)===Z){Z!==0&&Z===nl&&(Od=!0),F!==null&&(F=F.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var oe=t,Ee=S;Z=n;var at=s;switch(Ee.tag){case 1:if(oe=Ee.payload,typeof oe=="function"){J=oe.call(at,J,Z);break e}J=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=Ee.payload,Z=typeof oe=="function"?oe.call(at,J,Z):oe,Z==null)break e;J=x({},J,Z);break e;case 2:nr=!0}}Z=S.callback,Z!==null&&(t.flags|=64,G&&(t.flags|=8192),G=d.callbacks,G===null?d.callbacks=[Z]:G.push(Z))}else G={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},F===null?(q=F=G,C=J):F=F.next=G,y|=Z;if(S=S.next,S===null){if(S=d.shared.pending,S===null)break;G=S,S=G.next,G.next=null,d.lastBaseUpdate=G,d.shared.pending=null}}while(!0);F===null&&(C=J),d.baseState=C,d.firstBaseUpdate=q,d.lastBaseUpdate=F,f===null&&(d.shared.lanes=0),ur|=y,t.lanes=y,t.memoizedState=J}}function rg(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function sg(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)rg(s[t],n)}var ll=T(null),Xo=T(0);function lg(t,n){t=ka,V(Xo,t),V(ll,n),ka=t|n.baseLanes}function Md(){V(Xo,ka),V(ll,ll.current)}function Dd(){ka=Xo.current,A(ll),A(Xo)}var hn=T(null),Tn=null;function sr(t){var n=t.alternate;V(St,St.current&1),V(hn,t),Tn===null&&(n===null||ll.current!==null||n.memoizedState!==null)&&(Tn=t)}function Ud(t){V(St,St.current),V(hn,t),Tn===null&&(Tn=t)}function ig(t){t.tag===22?(V(St,St.current),V(hn,t),Tn===null&&(Tn=t)):lr()}function lr(){V(St,St.current),V(hn,hn.current)}function pn(t){A(hn),Tn===t&&(Tn=null),A(St)}var St=T(0);function Jo(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||If(s)||Qf(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var xa=0,ze=null,tt=null,Nt=null,Wo=!1,il=!1,us=!1,eu=0,Si=0,ol=null,Wj=0;function vt(){throw Error(l(321))}function Ld(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!fn(t[s],n[s]))return!1;return!0}function $d(t,n,s,i,d,f){return xa=f,ze=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Q.H=t===null||t.memoizedState===null?Qg:Wd,us=!1,f=s(i,d),us=!1,il&&(f=ug(n,s,i,d)),og(t),f}function og(t){Q.H=Ni;var n=tt!==null&&tt.next!==null;if(xa=0,Nt=tt=ze=null,Wo=!1,Si=0,ol=null,n)throw Error(l(300));t===null||Et||(t=t.dependencies,t!==null&&Qo(t)&&(Et=!0))}function ug(t,n,s,i){ze=t;var d=0;do{if(il&&(ol=null),Si=0,il=!1,25<=d)throw Error(l(301));if(d+=1,Nt=tt=null,t.updateQueue!=null){var f=t.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}Q.H=Pg,f=n(s,i)}while(il);return f}function ew(){var t=Q.H,n=t.useState()[0];return n=typeof n.then=="function"?ji(n):n,t=t.useState()[0],(tt!==null?tt.memoizedState:null)!==t&&(ze.flags|=1024),n}function qd(){var t=eu!==0;return eu=0,t}function Bd(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Zd(t){if(Wo){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Wo=!1}xa=0,Nt=tt=ze=null,il=!1,Si=eu=0,ol=null}function Ft(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?ze.memoizedState=Nt=t:Nt=Nt.next=t,Nt}function jt(){if(tt===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=tt.next;var n=Nt===null?ze.memoizedState:Nt.next;if(n!==null)Nt=n,tt=t;else{if(t===null)throw ze.alternate===null?Error(l(467)):Error(l(310));tt=t,t={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Nt===null?ze.memoizedState=Nt=t:Nt=Nt.next=t}return Nt}function tu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ji(t){var n=Si;return Si+=1,ol===null&&(ol=[]),t=Wp(ol,t,n),n=ze,(Nt===null?n.memoizedState:Nt.next)===null&&(n=n.alternate,Q.H=n===null||n.memoizedState===null?Qg:Wd),t}function nu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ji(t);if(t.$$typeof===D)return $t(t)}throw Error(l(438,String(t)))}function Hd(t){var n=null,s=ze.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=tu(),ze.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),i=0;i<t;i++)s[i]=Se;return n.index++,s}function Sa(t,n){return typeof n=="function"?n(t):n}function au(t){var n=jt();return Id(n,tt,t)}function Id(t,n,s){var i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=s;var d=t.baseQueue,f=i.pending;if(f!==null){if(d!==null){var y=d.next;d.next=f.next,f.next=y}n.baseQueue=d=f,i.pending=null}if(f=t.baseState,d===null)t.memoizedState=f;else{n=d.next;var S=y=null,C=null,q=n,F=!1;do{var J=q.lane&-536870913;if(J!==q.lane?(qe&J)===J:(xa&J)===J){var Z=q.revertLane;if(Z===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),J===nl&&(F=!0);else if((xa&Z)===Z){q=q.next,Z===nl&&(F=!0);continue}else J={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},C===null?(S=C=J,y=f):C=C.next=J,ze.lanes|=Z,ur|=Z;J=q.action,us&&s(f,J),f=q.hasEagerState?q.eagerState:s(f,J)}else Z={lane:J,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},C===null?(S=C=Z,y=f):C=C.next=Z,ze.lanes|=J,ur|=J;q=q.next}while(q!==null&&q!==n);if(C===null?y=f:C.next=S,!fn(f,t.memoizedState)&&(Et=!0,F&&(s=al,s!==null)))throw s;t.memoizedState=f,t.baseState=y,t.baseQueue=C,i.lastRenderedState=f}return d===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Qd(t){var n=jt(),s=n.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=t;var i=s.dispatch,d=s.pending,f=n.memoizedState;if(d!==null){s.pending=null;var y=d=d.next;do f=t(f,y.action),y=y.next;while(y!==d);fn(f,n.memoizedState)||(Et=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),s.lastRenderedState=f}return[f,i]}function cg(t,n,s){var i=ze,d=jt(),f=Ze;if(f){if(s===void 0)throw Error(l(407));s=s()}else s=n();var y=!fn((tt||d).memoizedState,s);if(y&&(d.memoizedState=s,Et=!0),d=d.queue,Vd(mg.bind(null,i,d,t),[t]),d.getSnapshot!==n||y||Nt!==null&&Nt.memoizedState.tag&1){if(i.flags|=2048,ul(9,{destroy:void 0},fg.bind(null,i,d,s,n),null),rt===null)throw Error(l(349));f||(xa&127)!==0||dg(i,n,s)}return s}function dg(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=ze.updateQueue,n===null?(n=tu(),ze.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function fg(t,n,s,i){n.value=s,n.getSnapshot=i,hg(n)&&pg(t)}function mg(t,n,s){return s(function(){hg(n)&&pg(t)})}function hg(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!fn(t,s)}catch{return!0}}function pg(t){var n=es(t,2);n!==null&&ln(n,t,2)}function Pd(t){var n=Ft();if(typeof t=="function"){var s=t;if(t=s(),us){Wn(!0);try{s()}finally{Wn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:t},n}function gg(t,n,s,i){return t.baseState=s,Id(t,tt,typeof i=="function"?i:Sa)}function tw(t,n,s,i,d){if(lu(t))throw Error(l(485));if(t=n.action,t!==null){var f={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};Q.T!==null?s(!0):f.isTransition=!1,i(f),s=n.pending,s===null?(f.next=n.pending=f,vg(n,f)):(f.next=s.next,n.pending=s.next=f)}}function vg(t,n){var s=n.action,i=n.payload,d=t.state;if(n.isTransition){var f=Q.T,y={};Q.T=y;try{var S=s(d,i),C=Q.S;C!==null&&C(y,S),yg(t,n,S)}catch(q){Gd(t,n,q)}finally{f!==null&&y.types!==null&&(f.types=y.types),Q.T=f}}else try{f=s(d,i),yg(t,n,f)}catch(q){Gd(t,n,q)}}function yg(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){bg(t,n,i)},function(i){return Gd(t,n,i)}):bg(t,n,s)}function bg(t,n,s){n.status="fulfilled",n.value=s,xg(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,vg(t,s)))}function Gd(t,n,s){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=s,xg(n),n=n.next;while(n!==i)}t.action=null}function xg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Sg(t,n){return n}function jg(t,n){if(Ze){var s=rt.formState;if(s!==null){e:{var i=ze;if(Ze){if(ot){t:{for(var d=ot,f=zn;d.nodeType!==8;){if(!f){d=null;break t}if(d=Rn(d.nextSibling),d===null){d=null;break t}}f=d.data,d=f==="F!"||f==="F"?d:null}if(d){ot=Rn(d.nextSibling),i=d.data==="F!";break e}}er(i)}i=!1}i&&(n=s[0])}}return s=Ft(),s.memoizedState=s.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sg,lastRenderedState:n},s.queue=i,s=Zg.bind(null,ze,i),i.dispatch=s,i=Pd(!1),f=Jd.bind(null,ze,!1,i.queue),i=Ft(),d={state:n,dispatch:null,action:t,pending:null},i.queue=d,s=tw.bind(null,ze,d,f,s),d.dispatch=s,i.memoizedState=t,[n,s,!1]}function wg(t){var n=jt();return Ng(n,tt,t)}function Ng(t,n,s){if(n=Id(t,n,Sg)[0],t=au(Sa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=ji(n)}catch(y){throw y===rl?Vo:y}else i=n;n=jt();var d=n.queue,f=d.dispatch;return s!==n.memoizedState&&(ze.flags|=2048,ul(9,{destroy:void 0},nw.bind(null,d,s),null)),[i,f,t]}function nw(t,n){t.action=n}function Eg(t){var n=jt(),s=tt;if(s!==null)return Ng(n,s,t);jt(),n=n.memoizedState,s=jt();var i=s.queue.dispatch;return s.memoizedState=t,[n,i,!1]}function ul(t,n,s,i){return t={tag:t,create:s,deps:i,inst:n,next:null},n=ze.updateQueue,n===null&&(n=tu(),ze.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(i=s.next,s.next=t,t.next=i,n.lastEffect=t),t}function _g(){return jt().memoizedState}function ru(t,n,s,i){var d=Ft();ze.flags|=t,d.memoizedState=ul(1|n,{destroy:void 0},s,i===void 0?null:i)}function su(t,n,s,i){var d=jt();i=i===void 0?null:i;var f=d.memoizedState.inst;tt!==null&&i!==null&&Ld(i,tt.memoizedState.deps)?d.memoizedState=ul(n,f,s,i):(ze.flags|=t,d.memoizedState=ul(1|n,f,s,i))}function Cg(t,n){ru(8390656,8,t,n)}function Vd(t,n){su(2048,8,t,n)}function aw(t){ze.flags|=4;var n=ze.updateQueue;if(n===null)n=tu(),ze.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function kg(t){var n=jt().memoizedState;return aw({ref:n,nextImpl:t}),function(){if((Ke&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function Ag(t,n){return su(4,2,t,n)}function zg(t,n){return su(4,4,t,n)}function Tg(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Rg(t,n,s){s=s!=null?s.concat([t]):null,su(4,4,Tg.bind(null,n,t),s)}function Kd(){}function Og(t,n){var s=jt();n=n===void 0?null:n;var i=s.memoizedState;return n!==null&&Ld(n,i[1])?i[0]:(s.memoizedState=[t,n],t)}function Mg(t,n){var s=jt();n=n===void 0?null:n;var i=s.memoizedState;if(n!==null&&Ld(n,i[1]))return i[0];if(i=t(),us){Wn(!0);try{t()}finally{Wn(!1)}}return s.memoizedState=[i,n],i}function Fd(t,n,s){return s===void 0||(xa&1073741824)!==0&&(qe&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=Dv(),ze.lanes|=t,ur|=t,s)}function Dg(t,n,s,i){return fn(s,n)?s:ll.current!==null?(t=Fd(t,s,i),fn(t,n)||(Et=!0),t):(xa&42)===0||(xa&1073741824)!==0&&(qe&261930)===0?(Et=!0,t.memoizedState=s):(t=Dv(),ze.lanes|=t,ur|=t,n)}function Ug(t,n,s,i,d){var f=te.p;te.p=f!==0&&8>f?f:8;var y=Q.T,S={};Q.T=S,Jd(t,!1,n,s);try{var C=d(),q=Q.S;if(q!==null&&q(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var F=Jj(C,i);wi(t,n,F,yn(t))}else wi(t,n,i,yn(t))}catch(J){wi(t,n,{then:function(){},status:"rejected",reason:J},yn())}finally{te.p=f,y!==null&&S.types!==null&&(y.types=S.types),Q.T=y}}function rw(){}function Yd(t,n,s,i){if(t.tag!==5)throw Error(l(476));var d=Lg(t).queue;Ug(t,d,n,ce,s===null?rw:function(){return $g(t),s(i)})}function Lg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:ce},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function $g(t){var n=Lg(t);n.next===null&&(n=t.alternate.memoizedState),wi(t,n.next.queue,{},yn())}function Xd(){return $t(Bi)}function qg(){return jt().memoizedState}function Bg(){return jt().memoizedState}function sw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=yn();t=ar(s);var i=rr(n,t,s);i!==null&&(ln(i,n,s),yi(i,n,s)),n={cache:_d()},t.payload=n;return}n=n.return}}function lw(t,n,s){var i=yn();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lu(t)?Hg(n,s):(s=pd(t,n,s,i),s!==null&&(ln(s,t,i),Ig(s,n,i)))}function Zg(t,n,s){var i=yn();wi(t,n,s,i)}function wi(t,n,s,i){var d={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lu(t))Hg(n,d);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,S=f(y,s);if(d.hasEagerState=!0,d.eagerState=S,fn(S,y))return Bo(t,n,d,0),rt===null&&qo(),!1}catch{}finally{}if(s=pd(t,n,d,i),s!==null)return ln(s,t,i),Ig(s,n,i),!0}return!1}function Jd(t,n,s,i){if(i={lane:2,revertLane:Tf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},lu(t)){if(n)throw Error(l(479))}else n=pd(t,s,i,2),n!==null&&ln(n,t,2)}function lu(t){var n=t.alternate;return t===ze||n!==null&&n===ze}function Hg(t,n){il=Wo=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Ig(t,n,s){if((s&4194048)!==0){var i=n.lanes;i&=t.pendingLanes,s|=i,n.lanes=s,Kh(t,s)}}var Ni={readContext:$t,use:nu,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};Ni.useEffectEvent=vt;var Qg={readContext:$t,use:nu,useCallback:function(t,n){return Ft().memoizedState=[t,n===void 0?null:n],t},useContext:$t,useEffect:Cg,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,ru(4194308,4,Tg.bind(null,n,t),s)},useLayoutEffect:function(t,n){return ru(4194308,4,t,n)},useInsertionEffect:function(t,n){ru(4,2,t,n)},useMemo:function(t,n){var s=Ft();n=n===void 0?null:n;var i=t();if(us){Wn(!0);try{t()}finally{Wn(!1)}}return s.memoizedState=[i,n],i},useReducer:function(t,n,s){var i=Ft();if(s!==void 0){var d=s(n);if(us){Wn(!0);try{s(n)}finally{Wn(!1)}}}else d=n;return i.memoizedState=i.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},i.queue=t,t=t.dispatch=lw.bind(null,ze,t),[i.memoizedState,t]},useRef:function(t){var n=Ft();return t={current:t},n.memoizedState=t},useState:function(t){t=Pd(t);var n=t.queue,s=Zg.bind(null,ze,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:Kd,useDeferredValue:function(t,n){var s=Ft();return Fd(s,t,n)},useTransition:function(){var t=Pd(!1);return t=Ug.bind(null,ze,t.queue,!0,!1),Ft().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var i=ze,d=Ft();if(Ze){if(s===void 0)throw Error(l(407));s=s()}else{if(s=n(),rt===null)throw Error(l(349));(qe&127)!==0||dg(i,n,s)}d.memoizedState=s;var f={value:s,getSnapshot:n};return d.queue=f,Cg(mg.bind(null,i,f,t),[t]),i.flags|=2048,ul(9,{destroy:void 0},fg.bind(null,i,f,s,n),null),s},useId:function(){var t=Ft(),n=rt.identifierPrefix;if(Ze){var s=na,i=ta;s=(i&~(1<<32-Vt(i)-1)).toString(32)+s,n="_"+n+"R_"+s,s=eu++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=Wj++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Xd,useFormState:jg,useActionState:jg,useOptimistic:function(t){var n=Ft();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Jd.bind(null,ze,!0,s),s.dispatch=n,[t,n]},useMemoCache:Hd,useCacheRefresh:function(){return Ft().memoizedState=sw.bind(null,ze)},useEffectEvent:function(t){var n=Ft(),s={impl:t};return n.memoizedState=s,function(){if((Ke&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Wd={readContext:$t,use:nu,useCallback:Og,useContext:$t,useEffect:Vd,useImperativeHandle:Rg,useInsertionEffect:Ag,useLayoutEffect:zg,useMemo:Mg,useReducer:au,useRef:_g,useState:function(){return au(Sa)},useDebugValue:Kd,useDeferredValue:function(t,n){var s=jt();return Dg(s,tt.memoizedState,t,n)},useTransition:function(){var t=au(Sa)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:ji(t),n]},useSyncExternalStore:cg,useId:qg,useHostTransitionStatus:Xd,useFormState:wg,useActionState:wg,useOptimistic:function(t,n){var s=jt();return gg(s,tt,t,n)},useMemoCache:Hd,useCacheRefresh:Bg};Wd.useEffectEvent=kg;var Pg={readContext:$t,use:nu,useCallback:Og,useContext:$t,useEffect:Vd,useImperativeHandle:Rg,useInsertionEffect:Ag,useLayoutEffect:zg,useMemo:Mg,useReducer:Qd,useRef:_g,useState:function(){return Qd(Sa)},useDebugValue:Kd,useDeferredValue:function(t,n){var s=jt();return tt===null?Fd(s,t,n):Dg(s,tt.memoizedState,t,n)},useTransition:function(){var t=Qd(Sa)[0],n=jt().memoizedState;return[typeof t=="boolean"?t:ji(t),n]},useSyncExternalStore:cg,useId:qg,useHostTransitionStatus:Xd,useFormState:Eg,useActionState:Eg,useOptimistic:function(t,n){var s=jt();return tt!==null?gg(s,tt,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Hd,useCacheRefresh:Bg};Pg.useEffectEvent=kg;function ef(t,n,s,i){n=t.memoizedState,s=s(i,n),s=s==null?n:x({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var tf={enqueueSetState:function(t,n,s){t=t._reactInternals;var i=yn(),d=ar(i);d.payload=n,s!=null&&(d.callback=s),n=rr(t,d,i),n!==null&&(ln(n,t,i),yi(n,t,i))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var i=yn(),d=ar(i);d.tag=1,d.payload=n,s!=null&&(d.callback=s),n=rr(t,d,i),n!==null&&(ln(n,t,i),yi(n,t,i))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=yn(),i=ar(s);i.tag=2,n!=null&&(i.callback=n),n=rr(t,i,s),n!==null&&(ln(n,t,s),yi(n,t,s))}};function Gg(t,n,s,i,d,f,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,f,y):n.prototype&&n.prototype.isPureReactComponent?!ci(s,i)||!ci(d,f):!0}function Vg(t,n,s,i){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,i),n.state!==t&&tf.enqueueReplaceState(n,n.state,null)}function cs(t,n){var s=n;if("ref"in n){s={};for(var i in n)i!=="ref"&&(s[i]=n[i])}if(t=t.defaultProps){s===n&&(s=x({},s));for(var d in t)s[d]===void 0&&(s[d]=t[d])}return s}function Kg(t){$o(t)}function Fg(t){console.error(t)}function Yg(t){$o(t)}function iu(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function Xg(t,n,s){try{var i=t.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function nf(t,n,s){return s=ar(s),s.tag=3,s.payload={element:null},s.callback=function(){iu(t,n)},s}function Jg(t){return t=ar(t),t.tag=3,t}function Wg(t,n,s,i){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var f=i.value;t.payload=function(){return d(f)},t.callback=function(){Xg(n,s,i)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Xg(n,s,i),typeof d!="function"&&(cr===null?cr=new Set([this]):cr.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function iw(t,n,s,i,d){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=s.alternate,n!==null&&tl(n,s,d,!0),s=hn.current,s!==null){switch(s.tag){case 31:case 13:return Tn===null?bu():s.alternate===null&&yt===0&&(yt=3),s.flags&=-257,s.flags|=65536,s.lanes=d,i===Ko?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([i]):n.add(i),kf(t,i,d)),!1;case 22:return s.flags|=65536,i===Ko?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([i]):s.add(i)),kf(t,i,d)),!1}throw Error(l(435,s.tag))}return kf(t,i,d),bu(),!1}if(Ze)return n=hn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,i!==Sd&&(t=Error(l(422),{cause:i}),mi(Cn(t,s)))):(i!==Sd&&(n=Error(l(423),{cause:i}),mi(Cn(n,s))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,i=Cn(i,s),d=nf(t.stateNode,i,d),Rd(t,d),yt!==4&&(yt=2)),!1;var f=Error(l(520),{cause:i});if(f=Cn(f,s),Ri===null?Ri=[f]:Ri.push(f),yt!==4&&(yt=2),n===null)return!0;i=Cn(i,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=d&-d,s.lanes|=t,t=nf(s.stateNode,i,t),Rd(s,t),!1;case 1:if(n=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(cr===null||!cr.has(f))))return s.flags|=65536,d&=-d,s.lanes|=d,d=Jg(d),Wg(d,t,s,i),Rd(s,d),!1}s=s.return}while(s!==null);return!1}var af=Error(l(461)),Et=!1;function qt(t,n,s,i){n.child=t===null?ag(n,null,s,i):os(n,t.child,s,i)}function ev(t,n,s,i,d){s=s.render;var f=n.ref;if("ref"in i){var y={};for(var S in i)S!=="ref"&&(y[S]=i[S])}else y=i;return rs(n),i=$d(t,n,s,y,f,d),S=qd(),t!==null&&!Et?(Bd(t,n,d),ja(t,n,d)):(Ze&&S&&bd(n),n.flags|=1,qt(t,n,i,d),n.child)}function tv(t,n,s,i,d){if(t===null){var f=s.type;return typeof f=="function"&&!gd(f)&&f.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=f,nv(t,n,f,i,d)):(t=Ho(s.type,null,i,n,n.mode,d),t.ref=n.ref,t.return=n,n.child=t)}if(f=t.child,!ff(t,d)){var y=f.memoizedProps;if(s=s.compare,s=s!==null?s:ci,s(y,i)&&t.ref===n.ref)return ja(t,n,d)}return n.flags|=1,t=ga(f,i),t.ref=n.ref,t.return=n,n.child=t}function nv(t,n,s,i,d){if(t!==null){var f=t.memoizedProps;if(ci(f,i)&&t.ref===n.ref)if(Et=!1,n.pendingProps=i=f,ff(t,d))(t.flags&131072)!==0&&(Et=!0);else return n.lanes=t.lanes,ja(t,n,d)}return rf(t,n,s,i,d)}function av(t,n,s,i){var d=i.children,f=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,t!==null){for(i=n.child=t.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~f}else i=0,n.child=null;return rv(t,n,f,s,i)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Go(n,f!==null?f.cachePool:null),f!==null?lg(n,f):Md(),ig(n);else return i=n.lanes=536870912,rv(t,n,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Go(n,f.cachePool),lg(n,f),lr(),n.memoizedState=null):(t!==null&&Go(n,null),Md(),lr());return qt(t,n,d,s),n.child}function Ei(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function rv(t,n,s,i,d){var f=kd();return f=f===null?null:{parent:wt._currentValue,pool:f},n.memoizedState={baseLanes:s,cachePool:f},t!==null&&Go(n,null),Md(),ig(n),t!==null&&tl(t,n,i,!0),n.childLanes=d,null}function ou(t,n){return n=cu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function sv(t,n,s){return os(n,t.child,null,s),t=ou(n,n.pendingProps),t.flags|=2,pn(n),n.memoizedState=null,t}function ow(t,n,s){var i=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ze){if(i.mode==="hidden")return t=ou(n,i),n.lanes=536870912,Ei(null,t);if(Ud(n),(t=ot)?(t=vy(t,zn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ja!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},s=Hp(t),s.return=n,n.child=s,Lt=n,ot=null)):t=null,t===null)throw er(n);return n.lanes=536870912,null}return ou(n,i)}var f=t.memoizedState;if(f!==null){var y=f.dehydrated;if(Ud(n),d)if(n.flags&256)n.flags&=-257,n=sv(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(l(558));else if(Et||tl(t,n,s,!1),d=(s&t.childLanes)!==0,Et||d){if(i=rt,i!==null&&(y=Fh(i,s),y!==0&&y!==f.retryLane))throw f.retryLane=y,es(t,y),ln(i,t,y),af;bu(),n=sv(t,n,s)}else t=f.treeContext,ot=Rn(y.nextSibling),Lt=n,Ze=!0,Wa=null,zn=!1,t!==null&&Pp(n,t),n=ou(n,i),n.flags|=4096;return n}return t=ga(t.child,{mode:i.mode,children:i.children}),t.ref=n.ref,n.child=t,t.return=n,t}function uu(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function rf(t,n,s,i,d){return rs(n),s=$d(t,n,s,i,void 0,d),i=qd(),t!==null&&!Et?(Bd(t,n,d),ja(t,n,d)):(Ze&&i&&bd(n),n.flags|=1,qt(t,n,s,d),n.child)}function lv(t,n,s,i,d,f){return rs(n),n.updateQueue=null,s=ug(n,i,s,d),og(t),i=qd(),t!==null&&!Et?(Bd(t,n,f),ja(t,n,f)):(Ze&&i&&bd(n),n.flags|=1,qt(t,n,s,f),n.child)}function iv(t,n,s,i,d){if(rs(n),n.stateNode===null){var f=Xs,y=s.contextType;typeof y=="object"&&y!==null&&(f=$t(y)),f=new s(i,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=tf,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=i,f.state=n.memoizedState,f.refs={},zd(n),y=s.contextType,f.context=typeof y=="object"&&y!==null?$t(y):Xs,f.state=n.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(ef(n,s,y,i),f.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&tf.enqueueReplaceState(f,f.state,null),xi(n,i,f,d),bi(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(t===null){f=n.stateNode;var S=n.memoizedProps,C=cs(s,S);f.props=C;var q=f.context,F=s.contextType;y=Xs,typeof F=="object"&&F!==null&&(y=$t(F));var J=s.getDerivedStateFromProps;F=typeof J=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,F||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||q!==y)&&Vg(n,f,i,y),nr=!1;var Z=n.memoizedState;f.state=Z,xi(n,i,f,d),bi(),q=n.memoizedState,S||Z!==q||nr?(typeof J=="function"&&(ef(n,s,J,i),q=n.memoizedState),(C=nr||Gg(n,s,C,i,Z,q,y))?(F||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=q),f.props=i,f.state=q,f.context=y,i=C):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{f=n.stateNode,Td(t,n),y=n.memoizedProps,F=cs(s,y),f.props=F,J=n.pendingProps,Z=f.context,q=s.contextType,C=Xs,typeof q=="object"&&q!==null&&(C=$t(q)),S=s.getDerivedStateFromProps,(q=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==J||Z!==C)&&Vg(n,f,i,C),nr=!1,Z=n.memoizedState,f.state=Z,xi(n,i,f,d),bi();var G=n.memoizedState;y!==J||Z!==G||nr||t!==null&&t.dependencies!==null&&Qo(t.dependencies)?(typeof S=="function"&&(ef(n,s,S,i),G=n.memoizedState),(F=nr||Gg(n,s,F,i,Z,G,C)||t!==null&&t.dependencies!==null&&Qo(t.dependencies))?(q||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,G,C),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,G,C)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=G),f.props=i,f.state=G,f.context=C,i=F):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(n.flags|=1024),i=!1)}return f=i,uu(t,n),i=(n.flags&128)!==0,f||i?(f=n.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,t!==null&&i?(n.child=os(n,t.child,null,d),n.child=os(n,null,s,d)):qt(t,n,s,d),n.memoizedState=f.state,t=n.child):t=ja(t,n,d),t}function ov(t,n,s,i){return ns(),n.flags|=256,qt(t,n,s,i),n.child}var sf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(t){return{baseLanes:t,cachePool:Xp()}}function of(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=vn),t}function uv(t,n,s){var i=n.pendingProps,d=!1,f=(n.flags&128)!==0,y;if((y=f)||(y=t!==null&&t.memoizedState===null?!1:(St.current&2)!==0),y&&(d=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ze){if(d?sr(n):lr(),(t=ot)?(t=vy(t,zn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ja!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},s=Hp(t),s.return=n,n.child=s,Lt=n,ot=null)):t=null,t===null)throw er(n);return Qf(t)?n.lanes=32:n.lanes=536870912,null}var S=i.children;return i=i.fallback,d?(lr(),d=n.mode,S=cu({mode:"hidden",children:S},d),i=ts(i,d,s,null),S.return=n,i.return=n,S.sibling=i,n.child=S,i=n.child,i.memoizedState=lf(s),i.childLanes=of(t,y,s),n.memoizedState=sf,Ei(null,i)):(sr(n),uf(n,S))}var C=t.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(f)n.flags&256?(sr(n),n.flags&=-257,n=cf(t,n,s)):n.memoizedState!==null?(lr(),n.child=t.child,n.flags|=128,n=null):(lr(),S=i.fallback,d=n.mode,i=cu({mode:"visible",children:i.children},d),S=ts(S,d,s,null),S.flags|=2,i.return=n,S.return=n,i.sibling=S,n.child=i,os(n,t.child,null,s),i=n.child,i.memoizedState=lf(s),i.childLanes=of(t,y,s),n.memoizedState=sf,n=Ei(null,i));else if(sr(n),Qf(S)){if(y=S.nextSibling&&S.nextSibling.dataset,y)var q=y.dgst;y=q,i=Error(l(419)),i.stack="",i.digest=y,mi({value:i,source:null,stack:null}),n=cf(t,n,s)}else if(Et||tl(t,n,s,!1),y=(s&t.childLanes)!==0,Et||y){if(y=rt,y!==null&&(i=Fh(y,s),i!==0&&i!==C.retryLane))throw C.retryLane=i,es(t,i),ln(y,t,i),af;If(S)||bu(),n=cf(t,n,s)}else If(S)?(n.flags|=192,n.child=t.child,n=null):(t=C.treeContext,ot=Rn(S.nextSibling),Lt=n,Ze=!0,Wa=null,zn=!1,t!==null&&Pp(n,t),n=uf(n,i.children),n.flags|=4096);return n}return d?(lr(),S=i.fallback,d=n.mode,C=t.child,q=C.sibling,i=ga(C,{mode:"hidden",children:i.children}),i.subtreeFlags=C.subtreeFlags&65011712,q!==null?S=ga(q,S):(S=ts(S,d,s,null),S.flags|=2),S.return=n,i.return=n,i.sibling=S,n.child=i,Ei(null,i),i=n.child,S=t.child.memoizedState,S===null?S=lf(s):(d=S.cachePool,d!==null?(C=wt._currentValue,d=d.parent!==C?{parent:C,pool:C}:d):d=Xp(),S={baseLanes:S.baseLanes|s,cachePool:d}),i.memoizedState=S,i.childLanes=of(t,y,s),n.memoizedState=sf,Ei(t.child,i)):(sr(n),s=t.child,t=s.sibling,s=ga(s,{mode:"visible",children:i.children}),s.return=n,s.sibling=null,t!==null&&(y=n.deletions,y===null?(n.deletions=[t],n.flags|=16):y.push(t)),n.child=s,n.memoizedState=null,s)}function uf(t,n){return n=cu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function cu(t,n){return t=mn(22,t,null,n),t.lanes=0,t}function cf(t,n,s){return os(n,t.child,null,s),t=uf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function cv(t,n,s){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n),Nd(t.return,n,s)}function df(t,n,s,i,d,f){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:d,treeForkCount:f}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=i,y.tail=s,y.tailMode=d,y.treeForkCount=f)}function dv(t,n,s){var i=n.pendingProps,d=i.revealOrder,f=i.tail;i=i.children;var y=St.current,S=(y&2)!==0;if(S?(y=y&1|2,n.flags|=128):y&=1,V(St,y),qt(t,n,i,s),i=Ze?fi:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&cv(t,s,n);else if(t.tag===19)cv(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(s=n.child,d=null;s!==null;)t=s.alternate,t!==null&&Jo(t)===null&&(d=s),s=s.sibling;s=d,s===null?(d=n.child,n.child=null):(d=s.sibling,s.sibling=null),df(n,!1,d,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=n.child,n.child=null;d!==null;){if(t=d.alternate,t!==null&&Jo(t)===null){n.child=d;break}t=d.sibling,d.sibling=s,s=d,d=t}df(n,!0,s,null,f,i);break;case"together":df(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function ja(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),ur|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(tl(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(l(153));if(n.child!==null){for(t=n.child,s=ga(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=ga(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function ff(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Qo(t)))}function uw(t,n,s){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),tr(n,wt,t.memoizedState.cache),ns();break;case 27:case 5:Dt(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:tr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ud(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(sr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?uv(t,n,s):(sr(n),t=ja(t,n,s),t!==null?t.sibling:null);sr(n);break;case 19:var d=(t.flags&128)!==0;if(i=(s&n.childLanes)!==0,i||(tl(t,n,s,!1),i=(s&n.childLanes)!==0),d){if(i)return dv(t,n,s);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),V(St,St.current),i)break;return null;case 22:return n.lanes=0,av(t,n,s,n.pendingProps);case 24:tr(n,wt,t.memoizedState.cache)}return ja(t,n,s)}function fv(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)Et=!0;else{if(!ff(t,s)&&(n.flags&128)===0)return Et=!1,uw(t,n,s);Et=(t.flags&131072)!==0}else Et=!1,Ze&&(n.flags&1048576)!==0&&Qp(n,fi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(t=ls(n.elementType),n.type=t,typeof t=="function")gd(t)?(i=cs(t,i),n.tag=1,n=iv(null,n,t,i,s)):(n.tag=0,n=rf(null,n,t,i,s));else{if(t!=null){var d=t.$$typeof;if(d===O){n.tag=11,n=ev(null,n,t,i,s);break e}else if(d===L){n.tag=14,n=tv(null,n,t,i,s);break e}}throw n=Te(t)||t,Error(l(306,n,""))}}return n;case 0:return rf(t,n,n.type,n.pendingProps,s);case 1:return i=n.type,d=cs(i,n.pendingProps),iv(t,n,i,d,s);case 3:e:{if(Me(n,n.stateNode.containerInfo),t===null)throw Error(l(387));i=n.pendingProps;var f=n.memoizedState;d=f.element,Td(t,n),xi(n,i,null,s);var y=n.memoizedState;if(i=y.cache,tr(n,wt,i),i!==f.cache&&Ed(n,[wt],s,!0),bi(),i=y.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=ov(t,n,i,s);break e}else if(i!==d){d=Cn(Error(l(424)),n),mi(d),n=ov(t,n,i,s);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ot=Rn(t.firstChild),Lt=n,Ze=!0,Wa=null,zn=!0,s=ag(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ns(),i===d){n=ja(t,n,s);break e}qt(t,n,i,s)}n=n.child}return n;case 26:return uu(t,n),t===null?(s=wy(n.type,null,n.pendingProps,null))?n.memoizedState=s:Ze||(s=n.type,t=n.pendingProps,i=_u(ne.current).createElement(s),i[Ut]=n,i[en]=t,Bt(i,s,t),Rt(i),n.stateNode=i):n.memoizedState=wy(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Dt(n),t===null&&Ze&&(i=n.stateNode=xy(n.type,n.pendingProps,ne.current),Lt=n,zn=!0,d=ot,hr(n.type)?(Pf=d,ot=Rn(i.firstChild)):ot=d),qt(t,n,n.pendingProps.children,s),uu(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ze&&((d=i=ot)&&(i=qw(i,n.type,n.pendingProps,zn),i!==null?(n.stateNode=i,Lt=n,ot=Rn(i.firstChild),zn=!1,d=!0):d=!1),d||er(n)),Dt(n),d=n.type,f=n.pendingProps,y=t!==null?t.memoizedProps:null,i=f.children,Bf(d,f)?i=null:y!==null&&Bf(d,y)&&(n.flags|=32),n.memoizedState!==null&&(d=$d(t,n,ew,null,null,s),Bi._currentValue=d),uu(t,n),qt(t,n,i,s),n.child;case 6:return t===null&&Ze&&((t=s=ot)&&(s=Bw(s,n.pendingProps,zn),s!==null?(n.stateNode=s,Lt=n,ot=null,t=!0):t=!1),t||er(n)),null;case 13:return uv(t,n,s);case 4:return Me(n,n.stateNode.containerInfo),i=n.pendingProps,t===null?n.child=os(n,null,i,s):qt(t,n,i,s),n.child;case 11:return ev(t,n,n.type,n.pendingProps,s);case 7:return qt(t,n,n.pendingProps,s),n.child;case 8:return qt(t,n,n.pendingProps.children,s),n.child;case 12:return qt(t,n,n.pendingProps.children,s),n.child;case 10:return i=n.pendingProps,tr(n,n.type,i.value),qt(t,n,i.children,s),n.child;case 9:return d=n.type._context,i=n.pendingProps.children,rs(n),d=$t(d),i=i(d),n.flags|=1,qt(t,n,i,s),n.child;case 14:return tv(t,n,n.type,n.pendingProps,s);case 15:return nv(t,n,n.type,n.pendingProps,s);case 19:return dv(t,n,s);case 31:return ow(t,n,s);case 22:return av(t,n,s,n.pendingProps);case 24:return rs(n),i=$t(wt),t===null?(d=kd(),d===null&&(d=rt,f=_d(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=s),d=f),n.memoizedState={parent:i,cache:d},zd(n),tr(n,wt,d)):((t.lanes&s)!==0&&(Td(t,n),xi(n,null,null,s),bi()),d=t.memoizedState,f=n.memoizedState,d.parent!==i?(d={parent:i,cache:i},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),tr(n,wt,i)):(i=f.cache,tr(n,wt,i),i!==d.cache&&Ed(n,[wt],s,!0))),qt(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function wa(t){t.flags|=4}function mf(t,n,s,i,d){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(qv())t.flags|=8192;else throw is=Ko,Ad}else t.flags&=-16777217}function mv(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ky(n))if(qv())t.flags|=8192;else throw is=Ko,Ad}function du(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?W():536870912,t.lanes|=n,ml|=n)}function _i(t,n){if(!Ze)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,i=0;if(n)for(var d=t.child;d!==null;)s|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)s|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=i,t.childLanes=s,n}function cw(t,n,s){var i=n.pendingProps;switch(xd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(n),null;case 1:return ut(n),null;case 3:return s=n.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),ba(wt),pe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(el(n)?wa(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,jd())),ut(n),null;case 26:var d=n.type,f=n.memoizedState;return t===null?(wa(n),f!==null?(ut(n),mv(n,f)):(ut(n),mf(n,d,null,i,s))):f?f!==t.memoizedState?(wa(n),ut(n),mv(n,f)):(ut(n),n.flags&=-16777217):(t=t.memoizedProps,t!==i&&wa(n),ut(n),mf(n,d,t,i,s)),null;case 27:if(jn(n),s=ne.current,d=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==i&&wa(n);else{if(!i){if(n.stateNode===null)throw Error(l(166));return ut(n),null}t=ee.current,el(n)?Gp(n):(t=xy(d,i,s),n.stateNode=t,wa(n))}return ut(n),null;case 5:if(jn(n),d=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==i&&wa(n);else{if(!i){if(n.stateNode===null)throw Error(l(166));return ut(n),null}if(f=ee.current,el(n))Gp(n);else{var y=_u(ne.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?y.createElement("select",{is:i.is}):y.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?y.createElement(d,{is:i.is}):y.createElement(d)}}f[Ut]=n,f[en]=i;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(Bt(f,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&wa(n)}}return ut(n),mf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==i&&wa(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(l(166));if(t=ne.current,el(n)){if(t=n.stateNode,s=n.memoizedProps,i=null,d=Lt,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}t[Ut]=n,t=!!(t.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||uy(t.nodeValue,s)),t||er(n,!0)}else t=_u(t).createTextNode(i),t[Ut]=n,n.stateNode=t}return ut(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(i=el(n),s!==null){if(t===null){if(!i)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Ut]=n}else ns(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),t=!1}else s=jd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(pn(n),n):(pn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return ut(n),null;case 13:if(i=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=el(n),i!==null&&i.dehydrated!==null){if(t===null){if(!d)throw Error(l(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(l(317));d[Ut]=n}else ns(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ut(n),d=!1}else d=jd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(pn(n),n):(pn(n),null)}return pn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=i!==null,t=t!==null&&t.memoizedState!==null,s&&(i=n.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==d&&(i.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),du(n,n.updateQueue),ut(n),null);case 4:return pe(),t===null&&Df(n.stateNode.containerInfo),ut(n),null;case 10:return ba(n.type),ut(n),null;case 19:if(A(St),i=n.memoizedState,i===null)return ut(n),null;if(d=(n.flags&128)!==0,f=i.rendering,f===null)if(d)_i(i,!1);else{if(yt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(f=Jo(t),f!==null){for(n.flags|=128,_i(i,!1),t=f.updateQueue,n.updateQueue=t,du(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)Zp(s,t),s=s.sibling;return V(St,St.current&1|2),Ze&&va(n,i.treeForkCount),n.child}t=t.sibling}i.tail!==null&&Pt()>gu&&(n.flags|=128,d=!0,_i(i,!1),n.lanes=4194304)}else{if(!d)if(t=Jo(f),t!==null){if(n.flags|=128,d=!0,t=t.updateQueue,n.updateQueue=t,du(n,t),_i(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!Ze)return ut(n),null}else 2*Pt()-i.renderingStartTime>gu&&s!==536870912&&(n.flags|=128,d=!0,_i(i,!1),n.lanes=4194304);i.isBackwards?(f.sibling=n.child,n.child=f):(t=i.last,t!==null?t.sibling=f:n.child=f,i.last=f)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Pt(),t.sibling=null,s=St.current,V(St,d?s&1|2:s&1),Ze&&va(n,i.treeForkCount),t):(ut(n),null);case 22:case 23:return pn(n),Dd(),i=n.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(s&536870912)!==0&&(n.flags&128)===0&&(ut(n),n.subtreeFlags&6&&(n.flags|=8192)):ut(n),s=n.updateQueue,s!==null&&du(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048),t!==null&&A(ss),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),ba(wt),ut(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function dw(t,n){switch(xd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ba(wt),pe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return jn(n),null;case 31:if(n.memoizedState!==null){if(pn(n),n.alternate===null)throw Error(l(340));ns()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));ns()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return A(St),null;case 4:return pe(),null;case 10:return ba(n.type),null;case 22:case 23:return pn(n),Dd(),t!==null&&A(ss),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ba(wt),null;case 25:return null;default:return null}}function hv(t,n){switch(xd(n),n.tag){case 3:ba(wt),pe();break;case 26:case 27:case 5:jn(n);break;case 4:pe();break;case 31:n.memoizedState!==null&&pn(n);break;case 13:pn(n);break;case 19:A(St);break;case 10:ba(n.type);break;case 22:case 23:pn(n),Dd(),t!==null&&A(ss);break;case 24:ba(wt)}}function Ci(t,n){try{var s=n.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var d=i.next;s=d;do{if((s.tag&t)===t){i=void 0;var f=s.create,y=s.inst;i=f(),y.destroy=i}s=s.next}while(s!==d)}}catch(S){et(n,n.return,S)}}function ir(t,n,s){try{var i=n.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var f=d.next;i=f;do{if((i.tag&t)===t){var y=i.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,d=n;var C=s,q=S;try{q()}catch(F){et(d,C,F)}}}i=i.next}while(i!==f)}}catch(F){et(n,n.return,F)}}function pv(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{sg(n,s)}catch(i){et(t,t.return,i)}}}function gv(t,n,s){s.props=cs(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(i){et(t,n,i)}}function ki(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof s=="function"?t.refCleanup=s(i):s.current=i}}catch(d){et(t,n,d)}}function aa(t,n){var s=t.ref,i=t.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(d){et(t,n,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){et(t,n,d)}else s.current=null}function vv(t){var n=t.type,s=t.memoizedProps,i=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(d){et(t,t.return,d)}}function hf(t,n,s){try{var i=t.stateNode;Ow(i,t.type,s,n),i[en]=n}catch(d){et(t,t.return,d)}}function yv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&hr(t.type)||t.tag===4}function pf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||yv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&hr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function gf(t,n,s){var i=t.tag;if(i===5||i===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=ha));else if(i!==4&&(i===27&&hr(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(gf(t,n,s),t=t.sibling;t!==null;)gf(t,n,s),t=t.sibling}function fu(t,n,s){var i=t.tag;if(i===5||i===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(i!==4&&(i===27&&hr(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fu(t,n,s),t=t.sibling;t!==null;)fu(t,n,s),t=t.sibling}function bv(t){var n=t.stateNode,s=t.memoizedProps;try{for(var i=t.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);Bt(n,i,s),n[Ut]=t,n[en]=s}catch(f){et(t,t.return,f)}}var Na=!1,_t=!1,vf=!1,xv=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function fw(t,n){if(t=t.containerInfo,$f=Ou,t=Rp(t),ud(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var d=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var y=0,S=-1,C=-1,q=0,F=0,J=t,Z=null;t:for(;;){for(var G;J!==s||d!==0&&J.nodeType!==3||(S=y+d),J!==f||i!==0&&J.nodeType!==3||(C=y+i),J.nodeType===3&&(y+=J.nodeValue.length),(G=J.firstChild)!==null;)Z=J,J=G;for(;;){if(J===t)break t;if(Z===s&&++q===d&&(S=y),Z===f&&++F===i&&(C=y),(G=J.nextSibling)!==null)break;J=Z,Z=J.parentNode}J=G}s=S===-1||C===-1?null:{start:S,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(qf={focusedElem:t,selectionRange:s},Ou=!1,Ot=n;Ot!==null;)if(n=Ot,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Ot=t;else for(;Ot!==null;){switch(n=Ot,f=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)d=t[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&f!==null){t=void 0,s=n,d=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var oe=cs(s.type,d);t=i.getSnapshotBeforeUpdate(oe,f),i.__reactInternalSnapshotBeforeUpdate=t}catch(Ee){et(s,s.return,Ee)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Hf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Hf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=n.sibling,t!==null){t.return=n.return,Ot=t;break}Ot=n.return}}function Sv(t,n,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:_a(t,s),i&4&&Ci(5,s);break;case 1:if(_a(t,s),i&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(y){et(s,s.return,y)}else{var d=cs(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(d,n,t.__reactInternalSnapshotBeforeUpdate)}catch(y){et(s,s.return,y)}}i&64&&pv(s),i&512&&ki(s,s.return);break;case 3:if(_a(t,s),i&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{sg(t,n)}catch(y){et(s,s.return,y)}}break;case 27:n===null&&i&4&&bv(s);case 26:case 5:_a(t,s),n===null&&i&4&&vv(s),i&512&&ki(s,s.return);break;case 12:_a(t,s);break;case 31:_a(t,s),i&4&&Nv(t,s);break;case 13:_a(t,s),i&4&&Ev(t,s),i&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Sw.bind(null,s),Zw(t,s))));break;case 22:if(i=s.memoizedState!==null||Na,!i){n=n!==null&&n.memoizedState!==null||_t,d=Na;var f=_t;Na=i,(_t=n)&&!f?Ca(t,s,(s.subtreeFlags&8772)!==0):_a(t,s),Na=d,_t=f}break;case 30:break;default:_a(t,s)}}function jv(t){var n=t.alternate;n!==null&&(t.alternate=null,jv(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Gc(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var dt=null,nn=!1;function Ea(t,n,s){for(s=s.child;s!==null;)wv(t,n,s),s=s.sibling}function wv(t,n,s){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(Pr,s)}catch{}switch(s.tag){case 26:_t||aa(s,n),Ea(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:_t||aa(s,n);var i=dt,d=nn;hr(s.type)&&(dt=s.stateNode,nn=!1),Ea(t,n,s),Li(s.stateNode),dt=i,nn=d;break;case 5:_t||aa(s,n);case 6:if(i=dt,d=nn,dt=null,Ea(t,n,s),dt=i,nn=d,dt!==null)if(nn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(s.stateNode)}catch(f){et(s,n,f)}else try{dt.removeChild(s.stateNode)}catch(f){et(s,n,f)}break;case 18:dt!==null&&(nn?(t=dt,py(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Sl(t)):py(dt,s.stateNode));break;case 4:i=dt,d=nn,dt=s.stateNode.containerInfo,nn=!0,Ea(t,n,s),dt=i,nn=d;break;case 0:case 11:case 14:case 15:ir(2,s,n),_t||ir(4,s,n),Ea(t,n,s);break;case 1:_t||(aa(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"&&gv(s,n,i)),Ea(t,n,s);break;case 21:Ea(t,n,s);break;case 22:_t=(i=_t)||s.memoizedState!==null,Ea(t,n,s),_t=i;break;default:Ea(t,n,s)}}function Nv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Sl(t)}catch(s){et(n,n.return,s)}}}function Ev(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Sl(t)}catch(s){et(n,n.return,s)}}function mw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new xv),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new xv),n;default:throw Error(l(435,t.tag))}}function mu(t,n){var s=mw(t);n.forEach(function(i){if(!s.has(i)){s.add(i);var d=jw.bind(null,t,i);i.then(d,d)}})}function an(t,n){var s=n.deletions;if(s!==null)for(var i=0;i<s.length;i++){var d=s[i],f=t,y=n,S=y;e:for(;S!==null;){switch(S.tag){case 27:if(hr(S.type)){dt=S.stateNode,nn=!1;break e}break;case 5:dt=S.stateNode,nn=!1;break e;case 3:case 4:dt=S.stateNode.containerInfo,nn=!0;break e}S=S.return}if(dt===null)throw Error(l(160));wv(f,y,d),dt=null,nn=!1,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)_v(n,t),n=n.sibling}var Gn=null;function _v(t,n){var s=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:an(n,t),rn(t),i&4&&(ir(3,t,t.return),Ci(3,t),ir(5,t,t.return));break;case 1:an(n,t),rn(t),i&512&&(_t||s===null||aa(s,s.return)),i&64&&Na&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var d=Gn;if(an(n,t),rn(t),i&512&&(_t||s===null||aa(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=t.memoizedState,s===null)if(i===null)if(t.stateNode===null){e:{i=t.type,s=t.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":f=d.getElementsByTagName("title")[0],(!f||f[ti]||f[Ut]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(i),d.head.insertBefore(f,d.querySelector("head > title"))),Bt(f,i,s),f[Ut]=t,Rt(f),i=f;break e;case"link":var y=_y("link","href",d).get(i+(s.href||""));if(y){for(var S=0;S<y.length;S++)if(f=y[S],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(S,1);break t}}f=d.createElement(i),Bt(f,i,s),d.head.appendChild(f);break;case"meta":if(y=_y("meta","content",d).get(i+(s.content||""))){for(S=0;S<y.length;S++)if(f=y[S],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(S,1);break t}}f=d.createElement(i),Bt(f,i,s),d.head.appendChild(f);break;default:throw Error(l(468,i))}f[Ut]=t,Rt(f),i=f}t.stateNode=i}else Cy(d,t.type,t.stateNode);else t.stateNode=Ey(d,i,t.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Cy(d,t.type,t.stateNode):Ey(d,i,t.memoizedProps)):i===null&&t.stateNode!==null&&hf(t,t.memoizedProps,s.memoizedProps)}break;case 27:an(n,t),rn(t),i&512&&(_t||s===null||aa(s,s.return)),s!==null&&i&4&&hf(t,t.memoizedProps,s.memoizedProps);break;case 5:if(an(n,t),rn(t),i&512&&(_t||s===null||aa(s,s.return)),t.flags&32){d=t.stateNode;try{Qs(d,"")}catch(oe){et(t,t.return,oe)}}i&4&&t.stateNode!=null&&(d=t.memoizedProps,hf(t,d,s!==null?s.memoizedProps:d)),i&1024&&(vf=!0);break;case 6:if(an(n,t),rn(t),i&4){if(t.stateNode===null)throw Error(l(162));i=t.memoizedProps,s=t.stateNode;try{s.nodeValue=i}catch(oe){et(t,t.return,oe)}}break;case 3:if(Au=null,d=Gn,Gn=Cu(n.containerInfo),an(n,t),Gn=d,rn(t),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Sl(n.containerInfo)}catch(oe){et(t,t.return,oe)}vf&&(vf=!1,Cv(t));break;case 4:i=Gn,Gn=Cu(t.stateNode.containerInfo),an(n,t),rn(t),Gn=i;break;case 12:an(n,t),rn(t);break;case 31:an(n,t),rn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,mu(t,i)));break;case 13:an(n,t),rn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pu=Pt()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,mu(t,i)));break;case 22:d=t.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,q=Na,F=_t;if(Na=q||d,_t=F||C,an(n,t),_t=F,Na=q,rn(t),i&8192)e:for(n=t.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(s===null||C||Na||_t||ds(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){C=s=n;try{if(f=C.stateNode,d)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{S=C.stateNode;var J=C.memoizedProps.style,Z=J!=null&&J.hasOwnProperty("display")?J.display:null;S.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(oe){et(C,C.return,oe)}}}else if(n.tag===6){if(s===null){C=n;try{C.stateNode.nodeValue=d?"":C.memoizedProps}catch(oe){et(C,C.return,oe)}}}else if(n.tag===18){if(s===null){C=n;try{var G=C.stateNode;d?gy(G,!0):gy(C.stateNode,!1)}catch(oe){et(C,C.return,oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=t.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,mu(t,s))));break;case 19:an(n,t),rn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,mu(t,i)));break;case 30:break;case 21:break;default:an(n,t),rn(t)}}function rn(t){var n=t.flags;if(n&2){try{for(var s,i=t.return;i!==null;){if(yv(i)){s=i;break}i=i.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var d=s.stateNode,f=pf(t);fu(t,f,d);break;case 5:var y=s.stateNode;s.flags&32&&(Qs(y,""),s.flags&=-33);var S=pf(t);fu(t,S,y);break;case 3:case 4:var C=s.stateNode.containerInfo,q=pf(t);gf(t,q,C);break;default:throw Error(l(161))}}catch(F){et(t,t.return,F)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Cv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Cv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function _a(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Sv(t,n.alternate,n),n=n.sibling}function ds(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ir(4,n,n.return),ds(n);break;case 1:aa(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&gv(n,n.return,s),ds(n);break;case 27:Li(n.stateNode);case 26:case 5:aa(n,n.return),ds(n);break;case 22:n.memoizedState===null&&ds(n);break;case 30:ds(n);break;default:ds(n)}t=t.sibling}}function Ca(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,d=t,f=n,y=f.flags;switch(f.tag){case 0:case 11:case 15:Ca(d,f,s),Ci(4,f);break;case 1:if(Ca(d,f,s),i=f,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(q){et(i,i.return,q)}if(i=f,d=i.updateQueue,d!==null){var S=i.stateNode;try{var C=d.shared.hiddenCallbacks;if(C!==null)for(d.shared.hiddenCallbacks=null,d=0;d<C.length;d++)rg(C[d],S)}catch(q){et(i,i.return,q)}}s&&y&64&&pv(f),ki(f,f.return);break;case 27:bv(f);case 26:case 5:Ca(d,f,s),s&&i===null&&y&4&&vv(f),ki(f,f.return);break;case 12:Ca(d,f,s);break;case 31:Ca(d,f,s),s&&y&4&&Nv(d,f);break;case 13:Ca(d,f,s),s&&y&4&&Ev(d,f);break;case 22:f.memoizedState===null&&Ca(d,f,s),ki(f,f.return);break;case 30:break;default:Ca(d,f,s)}n=n.sibling}}function yf(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&hi(s))}function bf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hi(t))}function Vn(t,n,s,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)kv(t,n,s,i),n=n.sibling}function kv(t,n,s,i){var d=n.flags;switch(n.tag){case 0:case 11:case 15:Vn(t,n,s,i),d&2048&&Ci(9,n);break;case 1:Vn(t,n,s,i);break;case 3:Vn(t,n,s,i),d&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hi(t)));break;case 12:if(d&2048){Vn(t,n,s,i),t=n.stateNode;try{var f=n.memoizedProps,y=f.id,S=f.onPostCommit;typeof S=="function"&&S(y,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(C){et(n,n.return,C)}}else Vn(t,n,s,i);break;case 31:Vn(t,n,s,i);break;case 13:Vn(t,n,s,i);break;case 23:break;case 22:f=n.stateNode,y=n.alternate,n.memoizedState!==null?f._visibility&2?Vn(t,n,s,i):Ai(t,n):f._visibility&2?Vn(t,n,s,i):(f._visibility|=2,cl(t,n,s,i,(n.subtreeFlags&10256)!==0||!1)),d&2048&&yf(y,n);break;case 24:Vn(t,n,s,i),d&2048&&bf(n.alternate,n);break;default:Vn(t,n,s,i)}}function cl(t,n,s,i,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=t,y=n,S=s,C=i,q=y.flags;switch(y.tag){case 0:case 11:case 15:cl(f,y,S,C,d),Ci(8,y);break;case 23:break;case 22:var F=y.stateNode;y.memoizedState!==null?F._visibility&2?cl(f,y,S,C,d):Ai(f,y):(F._visibility|=2,cl(f,y,S,C,d)),d&&q&2048&&yf(y.alternate,y);break;case 24:cl(f,y,S,C,d),d&&q&2048&&bf(y.alternate,y);break;default:cl(f,y,S,C,d)}n=n.sibling}}function Ai(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,i=n,d=i.flags;switch(i.tag){case 22:Ai(s,i),d&2048&&yf(i.alternate,i);break;case 24:Ai(s,i),d&2048&&bf(i.alternate,i);break;default:Ai(s,i)}n=n.sibling}}var zi=8192;function dl(t,n,s){if(t.subtreeFlags&zi)for(t=t.child;t!==null;)Av(t,n,s),t=t.sibling}function Av(t,n,s){switch(t.tag){case 26:dl(t,n,s),t.flags&zi&&t.memoizedState!==null&&Ww(s,Gn,t.memoizedState,t.memoizedProps);break;case 5:dl(t,n,s);break;case 3:case 4:var i=Gn;Gn=Cu(t.stateNode.containerInfo),dl(t,n,s),Gn=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=zi,zi=16777216,dl(t,n,s),zi=i):dl(t,n,s));break;default:dl(t,n,s)}}function zv(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Ti(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];Ot=i,Rv(i,t)}zv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tv(t),t=t.sibling}function Tv(t){switch(t.tag){case 0:case 11:case 15:Ti(t),t.flags&2048&&ir(9,t,t.return);break;case 3:Ti(t);break;case 12:Ti(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,hu(t)):Ti(t);break;default:Ti(t)}}function hu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];Ot=i,Rv(i,t)}zv(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ir(8,n,n.return),hu(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,hu(n));break;default:hu(n)}t=t.sibling}}function Rv(t,n){for(;Ot!==null;){var s=Ot;switch(s.tag){case 0:case 11:case 15:ir(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:hi(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,Ot=i;else e:for(s=t;Ot!==null;){i=Ot;var d=i.sibling,f=i.return;if(jv(i),i===s){Ot=null;break e}if(d!==null){d.return=f,Ot=d;break e}Ot=f}}}var hw={getCacheForType:function(t){var n=$t(wt),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return $t(wt).controller.signal}},pw=typeof WeakMap=="function"?WeakMap:Map,Ke=0,rt=null,Ue=null,qe=0,We=0,gn=null,or=!1,fl=!1,xf=!1,ka=0,yt=0,ur=0,fs=0,Sf=0,vn=0,ml=0,Ri=null,sn=null,jf=!1,pu=0,Ov=0,gu=1/0,vu=null,cr=null,At=0,dr=null,hl=null,Aa=0,wf=0,Nf=null,Mv=null,Oi=0,Ef=null;function yn(){return(Ke&2)!==0&&qe!==0?qe&-qe:Q.T!==null?Tf():Yh()}function Dv(){if(vn===0)if((qe&536870912)===0||Ze){var t=Vr;Vr<<=1,(Vr&3932160)===0&&(Vr=262144),vn=t}else vn=536870912;return t=hn.current,t!==null&&(t.flags|=32),vn}function ln(t,n,s){(t===rt&&(We===2||We===9)||t.cancelPendingCommit!==null)&&(pl(t,0),fr(t,qe,vn,!1)),Kt(t,s),((Ke&2)===0||t!==rt)&&(t===rt&&((Ke&2)===0&&(fs|=s),yt===4&&fr(t,qe,vn,!1)),ra(t))}function Uv(t,n,s){if((Ke&6)!==0)throw Error(l(327));var i=!s&&(n&127)===0&&(n&t.expiredLanes)===0||Fa(t,n),d=i?yw(t,n):Cf(t,n,!0),f=i;do{if(d===0){fl&&!i&&fr(t,n,0,!1);break}else{if(s=t.current.alternate,f&&!gw(s)){d=Cf(t,n,!1),f=!1;continue}if(d===2){if(f=n,t.errorRecoveryDisabledLanes&f)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var S=t;d=Ri;var C=S.current.memoizedState.isDehydrated;if(C&&(pl(S,y).flags|=256),y=Cf(S,y,!1),y!==2){if(xf&&!C){S.errorRecoveryDisabledLanes|=f,fs|=f,d=4;break e}f=sn,sn=d,f!==null&&(sn===null?sn=f:sn.push.apply(sn,f))}d=y}if(f=!1,d!==2)continue}}if(d===1){pl(t,0),fr(t,n,0,!0);break}e:{switch(i=t,f=d,f){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:fr(i,n,vn,!or);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(d=pu+300-Pt(),10<d)){if(fr(i,n,vn,!or),Fr(i,0,!0)!==0)break e;Aa=n,i.timeoutHandle=my(Lv.bind(null,i,s,sn,vu,jf,n,vn,fs,ml,or,f,"Throttled",-0,0),d);break e}Lv(i,s,sn,vu,jf,n,vn,fs,ml,or,f,null,-0,0)}}break}while(!0);ra(t)}function Lv(t,n,s,i,d,f,y,S,C,q,F,J,Z,G){if(t.timeoutHandle=-1,J=n.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ha},Av(n,f,J);var oe=(f&62914560)===f?pu-Pt():(f&4194048)===f?Ov-Pt():0;if(oe=eN(J,oe),oe!==null){Aa=f,t.cancelPendingCommit=oe(Pv.bind(null,t,n,f,s,i,d,y,S,C,F,J,null,Z,G)),fr(t,f,y,!q);return}}Pv(t,n,f,s,i,d,y,S,C)}function gw(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var d=s[i],f=d.getSnapshot;d=d.value;try{if(!fn(f(),d))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function fr(t,n,s,i){n&=~Sf,n&=~fs,t.suspendedLanes|=n,t.pingedLanes&=~n,i&&(t.warmLanes|=n),i=t.expirationTimes;for(var d=n;0<d;){var f=31-Vt(d),y=1<<f;i[f]=-1,d&=~y}s!==0&&Hc(t,s,n)}function yu(){return(Ke&6)===0?(Mi(0),!1):!0}function _f(){if(Ue!==null){if(We===0)var t=Ue.return;else t=Ue,ya=as=null,Zd(t),sl=null,gi=0,t=Ue;for(;t!==null;)hv(t.alternate,t),t=t.return;Ue=null}}function pl(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Uw(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Aa=0,_f(),rt=t,Ue=s=ga(t.current,null),qe=n,We=0,gn=null,or=!1,fl=Fa(t,n),xf=!1,ml=vn=Sf=fs=ur=yt=0,sn=Ri=null,jf=!1,(n&8)!==0&&(n|=n&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=n;0<i;){var d=31-Vt(i),f=1<<d;n|=t[d],i&=~f}return ka=n,qo(),s}function $v(t,n){ze=null,Q.H=Ni,n===rl||n===Vo?(n=eg(),We=3):n===Ad?(n=eg(),We=4):We=n===af?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,gn=n,Ue===null&&(yt=1,iu(t,Cn(n,t.current)))}function qv(){var t=hn.current;return t===null?!0:(qe&4194048)===qe?Tn===null:(qe&62914560)===qe||(qe&536870912)!==0?t===Tn:!1}function Bv(){var t=Q.H;return Q.H=Ni,t===null?Ni:t}function Zv(){var t=Q.A;return Q.A=hw,t}function bu(){yt=4,or||(qe&4194048)!==qe&&hn.current!==null||(fl=!0),(ur&134217727)===0&&(fs&134217727)===0||rt===null||fr(rt,qe,vn,!1)}function Cf(t,n,s){var i=Ke;Ke|=2;var d=Bv(),f=Zv();(rt!==t||qe!==n)&&(vu=null,pl(t,n)),n=!1;var y=yt;e:do try{if(We!==0&&Ue!==null){var S=Ue,C=gn;switch(We){case 8:_f(),y=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(n=!0);var q=We;if(We=0,gn=null,gl(t,S,C,q),s&&fl){y=0;break e}break;default:q=We,We=0,gn=null,gl(t,S,C,q)}}vw(),y=yt;break}catch(F){$v(t,F)}while(!0);return n&&t.shellSuspendCounter++,ya=as=null,Ke=i,Q.H=d,Q.A=f,Ue===null&&(rt=null,qe=0,qo()),y}function vw(){for(;Ue!==null;)Hv(Ue)}function yw(t,n){var s=Ke;Ke|=2;var i=Bv(),d=Zv();rt!==t||qe!==n?(vu=null,gu=Pt()+500,pl(t,n)):fl=Fa(t,n);e:do try{if(We!==0&&Ue!==null){n=Ue;var f=gn;t:switch(We){case 1:We=0,gn=null,gl(t,n,f,1);break;case 2:case 9:if(Jp(f)){We=0,gn=null,Iv(n);break}n=function(){We!==2&&We!==9||rt!==t||(We=7),ra(t)},f.then(n,n);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Jp(f)?(We=0,gn=null,Iv(n)):(We=0,gn=null,gl(t,n,f,7));break;case 5:var y=null;switch(Ue.tag){case 26:y=Ue.memoizedState;case 5:case 27:var S=Ue;if(y?ky(y):S.stateNode.complete){We=0,gn=null;var C=S.sibling;if(C!==null)Ue=C;else{var q=S.return;q!==null?(Ue=q,xu(q)):Ue=null}break t}}We=0,gn=null,gl(t,n,f,5);break;case 6:We=0,gn=null,gl(t,n,f,6);break;case 8:_f(),yt=6;break e;default:throw Error(l(462))}}bw();break}catch(F){$v(t,F)}while(!0);return ya=as=null,Q.H=i,Q.A=d,Ke=s,Ue!==null?0:(rt=null,qe=0,qo(),yt)}function bw(){for(;Ue!==null&&!Lc();)Hv(Ue)}function Hv(t){var n=fv(t.alternate,t,ka);t.memoizedProps=t.pendingProps,n===null?xu(t):Ue=n}function Iv(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=lv(s,n,n.pendingProps,n.type,void 0,qe);break;case 11:n=lv(s,n,n.pendingProps,n.type.render,n.ref,qe);break;case 5:Zd(n);default:hv(s,n),n=Ue=Zp(n,ka),n=fv(s,n,ka)}t.memoizedProps=t.pendingProps,n===null?xu(t):Ue=n}function gl(t,n,s,i){ya=as=null,Zd(n),sl=null,gi=0;var d=n.return;try{if(iw(t,d,n,s,qe)){yt=1,iu(t,Cn(s,t.current)),Ue=null;return}}catch(f){if(d!==null)throw Ue=d,f;yt=1,iu(t,Cn(s,t.current)),Ue=null;return}n.flags&32768?(Ze||i===1?t=!0:fl||(qe&536870912)!==0?t=!1:(or=t=!0,(i===2||i===9||i===3||i===6)&&(i=hn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Qv(n,t)):xu(n)}function xu(t){var n=t;do{if((n.flags&32768)!==0){Qv(n,or);return}t=n.return;var s=cw(n.alternate,n,ka);if(s!==null){Ue=s;return}if(n=n.sibling,n!==null){Ue=n;return}Ue=n=t}while(n!==null);yt===0&&(yt=5)}function Qv(t,n){do{var s=dw(t.alternate,t);if(s!==null){s.flags&=32767,Ue=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){Ue=t;return}Ue=t=s}while(t!==null);yt=6,Ue=null}function Pv(t,n,s,i,d,f,y,S,C){t.cancelPendingCommit=null;do Su();while(At!==0);if((Ke&6)!==0)throw Error(l(327));if(n!==null){if(n===t.current)throw Error(l(177));if(f=n.lanes|n.childLanes,f|=hd,Co(t,s,f,y,S,C),t===rt&&(Ue=rt=null,qe=0),hl=n,dr=t,Aa=s,wf=f,Nf=d,Mv=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ww(Ls,function(){return Yv(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,d=te.p,te.p=2,y=Ke,Ke|=4;try{fw(t,n,s)}finally{Ke=y,te.p=d,Q.T=i}}At=1,Gv(),Vv(),Kv()}}function Gv(){if(At===1){At=0;var t=dr,n=hl,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=Q.T,Q.T=null;var i=te.p;te.p=2;var d=Ke;Ke|=4;try{_v(n,t);var f=qf,y=Rp(t.containerInfo),S=f.focusedElem,C=f.selectionRange;if(y!==S&&S&&S.ownerDocument&&Tp(S.ownerDocument.documentElement,S)){if(C!==null&&ud(S)){var q=C.start,F=C.end;if(F===void 0&&(F=q),"selectionStart"in S)S.selectionStart=q,S.selectionEnd=Math.min(F,S.value.length);else{var J=S.ownerDocument||document,Z=J&&J.defaultView||window;if(Z.getSelection){var G=Z.getSelection(),oe=S.textContent.length,Ee=Math.min(C.start,oe),at=C.end===void 0?Ee:Math.min(C.end,oe);!G.extend&&Ee>at&&(y=at,at=Ee,Ee=y);var U=zp(S,Ee),R=zp(S,at);if(U&&R&&(G.rangeCount!==1||G.anchorNode!==U.node||G.anchorOffset!==U.offset||G.focusNode!==R.node||G.focusOffset!==R.offset)){var $=J.createRange();$.setStart(U.node,U.offset),G.removeAllRanges(),Ee>at?(G.addRange($),G.extend(R.node,R.offset)):($.setEnd(R.node,R.offset),G.addRange($))}}}}for(J=[],G=S;G=G.parentNode;)G.nodeType===1&&J.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<J.length;S++){var X=J[S];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}Ou=!!$f,qf=$f=null}finally{Ke=d,te.p=i,Q.T=s}}t.current=n,At=2}}function Vv(){if(At===2){At=0;var t=dr,n=hl,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=Q.T,Q.T=null;var i=te.p;te.p=2;var d=Ke;Ke|=4;try{Sv(t,n.alternate,n)}finally{Ke=d,te.p=i,Q.T=s}}At=3}}function Kv(){if(At===4||At===3){At=0,So();var t=dr,n=hl,s=Aa,i=Mv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?At=5:(At=0,hl=dr=null,Fv(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(cr=null),Qc(s),n=n.stateNode,Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(Pr,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=Q.T,d=te.p,te.p=2,Q.T=null;try{for(var f=t.onRecoverableError,y=0;y<i.length;y++){var S=i[y];f(S.value,{componentStack:S.stack})}}finally{Q.T=n,te.p=d}}(Aa&3)!==0&&Su(),ra(t),d=t.pendingLanes,(s&261930)!==0&&(d&42)!==0?t===Ef?Oi++:(Oi=0,Ef=t):Oi=0,Mi(0)}}function Fv(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,hi(n)))}function Su(){return Gv(),Vv(),Kv(),Yv()}function Yv(){if(At!==5)return!1;var t=dr,n=wf;wf=0;var s=Qc(Aa),i=Q.T,d=te.p;try{te.p=32>s?32:s,Q.T=null,s=Nf,Nf=null;var f=dr,y=Aa;if(At=0,hl=dr=null,Aa=0,(Ke&6)!==0)throw Error(l(331));var S=Ke;if(Ke|=4,Tv(f.current),kv(f,f.current,y,s),Ke=S,Mi(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(Pr,f)}catch{}return!0}finally{te.p=d,Q.T=i,Fv(t,n)}}function Xv(t,n,s){n=Cn(s,n),n=nf(t.stateNode,n,2),t=rr(t,n,2),t!==null&&(Kt(t,2),ra(t))}function et(t,n,s){if(t.tag===3)Xv(t,t,s);else for(;n!==null;){if(n.tag===3){Xv(n,t,s);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(cr===null||!cr.has(i))){t=Cn(s,t),s=Jg(2),i=rr(n,s,2),i!==null&&(Wg(s,i,n,t),Kt(i,2),ra(i));break}}n=n.return}}function kf(t,n,s){var i=t.pingCache;if(i===null){i=t.pingCache=new pw;var d=new Set;i.set(n,d)}else d=i.get(n),d===void 0&&(d=new Set,i.set(n,d));d.has(s)||(xf=!0,d.add(s),t=xw.bind(null,t,n,s),n.then(t,t))}function xw(t,n,s){var i=t.pingCache;i!==null&&i.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,rt===t&&(qe&s)===s&&(yt===4||yt===3&&(qe&62914560)===qe&&300>Pt()-pu?(Ke&2)===0&&pl(t,0):Sf|=s,ml===qe&&(ml=0)),ra(t)}function Jv(t,n){n===0&&(n=W()),t=es(t,n),t!==null&&(Kt(t,n),ra(t))}function Sw(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),Jv(t,s)}function jw(t,n){var s=0;switch(t.tag){case 31:case 13:var i=t.stateNode,d=t.memoizedState;d!==null&&(s=d.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(l(314))}i!==null&&i.delete(n),Jv(t,s)}function ww(t,n){return Ds(t,n)}var ju=null,vl=null,Af=!1,wu=!1,zf=!1,mr=0;function ra(t){t!==vl&&t.next===null&&(vl===null?ju=vl=t:vl=vl.next=t),wu=!0,Af||(Af=!0,Ew())}function Mi(t,n){if(!zf&&wu){zf=!0;do for(var s=!1,i=ju;i!==null;){if(t!==0){var d=i.pendingLanes;if(d===0)var f=0;else{var y=i.suspendedLanes,S=i.pingedLanes;f=(1<<31-Vt(42|t)+1)-1,f&=d&~(y&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,ny(i,f))}else f=qe,f=Fr(i,i===rt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Fa(i,f)||(s=!0,ny(i,f));i=i.next}while(s);zf=!1}}function Nw(){Wv()}function Wv(){wu=Af=!1;var t=0;mr!==0&&Dw()&&(t=mr);for(var n=Pt(),s=null,i=ju;i!==null;){var d=i.next,f=ey(i,n);f===0?(i.next=null,s===null?ju=d:s.next=d,d===null&&(vl=s)):(s=i,(t!==0||(f&3)!==0)&&(wu=!0)),i=d}At!==0&&At!==5||Mi(t),mr!==0&&(mr=0)}function ey(t,n){for(var s=t.suspendedLanes,i=t.pingedLanes,d=t.expirationTimes,f=t.pendingLanes&-62914561;0<f;){var y=31-Vt(f),S=1<<y,C=d[y];C===-1?((S&s)===0||(S&i)!==0)&&(d[y]=_o(S,n)):C<=n&&(t.expiredLanes|=S),f&=~S}if(n=rt,s=qe,s=Fr(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,s===0||t===n&&(We===2||We===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Us(i),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||Fa(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(i!==null&&Us(i),Qc(s)){case 2:case 8:s=jo;break;case 32:s=Ls;break;case 268435456:s=ei;break;default:s=Ls}return i=ty.bind(null,t),s=Ds(s,i),t.callbackPriority=n,t.callbackNode=s,n}return i!==null&&i!==null&&Us(i),t.callbackPriority=2,t.callbackNode=null,2}function ty(t,n){if(At!==0&&At!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Su()&&t.callbackNode!==s)return null;var i=qe;return i=Fr(t,t===rt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(Uv(t,i,n),ey(t,Pt()),t.callbackNode!=null&&t.callbackNode===s?ty.bind(null,t):null)}function ny(t,n){if(Su())return null;Uv(t,n,!0)}function Ew(){Lw(function(){(Ke&6)!==0?Ds(Qr,Nw):Wv()})}function Tf(){if(mr===0){var t=nl;t===0&&(t=Gr,Gr<<=1,(Gr&261888)===0&&(Gr=256)),mr=t}return mr}function ay(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:To(""+t)}function ry(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function _w(t,n,s,i,d){if(n==="submit"&&s&&s.stateNode===d){var f=ay((d[en]||null).action),y=i.submitter;y&&(n=(n=y[en]||null)?ay(n.formAction):y.getAttribute("formAction"),n!==null&&(f=n,y=null));var S=new Do("action","action",null,i,d);t.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(mr!==0){var C=y?ry(d,y):new FormData(d);Yd(s,{pending:!0,data:C,method:d.method,action:f},null,C)}}else typeof f=="function"&&(S.preventDefault(),C=y?ry(d,y):new FormData(d),Yd(s,{pending:!0,data:C,method:d.method,action:f},f,C))},currentTarget:d}]})}}for(var Rf=0;Rf<md.length;Rf++){var Of=md[Rf],Cw=Of.toLowerCase(),kw=Of[0].toUpperCase()+Of.slice(1);Pn(Cw,"on"+kw)}Pn(Dp,"onAnimationEnd"),Pn(Up,"onAnimationIteration"),Pn(Lp,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(Qj,"onTransitionRun"),Pn(Pj,"onTransitionStart"),Pn(Gj,"onTransitionCancel"),Pn($p,"onTransitionEnd"),Hs("onMouseEnter",["mouseout","mouseover"]),Hs("onMouseLeave",["mouseout","mouseover"]),Hs("onPointerEnter",["pointerout","pointerover"]),Hs("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Di="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(" "),Aw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Di));function sy(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var i=t[s],d=i.event;i=i.listeners;e:{var f=void 0;if(n)for(var y=i.length-1;0<=y;y--){var S=i[y],C=S.instance,q=S.currentTarget;if(S=S.listener,C!==f&&d.isPropagationStopped())break e;f=S,d.currentTarget=q;try{f(d)}catch(F){$o(F)}d.currentTarget=null,f=C}else for(y=0;y<i.length;y++){if(S=i[y],C=S.instance,q=S.currentTarget,S=S.listener,C!==f&&d.isPropagationStopped())break e;f=S,d.currentTarget=q;try{f(d)}catch(F){$o(F)}d.currentTarget=null,f=C}}}}function Le(t,n){var s=n[Pc];s===void 0&&(s=n[Pc]=new Set);var i=t+"__bubble";s.has(i)||(ly(n,t,2,!1),s.add(i))}function Mf(t,n,s){var i=0;n&&(i|=4),ly(s,t,i,n)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function Df(t){if(!t[Nu]){t[Nu]=!0,Wh.forEach(function(s){s!=="selectionchange"&&(Aw.has(s)||Mf(s,!1,t),Mf(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Nu]||(n[Nu]=!0,Mf("selectionchange",!1,n))}}function ly(t,n,s,i){switch(Dy(n)){case 2:var d=aN;break;case 8:d=rN;break;default:d=Yf}s=d.bind(null,n,s,t),d=void 0,!ed||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),i?d!==void 0?t.addEventListener(n,s,{capture:!0,passive:d}):t.addEventListener(n,s,!0):d!==void 0?t.addEventListener(n,s,{passive:d}):t.addEventListener(n,s,!1)}function Uf(t,n,s,i,d){var f=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var y=i.tag;if(y===3||y===4){var S=i.stateNode.containerInfo;if(S===d)break;if(y===4)for(y=i.return;y!==null;){var C=y.tag;if((C===3||C===4)&&y.stateNode.containerInfo===d)return;y=y.return}for(;S!==null;){if(y=qs(S),y===null)return;if(C=y.tag,C===5||C===6||C===26||C===27){i=f=y;continue e}S=S.parentNode}}i=i.return}dp(function(){var q=f,F=Jc(s),J=[];e:{var Z=qp.get(t);if(Z!==void 0){var G=Do,oe=t;switch(t){case"keypress":if(Oo(s)===0)break e;case"keydown":case"keyup":G=jj;break;case"focusin":oe="focus",G=rd;break;case"focusout":oe="blur",G=rd;break;case"beforeblur":case"afterblur":G=rd;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":G=hp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=cj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Ej;break;case Dp:case Up:case Lp:G=mj;break;case $p:G=Cj;break;case"scroll":case"scrollend":G=oj;break;case"wheel":G=Aj;break;case"copy":case"cut":case"paste":G=pj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=gp;break;case"toggle":case"beforetoggle":G=Tj}var Ee=(n&4)!==0,at=!Ee&&(t==="scroll"||t==="scrollend"),U=Ee?Z!==null?Z+"Capture":null:Z;Ee=[];for(var R=q,$;R!==null;){var X=R;if($=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||$===null||U===null||(X=ai(R,U),X!=null&&Ee.push(Ui(R,X,$))),at)break;R=R.return}0<Ee.length&&(Z=new G(Z,oe,null,s,F),J.push({event:Z,listeners:Ee}))}}if((n&7)===0){e:{if(Z=t==="mouseover"||t==="pointerover",G=t==="mouseout"||t==="pointerout",Z&&s!==Xc&&(oe=s.relatedTarget||s.fromElement)&&(qs(oe)||oe[$s]))break e;if((G||Z)&&(Z=F.window===F?F:(Z=F.ownerDocument)?Z.defaultView||Z.parentWindow:window,G?(oe=s.relatedTarget||s.toElement,G=q,oe=oe?qs(oe):null,oe!==null&&(at=c(oe),Ee=oe.tag,oe!==at||Ee!==5&&Ee!==27&&Ee!==6)&&(oe=null)):(G=null,oe=q),G!==oe)){if(Ee=hp,X="onMouseLeave",U="onMouseEnter",R="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=gp,X="onPointerLeave",U="onPointerEnter",R="pointer"),at=G==null?Z:ni(G),$=oe==null?Z:ni(oe),Z=new Ee(X,R+"leave",G,s,F),Z.target=at,Z.relatedTarget=$,X=null,qs(F)===q&&(Ee=new Ee(U,R+"enter",oe,s,F),Ee.target=$,Ee.relatedTarget=at,X=Ee),at=X,G&&oe)t:{for(Ee=zw,U=G,R=oe,$=0,X=U;X;X=Ee(X))$++;X=0;for(var be=R;be;be=Ee(be))X++;for(;0<$-X;)U=Ee(U),$--;for(;0<X-$;)R=Ee(R),X--;for(;$--;){if(U===R||R!==null&&U===R.alternate){Ee=U;break t}U=Ee(U),R=Ee(R)}Ee=null}else Ee=null;G!==null&&iy(J,Z,G,Ee,!1),oe!==null&&at!==null&&iy(J,at,oe,Ee,!0)}}e:{if(Z=q?ni(q):window,G=Z.nodeName&&Z.nodeName.toLowerCase(),G==="select"||G==="input"&&Z.type==="file")var Ge=Np;else if(jp(Z))if(Ep)Ge=Zj;else{Ge=qj;var me=$j}else G=Z.nodeName,!G||G.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?q&&Yc(q.elementType)&&(Ge=Np):Ge=Bj;if(Ge&&(Ge=Ge(t,q))){wp(J,Ge,s,F);break e}me&&me(t,Z,q),t==="focusout"&&q&&Z.type==="number"&&q.memoizedProps.value!=null&&Fc(Z,"number",Z.value)}switch(me=q?ni(q):window,t){case"focusin":(jp(me)||me.contentEditable==="true")&&(Ks=me,cd=q,di=null);break;case"focusout":di=cd=Ks=null;break;case"mousedown":dd=!0;break;case"contextmenu":case"mouseup":case"dragend":dd=!1,Op(J,s,F);break;case"selectionchange":if(Ij)break;case"keydown":case"keyup":Op(J,s,F)}var Re;if(ld)e:{switch(t){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Vs?xp(t,s)&&(Be="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(vp&&s.locale!=="ko"&&(Vs||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Vs&&(Re=fp()):(Xa=F,td="value"in Xa?Xa.value:Xa.textContent,Vs=!0)),me=Eu(q,Be),0<me.length&&(Be=new pp(Be,t,null,s,F),J.push({event:Be,listeners:me}),Re?Be.data=Re:(Re=Sp(s),Re!==null&&(Be.data=Re)))),(Re=Oj?Mj(t,s):Dj(t,s))&&(Be=Eu(q,"onBeforeInput"),0<Be.length&&(me=new pp("onBeforeInput","beforeinput",null,s,F),J.push({event:me,listeners:Be}),me.data=Re)),_w(J,t,q,s,F)}sy(J,n)})}function Ui(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Eu(t,n){for(var s=n+"Capture",i=[];t!==null;){var d=t,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=ai(t,s),d!=null&&i.unshift(Ui(t,d,f)),d=ai(t,n),d!=null&&i.push(Ui(t,d,f))),t.tag===3)return i;t=t.return}return[]}function zw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function iy(t,n,s,i,d){for(var f=n._reactName,y=[];s!==null&&s!==i;){var S=s,C=S.alternate,q=S.stateNode;if(S=S.tag,C!==null&&C===i)break;S!==5&&S!==26&&S!==27||q===null||(C=q,d?(q=ai(s,f),q!=null&&y.unshift(Ui(s,q,C))):d||(q=ai(s,f),q!=null&&y.push(Ui(s,q,C)))),s=s.return}y.length!==0&&t.push({event:n,listeners:y})}var Tw=/\r\n?/g,Rw=/\u0000|\uFFFD/g;function oy(t){return(typeof t=="string"?t:""+t).replace(Tw,`
|
|
49
|
-
`).replace(Rw,"")}function uy(t,n){return n=oy(n),oy(t)===n}function nt(t,n,s,i,d,f){switch(s){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||Qs(t,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&Qs(t,""+i);break;case"className":Ao(t,"class",i);break;case"tabIndex":Ao(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ao(t,s,i);break;case"style":up(t,i,f);break;case"data":if(n!=="object"){Ao(t,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(s);break}i=To(""+i),t.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){t.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 f=="function"&&(s==="formAction"?(n!=="input"&&nt(t,n,"name",d.name,d,null),nt(t,n,"formEncType",d.formEncType,d,null),nt(t,n,"formMethod",d.formMethod,d,null),nt(t,n,"formTarget",d.formTarget,d,null)):(nt(t,n,"encType",d.encType,d,null),nt(t,n,"method",d.method,d,null),nt(t,n,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(s);break}i=To(""+i),t.setAttribute(s,i);break;case"onClick":i!=null&&(t.onclick=ha);break;case"onScroll":i!=null&&Le("scroll",t);break;case"onScrollEnd":i!=null&&Le("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(l(61));if(s=i.__html,s!=null){if(d.children!=null)throw Error(l(60));t.innerHTML=s}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}s=To(""+i),t.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":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(s,""+i):t.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":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":i===!0?t.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(s,i):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(s,i):t.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(s):t.setAttribute(s,i);break;case"popover":Le("beforetoggle",t),Le("toggle",t),ko(t,"popover",i);break;case"xlinkActuate":ma(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ma(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ma(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ma(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ma(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ma(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ma(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ma(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ma(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ko(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=lj.get(s)||s,ko(t,s,i))}}function Lf(t,n,s,i,d,f){switch(s){case"style":up(t,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(l(61));if(s=i.__html,s!=null){if(d.children!=null)throw Error(l(60));t.innerHTML=s}}break;case"children":typeof i=="string"?Qs(t,i):(typeof i=="number"||typeof i=="bigint")&&Qs(t,""+i);break;case"onScroll":i!=null&&Le("scroll",t);break;case"onScrollEnd":i!=null&&Le("scrollend",t);break;case"onClick":i!=null&&(t.onclick=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ep.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),n=s.slice(2,d?s.length-7:void 0),f=t[en]||null,f=f!=null?f[s]:null,typeof f=="function"&&t.removeEventListener(n,f,d),typeof i=="function")){typeof f!="function"&&f!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,i,d);break e}s in t?t[s]=i:i===!0?t.setAttribute(s,""):ko(t,s,i)}}}function Bt(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",t),Le("load",t);var i=!1,d=!1,f;for(f in s)if(s.hasOwnProperty(f)){var y=s[f];if(y!=null)switch(f){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:nt(t,n,f,y,s,null)}}d&&nt(t,n,"srcSet",s.srcSet,s,null),i&&nt(t,n,"src",s.src,s,null);return;case"input":Le("invalid",t);var S=f=y=d=null,C=null,q=null;for(i in s)if(s.hasOwnProperty(i)){var F=s[i];if(F!=null)switch(i){case"name":d=F;break;case"type":y=F;break;case"checked":C=F;break;case"defaultChecked":q=F;break;case"value":f=F;break;case"defaultValue":S=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(137,n));break;default:nt(t,n,i,F,s,null)}}sp(t,f,S,C,q,y,d,!1);return;case"select":Le("invalid",t),i=y=f=null;for(d in s)if(s.hasOwnProperty(d)&&(S=s[d],S!=null))switch(d){case"value":f=S;break;case"defaultValue":y=S;break;case"multiple":i=S;default:nt(t,n,d,S,s,null)}n=f,s=y,t.multiple=!!i,n!=null?Is(t,!!i,n,!1):s!=null&&Is(t,!!i,s,!0);return;case"textarea":Le("invalid",t),f=d=i=null;for(y in s)if(s.hasOwnProperty(y)&&(S=s[y],S!=null))switch(y){case"value":i=S;break;case"defaultValue":d=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(l(91));break;default:nt(t,n,y,S,s,null)}ip(t,i,d,f);return;case"option":for(C in s)if(s.hasOwnProperty(C)&&(i=s[C],i!=null))switch(C){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:nt(t,n,C,i,s,null)}return;case"dialog":Le("beforetoggle",t),Le("toggle",t),Le("cancel",t),Le("close",t);break;case"iframe":case"object":Le("load",t);break;case"video":case"audio":for(i=0;i<Di.length;i++)Le(Di[i],t);break;case"image":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"embed":case"source":case"link":Le("error",t),Le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in s)if(s.hasOwnProperty(q)&&(i=s[q],i!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:nt(t,n,q,i,s,null)}return;default:if(Yc(n)){for(F in s)s.hasOwnProperty(F)&&(i=s[F],i!==void 0&&Lf(t,n,F,i,s,void 0));return}}for(S in s)s.hasOwnProperty(S)&&(i=s[S],i!=null&&nt(t,n,S,i,s,null))}function Ow(t,n,s,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,f=null,y=null,S=null,C=null,q=null,F=null;for(G in s){var J=s[G];if(s.hasOwnProperty(G)&&J!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":C=J;default:i.hasOwnProperty(G)||nt(t,n,G,null,i,J)}}for(var Z in i){var G=i[Z];if(J=s[Z],i.hasOwnProperty(Z)&&(G!=null||J!=null))switch(Z){case"type":f=G;break;case"name":d=G;break;case"checked":q=G;break;case"defaultChecked":F=G;break;case"value":y=G;break;case"defaultValue":S=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,n));break;default:G!==J&&nt(t,n,Z,G,i,J)}}Kc(t,y,S,C,q,F,f,d);return;case"select":G=y=S=Z=null;for(f in s)if(C=s[f],s.hasOwnProperty(f)&&C!=null)switch(f){case"value":break;case"multiple":G=C;default:i.hasOwnProperty(f)||nt(t,n,f,null,i,C)}for(d in i)if(f=i[d],C=s[d],i.hasOwnProperty(d)&&(f!=null||C!=null))switch(d){case"value":Z=f;break;case"defaultValue":S=f;break;case"multiple":y=f;default:f!==C&&nt(t,n,d,f,i,C)}n=S,s=y,i=G,Z!=null?Is(t,!!s,Z,!1):!!i!=!!s&&(n!=null?Is(t,!!s,n,!0):Is(t,!!s,s?[]:"",!1));return;case"textarea":G=Z=null;for(S in s)if(d=s[S],s.hasOwnProperty(S)&&d!=null&&!i.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:nt(t,n,S,null,i,d)}for(y in i)if(d=i[y],f=s[y],i.hasOwnProperty(y)&&(d!=null||f!=null))switch(y){case"value":Z=d;break;case"defaultValue":G=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(l(91));break;default:d!==f&&nt(t,n,y,d,i,f)}lp(t,Z,G);return;case"option":for(var oe in s)if(Z=s[oe],s.hasOwnProperty(oe)&&Z!=null&&!i.hasOwnProperty(oe))switch(oe){case"selected":t.selected=!1;break;default:nt(t,n,oe,null,i,Z)}for(C in i)if(Z=i[C],G=s[C],i.hasOwnProperty(C)&&Z!==G&&(Z!=null||G!=null))switch(C){case"selected":t.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:nt(t,n,C,Z,i,G)}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 Ee in s)Z=s[Ee],s.hasOwnProperty(Ee)&&Z!=null&&!i.hasOwnProperty(Ee)&&nt(t,n,Ee,null,i,Z);for(q in i)if(Z=i[q],G=s[q],i.hasOwnProperty(q)&&Z!==G&&(Z!=null||G!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(l(137,n));break;default:nt(t,n,q,Z,i,G)}return;default:if(Yc(n)){for(var at in s)Z=s[at],s.hasOwnProperty(at)&&Z!==void 0&&!i.hasOwnProperty(at)&&Lf(t,n,at,void 0,i,Z);for(F in i)Z=i[F],G=s[F],!i.hasOwnProperty(F)||Z===G||Z===void 0&&G===void 0||Lf(t,n,F,Z,i,G);return}}for(var U in s)Z=s[U],s.hasOwnProperty(U)&&Z!=null&&!i.hasOwnProperty(U)&&nt(t,n,U,null,i,Z);for(J in i)Z=i[J],G=s[J],!i.hasOwnProperty(J)||Z===G||Z==null&&G==null||nt(t,n,J,Z,i,G)}function cy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var d=s[i],f=d.transferSize,y=d.initiatorType,S=d.duration;if(f&&S&&cy(y)){for(y=0,S=d.responseEnd,i+=1;i<s.length;i++){var C=s[i],q=C.startTime;if(q>S)break;var F=C.transferSize,J=C.initiatorType;F&&cy(J)&&(C=C.responseEnd,y+=F*(C<S?1:(S-q)/(C-q)))}if(--i,n+=8*(f+y)/(d.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var $f=null,qf=null;function _u(t){return t.nodeType===9?t:t.ownerDocument}function dy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fy(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Bf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Zf=null;function Dw(){var t=window.event;return t&&t.type==="popstate"?t===Zf?!1:(Zf=t,!0):(Zf=null,!1)}var my=typeof setTimeout=="function"?setTimeout:void 0,Uw=typeof clearTimeout=="function"?clearTimeout:void 0,hy=typeof Promise=="function"?Promise:void 0,Lw=typeof queueMicrotask=="function"?queueMicrotask:typeof hy<"u"?function(t){return hy.resolve(null).then(t).catch($w)}:my;function $w(t){setTimeout(function(){throw t})}function hr(t){return t==="head"}function py(t,n){var s=n,i=0;do{var d=s.nextSibling;if(t.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(i===0){t.removeChild(d),Sl(n);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")Li(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Li(s);for(var f=s.firstChild;f;){var y=f.nextSibling,S=f.nodeName;f[ti]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=y}}else s==="body"&&Li(t.ownerDocument.body);s=d}while(s);Sl(n)}function gy(t,n){var s=t;t=0;do{var i=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=i}while(s)}function Hf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Hf(s),Gc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function qw(t,n,s,i){for(;t.nodeType===1;){var d=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[ti])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(f=t.getAttribute("rel"),f==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(f!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(f=t.getAttribute("src"),(f!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&f&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var f=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===f)return t}else return t;if(t=Rn(t.nextSibling),t===null)break}return null}function Bw(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Rn(t.nextSibling),t===null))return null;return t}function vy(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Rn(t.nextSibling),t===null))return null;return t}function If(t){return t.data==="$?"||t.data==="$~"}function Qf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Zw(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var i=function(){n(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Rn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Pf=null;function yy(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return Rn(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function by(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function xy(t,n,s){switch(n=_u(s),t){case"html":if(t=n.documentElement,!t)throw Error(l(452));return t;case"head":if(t=n.head,!t)throw Error(l(453));return t;case"body":if(t=n.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Li(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Gc(t)}var On=new Map,Sy=new Set;function Cu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var za=te.d;te.d={f:Hw,r:Iw,D:Qw,C:Pw,L:Gw,m:Vw,X:Fw,S:Kw,M:Yw};function Hw(){var t=za.f(),n=yu();return t||n}function Iw(t){var n=Bs(t);n!==null&&n.tag===5&&n.type==="form"?$g(n):za.r(t)}var yl=typeof document>"u"?null:document;function jy(t,n,s){var i=yl;if(i&&typeof n=="string"&&n){var d=En(n);d='link[rel="'+t+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),Sy.has(d)||(Sy.add(d),t={rel:t,crossOrigin:s,href:n},i.querySelector(d)===null&&(n=i.createElement("link"),Bt(n,"link",t),Rt(n),i.head.appendChild(n)))}}function Qw(t){za.D(t),jy("dns-prefetch",t,null)}function Pw(t,n){za.C(t,n),jy("preconnect",t,n)}function Gw(t,n,s){za.L(t,n,s);var i=yl;if(i&&t&&n){var d='link[rel="preload"][as="'+En(n)+'"]';n==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+En(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+En(s.imageSizes)+'"]')):d+='[href="'+En(t)+'"]';var f=d;switch(n){case"style":f=bl(t);break;case"script":f=xl(t)}On.has(f)||(t=x({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),On.set(f,t),i.querySelector(d)!==null||n==="style"&&i.querySelector($i(f))||n==="script"&&i.querySelector(qi(f))||(n=i.createElement("link"),Bt(n,"link",t),Rt(n),i.head.appendChild(n)))}}function Vw(t,n){za.m(t,n);var s=yl;if(s&&t){var i=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+En(i)+'"][href="'+En(t)+'"]',f=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=xl(t)}if(!On.has(f)&&(t=x({rel:"modulepreload",href:t},n),On.set(f,t),s.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(qi(f)))return}i=s.createElement("link"),Bt(i,"link",t),Rt(i),s.head.appendChild(i)}}}function Kw(t,n,s){za.S(t,n,s);var i=yl;if(i&&t){var d=Zs(i).hoistableStyles,f=bl(t);n=n||"default";var y=d.get(f);if(!y){var S={loading:0,preload:null};if(y=i.querySelector($i(f)))S.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},s),(s=On.get(f))&&Gf(t,s);var C=y=i.createElement("link");Rt(C),Bt(C,"link",t),C._p=new Promise(function(q,F){C.onload=q,C.onerror=F}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ku(y,n,i)}y={type:"stylesheet",instance:y,count:1,state:S},d.set(f,y)}}}function Fw(t,n){za.X(t,n);var s=yl;if(s&&t){var i=Zs(s).hoistableScripts,d=xl(t),f=i.get(d);f||(f=s.querySelector(qi(d)),f||(t=x({src:t,async:!0},n),(n=On.get(d))&&Vf(t,n),f=s.createElement("script"),Rt(f),Bt(f,"link",t),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(d,f))}}function Yw(t,n){za.M(t,n);var s=yl;if(s&&t){var i=Zs(s).hoistableScripts,d=xl(t),f=i.get(d);f||(f=s.querySelector(qi(d)),f||(t=x({src:t,async:!0,type:"module"},n),(n=On.get(d))&&Vf(t,n),f=s.createElement("script"),Rt(f),Bt(f,"link",t),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(d,f))}}function wy(t,n,s,i){var d=(d=ne.current)?Cu(d):null;if(!d)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=bl(s.href),s=Zs(d).hoistableStyles,i=s.get(n),i||(i={type:"style",instance:null,count:0,state:null},s.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=bl(s.href);var f=Zs(d).hoistableStyles,y=f.get(t);if(y||(d=d.ownerDocument||d,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,y),(f=d.querySelector($i(t)))&&!f._p&&(y.instance=f,y.state.loading=5),On.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},On.set(t,s),f||Xw(d,t,s,y.state))),n&&i===null)throw Error(l(528,""));return y}if(n&&i!==null)throw Error(l(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=xl(s),s=Zs(d).hoistableScripts,i=s.get(n),i||(i={type:"script",instance:null,count:0,state:null},s.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function bl(t){return'href="'+En(t)+'"'}function $i(t){return'link[rel="stylesheet"]['+t+"]"}function Ny(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Xw(t,n,s,i){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=t.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),Bt(n,"link",s),Rt(n),t.head.appendChild(n))}function xl(t){return'[src="'+En(t)+'"]'}function qi(t){return"script[async]"+t}function Ey(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var i=t.querySelector('style[data-href~="'+En(s.href)+'"]');if(i)return n.instance=i,Rt(i),i;var d=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),Rt(i),Bt(i,"style",d),ku(i,s.precedence,t),n.instance=i;case"stylesheet":d=bl(s.href);var f=t.querySelector($i(d));if(f)return n.state.loading|=4,n.instance=f,Rt(f),f;i=Ny(s),(d=On.get(d))&&Gf(i,d),f=(t.ownerDocument||t).createElement("link"),Rt(f);var y=f;return y._p=new Promise(function(S,C){y.onload=S,y.onerror=C}),Bt(f,"link",i),n.state.loading|=4,ku(f,s.precedence,t),n.instance=f;case"script":return f=xl(s.src),(d=t.querySelector(qi(f)))?(n.instance=d,Rt(d),d):(i=s,(d=On.get(f))&&(i=x({},s),Vf(i,d)),t=t.ownerDocument||t,d=t.createElement("script"),Rt(d),Bt(d,"link",i),t.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,ku(i,s.precedence,t));return n.instance}function ku(t,n,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,f=d,y=0;y<i.length;y++){var S=i[y];if(S.dataset.precedence===n)f=S;else if(f!==d)break}f?f.parentNode.insertBefore(t,f.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function Gf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Vf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Au=null;function _y(t,n,s){if(Au===null){var i=new Map,d=Au=new Map;d.set(s,i)}else d=Au,i=d.get(s),i||(i=new Map,d.set(s,i));if(i.has(t))return i;for(i.set(t,null),s=s.getElementsByTagName(t),d=0;d<s.length;d++){var f=s[d];if(!(f[ti]||f[Ut]||t==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(n)||"";y=t+y;var S=i.get(y);S?S.push(f):i.set(y,[f])}}return i}function Cy(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function Jw(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function ky(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ww(t,n,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=bl(i.href),f=n.querySelector($i(d));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=zu.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=f,Rt(f);return}f=n.ownerDocument||n,i=Ny(i),(d=On.get(d))&&Gf(i,d),f=f.createElement("link"),Rt(f);var y=f;y._p=new Promise(function(S,C){y.onload=S,y.onerror=C}),Bt(f,"link",i),s.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=zu.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var Kf=0;function eN(t,n){return t.stylesheets&&t.count===0&&Ru(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var i=setTimeout(function(){if(t.stylesheets&&Ru(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4+n);0<t.imgBytes&&Kf===0&&(Kf=62500*Mw());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ru(t,t.stylesheets),t.unsuspend)){var f=t.unsuspend;t.unsuspend=null,f()}},(t.imgBytes>Kf?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function zu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ru(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Tu=null;function Ru(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Tu=new Map,n.forEach(tN,t),Tu=null,zu.call(t))}function tN(t,n){if(!(n.state.loading&4)){var s=Tu.get(t);if(s)var i=s.get(null);else{s=new Map,Tu.set(t,s);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var y=d[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),i=y)}i&&s.set(null,i)}d=n.instance,y=d.getAttribute("data-precedence"),f=s.get(y)||i,f===i&&s.set(null,d),s.set(y,d),this.count++,i=zu.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),f?f.parentNode.insertBefore(d,f.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),n.state.loading|=4}}var Bi={$$typeof:D,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function nN(t,n,s,i,d,f,y,S,C){this.tag=1,this.containerInfo=t,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=$e(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.hiddenUpdates=$e(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Ay(t,n,s,i,d,f,y,S,C,q,F,J){return t=new nN(t,n,s,y,C,q,F,J,S),n=1,f===!0&&(n|=24),f=mn(3,null,null,n),t.current=f,f.stateNode=t,n=_d(),n.refCount++,t.pooledCache=n,n.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:n},zd(f),t}function zy(t){return t?(t=Xs,t):Xs}function Ty(t,n,s,i,d,f){d=zy(d),i.context===null?i.context=d:i.pendingContext=d,i=ar(n),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=rr(t,i,n),s!==null&&(ln(s,t,n),yi(s,t,n))}function Ry(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Ff(t,n){Ry(t,n),(t=t.alternate)&&Ry(t,n)}function Oy(t){if(t.tag===13||t.tag===31){var n=es(t,67108864);n!==null&&ln(n,t,67108864),Ff(t,67108864)}}function My(t){if(t.tag===13||t.tag===31){var n=yn();n=Ic(n);var s=es(t,n);s!==null&&ln(s,t,n),Ff(t,n)}}var Ou=!0;function aN(t,n,s,i){var d=Q.T;Q.T=null;var f=te.p;try{te.p=2,Yf(t,n,s,i)}finally{te.p=f,Q.T=d}}function rN(t,n,s,i){var d=Q.T;Q.T=null;var f=te.p;try{te.p=8,Yf(t,n,s,i)}finally{te.p=f,Q.T=d}}function Yf(t,n,s,i){if(Ou){var d=Xf(i);if(d===null)Uf(t,n,i,Mu,s),Uy(t,i);else if(lN(d,t,n,s,i))i.stopPropagation();else if(Uy(t,i),n&4&&-1<sN.indexOf(t)){for(;d!==null;){var f=Bs(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=ea(f.pendingLanes);if(y!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;y;){var C=1<<31-Vt(y);S.entanglements[1]|=C,y&=~C}ra(f),(Ke&6)===0&&(gu=Pt()+500,Mi(0))}}break;case 31:case 13:S=es(f,2),S!==null&&ln(S,f,2),yu(),Ff(f,2)}if(f=Xf(i),f===null&&Uf(t,n,i,Mu,s),f===d)break;d=f}d!==null&&i.stopPropagation()}else Uf(t,n,i,null,s)}}function Xf(t){return t=Jc(t),Jf(t)}var Mu=null;function Jf(t){if(Mu=null,t=qs(t),t!==null){var n=c(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=m(n),t!==null)return t;t=null}else if(s===31){if(t=h(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Mu=t,null}function Dy(t){switch(t){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($c()){case Qr:return 2;case jo:return 8;case Ls:case wo:return 32;case ei:return 268435456;default:return 32}default:return 32}}var Wf=!1,pr=null,gr=null,vr=null,Zi=new Map,Hi=new Map,yr=[],sN="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 Uy(t,n){switch(t){case"focusin":case"focusout":pr=null;break;case"dragenter":case"dragleave":gr=null;break;case"mouseover":case"mouseout":vr=null;break;case"pointerover":case"pointerout":Zi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hi.delete(n.pointerId)}}function Ii(t,n,s,i,d,f){return t===null||t.nativeEvent!==f?(t={blockedOn:n,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[d]},n!==null&&(n=Bs(n),n!==null&&Oy(n)),t):(t.eventSystemFlags|=i,n=t.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),t)}function lN(t,n,s,i,d){switch(n){case"focusin":return pr=Ii(pr,t,n,s,i,d),!0;case"dragenter":return gr=Ii(gr,t,n,s,i,d),!0;case"mouseover":return vr=Ii(vr,t,n,s,i,d),!0;case"pointerover":var f=d.pointerId;return Zi.set(f,Ii(Zi.get(f)||null,t,n,s,i,d)),!0;case"gotpointercapture":return f=d.pointerId,Hi.set(f,Ii(Hi.get(f)||null,t,n,s,i,d)),!0}return!1}function Ly(t){var n=qs(t.target);if(n!==null){var s=c(n);if(s!==null){if(n=s.tag,n===13){if(n=m(s),n!==null){t.blockedOn=n,Xh(t.priority,function(){My(s)});return}}else if(n===31){if(n=h(s),n!==null){t.blockedOn=n,Xh(t.priority,function(){My(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Du(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=Xf(t.nativeEvent);if(s===null){s=t.nativeEvent;var i=new s.constructor(s.type,s);Xc=i,s.target.dispatchEvent(i),Xc=null}else return n=Bs(s),n!==null&&Oy(n),t.blockedOn=s,!1;n.shift()}return!0}function $y(t,n,s){Du(t)&&s.delete(n)}function iN(){Wf=!1,pr!==null&&Du(pr)&&(pr=null),gr!==null&&Du(gr)&&(gr=null),vr!==null&&Du(vr)&&(vr=null),Zi.forEach($y),Hi.forEach($y)}function Uu(t,n){t.blockedOn===n&&(t.blockedOn=null,Wf||(Wf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iN)))}var Lu=null;function qy(t){Lu!==t&&(Lu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lu===t&&(Lu=null);for(var n=0;n<t.length;n+=3){var s=t[n],i=t[n+1],d=t[n+2];if(typeof i!="function"){if(Jf(i||s)===null)continue;break}var f=Bs(s);f!==null&&(t.splice(n,3),n-=3,Yd(f,{pending:!0,data:d,method:s.method,action:i},i,d))}}))}function Sl(t){function n(C){return Uu(C,t)}pr!==null&&Uu(pr,t),gr!==null&&Uu(gr,t),vr!==null&&Uu(vr,t),Zi.forEach(n),Hi.forEach(n);for(var s=0;s<yr.length;s++){var i=yr[s];i.blockedOn===t&&(i.blockedOn=null)}for(;0<yr.length&&(s=yr[0],s.blockedOn===null);)Ly(s),s.blockedOn===null&&yr.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var d=s[i],f=s[i+1],y=d[en]||null;if(typeof f=="function")y||qy(s);else if(y){var S=null;if(f&&f.hasAttribute("formAction")){if(d=f,y=f[en]||null)S=y.formAction;else if(Jf(d)!==null)continue}else S=y.action;typeof S=="function"?s[i+1]=S:(s.splice(i,3),i-=3),qy(s)}}}function By(){function t(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return d=y})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function em(t){this._internalRoot=t}$u.prototype.render=em.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(l(409));var s=n.current,i=yn();Ty(s,i,t,n,null,null)},$u.prototype.unmount=em.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Ty(t.current,2,null,t,null,null),yu(),n[$s]=null}};function $u(t){this._internalRoot=t}$u.prototype.unstable_scheduleHydration=function(t){if(t){var n=Yh();t={blockedOn:null,target:t,priority:n};for(var s=0;s<yr.length&&n!==0&&n<yr[s].priority;s++);yr.splice(s,0,t),s===0&&Ly(t)}};var Zy=a.version;if(Zy!=="19.2.4")throw Error(l(527,Zy,"19.2.4"));te.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var oN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qu.isDisabled&&qu.supportsFiber)try{Pr=qu.inject(oN),Gt=qu}catch{}}return Pi.createRoot=function(t,n){if(!o(t))throw Error(l(299));var s=!1,i="",d=Kg,f=Fg,y=Yg;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=Ay(t,1,!1,null,null,s,i,null,d,f,y,By),t[$s]=n.current,Df(t),new em(n)},Pi.hydrateRoot=function(t,n,s){if(!o(t))throw Error(l(299));var i=!1,d="",f=Kg,y=Fg,S=Yg,C=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),n=Ay(t,1,!0,n,s??null,i,d,C,f,y,S,By),n.context=zy(null),s=n.current,i=yn(),i=Ic(i),d=ar(i),d.callback=null,rr(s,d,i),s=i,n.current.lanes=s,Kt(n,s),ra(n),t[$s]=n.current,Df(t),new $u(n)},Pi.version="19.2.4",Pi}var Jy;function bN(){if(Jy)return rm.exports;Jy=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(a){console.error(a)}}return e(),rm.exports=yN(),rm.exports}var xN=bN(),Kl=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(){}},gs,Er,Rl,Nx,SN=(Nx=class extends Kl{constructor(){super();ye(this,gs);ye(this,Er);ye(this,Rl);ie(this,Rl,a=>{if(typeof window<"u"&&window.addEventListener){const r=()=>a();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){k(this,Er)||this.setEventListener(k(this,Rl))}onUnsubscribe(){var a;this.hasListeners()||((a=k(this,Er))==null||a.call(this),ie(this,Er,void 0))}setEventListener(a){var r;ie(this,Rl,a),(r=k(this,Er))==null||r.call(this),ie(this,Er,a(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()}))}setFocused(a){k(this,gs)!==a&&(ie(this,gs,a),this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(r=>{r(a)})}isFocused(){var a;return typeof k(this,gs)=="boolean"?k(this,gs):((a=globalThis.document)==null?void 0:a.visibilityState)!=="hidden"}},gs=new WeakMap,Er=new WeakMap,Rl=new WeakMap,Nx),mh=new SN,jN={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},_r,ch,Ex,wN=(Ex=class{constructor(){ye(this,_r,jN);ye(this,ch,!1)}setTimeoutProvider(e){ie(this,_r,e)}setTimeout(e,a){return k(this,_r).setTimeout(e,a)}clearTimeout(e){k(this,_r).clearTimeout(e)}setInterval(e,a){return k(this,_r).setInterval(e,a)}clearInterval(e){k(this,_r).clearInterval(e)}},_r=new WeakMap,ch=new WeakMap,Ex),ps=new wN;function NN(e){setTimeout(e,0)}var EN=typeof window>"u"||"Deno"in globalThis;function Jt(){}function _N(e,a){return typeof e=="function"?e(a):e}function Om(e){return typeof e=="number"&&e>=0&&e!==1/0}function Lx(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Mr(e,a){return typeof e=="function"?e(a):e}function Dn(e,a){return typeof e=="function"?e(a):e}function Wy(e,a){const{type:r="all",exact:l,fetchStatus:o,predicate:c,queryKey:m,stale:h}=e;if(m){if(l){if(a.queryHash!==hh(m,a.options))return!1}else if(!eo(a.queryKey,m))return!1}if(r!=="all"){const g=a.isActive();if(r==="active"&&!g||r==="inactive"&&g)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||o&&o!==a.state.fetchStatus||c&&!c(a))}function eb(e,a){const{exact:r,status:l,predicate:o,mutationKey:c}=e;if(c){if(!a.options.mutationKey)return!1;if(r){if(Es(a.options.mutationKey)!==Es(c))return!1}else if(!eo(a.options.mutationKey,c))return!1}return!(l&&a.state.status!==l||o&&!o(a))}function hh(e,a){return((a==null?void 0:a.queryKeyHashFn)||Es)(e)}function Es(e){return JSON.stringify(e,(a,r)=>Mm(r)?Object.keys(r).sort().reduce((l,o)=>(l[o]=r[o],l),{}):r)}function eo(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(r=>eo(e[r],a[r])):!1}var CN=Object.prototype.hasOwnProperty;function $x(e,a,r=0){if(e===a)return e;if(r>500)return a;const l=tb(e)&&tb(a);if(!l&&!(Mm(e)&&Mm(a)))return a;const c=(l?e:Object.keys(e)).length,m=l?a:Object.keys(a),h=m.length,g=l?new Array(h):{};let p=0;for(let b=0;b<h;b++){const x=l?b:m[b],j=e[x],N=a[x];if(j===N){g[x]=j,(l?b<c:CN.call(e,x))&&p++;continue}if(j===null||N===null||typeof j!="object"||typeof N!="object"){g[x]=N;continue}const z=$x(j,N,r+1);g[x]=z,z===j&&p++}return c===h&&p===c?e:g}function ic(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const r in e)if(e[r]!==a[r])return!1;return!0}function tb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Mm(e){if(!nb(e))return!1;const a=e.constructor;if(a===void 0)return!0;const r=a.prototype;return!(!nb(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nb(e){return Object.prototype.toString.call(e)==="[object Object]"}function kN(e){return new Promise(a=>{ps.setTimeout(a,e)})}function Dm(e,a,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,a):r.structuralSharing!==!1?$x(e,a):a}function AN(e,a,r=0){const l=[...e,a];return r&&l.length>r?l.slice(1):l}function zN(e,a,r=0){const l=[a,...e];return r&&l.length>r?l.slice(0,-1):l}var ph=Symbol();function qx(e,a){return!e.queryFn&&(a!=null&&a.initialPromise)?()=>a.initialPromise:!e.queryFn||e.queryFn===ph?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gh(e,a){return typeof e=="function"?e(...a):!!e}function TN(e,a,r){let l=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=a()),l||(l=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var to=(()=>{let e=()=>EN;return{isServer(){return e()},setIsServer(a){e=a}}})();function Um(){let e,a;const r=new Promise((o,c)=>{e=o,a=c});r.status="pending",r.catch(()=>{});function l(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{l({status:"fulfilled",value:o}),e(o)},r.reject=o=>{l({status:"rejected",reason:o}),a(o)},r}var RN=NN;function ON(){let e=[],a=0,r=h=>{h()},l=h=>{h()},o=RN;const c=h=>{a?e.push(h):o(()=>{r(h)})},m=()=>{const h=e;e=[],h.length&&o(()=>{l(()=>{h.forEach(g=>{r(g)})})})};return{batch:h=>{let g;a++;try{g=h()}finally{a--,a||m()}return g},batchCalls:h=>(...g)=>{c(()=>{h(...g)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{l=h},setScheduler:h=>{o=h}}}var Tt=ON(),Ol,Cr,Ml,_x,MN=(_x=class extends Kl{constructor(){super();ye(this,Ol,!0);ye(this,Cr);ye(this,Ml);ie(this,Ml,a=>{if(typeof window<"u"&&window.addEventListener){const r=()=>a(!0),l=()=>a(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",l)}}})}onSubscribe(){k(this,Cr)||this.setEventListener(k(this,Ml))}onUnsubscribe(){var a;this.hasListeners()||((a=k(this,Cr))==null||a.call(this),ie(this,Cr,void 0))}setEventListener(a){var r;ie(this,Ml,a),(r=k(this,Cr))==null||r.call(this),ie(this,Cr,a(this.setOnline.bind(this)))}setOnline(a){k(this,Ol)!==a&&(ie(this,Ol,a),this.listeners.forEach(l=>{l(a)}))}isOnline(){return k(this,Ol)}},Ol=new WeakMap,Cr=new WeakMap,Ml=new WeakMap,_x),oc=new MN;function DN(e){return Math.min(1e3*2**e,3e4)}function Bx(e){return(e??"online")==="online"?oc.isOnline():!0}var Lm=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Zx(e){let a=!1,r=0,l;const o=Um(),c=()=>o.status!=="pending",m=w=>{var E;if(!c()){const M=new Lm(w);j(M),(E=e.onCancel)==null||E.call(e,M)}},h=()=>{a=!0},g=()=>{a=!1},p=()=>mh.isFocused()&&(e.networkMode==="always"||oc.isOnline())&&e.canRun(),b=()=>Bx(e.networkMode)&&e.canRun(),x=w=>{c()||(l==null||l(),o.resolve(w))},j=w=>{c()||(l==null||l(),o.reject(w))},N=()=>new Promise(w=>{var E;l=M=>{(c()||p())&&w(M)},(E=e.onPause)==null||E.call(e)}).then(()=>{var w;l=void 0,c()||(w=e.onContinue)==null||w.call(e)}),z=()=>{if(c())return;let w;const E=r===0?e.initialPromise:void 0;try{w=E??e.fn()}catch(M){w=Promise.reject(M)}Promise.resolve(w).then(x).catch(M=>{var I;if(c())return;const B=e.retry??(to.isServer()?0:3),D=e.retryDelay??DN,O=typeof D=="function"?D(r,M):D,P=B===!0||typeof B=="number"&&r<B||typeof B=="function"&&B(r,M);if(a||!P){j(M);return}r++,(I=e.onFail)==null||I.call(e,r,M),kN(O).then(()=>p()?void 0:N()).then(()=>{a?j(M):z()})})};return{promise:o,status:()=>o.status,cancel:m,continue:()=>(l==null||l(),o),cancelRetry:h,continueRetry:g,canStart:b,start:()=>(b()?z():N().then(z),o)}}var vs,Cx,Hx=(Cx=class{constructor(){ye(this,vs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Om(this.gcTime)&&ie(this,vs,ps.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(to.isServer()?1/0:300*1e3))}clearGcTimeout(){k(this,vs)&&(ps.clearTimeout(k(this,vs)),ie(this,vs,void 0))}},vs=new WeakMap,Cx),ys,Dl,Mn,bs,Mt,co,xs,bn,Ix,Ra,kx,UN=(kx=class extends Hx{constructor(a){super();ye(this,bn);ye(this,ys);ye(this,Dl);ye(this,Mn);ye(this,bs);ye(this,Mt);ye(this,co);ye(this,xs);ie(this,xs,!1),ie(this,co,a.defaultOptions),this.setOptions(a.options),this.observers=[],ie(this,bs,a.client),ie(this,Mn,k(this,bs).getQueryCache()),this.queryKey=a.queryKey,this.queryHash=a.queryHash,ie(this,ys,rb(this.options)),this.state=a.state??k(this,ys),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var a;return(a=k(this,Mt))==null?void 0:a.promise}setOptions(a){if(this.options={...k(this,co),...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=rb(this.options);r.data!==void 0&&(this.setState(ab(r.data,r.dataUpdatedAt)),ie(this,ys,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Mn).remove(this)}setData(a,r){const l=Dm(this.state.data,a,this.options);return Oe(this,bn,Ra).call(this,{data:l,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),l}setState(a,r){Oe(this,bn,Ra).call(this,{type:"setState",state:a,setStateOptions:r})}cancel(a){var l,o;const r=(l=k(this,Mt))==null?void 0:l.promise;return(o=k(this,Mt))==null||o.cancel(a),r?r.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return k(this,ys)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(a=>Dn(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ph||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Mr(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!Lx(this.state.dataUpdatedAt,a)}onFocus(){var r;const a=this.observers.find(l=>l.shouldFetchOnWindowFocus());a==null||a.refetch({cancelRefetch:!1}),(r=k(this,Mt))==null||r.continue()}onOnline(){var r;const a=this.observers.find(l=>l.shouldFetchOnReconnect());a==null||a.refetch({cancelRefetch:!1}),(r=k(this,Mt))==null||r.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),k(this,Mn).notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(r=>r!==a),this.observers.length||(k(this,Mt)&&(k(this,xs)||Oe(this,bn,Ix).call(this)?k(this,Mt).cancel({revert:!0}):k(this,Mt).cancelRetry()),this.scheduleGc()),k(this,Mn).notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,bn,Ra).call(this,{type:"invalidate"})}async fetch(a,r){var g,p,b,x,j,N,z,w,E,M,B,D;if(this.state.fetchStatus!=="idle"&&((g=k(this,Mt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(k(this,Mt))return k(this,Mt).continueRetry(),k(this,Mt).promise}if(a&&this.setOptions(a),!this.options.queryFn){const O=this.observers.find(P=>P.options.queryFn);O&&this.setOptions(O.options)}const l=new AbortController,o=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(ie(this,xs,!0),l.signal)})},c=()=>{const O=qx(this.options,r),I=(()=>{const L={client:k(this,bs),queryKey:this.queryKey,meta:this.meta};return o(L),L})();return ie(this,xs,!1),this.options.persister?this.options.persister(O,I,this):O(I)},h=(()=>{const O={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:k(this,bs),state:this.state,fetchFn:c};return o(O),O})();(p=this.options.behavior)==null||p.onFetch(h,this),ie(this,Dl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=h.fetchOptions)==null?void 0:b.meta))&&Oe(this,bn,Ra).call(this,{type:"fetch",meta:(x=h.fetchOptions)==null?void 0:x.meta}),ie(this,Mt,Zx({initialPromise:r==null?void 0:r.initialPromise,fn:h.fetchFn,onCancel:O=>{O instanceof Lm&&O.revert&&this.setState({...k(this,Dl),fetchStatus:"idle"}),l.abort()},onFail:(O,P)=>{Oe(this,bn,Ra).call(this,{type:"failed",failureCount:O,error:P})},onPause:()=>{Oe(this,bn,Ra).call(this,{type:"pause"})},onContinue:()=>{Oe(this,bn,Ra).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const O=await k(this,Mt).start();if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(N=(j=k(this,Mn).config).onSuccess)==null||N.call(j,O,this),(w=(z=k(this,Mn).config).onSettled)==null||w.call(z,O,this.state.error,this),O}catch(O){if(O instanceof Lm){if(O.silent)return k(this,Mt).promise;if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw Oe(this,bn,Ra).call(this,{type:"error",error:O}),(M=(E=k(this,Mn).config).onError)==null||M.call(E,O,this),(D=(B=k(this,Mn).config).onSettled)==null||D.call(B,this.state.data,O,this),O}finally{this.scheduleGc()}}},ys=new WeakMap,Dl=new WeakMap,Mn=new WeakMap,bs=new WeakMap,Mt=new WeakMap,co=new WeakMap,xs=new WeakMap,bn=new WeakSet,Ix=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ra=function(a){const r=l=>{switch(a.type){case"failed":return{...l,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,...Qx(l.data,this.options),fetchMeta:a.meta??null};case"success":const o={...l,...ab(a.data,a.dataUpdatedAt),dataUpdateCount:l.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ie(this,Dl,a.manual?o:void 0),o;case"error":const c=a.error;return{...l,error:c,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...a.state}}};this.state=r(this.state),Tt.batch(()=>{this.observers.forEach(l=>{l.onQueryUpdate()}),k(this,Mn).notify({query:this,type:"updated",action:a})})},kx);function Qx(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bx(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ab(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rb(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,r=a!==void 0,l=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:r?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var on,He,fo,Xt,Ss,Ul,Ma,kr,mo,Ll,$l,js,ws,Ar,ql,Xe,Yi,$m,qm,Bm,Zm,Hm,Im,Qm,Px,Ax,LN=(Ax=class extends Kl{constructor(a,r){super();ye(this,Xe);ye(this,on);ye(this,He);ye(this,fo);ye(this,Xt);ye(this,Ss);ye(this,Ul);ye(this,Ma);ye(this,kr);ye(this,mo);ye(this,Ll);ye(this,$l);ye(this,js);ye(this,ws);ye(this,Ar);ye(this,ql,new Set);this.options=r,ie(this,on,a),ie(this,kr,null),ie(this,Ma,Um()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,He).addObserver(this),sb(k(this,He),this.options)?Oe(this,Xe,Yi).call(this):this.updateResult(),Oe(this,Xe,Zm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Pm(k(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Pm(k(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,Xe,Hm).call(this),Oe(this,Xe,Im).call(this),k(this,He).removeObserver(this)}setOptions(a){const r=this.options,l=k(this,He);if(this.options=k(this,on).defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,k(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,Xe,Qm).call(this),k(this,He).setOptions(this.options),r._defaulted&&!ic(this.options,r)&&k(this,on).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,He),observer:this});const o=this.hasListeners();o&&lb(k(this,He),l,this.options,r)&&Oe(this,Xe,Yi).call(this),this.updateResult(),o&&(k(this,He)!==l||Dn(this.options.enabled,k(this,He))!==Dn(r.enabled,k(this,He))||Mr(this.options.staleTime,k(this,He))!==Mr(r.staleTime,k(this,He)))&&Oe(this,Xe,$m).call(this);const c=Oe(this,Xe,qm).call(this);o&&(k(this,He)!==l||Dn(this.options.enabled,k(this,He))!==Dn(r.enabled,k(this,He))||c!==k(this,Ar))&&Oe(this,Xe,Bm).call(this,c)}getOptimisticResult(a){const r=k(this,on).getQueryCache().build(k(this,on),a),l=this.createResult(r,a);return qN(this,l)&&(ie(this,Xt,l),ie(this,Ul,this.options),ie(this,Ss,k(this,He).state)),l}getCurrentResult(){return k(this,Xt)}trackResult(a,r){return new Proxy(a,{get:(l,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&k(this,Ma).status==="pending"&&k(this,Ma).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(l,o))})}trackProp(a){k(this,ql).add(a)}getCurrentQuery(){return k(this,He)}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const r=k(this,on).defaultQueryOptions(a),l=k(this,on).getQueryCache().build(k(this,on),r);return l.fetch().then(()=>this.createResult(l,r))}fetch(a){return Oe(this,Xe,Yi).call(this,{...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Xt)))}createResult(a,r){var le;const l=k(this,He),o=this.options,c=k(this,Xt),m=k(this,Ss),h=k(this,Ul),p=a!==l?a.state:k(this,fo),{state:b}=a;let x={...b},j=!1,N;if(r._optimisticResults){const Se=this.hasListeners(),_e=!Se&&sb(a,r),se=Se&&lb(a,l,r,o);(_e||se)&&(x={...x,...Qx(b.data,a.options)}),r._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:z,errorUpdatedAt:w,status:E}=x;N=x.data;let M=!1;if(r.placeholderData!==void 0&&N===void 0&&E==="pending"){let Se;c!=null&&c.isPlaceholderData&&r.placeholderData===(h==null?void 0:h.placeholderData)?(Se=c.data,M=!0):Se=typeof r.placeholderData=="function"?r.placeholderData((le=k(this,$l))==null?void 0:le.state.data,k(this,$l)):r.placeholderData,Se!==void 0&&(E="success",N=Dm(c==null?void 0:c.data,Se,r),j=!0)}if(r.select&&N!==void 0&&!M)if(c&&N===(m==null?void 0:m.data)&&r.select===k(this,mo))N=k(this,Ll);else try{ie(this,mo,r.select),N=r.select(N),N=Dm(c==null?void 0:c.data,N,r),ie(this,Ll,N),ie(this,kr,null)}catch(Se){ie(this,kr,Se)}k(this,kr)&&(z=k(this,kr),N=k(this,Ll),w=Date.now(),E="error");const B=x.fetchStatus==="fetching",D=E==="pending",O=E==="error",P=D&&B,I=N!==void 0,K={status:E,fetchStatus:x.fetchStatus,isPending:D,isSuccess:E==="success",isError:O,isInitialLoading:P,isLoading:P,data:N,dataUpdatedAt:x.dataUpdatedAt,error:z,errorUpdatedAt:w,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:a.isFetched(),isFetchedAfterMount:x.dataUpdateCount>p.dataUpdateCount||x.errorUpdateCount>p.errorUpdateCount,isFetching:B,isRefetching:B&&!D,isLoadingError:O&&!I,isPaused:x.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:O&&I,isStale:vh(a,r),refetch:this.refetch,promise:k(this,Ma),isEnabled:Dn(r.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const Se=K.data!==void 0,_e=K.status==="error"&&!Se,se=we=>{_e?we.reject(K.error):Se&&we.resolve(K.data)},ve=()=>{const we=ie(this,Ma,K.promise=Um());se(we)},Te=k(this,Ma);switch(Te.status){case"pending":a.queryHash===l.queryHash&&se(Te);break;case"fulfilled":(_e||K.data!==Te.value)&&ve();break;case"rejected":(!_e||K.error!==Te.reason)&&ve();break}}return K}updateResult(){const a=k(this,Xt),r=this.createResult(k(this,He),this.options);if(ie(this,Ss,k(this,He).state),ie(this,Ul,this.options),k(this,Ss).data!==void 0&&ie(this,$l,k(this,He)),ic(r,a))return;ie(this,Xt,r);const l=()=>{if(!a)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!k(this,ql).size)return!0;const m=new Set(c??k(this,ql));return this.options.throwOnError&&m.add("error"),Object.keys(k(this,Xt)).some(h=>{const g=h;return k(this,Xt)[g]!==a[g]&&m.has(g)})};Oe(this,Xe,Px).call(this,{listeners:l()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,Xe,Zm).call(this)}},on=new WeakMap,He=new WeakMap,fo=new WeakMap,Xt=new WeakMap,Ss=new WeakMap,Ul=new WeakMap,Ma=new WeakMap,kr=new WeakMap,mo=new WeakMap,Ll=new WeakMap,$l=new WeakMap,js=new WeakMap,ws=new WeakMap,Ar=new WeakMap,ql=new WeakMap,Xe=new WeakSet,Yi=function(a){Oe(this,Xe,Qm).call(this);let r=k(this,He).fetch(this.options,a);return a!=null&&a.throwOnError||(r=r.catch(Jt)),r},$m=function(){Oe(this,Xe,Hm).call(this);const a=Mr(this.options.staleTime,k(this,He));if(to.isServer()||k(this,Xt).isStale||!Om(a))return;const l=Lx(k(this,Xt).dataUpdatedAt,a)+1;ie(this,js,ps.setTimeout(()=>{k(this,Xt).isStale||this.updateResult()},l))},qm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,He)):this.options.refetchInterval)??!1},Bm=function(a){Oe(this,Xe,Im).call(this),ie(this,Ar,a),!(to.isServer()||Dn(this.options.enabled,k(this,He))===!1||!Om(k(this,Ar))||k(this,Ar)===0)&&ie(this,ws,ps.setInterval(()=>{(this.options.refetchIntervalInBackground||mh.isFocused())&&Oe(this,Xe,Yi).call(this)},k(this,Ar)))},Zm=function(){Oe(this,Xe,$m).call(this),Oe(this,Xe,Bm).call(this,Oe(this,Xe,qm).call(this))},Hm=function(){k(this,js)&&(ps.clearTimeout(k(this,js)),ie(this,js,void 0))},Im=function(){k(this,ws)&&(ps.clearInterval(k(this,ws)),ie(this,ws,void 0))},Qm=function(){const a=k(this,on).getQueryCache().build(k(this,on),this.options);if(a===k(this,He))return;const r=k(this,He);ie(this,He,a),ie(this,fo,a.state),this.hasListeners()&&(r==null||r.removeObserver(this),a.addObserver(this))},Px=function(a){Tt.batch(()=>{a.listeners&&this.listeners.forEach(r=>{r(k(this,Xt))}),k(this,on).getQueryCache().notify({query:k(this,He),type:"observerResultsUpdated"})})},Ax);function $N(e,a){return Dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function sb(e,a){return $N(e,a)||e.state.data!==void 0&&Pm(e,a,a.refetchOnMount)}function Pm(e,a,r){if(Dn(a.enabled,e)!==!1&&Mr(a.staleTime,e)!=="static"){const l=typeof r=="function"?r(e):r;return l==="always"||l!==!1&&vh(e,a)}return!1}function lb(e,a,r,l){return(e!==a||Dn(l.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&vh(e,r)}function vh(e,a){return Dn(a.enabled,e)!==!1&&e.isStaleByTime(Mr(a.staleTime,e))}function qN(e,a){return!ic(e.getCurrentResult(),a)}function ib(e){return{onFetch:(a,r)=>{var b,x,j,N,z;const l=a.options,o=(j=(x=(b=a.fetchOptions)==null?void 0:b.meta)==null?void 0:x.fetchMore)==null?void 0:j.direction,c=((N=a.state.data)==null?void 0:N.pages)||[],m=((z=a.state.data)==null?void 0:z.pageParams)||[];let h={pages:[],pageParams:[]},g=0;const p=async()=>{let w=!1;const E=D=>{TN(D,()=>a.signal,()=>w=!0)},M=qx(a.options,a.fetchOptions),B=async(D,O,P)=>{if(w)return Promise.reject();if(O==null&&D.pages.length)return Promise.resolve(D);const L=(()=>{const _e={client:a.client,queryKey:a.queryKey,pageParam:O,direction:P?"backward":"forward",meta:a.options.meta};return E(_e),_e})(),K=await M(L),{maxPages:le}=a.options,Se=P?zN:AN;return{pages:Se(D.pages,K,le),pageParams:Se(D.pageParams,O,le)}};if(o&&c.length){const D=o==="backward",O=D?BN:ob,P={pages:c,pageParams:m},I=O(l,P);h=await B(P,I,D)}else{const D=e??c.length;do{const O=g===0?m[0]??l.initialPageParam:ob(l,h);if(g>0&&O==null)break;h=await B(h,O),g++}while(g<D)}return h};a.options.persister?a.fetchFn=()=>{var w,E;return(E=(w=a.options).persister)==null?void 0:E.call(w,p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},r)}:a.fetchFn=p}}}function ob(e,{pages:a,pageParams:r}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,r[l],r):void 0}function BN(e,{pages:a,pageParams:r}){var l;return a.length>0?(l=e.getPreviousPageParam)==null?void 0:l.call(e,a[0],a,r[0],r):void 0}var ho,sa,It,Ns,la,jr,zx,ZN=(zx=class extends Hx{constructor(a){super();ye(this,la);ye(this,ho);ye(this,sa);ye(this,It);ye(this,Ns);ie(this,ho,a.client),this.mutationId=a.mutationId,ie(this,It,a.mutationCache),ie(this,sa,[]),this.state=a.state||Gx(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){k(this,sa).includes(a)||(k(this,sa).push(a),this.clearGcTimeout(),k(this,It).notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){ie(this,sa,k(this,sa).filter(r=>r!==a)),this.scheduleGc(),k(this,It).notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){k(this,sa).length||(this.state.status==="pending"?this.scheduleGc():k(this,It).remove(this))}continue(){var a;return((a=k(this,Ns))==null?void 0:a.continue())??this.execute(this.state.variables)}async execute(a){var m,h,g,p,b,x,j,N,z,w,E,M,B,D,O,P,I,L;const r=()=>{Oe(this,la,jr).call(this,{type:"continue"})},l={client:k(this,ho),meta:this.options.meta,mutationKey:this.options.mutationKey};ie(this,Ns,Zx({fn:()=>this.options.mutationFn?this.options.mutationFn(a,l):Promise.reject(new Error("No mutationFn found")),onFail:(K,le)=>{Oe(this,la,jr).call(this,{type:"failed",failureCount:K,error:le})},onPause:()=>{Oe(this,la,jr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,It).canRun(this)}));const o=this.state.status==="pending",c=!k(this,Ns).canStart();try{if(o)r();else{Oe(this,la,jr).call(this,{type:"pending",variables:a,isPaused:c}),k(this,It).config.onMutate&&await k(this,It).config.onMutate(a,this,l);const le=await((h=(m=this.options).onMutate)==null?void 0:h.call(m,a,l));le!==this.state.context&&Oe(this,la,jr).call(this,{type:"pending",context:le,variables:a,isPaused:c})}const K=await k(this,Ns).start();return await((p=(g=k(this,It).config).onSuccess)==null?void 0:p.call(g,K,a,this.state.context,this,l)),await((x=(b=this.options).onSuccess)==null?void 0:x.call(b,K,a,this.state.context,l)),await((N=(j=k(this,It).config).onSettled)==null?void 0:N.call(j,K,null,this.state.variables,this.state.context,this,l)),await((w=(z=this.options).onSettled)==null?void 0:w.call(z,K,null,a,this.state.context,l)),Oe(this,la,jr).call(this,{type:"success",data:K}),K}catch(K){try{await((M=(E=k(this,It).config).onError)==null?void 0:M.call(E,K,a,this.state.context,this,l))}catch(le){Promise.reject(le)}try{await((D=(B=this.options).onError)==null?void 0:D.call(B,K,a,this.state.context,l))}catch(le){Promise.reject(le)}try{await((P=(O=k(this,It).config).onSettled)==null?void 0:P.call(O,void 0,K,this.state.variables,this.state.context,this,l))}catch(le){Promise.reject(le)}try{await((L=(I=this.options).onSettled)==null?void 0:L.call(I,void 0,K,a,this.state.context,l))}catch(le){Promise.reject(le)}throw Oe(this,la,jr).call(this,{type:"error",error:K}),K}finally{k(this,It).runNext(this)}}},ho=new WeakMap,sa=new WeakMap,It=new WeakMap,Ns=new WeakMap,la=new WeakSet,jr=function(a){const r=l=>{switch(a.type){case"failed":return{...l,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...l,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:a.error,failureCount:l.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Tt.batch(()=>{k(this,sa).forEach(l=>{l.onMutationUpdate(a)}),k(this,It).notify({mutation:this,type:"updated",action:a})})},zx);function Gx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Da,Kn,po,Tx,HN=(Tx=class extends Kl{constructor(a={}){super();ye(this,Da);ye(this,Kn);ye(this,po);this.config=a,ie(this,Da,new Set),ie(this,Kn,new Map),ie(this,po,0)}build(a,r,l){const o=new ZN({client:a,mutationCache:this,mutationId:++Bu(this,po)._,options:a.defaultMutationOptions(r),state:l});return this.add(o),o}add(a){k(this,Da).add(a);const r=Zu(a);if(typeof r=="string"){const l=k(this,Kn).get(r);l?l.push(a):k(this,Kn).set(r,[a])}this.notify({type:"added",mutation:a})}remove(a){if(k(this,Da).delete(a)){const r=Zu(a);if(typeof r=="string"){const l=k(this,Kn).get(r);if(l)if(l.length>1){const o=l.indexOf(a);o!==-1&&l.splice(o,1)}else l[0]===a&&k(this,Kn).delete(r)}}this.notify({type:"removed",mutation:a})}canRun(a){const r=Zu(a);if(typeof r=="string"){const l=k(this,Kn).get(r),o=l==null?void 0:l.find(c=>c.state.status==="pending");return!o||o===a}else return!0}runNext(a){var l;const r=Zu(a);if(typeof r=="string"){const o=(l=k(this,Kn).get(r))==null?void 0:l.find(c=>c!==a&&c.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tt.batch(()=>{k(this,Da).forEach(a=>{this.notify({type:"removed",mutation:a})}),k(this,Da).clear(),k(this,Kn).clear()})}getAll(){return Array.from(k(this,Da))}find(a){const r={exact:!0,...a};return this.getAll().find(l=>eb(r,l))}findAll(a={}){return this.getAll().filter(r=>eb(a,r))}notify(a){Tt.batch(()=>{this.listeners.forEach(r=>{r(a)})})}resumePausedMutations(){const a=this.getAll().filter(r=>r.state.isPaused);return Tt.batch(()=>Promise.all(a.map(r=>r.continue().catch(Jt))))}},Da=new WeakMap,Kn=new WeakMap,po=new WeakMap,Tx);function Zu(e){var a;return(a=e.options.scope)==null?void 0:a.id}var Ua,zr,un,La,Ba,ec,Gm,Rx,IN=(Rx=class extends Kl{constructor(r,l){super();ye(this,Ba);ye(this,Ua);ye(this,zr);ye(this,un);ye(this,La);ie(this,Ua,r),this.setOptions(l),this.bindMethods(),Oe(this,Ba,ec).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var o;const l=this.options;this.options=k(this,Ua).defaultMutationOptions(r),ic(this.options,l)||k(this,Ua).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,un),observer:this}),l!=null&&l.mutationKey&&this.options.mutationKey&&Es(l.mutationKey)!==Es(this.options.mutationKey)?this.reset():((o=k(this,un))==null?void 0:o.state.status)==="pending"&&k(this,un).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=k(this,un))==null||r.removeObserver(this)}onMutationUpdate(r){Oe(this,Ba,ec).call(this),Oe(this,Ba,Gm).call(this,r)}getCurrentResult(){return k(this,zr)}reset(){var r;(r=k(this,un))==null||r.removeObserver(this),ie(this,un,void 0),Oe(this,Ba,ec).call(this),Oe(this,Ba,Gm).call(this)}mutate(r,l){var o;return ie(this,La,l),(o=k(this,un))==null||o.removeObserver(this),ie(this,un,k(this,Ua).getMutationCache().build(k(this,Ua),this.options)),k(this,un).addObserver(this),k(this,un).execute(r)}},Ua=new WeakMap,zr=new WeakMap,un=new WeakMap,La=new WeakMap,Ba=new WeakSet,ec=function(){var l;const r=((l=k(this,un))==null?void 0:l.state)??Gx();ie(this,zr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Gm=function(r){Tt.batch(()=>{var l,o,c,m,h,g,p,b;if(k(this,La)&&this.hasListeners()){const x=k(this,zr).variables,j=k(this,zr).context,N={client:k(this,Ua),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(o=(l=k(this,La)).onSuccess)==null||o.call(l,r.data,x,j,N)}catch(z){Promise.reject(z)}try{(m=(c=k(this,La)).onSettled)==null||m.call(c,r.data,null,x,j,N)}catch(z){Promise.reject(z)}}else if((r==null?void 0:r.type)==="error"){try{(g=(h=k(this,La)).onError)==null||g.call(h,r.error,x,j,N)}catch(z){Promise.reject(z)}try{(b=(p=k(this,La)).onSettled)==null||b.call(p,void 0,r.error,x,j,N)}catch(z){Promise.reject(z)}}}this.listeners.forEach(x=>{x(k(this,zr))})})},Rx),ia,Ox,QN=(Ox=class extends Kl{constructor(a={}){super();ye(this,ia);this.config=a,ie(this,ia,new Map)}build(a,r,l){const o=r.queryKey,c=r.queryHash??hh(o,r);let m=this.get(c);return m||(m=new UN({client:a,queryKey:o,queryHash:c,options:a.defaultQueryOptions(r),state:l,defaultOptions:a.getQueryDefaults(o)}),this.add(m)),m}add(a){k(this,ia).has(a.queryHash)||(k(this,ia).set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const r=k(this,ia).get(a.queryHash);r&&(a.destroy(),r===a&&k(this,ia).delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){Tt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return k(this,ia).get(a)}getAll(){return[...k(this,ia).values()]}find(a){const r={exact:!0,...a};return this.getAll().find(l=>Wy(r,l))}findAll(a={}){const r=this.getAll();return Object.keys(a).length>0?r.filter(l=>Wy(a,l)):r}notify(a){Tt.batch(()=>{this.listeners.forEach(r=>{r(a)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},ia=new WeakMap,Ox),bt,Tr,Rr,Bl,Zl,Or,Hl,Il,Mx,PN=(Mx=class{constructor(e={}){ye(this,bt);ye(this,Tr);ye(this,Rr);ye(this,Bl);ye(this,Zl);ye(this,Or);ye(this,Hl);ye(this,Il);ie(this,bt,e.queryCache||new QN),ie(this,Tr,e.mutationCache||new HN),ie(this,Rr,e.defaultOptions||{}),ie(this,Bl,new Map),ie(this,Zl,new Map),ie(this,Or,0)}mount(){Bu(this,Or)._++,k(this,Or)===1&&(ie(this,Hl,mh.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,bt).onFocus())})),ie(this,Il,oc.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,bt).onOnline())})))}unmount(){var e,a;Bu(this,Or)._--,k(this,Or)===0&&((e=k(this,Hl))==null||e.call(this),ie(this,Hl,void 0),(a=k(this,Il))==null||a.call(this),ie(this,Il,void 0))}isFetching(e){return k(this,bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,Tr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const a=this.defaultQueryOptions({queryKey:e});return(r=k(this,bt).get(a.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),r=k(this,bt).build(this,a),l=r.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Mr(a.staleTime,r))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return k(this,bt).findAll(e).map(({queryKey:a,state:r})=>{const l=r.data;return[a,l]})}setQueryData(e,a,r){const l=this.defaultQueryOptions({queryKey:e}),o=k(this,bt).get(l.queryHash),c=o==null?void 0:o.state.data,m=_N(a,c);if(m!==void 0)return k(this,bt).build(this,l).setData(m,{...r,manual:!0})}setQueriesData(e,a,r){return Tt.batch(()=>k(this,bt).findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,r)]))}getQueryState(e){var r;const a=this.defaultQueryOptions({queryKey:e});return(r=k(this,bt).get(a.queryHash))==null?void 0:r.state}removeQueries(e){const a=k(this,bt);Tt.batch(()=>{a.findAll(e).forEach(r=>{a.remove(r)})})}resetQueries(e,a){const r=k(this,bt);return Tt.batch(()=>(r.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const r={revert:!0,...a},l=Tt.batch(()=>k(this,bt).findAll(e).map(o=>o.cancel(r)));return Promise.all(l).then(Jt).catch(Jt)}invalidateQueries(e,a={}){return Tt.batch(()=>(k(this,bt).findAll(e).forEach(r=>{r.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"},a)))}refetchQueries(e,a={}){const r={...a,cancelRefetch:a.cancelRefetch??!0},l=Tt.batch(()=>k(this,bt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,r);return r.throwOnError||(c=c.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(l).then(Jt)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const r=k(this,bt).build(this,a);return r.isStaleByTime(Mr(a.staleTime,r))?r.fetch(a):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=ib(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=ib(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return oc.isOnline()?k(this,Tr).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,bt)}getMutationCache(){return k(this,Tr)}getDefaultOptions(){return k(this,Rr)}setDefaultOptions(e){ie(this,Rr,e)}setQueryDefaults(e,a){k(this,Bl).set(Es(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...k(this,Bl).values()],r={};return a.forEach(l=>{eo(e,l.queryKey)&&Object.assign(r,l.defaultOptions)}),r}setMutationDefaults(e,a){k(this,Zl).set(Es(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...k(this,Zl).values()],r={};return a.forEach(l=>{eo(e,l.mutationKey)&&Object.assign(r,l.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const a={...k(this,Rr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=hh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===ph&&(a.enabled=!1),a}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Rr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,bt).clear(),k(this,Tr).clear()}},bt=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Bl=new WeakMap,Zl=new WeakMap,Or=new WeakMap,Hl=new WeakMap,Il=new WeakMap,Mx),Vx=v.createContext(void 0),Bn=e=>{const a=v.useContext(Vx);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},GN=({client:e,children:a})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Vx.Provider,{value:e,children:a})),Kx=v.createContext(!1),VN=()=>v.useContext(Kx);Kx.Provider;function KN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var FN=v.createContext(KN()),YN=()=>v.useContext(FN),XN=(e,a,r)=>{const l=r!=null&&r.state.error&&typeof e.throwOnError=="function"?gh(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},JN=e=>{v.useEffect(()=>{e.clearReset()},[e])},WN=({result:e,errorResetBoundary:a,throwOnError:r,query:l,suspense:o})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(o&&e.data===void 0||gh(r,[e.error,l])),eE=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...o)=>r(l(...o)):r(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},tE=(e,a)=>e.isLoading&&e.isFetching&&!a,nE=(e,a)=>(e==null?void 0:e.suspense)&&a.isPending,ub=(e,a,r)=>a.fetchOptimistic(e).catch(()=>{r.clearReset()});function aE(e,a,r){var j,N,z,w;const l=VN(),o=YN(),c=Bn(),m=c.defaultQueryOptions(e);(N=(j=c.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||N.call(j,m);const h=c.getQueryCache().get(m.queryHash);m._optimisticResults=l?"isRestoring":"optimistic",eE(m),XN(m,o,h),JN(o);const g=!c.getQueryCache().get(m.queryHash),[p]=v.useState(()=>new a(c,m)),b=p.getOptimisticResult(m),x=!l&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(E=>{const M=x?p.subscribe(Tt.batchCalls(E)):Jt;return p.updateResult(),M},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),v.useEffect(()=>{p.setOptions(m)},[m,p]),nE(m,b))throw ub(m,p,o);if(WN({result:b,errorResetBoundary:o,throwOnError:m.throwOnError,query:h,suspense:m.suspense}))throw b.error;if((w=(z=c.getDefaultOptions().queries)==null?void 0:z._experimental_afterQuery)==null||w.call(z,m,b),m.experimental_prefetchInRender&&!to.isServer()&&tE(b,l)){const E=g?ub(m,p,o):h==null?void 0:h.promise;E==null||E.catch(Jt).finally(()=>{p.updateResult()})}return m.notifyOnChangeProps?b:p.trackResult(b)}function Ie(e,a){return aE(e,LN)}function lt(e,a){const r=Bn(),[l]=v.useState(()=>new IN(r,e));v.useEffect(()=>{l.setOptions(e)},[l,e]);const o=v.useSyncExternalStore(v.useCallback(m=>l.subscribe(Tt.batchCalls(m)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),c=v.useCallback((m,h)=>{l.mutate(m,h).catch(Jt)},[l]);if(o.error&&gh(l.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.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 cb="popstate";function db(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function rE(e={}){function a(l,o){var p;let c=(p=o.state)==null?void 0:p.masked,{pathname:m,search:h,hash:g}=c||l.location;return Vm("",{pathname:m,search:h,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function r(l,o){return typeof o=="string"?o:no(o)}return lE(a,r,null,e)}function ft(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Un(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function sE(){return Math.random().toString(36).substring(2,10)}function fb(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Vm(e,a,r=null,l,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?Fl(a):a,state:r,key:a&&a.key||l||sE(),unstable_mask:o}}function no({pathname:e="/",search:a="",hash:r=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Fl(e){let a={};if(e){let r=e.indexOf("#");r>=0&&(a.hash=e.substring(r),e=e.substring(0,r));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function lE(e,a,r,l={}){let{window:o=document.defaultView,v5Compat:c=!1}=l,m=o.history,h="POP",g=null,p=b();p==null&&(p=0,m.replaceState({...m.state,idx:p},""));function b(){return(m.state||{idx:null}).idx}function x(){h="POP";let E=b(),M=E==null?null:E-p;p=E,g&&g({action:h,location:w.location,delta:M})}function j(E,M){h="PUSH";let B=db(E)?E:Vm(w.location,E,M);p=b()+1;let D=fb(B,p),O=w.createHref(B.unstable_mask||B);try{m.pushState(D,"",O)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(O)}c&&g&&g({action:h,location:w.location,delta:1})}function N(E,M){h="REPLACE";let B=db(E)?E:Vm(w.location,E,M);p=b();let D=fb(B,p),O=w.createHref(B.unstable_mask||B);m.replaceState(D,"",O),c&&g&&g({action:h,location:w.location,delta:0})}function z(E){return iE(E)}let w={get action(){return h},get location(){return e(o,m)},listen(E){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(cb,x),g=E,()=>{o.removeEventListener(cb,x),g=null}},createHref(E){return a(o,E)},createURL:z,encodeLocation(E){let M=z(E);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:j,replace:N,go(E){return m.go(E)}};return w}function iE(e,a=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),ft(r,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:no(e);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=r+l),new URL(l,r)}function Fx(e,a,r="/"){return oE(e,a,r,!1)}function oE(e,a,r,l){let o=typeof a=="string"?Fl(a):a,c=Za(o.pathname||"/",r);if(c==null)return null;let m=Yx(e);uE(m);let h=null;for(let g=0;h==null&&g<m.length;++g){let p=xE(c);h=yE(m[g],p,l)}return h}function Yx(e,a=[],r=[],l="",o=!1){let c=(m,h,g=o,p)=>{let b={relativePath:p===void 0?m.path||"":p,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&g)return;ft(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let x=ca([l,b.relativePath]),j=r.concat(b);m.children&&m.children.length>0&&(ft(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Yx(m.children,a,j,x,g)),!(m.path==null&&!m.index)&&a.push({path:x,score:gE(x,m.index),routesMeta:j})};return e.forEach((m,h)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))c(m,h);else for(let p of Xx(m.path))c(m,h,!0,p)}),a}function Xx(e){let a=e.split("/");if(a.length===0)return[];let[r,...l]=a,o=r.endsWith("?"),c=r.replace(/\?$/,"");if(l.length===0)return o?[c,""]:[c];let m=Xx(l.join("/")),h=[];return h.push(...m.map(g=>g===""?c:[c,g].join("/"))),o&&h.push(...m),h.map(g=>e.startsWith("/")&&g===""?"/":g)}function uE(e){e.sort((a,r)=>a.score!==r.score?r.score-a.score:vE(a.routesMeta.map(l=>l.childrenIndex),r.routesMeta.map(l=>l.childrenIndex)))}var cE=/^:[\w-]+$/,dE=3,fE=2,mE=1,hE=10,pE=-2,mb=e=>e==="*";function gE(e,a){let r=e.split("/"),l=r.length;return r.some(mb)&&(l+=pE),a&&(l+=fE),r.filter(o=>!mb(o)).reduce((o,c)=>o+(cE.test(c)?dE:c===""?mE:hE),l)}function vE(e,a){return e.length===a.length&&e.slice(0,-1).every((l,o)=>l===a[o])?e[e.length-1]-a[a.length-1]:0}function yE(e,a,r=!1){let{routesMeta:l}=e,o={},c="/",m=[];for(let h=0;h<l.length;++h){let g=l[h],p=h===l.length-1,b=c==="/"?a:a.slice(c.length)||"/",x=uc({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},b),j=g.route;if(!x&&p&&r&&!l[l.length-1].route.index&&(x=uc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!x)return null;Object.assign(o,x.params),m.push({params:o,pathname:ca([c,x.pathname]),pathnameBase:NE(ca([c,x.pathnameBase])),route:j}),x.pathnameBase!=="/"&&(c=ca([c,x.pathnameBase]))}return m}function uc(e,a){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,l]=bE(e.path,e.caseSensitive,e.end),o=a.match(r);if(!o)return null;let c=o[0],m=c.replace(/(.)\/+$/,"$1"),h=o.slice(1);return{params:l.reduce((p,{paramName:b,isOptional:x},j)=>{if(b==="*"){let z=h[j]||"";m=c.slice(0,c.length-z.length).replace(/(.)\/+$/,"$1")}const N=h[j];return x&&!N?p[b]=void 0:p[b]=(N||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:m,pattern:e}}function bE(e,a=!1,r=!0){Un(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,h,g,p,b)=>{if(l.push({paramName:h,isOptional:g!=null}),g){let x=b.charAt(p+m.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),l]}function xE(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Un(!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 (${a}).`),e}}function Za(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let r=a.endsWith("/")?a.length-1:a.length,l=e.charAt(r);return l&&l!=="/"?null:e.slice(r)||"/"}var SE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function jE(e,a="/"){let{pathname:r,search:l="",hash:o=""}=typeof e=="string"?Fl(e):e,c;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?c=hb(r.substring(1),"/"):c=hb(r,a)):c=a,{pathname:c,search:EE(l),hash:_E(o)}}function hb(e,a){let r=a.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function om(e,a,r,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function wE(e){return e.filter((a,r)=>r===0||a.route.path&&a.route.path.length>0)}function yh(e){let a=wE(e);return a.map((r,l)=>l===a.length-1?r.pathname:r.pathnameBase)}function yc(e,a,r,l=!1){let o;typeof e=="string"?o=Fl(e):(o={...e},ft(!o.pathname||!o.pathname.includes("?"),om("?","pathname","search",o)),ft(!o.pathname||!o.pathname.includes("#"),om("#","pathname","hash",o)),ft(!o.search||!o.search.includes("#"),om("#","search","hash",o)));let c=e===""||o.pathname==="",m=c?"/":o.pathname,h;if(m==null)h=r;else{let x=a.length-1;if(!l&&m.startsWith("..")){let j=m.split("/");for(;j[0]==="..";)j.shift(),x-=1;o.pathname=j.join("/")}h=x>=0?a[x]:"/"}let g=jE(o,h),p=m&&m!=="/"&&m.endsWith("/"),b=(c||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(p||b)&&(g.pathname+="/"),g}var ca=e=>e.join("/").replace(/\/\/+/g,"/"),NE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),EE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_E=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,CE=class{constructor(e,a,r,l=!1){this.status=e,this.statusText=a||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function kE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function AE(e){return e.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Jx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Wx(e,a){let r=e;if(typeof r!="string"||!SE.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let l=r,o=!1;if(Jx)try{let c=new URL(window.location.href),m=r.startsWith("//")?new URL(c.protocol+r):new URL(r),h=Za(m.pathname,a);m.origin===c.origin&&h!=null?r=h+m.search+m.hash:o=!0}catch{Un(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var e0=["POST","PUT","PATCH","DELETE"];new Set(e0);var zE=["GET",...e0];new Set(zE);var Yl=v.createContext(null);Yl.displayName="DataRouter";var bc=v.createContext(null);bc.displayName="DataRouterState";var TE=v.createContext(!1),t0=v.createContext({isTransitioning:!1});t0.displayName="ViewTransition";var RE=v.createContext(new Map);RE.displayName="Fetchers";var OE=v.createContext(null);OE.displayName="Await";var Sn=v.createContext(null);Sn.displayName="Navigation";var go=v.createContext(null);go.displayName="Location";var Zn=v.createContext({outlet:null,matches:[],isDataRoute:!1});Zn.displayName="Route";var bh=v.createContext(null);bh.displayName="RouteError";var n0="REACT_ROUTER_ERROR",ME="REDIRECT",DE="ROUTE_ERROR_RESPONSE";function UE(e){if(e.startsWith(`${n0}:${ME}:{`))try{let a=JSON.parse(e.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function LE(e){if(e.startsWith(`${n0}:${DE}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new CE(a.status,a.statusText,a.data)}catch{}}function $E(e,{relative:a}={}){ft(Xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:l}=v.useContext(Sn),{hash:o,pathname:c,search:m}=vo(e,{relative:a}),h=c;return r!=="/"&&(h=c==="/"?r:ca([r,c])),l.createHref({pathname:h,search:m,hash:o})}function Xl(){return v.useContext(go)!=null}function Hn(){return ft(Xl(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(go).location}var a0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function r0(e){v.useContext(Sn).static||v.useLayoutEffect(e)}function Pa(){let{isDataRoute:e}=v.useContext(Zn);return e?e_():qE()}function qE(){ft(Xl(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Yl),{basename:a,navigator:r}=v.useContext(Sn),{matches:l}=v.useContext(Zn),{pathname:o}=Hn(),c=JSON.stringify(yh(l)),m=v.useRef(!1);return r0(()=>{m.current=!0}),v.useCallback((g,p={})=>{if(Un(m.current,a0),!m.current)return;if(typeof g=="number"){r.go(g);return}let b=yc(g,JSON.parse(c),o,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:ca([a,b.pathname])),(p.replace?r.replace:r.push)(b,p.state,p)},[a,r,c,o,e])}var BE=v.createContext(null);function ZE(e){let a=v.useContext(Zn).outlet;return v.useMemo(()=>a&&v.createElement(BE.Provider,{value:e},a),[a,e])}function HE(){let{matches:e}=v.useContext(Zn),a=e[e.length-1];return a?a.params:{}}function vo(e,{relative:a}={}){let{matches:r}=v.useContext(Zn),{pathname:l}=Hn(),o=JSON.stringify(yh(r));return v.useMemo(()=>yc(e,JSON.parse(o),l,a==="path"),[e,o,l,a])}function IE(e,a){return s0(e,a)}function s0(e,a,r){var E;ft(Xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=v.useContext(Sn),{matches:o}=v.useContext(Zn),c=o[o.length-1],m=c?c.params:{},h=c?c.pathname:"/",g=c?c.pathnameBase:"/",p=c&&c.route;{let M=p&&p.path||"";i0(h,!p||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${M}">) 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="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let b=Hn(),x;if(a){let M=typeof a=="string"?Fl(a):a;ft(g==="/"||((E=M.pathname)==null?void 0:E.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${M.pathname}" was given in the \`location\` prop.`),x=M}else x=b;let j=x.pathname||"/",N=j;if(g!=="/"){let M=g.replace(/^\//,"").split("/");N="/"+j.replace(/^\//,"").split("/").slice(M.length).join("/")}let z=Fx(e,{pathname:N});Un(p||z!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Un(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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 w=KE(z&&z.map(M=>Object.assign({},M,{params:Object.assign({},m,M.params),pathname:ca([g,l.encodeLocation?l.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?g:ca([g,l.encodeLocation?l.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),o,r);return a&&w?v.createElement(go.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},w):w}function QE(){let e=WE(),a=kE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},c={padding:"2px 4px",backgroundColor:l},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:c},"ErrorBoundary")," or"," ",v.createElement("code",{style:c},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},a),r?v.createElement("pre",{style:o},r):null,m)}var PE=v.createElement(QE,null),l0=class extends v.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,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):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 r=LE(e.digest);r&&(e=r)}let a=e!==void 0?v.createElement(Zn.Provider,{value:this.props.routeContext},v.createElement(bh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(GE,{error:e},a):a}};l0.contextType=TE;var um=new WeakMap;function GE({children:e,error:a}){let{basename:r}=v.useContext(Sn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=UE(a.digest);if(l){let o=um.get(a);if(o)throw o;let c=Wx(l.location,r);if(Jx&&!um.get(a))if(c.isExternal||l.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:l.replace}));throw um.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function VE({routeContext:e,match:a,children:r}){let l=v.useContext(Yl);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(Zn.Provider,{value:e},r)}function KE(e,a=[],r){let l=r==null?void 0:r.state;if(e==null){if(!l)return null;if(l.errors)e=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)e=l.matches;else return null}let o=e,c=l==null?void 0:l.errors;if(c!=null){let b=o.findIndex(x=>x.route.id&&(c==null?void 0:c[x.route.id])!==void 0);ft(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let m=!1,h=-1;if(r&&l){m=l.renderFallback;for(let b=0;b<o.length;b++){let x=o[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=b),x.route.id){let{loaderData:j,errors:N}=l,z=x.route.loader&&!j.hasOwnProperty(x.route.id)&&(!N||N[x.route.id]===void 0);if(x.route.lazy||z){r.isStatic&&(m=!0),h>=0?o=o.slice(0,h+1):o=[o[0]];break}}}}let g=r==null?void 0:r.onError,p=l&&g?(b,x)=>{var j,N;g(b,{location:l.location,params:((N=(j=l.matches)==null?void 0:j[0])==null?void 0:N.params)??{},unstable_pattern:AE(l.matches),errorInfo:x})}:void 0;return o.reduceRight((b,x,j)=>{let N,z=!1,w=null,E=null;l&&(N=c&&x.route.id?c[x.route.id]:void 0,w=x.route.errorElement||PE,m&&(h<0&&j===0?(i0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,E=null):h===j&&(z=!0,E=x.route.hydrateFallbackElement||null)));let M=a.concat(o.slice(0,j+1)),B=()=>{let D;return N?D=w:z?D=E:x.route.Component?D=v.createElement(x.route.Component,null):x.route.element?D=x.route.element:D=b,v.createElement(VE,{match:x,routeContext:{outlet:b,matches:M,isDataRoute:l!=null},children:D})};return l&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?v.createElement(l0,{location:l.location,revalidation:l.revalidation,component:w,error:N,children:B(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:p}):B()},null)}function xh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FE(e){let a=v.useContext(Yl);return ft(a,xh(e)),a}function YE(e){let a=v.useContext(bc);return ft(a,xh(e)),a}function XE(e){let a=v.useContext(Zn);return ft(a,xh(e)),a}function Sh(e){let a=XE(e),r=a.matches[a.matches.length-1];return ft(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function JE(){return Sh("useRouteId")}function WE(){var l;let e=v.useContext(bh),a=YE("useRouteError"),r=Sh("useRouteError");return e!==void 0?e:(l=a.errors)==null?void 0:l[r]}function e_(){let{router:e}=FE("useNavigate"),a=Sh("useNavigate"),r=v.useRef(!1);return r0(()=>{r.current=!0}),v.useCallback(async(o,c={})=>{Un(r.current,a0),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:a,...c}))},[e,a])}var pb={};function i0(e,a,r){!a&&!pb[e]&&(pb[e]=!0,Un(!1,r))}v.memo(t_);function t_({routes:e,future:a,state:r,isStatic:l,onError:o}){return s0(e,void 0,{state:r,isStatic:l,onError:o})}function o0({to:e,replace:a,state:r,relative:l}){ft(Xl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(Sn);Un(!o,"<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:c}=v.useContext(Zn),{pathname:m}=Hn(),h=Pa(),g=yc(e,yh(c),m,l==="path"),p=JSON.stringify(g);return v.useEffect(()=>{h(JSON.parse(p),{replace:a,state:r,relative:l})},[h,p,l,a,r]),null}function Km(e){return ZE(e.context)}function Oa(e){ft(!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 n_({basename:e="/",children:a=null,location:r,navigationType:l="POP",navigator:o,static:c=!1,unstable_useTransitions:m}){ft(!Xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),g=v.useMemo(()=>({basename:h,navigator:o,static:c,unstable_useTransitions:m,future:{}}),[h,o,c,m]);typeof r=="string"&&(r=Fl(r));let{pathname:p="/",search:b="",hash:x="",state:j=null,key:N="default",unstable_mask:z}=r,w=v.useMemo(()=>{let E=Za(p,h);return E==null?null:{location:{pathname:E,search:b,hash:x,state:j,key:N,unstable_mask:z},navigationType:l}},[h,p,b,x,j,N,l,z]);return Un(w!=null,`<Router basename="${h}"> is not able to match the URL "${p}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:v.createElement(Sn.Provider,{value:g},v.createElement(go.Provider,{children:a,value:w}))}function a_({children:e,location:a}){return IE(Fm(e),a)}function Fm(e,a=[]){let r=[];return v.Children.forEach(e,(l,o)=>{if(!v.isValidElement(l))return;let c=[...a,o];if(l.type===v.Fragment){r.push.apply(r,Fm(l.props.children,c));return}ft(l.type===Oa,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ft(!l.props.index||!l.props.children,"An index route cannot have child routes.");let m={id:l.props.id||c.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(m.children=Fm(l.props.children,c)),r.push(m)}),r}var tc="get",nc="application/x-www-form-urlencoded";function xc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function r_(e){return xc(e)&&e.tagName.toLowerCase()==="button"}function s_(e){return xc(e)&&e.tagName.toLowerCase()==="form"}function l_(e){return xc(e)&&e.tagName.toLowerCase()==="input"}function i_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function o_(e,a){return e.button===0&&(!a||a==="_self")&&!i_(e)}function Ym(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,r)=>{let l=e[r];return a.concat(Array.isArray(l)?l.map(o=>[r,o]):[[r,l]])},[]))}function u_(e,a){let r=Ym(e);return a&&a.forEach((l,o)=>{r.has(o)||a.getAll(o).forEach(c=>{r.append(o,c)})}),r}var Hu=null;function c_(){if(Hu===null)try{new FormData(document.createElement("form"),0),Hu=!1}catch{Hu=!0}return Hu}var d_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function cm(e){return e!=null&&!d_.has(e)?(Un(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nc}"`),null):e}function f_(e,a){let r,l,o,c,m;if(s_(e)){let h=e.getAttribute("action");l=h?Za(h,a):null,r=e.getAttribute("method")||tc,o=cm(e.getAttribute("enctype"))||nc,c=new FormData(e)}else if(r_(e)||l_(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=e.getAttribute("formaction")||h.getAttribute("action");if(l=g?Za(g,a):null,r=e.getAttribute("formmethod")||h.getAttribute("method")||tc,o=cm(e.getAttribute("formenctype"))||cm(h.getAttribute("enctype"))||nc,c=new FormData(h,e),!c_()){let{name:p,type:b,value:x}=e;if(b==="image"){let j=p?`${p}.`:"";c.append(`${j}x`,"0"),c.append(`${j}y`,"0")}else p&&c.append(p,x)}}else{if(xc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=tc,l=null,o=nc,m=e}return c&&o==="text/plain"&&(m=c,c=void 0),{action:l,method:r.toLowerCase(),encType:o,formData:c,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jh(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function m_(e,a,r,l){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:a&&Za(o.pathname,a)==="/"?o.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function h_(e,a){if(e.id in a)return a[e.id];try{let r=await import(e.module);return a[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function p_(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 g_(e,a,r){let l=await Promise.all(e.map(async o=>{let c=a.routes[o.route.id];if(c){let m=await h_(c,r);return m.links?m.links():[]}return[]}));return x_(l.flat(1).filter(p_).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function gb(e,a,r,l,o,c){let m=(g,p)=>r[p]?g.route.id!==r[p].route.id:!0,h=(g,p)=>{var b;return r[p].pathname!==g.pathname||((b=r[p].route.path)==null?void 0:b.endsWith("*"))&&r[p].params["*"]!==g.params["*"]};return c==="assets"?a.filter((g,p)=>m(g,p)||h(g,p)):c==="data"?a.filter((g,p)=>{var x;let b=l.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,p)||h(g,p))return!0;if(g.route.shouldRevalidate){let j=g.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((x=r[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function v_(e,a,{includeHydrateFallback:r}={}){return y_(e.map(l=>{let o=a.routes[l.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function y_(e){return[...new Set(e)]}function b_(e){let a={},r=Object.keys(e).sort();for(let l of r)a[l]=e[l];return a}function x_(e,a){let r=new Set;return new Set(a),e.reduce((l,o)=>{let c=JSON.stringify(b_(o));return r.has(c)||(r.add(c),l.push({key:c,link:o})),l},[])}function u0(){let e=v.useContext(Yl);return jh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function S_(){let e=v.useContext(bc);return jh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wh=v.createContext(void 0);wh.displayName="FrameworkContext";function c0(){let e=v.useContext(wh);return jh(e,"You must render this element inside a <HydratedRouter> element"),e}function j_(e,a){let r=v.useContext(wh),[l,o]=v.useState(!1),[c,m]=v.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:p,onMouseLeave:b,onTouchStart:x}=a,j=v.useRef(null);v.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let w=M=>{M.forEach(B=>{m(B.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return j.current&&E.observe(j.current),()=>{E.disconnect()}}},[e]),v.useEffect(()=>{if(l){let w=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(w)}}},[l]);let N=()=>{o(!0)},z=()=>{o(!1),m(!1)};return r?e!=="intent"?[c,j,{}]:[c,j,{onFocus:Gi(h,N),onBlur:Gi(g,z),onMouseEnter:Gi(p,N),onMouseLeave:Gi(b,z),onTouchStart:Gi(x,N)}]:[!1,j,{}]}function Gi(e,a){return r=>{e&&e(r),r.defaultPrevented||a(r)}}function w_({page:e,...a}){let{router:r}=u0(),l=v.useMemo(()=>Fx(r.routes,e,r.basename),[r.routes,e,r.basename]);return l?v.createElement(E_,{page:e,matches:l,...a}):null}function N_(e){let{manifest:a,routeModules:r}=c0(),[l,o]=v.useState([]);return v.useEffect(()=>{let c=!1;return g_(e,a,r).then(m=>{c||o(m)}),()=>{c=!0}},[e,a,r]),l}function E_({page:e,matches:a,...r}){let l=Hn(),{future:o,manifest:c,routeModules:m}=c0(),{basename:h}=u0(),{loaderData:g,matches:p}=S_(),b=v.useMemo(()=>gb(e,a,p,c,l,"data"),[e,a,p,c,l]),x=v.useMemo(()=>gb(e,a,p,c,l,"assets"),[e,a,p,c,l]),j=v.useMemo(()=>{if(e===l.pathname+l.search+l.hash)return[];let w=new Set,E=!1;if(a.forEach(B=>{var O;let D=c.routes[B.route.id];!D||!D.hasLoader||(!b.some(P=>P.route.id===B.route.id)&&B.route.id in g&&((O=m[B.route.id])!=null&&O.shouldRevalidate)||D.hasClientLoader?E=!0:w.add(B.route.id))}),w.size===0)return[];let M=m_(e,h,o.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&M.searchParams.set("_routes",a.filter(B=>w.has(B.route.id)).map(B=>B.route.id).join(",")),[M.pathname+M.search]},[h,o.unstable_trailingSlashAwareDataRequests,g,l,c,b,a,e,m]),N=v.useMemo(()=>v_(x,c),[x,c]),z=N_(x);return v.createElement(v.Fragment,null,j.map(w=>v.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),N.map(w=>v.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),z.map(({key:w,link:E})=>v.createElement("link",{key:w,nonce:r.nonce,...E,crossOrigin:E.crossOrigin??r.crossOrigin})))}function __(...e){return a=>{e.forEach(r=>{typeof r=="function"?r(a):r!=null&&(r.current=a)})}}var C_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{C_&&(window.__reactRouterVersion="7.13.1")}catch{}function k_({basename:e,children:a,unstable_useTransitions:r,window:l}){let o=v.useRef();o.current==null&&(o.current=rE({window:l,v5Compat:!0}));let c=o.current,[m,h]=v.useState({action:c.action,location:c.location}),g=v.useCallback(p=>{r===!1?h(p):v.startTransition(()=>h(p))},[r]);return v.useLayoutEffect(()=>c.listen(g),[c,g]),v.createElement(n_,{basename:e,children:a,location:m.location,navigationType:m.action,navigator:c,unstable_useTransitions:r})}var d0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,f0=v.forwardRef(function({onClick:a,discover:r="render",prefetch:l="none",relative:o,reloadDocument:c,replace:m,unstable_mask:h,state:g,target:p,to:b,preventScrollReset:x,viewTransition:j,unstable_defaultShouldRevalidate:N,...z},w){let{basename:E,navigator:M,unstable_useTransitions:B}=v.useContext(Sn),D=typeof b=="string"&&d0.test(b),O=Wx(b,E);b=O.to;let P=$E(b,{relative:o}),I=Hn(),L=null;if(h){let we=yc(h,[],I.unstable_mask?I.unstable_mask.pathname:"/",!0);E!=="/"&&(we.pathname=we.pathname==="/"?E:ca([E,we.pathname])),L=M.createHref(we)}let[K,le,Se]=j_(l,z),_e=T_(b,{replace:m,unstable_mask:h,state:g,target:p,preventScrollReset:x,relative:o,viewTransition:j,unstable_defaultShouldRevalidate:N,unstable_useTransitions:B});function se(we){a&&a(we),we.defaultPrevented||_e(we)}let ve=!(O.isExternal||c),Te=v.createElement("a",{...z,...Se,href:(ve?L:void 0)||O.absoluteURL||P,onClick:ve?se:a,ref:__(w,le),target:p,"data-discover":!D&&r==="render"?"true":void 0});return K&&!D?v.createElement(v.Fragment,null,Te,v.createElement(w_,{page:P})):Te});f0.displayName="Link";var m0=v.forwardRef(function({"aria-current":a="page",caseSensitive:r=!1,className:l="",end:o=!1,style:c,to:m,viewTransition:h,children:g,...p},b){let x=vo(m,{relative:p.relative}),j=Hn(),N=v.useContext(bc),{navigator:z,basename:w}=v.useContext(Sn),E=N!=null&&U_(x)&&h===!0,M=z.encodeLocation?z.encodeLocation(x).pathname:x.pathname,B=j.pathname,D=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;r||(B=B.toLowerCase(),D=D?D.toLowerCase():null,M=M.toLowerCase()),D&&w&&(D=Za(D,w)||D);const O=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let P=B===M||!o&&B.startsWith(M)&&B.charAt(O)==="/",I=D!=null&&(D===M||!o&&D.startsWith(M)&&D.charAt(M.length)==="/"),L={isActive:P,isPending:I,isTransitioning:E},K=P?a:void 0,le;typeof l=="function"?le=l(L):le=[l,P?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let Se=typeof c=="function"?c(L):c;return v.createElement(f0,{...p,"aria-current":K,className:le,ref:b,style:Se,to:m,viewTransition:h},typeof g=="function"?g(L):g)});m0.displayName="NavLink";var A_=v.forwardRef(({discover:e="render",fetcherKey:a,navigate:r,reloadDocument:l,replace:o,state:c,method:m=tc,action:h,onSubmit:g,relative:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:j,...N},z)=>{let{unstable_useTransitions:w}=v.useContext(Sn),E=M_(),M=D_(h,{relative:p}),B=m.toLowerCase()==="get"?"get":"post",D=typeof h=="string"&&d0.test(h),O=P=>{if(g&&g(P),P.defaultPrevented)return;P.preventDefault();let I=P.nativeEvent.submitter,L=(I==null?void 0:I.getAttribute("formmethod"))||m,K=()=>E(I||P.currentTarget,{fetcherKey:a,method:L,navigate:r,replace:o,state:c,relative:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:j});w&&r!==!1?v.startTransition(()=>K()):K()};return v.createElement("form",{ref:z,method:B,action:M,onSubmit:l?g:O,...N,"data-discover":!D&&e==="render"?"true":void 0})});A_.displayName="Form";function z_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function h0(e){let a=v.useContext(Yl);return ft(a,z_(e)),a}function T_(e,{target:a,replace:r,unstable_mask:l,state:o,preventScrollReset:c,relative:m,viewTransition:h,unstable_defaultShouldRevalidate:g,unstable_useTransitions:p}={}){let b=Pa(),x=Hn(),j=vo(e,{relative:m});return v.useCallback(N=>{if(o_(N,a)){N.preventDefault();let z=r!==void 0?r:no(x)===no(j),w=()=>b(e,{replace:z,unstable_mask:l,state:o,preventScrollReset:c,relative:m,viewTransition:h,unstable_defaultShouldRevalidate:g});p?v.startTransition(()=>w()):w()}},[x,b,j,r,l,o,a,e,c,m,h,g,p])}function p0(e){Un(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 a=v.useRef(Ym(e)),r=v.useRef(!1),l=Hn(),o=v.useMemo(()=>u_(l.search,r.current?null:a.current),[l.search]),c=Pa(),m=v.useCallback((h,g)=>{const p=Ym(typeof h=="function"?h(new URLSearchParams(o)):h);r.current=!0,c("?"+p,g)},[c,o]);return[o,m]}var R_=0,O_=()=>`__${String(++R_)}__`;function M_(){let{router:e}=h0("useSubmit"),{basename:a}=v.useContext(Sn),r=JE(),l=e.fetch,o=e.navigate;return v.useCallback(async(c,m={})=>{let{action:h,method:g,encType:p,formData:b,body:x}=f_(c,a);if(m.navigate===!1){let j=m.fetcherKey||O_();await l(j,r,m.action||h,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||p,flushSync:m.flushSync})}else await o(m.action||h,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||p,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[l,o,a,r])}function D_(e,{relative:a}={}){let{basename:r}=v.useContext(Sn),l=v.useContext(Zn);ft(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),c={...vo(e||".",{relative:a})},m=Hn();if(e==null){c.search=m.search;let h=new URLSearchParams(c.search),g=h.getAll("index");if(g.some(b=>b==="")){h.delete("index"),g.filter(x=>x).forEach(x=>h.append("index",x));let b=h.toString();c.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(c.pathname=c.pathname==="/"?r:ca([r,c.pathname])),no(c)}function U_(e,{relative:a}={}){let r=v.useContext(t0);ft(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=h0("useViewTransitionState"),o=vo(e,{relative:a});if(!r.isTransitioning)return!1;let c=Za(r.currentLocation.pathname,l)||r.currentLocation.pathname,m=Za(r.nextLocation.pathname,l)||r.nextLocation.pathname;return uc(o.pathname,m)!=null||uc(o.pathname,c)!=null}const L_="/api/v1";async function $_(e,a){const r=await fetch(`${L_}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:a})});if(!r.ok){const l=await r.text();let o;try{o=JSON.parse(l).error??l}catch{o=l}throw new Error(o)}return await r.json()}const g0="/api/v1",Nh="first-tree-hub:tokens";function Eh(){const e=localStorage.getItem(Nh);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function v0(e){localStorage.setItem(Nh,JSON.stringify(e))}function y0(){localStorage.removeItem(Nh)}class Sc extends Error{constructor(a,r,l){super(r),this.status=a,this.issues=l,this.name="ApiError"}}let Vi=null;async function q_(e){return Vi||(Vi=(async()=>{try{const a=await fetch(`${g0}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!a.ok)return null;const r=await a.json(),l={accessToken:r.accessToken,refreshToken:r.refreshToken??e};return v0(l),l}catch{return null}finally{Vi=null}})(),Vi)}async function Iu(e,a){const{method:r="GET",body:l}=a??{},o=h=>{const g={};return h&&(g.Authorization=`Bearer ${h}`),l!==void 0&&(g["Content-Type"]="application/json"),fetch(`${g0}${e}`,{method:r,headers:g,body:l!==void 0?JSON.stringify(l):void 0})},c=Eh();let m=await o(c==null?void 0:c.accessToken);if(m.status===401&&(c!=null&&c.refreshToken)){const h=await q_(c.refreshToken);h&&(m=await o(h.accessToken))}if(!m.ok){m.status===401&&(y0(),window.dispatchEvent(new CustomEvent("auth:logout")));const h=await m.text();let g,p;try{const b=JSON.parse(h);g=b.error??h,Array.isArray(b.details)&&(p=b.details.filter(x=>typeof x=="object"&&x!==null&&Array.isArray(x.path)))}catch{g=h}throw new Sc(m.status,g,p)}if(m.status!==204)return await m.json()}const Ae={get:e=>Iu(e),post:(e,a)=>Iu(e,{method:"POST",body:a}),patch:(e,a)=>Iu(e,{method:"PATCH",body:a}),delete:e=>Iu(e,{method:"DELETE"})},b0=v.createContext(null);function B_({children:e}){const[a,r]=v.useState(()=>!!Eh()),[l,o]=v.useState(null),[c,m]=v.useState(null),[h,g]=v.useState(null),p=v.useCallback(()=>{y0(),r(!1),o(null),m(null),g(null)},[]),b=v.useCallback(async()=>{try{const j=await Ae.get("/me");o(j.member.role),m(j.member.id),g(j.member.agentId)}catch{}},[]),x=v.useCallback(async(j,N)=>{const z=await $_(j,N);v0({accessToken:z.accessToken,refreshToken:z.refreshToken}),r(!0),await Ae.get("/me").then(w=>{o(w.member.role),m(w.member.id),g(w.member.agentId)}).catch(()=>{})},[]);return v.useEffect(()=>{a&&!l&&b()},[a,l,b]),v.useEffect(()=>{const j=()=>p();return window.addEventListener("auth:logout",j),()=>window.removeEventListener("auth:logout",j)},[p]),u.jsx(b0.Provider,{value:{isAuthenticated:a,role:l,memberId:c,agentId:h,login:x,logout:p},children:e})}function yo(){const e=v.useContext(b0);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function Z_(){const{isAuthenticated:e}=yo();return e?u.jsx(Km,{}):u.jsx(o0,{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 x0=(...e)=>e.filter((a,r,l)=>!!a&&a.trim()!==""&&l.indexOf(a)===r).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 H_=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 I_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,r,l)=>l?l.toUpperCase():r.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 vb=e=>{const a=I_(e);return a.charAt(0).toUpperCase()+a.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 Q_={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 P_=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="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 G_=v.forwardRef(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:o="",children:c,iconNode:m,...h},g)=>v.createElement("svg",{ref:g,...Q_,width:a,height:a,stroke:e,strokeWidth:l?Number(r)*24/Number(a):r,className:x0("lucide",o),...!c&&!P_(h)&&{"aria-hidden":"true"},...h},[...m.map(([p,b])=>v.createElement(p,b)),...Array.isArray(c)?c:[c]]));/**
|
|
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 Je=(e,a)=>{const r=v.forwardRef(({className:l,...o},c)=>v.createElement(G_,{ref:c,iconNode:a,className:x0(`lucide-${H_(vb(e))}`,`lucide-${e}`,l),...o}));return r.displayName=vb(e),r};/**
|
|
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 V_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],K_=Je("arrow-left",V_);/**
|
|
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 F_=[["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"}]],Y_=Je("bell",F_);/**
|
|
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 X_=[["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"}]],J_=Je("bot",X_);/**
|
|
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 W_=[["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"}]],e2=Je("cable",W_);/**
|
|
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 t2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],S0=Je("check",t2);/**
|
|
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 n2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],a2=Je("chevron-down",n2);/**
|
|
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 r2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],s2=Je("chevron-right",r2);/**
|
|
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 l2=[["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"}]],_h=Je("copy",l2);/**
|
|
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 i2=[["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"}]],j0=Je("ellipsis",i2);/**
|
|
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 o2=[["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"}]],u2=Je("layout-dashboard",o2);/**
|
|
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 c2=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],jc=Je("leaf",c2);/**
|
|
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 d2=[["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"}]],yb=Je("link-2",d2);/**
|
|
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 f2=[["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"}]],m2=Je("lock",f2);/**
|
|
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 h2=[["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"}]],p2=Je("log-out",h2);/**
|
|
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 g2=[["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"}]],w0=Je("message-square",g2);/**
|
|
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 v2=[["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"}]],y2=Je("moon",v2);/**
|
|
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 b2=[["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"}]],x2=Je("pause",b2);/**
|
|
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 S2=[["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"}]],N0=Je("pencil",S2);/**
|
|
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 j2=[["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"}]],E0=Je("play",j2);/**
|
|
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 w2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zs=Je("plus",w2);/**
|
|
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 N2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ch=Je("search",N2);/**
|
|
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 E2=[["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"}]],_2=Je("send",E2);/**
|
|
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 C2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],k2=Je("square",C2);/**
|
|
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 A2=[["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"}]],z2=Je("sun",A2);/**
|
|
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 T2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bb=Je("terminal",T2);/**
|
|
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 R2=[["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"}]],ao=Je("trash-2",R2);/**
|
|
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 O2=[["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"}]],M2=Je("triangle-alert",O2);/**
|
|
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 D2=[["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"}]],U2=Je("undo-2",D2);/**
|
|
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 L2=[["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"}]],$2=Je("unplug",L2);/**
|
|
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 q2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],B2=Je("x",q2);function _0(e){var a,r,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(a=0;a<o;a++)e[a]&&(r=_0(e[a]))&&(l&&(l+=" "),l+=r)}else for(r in e)e[r]&&(l&&(l+=" "),l+=r);return l}function C0(){for(var e,a,r=0,l="",o=arguments.length;r<o;r++)(e=arguments[r])&&(a=_0(e))&&(l&&(l+=" "),l+=a);return l}const Z2=(e,a)=>{const r=new Array(e.length+a.length);for(let l=0;l<e.length;l++)r[l]=e[l];for(let l=0;l<a.length;l++)r[e.length+l]=a[l];return r},H2=(e,a)=>({classGroupId:e,validator:a}),k0=(e=new Map,a=null,r)=>({nextPart:e,validators:a,classGroupId:r}),cc="-",xb=[],I2="arbitrary..",Q2=e=>{const a=G2(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return P2(m);const h=m.split(cc),g=h[0]===""&&h.length>1?1:0;return A0(h,g,a)},getConflictingClassGroupIds:(m,h)=>{if(h){const g=l[m],p=r[m];return g?p?Z2(p,g):g:p||xb}return r[m]||xb}}},A0=(e,a,r)=>{if(e.length-a===0)return r.classGroupId;const o=e[a],c=r.nextPart.get(o);if(c){const p=A0(e,a+1,c);if(p)return p}const m=r.validators;if(m===null)return;const h=a===0?e.join(cc):e.slice(a).join(cc),g=m.length;for(let p=0;p<g;p++){const b=m[p];if(b.validator(h))return b.classGroupId}},P2=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=e.slice(1,-1),r=a.indexOf(":"),l=a.slice(0,r);return l?I2+l:void 0})(),G2=e=>{const{theme:a,classGroups:r}=e;return V2(r,a)},V2=(e,a)=>{const r=k0();for(const l in e){const o=e[l];kh(o,r,l,a)}return r},kh=(e,a,r,l)=>{const o=e.length;for(let c=0;c<o;c++){const m=e[c];K2(m,a,r,l)}},K2=(e,a,r,l)=>{if(typeof e=="string"){F2(e,a,r);return}if(typeof e=="function"){Y2(e,a,r,l);return}X2(e,a,r,l)},F2=(e,a,r)=>{const l=e===""?a:z0(a,e);l.classGroupId=r},Y2=(e,a,r,l)=>{if(J2(e)){kh(e(l),a,r,l);return}a.validators===null&&(a.validators=[]),a.validators.push(H2(r,e))},X2=(e,a,r,l)=>{const o=Object.entries(e),c=o.length;for(let m=0;m<c;m++){const[h,g]=o[m];kh(g,z0(a,h),r,l)}},z0=(e,a)=>{let r=e;const l=a.split(cc),o=l.length;for(let c=0;c<o;c++){const m=l[c];let h=r.nextPart.get(m);h||(h=k0(),r.nextPart.set(m,h)),r=h}return r},J2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,W2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let a=0,r=Object.create(null),l=Object.create(null);const o=(c,m)=>{r[c]=m,a++,a>e&&(a=0,l=r,r=Object.create(null))};return{get(c){let m=r[c];if(m!==void 0)return m;if((m=l[c])!==void 0)return o(c,m),m},set(c,m){c in r?r[c]=m:o(c,m)}}},Xm="!",Sb=":",eC=[],jb=(e,a,r,l,o)=>({modifiers:e,hasImportantModifier:a,baseClassName:r,maybePostfixModifierPosition:l,isExternal:o}),tC=e=>{const{prefix:a,experimentalParseClassName:r}=e;let l=o=>{const c=[];let m=0,h=0,g=0,p;const b=o.length;for(let w=0;w<b;w++){const E=o[w];if(m===0&&h===0){if(E===Sb){c.push(o.slice(g,w)),g=w+1;continue}if(E==="/"){p=w;continue}}E==="["?m++:E==="]"?m--:E==="("?h++:E===")"&&h--}const x=c.length===0?o:o.slice(g);let j=x,N=!1;x.endsWith(Xm)?(j=x.slice(0,-1),N=!0):x.startsWith(Xm)&&(j=x.slice(1),N=!0);const z=p&&p>g?p-g:void 0;return jb(c,N,j,z)};if(a){const o=a+Sb,c=l;l=m=>m.startsWith(o)?c(m.slice(o.length)):jb(eC,!1,m,void 0,!0)}if(r){const o=l;l=c=>r({className:c,parseClassName:o})}return l},nC=e=>{const a=new Map;return e.orderSensitiveModifiers.forEach((r,l)=>{a.set(r,1e6+l)}),r=>{const l=[];let o=[];for(let c=0;c<r.length;c++){const m=r[c],h=m[0]==="[",g=a.has(m);h||g?(o.length>0&&(o.sort(),l.push(...o),o=[]),l.push(m)):o.push(m)}return o.length>0&&(o.sort(),l.push(...o)),l}},aC=e=>({cache:W2(e.cacheSize),parseClassName:tC(e),sortModifiers:nC(e),...Q2(e)}),rC=/\s+/,sC=(e,a)=>{const{parseClassName:r,getClassGroupId:l,getConflictingClassGroupIds:o,sortModifiers:c}=a,m=[],h=e.trim().split(rC);let g="";for(let p=h.length-1;p>=0;p-=1){const b=h[p],{isExternal:x,modifiers:j,hasImportantModifier:N,baseClassName:z,maybePostfixModifierPosition:w}=r(b);if(x){g=b+(g.length>0?" "+g:g);continue}let E=!!w,M=l(E?z.substring(0,w):z);if(!M){if(!E){g=b+(g.length>0?" "+g:g);continue}if(M=l(z),!M){g=b+(g.length>0?" "+g:g);continue}E=!1}const B=j.length===0?"":j.length===1?j[0]:c(j).join(":"),D=N?B+Xm:B,O=D+M;if(m.indexOf(O)>-1)continue;m.push(O);const P=o(M,E);for(let I=0;I<P.length;++I){const L=P[I];m.push(D+L)}g=b+(g.length>0?" "+g:g)}return g},lC=(...e)=>{let a=0,r,l,o="";for(;a<e.length;)(r=e[a++])&&(l=T0(r))&&(o&&(o+=" "),o+=l);return o},T0=e=>{if(typeof e=="string")return e;let a,r="";for(let l=0;l<e.length;l++)e[l]&&(a=T0(e[l]))&&(r&&(r+=" "),r+=a);return r},iC=(e,...a)=>{let r,l,o,c;const m=g=>{const p=a.reduce((b,x)=>x(b),e());return r=aC(p),l=r.cache.get,o=r.cache.set,c=h,h(g)},h=g=>{const p=l(g);if(p)return p;const b=sC(g,r);return o(g,b),b};return c=m,(...g)=>c(lC(...g))},oC=[],zt=e=>{const a=r=>r[e]||oC;return a.isThemeGetter=!0,a},R0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,O0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uC=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dC=/\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$/,fC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xr=e=>uC.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),Sr=e=>!!e&&Number.isInteger(Number(e)),dm=e=>e.endsWith("%")&&De(e.slice(0,-1)),Ta=e=>cC.test(e),M0=()=>!0,pC=e=>dC.test(e)&&!fC.test(e),Ah=()=>!1,gC=e=>mC.test(e),vC=e=>hC.test(e),yC=e=>!ue(e)&&!de(e),bC=e=>Br(e,L0,Ah),ue=e=>R0.test(e),ms=e=>Br(e,$0,pC),wb=e=>Br(e,CC,De),xC=e=>Br(e,B0,M0),SC=e=>Br(e,q0,Ah),Nb=e=>Br(e,D0,Ah),jC=e=>Br(e,U0,vC),Qu=e=>Br(e,Z0,gC),de=e=>O0.test(e),Ki=e=>Ts(e,$0),wC=e=>Ts(e,q0),Eb=e=>Ts(e,D0),NC=e=>Ts(e,L0),EC=e=>Ts(e,U0),Pu=e=>Ts(e,Z0,!0),_C=e=>Ts(e,B0,!0),Br=(e,a,r)=>{const l=R0.exec(e);return l?l[1]?a(l[1]):r(l[2]):!1},Ts=(e,a,r=!1)=>{const l=O0.exec(e);return l?l[1]?a(l[1]):r:!1},D0=e=>e==="position"||e==="percentage",U0=e=>e==="image"||e==="url",L0=e=>e==="length"||e==="size"||e==="bg-size",$0=e=>e==="length",CC=e=>e==="number",q0=e=>e==="family-name",B0=e=>e==="number"||e==="weight",Z0=e=>e==="shadow",kC=()=>{const e=zt("color"),a=zt("font"),r=zt("text"),l=zt("font-weight"),o=zt("tracking"),c=zt("leading"),m=zt("breakpoint"),h=zt("container"),g=zt("spacing"),p=zt("radius"),b=zt("shadow"),x=zt("inset-shadow"),j=zt("text-shadow"),N=zt("drop-shadow"),z=zt("blur"),w=zt("perspective"),E=zt("aspect"),M=zt("ease"),B=zt("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...O(),de,ue],I=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],K=()=>[de,ue,g],le=()=>[xr,"full","auto",...K()],Se=()=>[Sr,"none","subgrid",de,ue],_e=()=>["auto",{span:["full",Sr,de,ue]},Sr,de,ue],se=()=>[Sr,"auto",de,ue],ve=()=>["auto","min","max","fr",de,ue],Te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...K()],te=()=>[xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...K()],ce=()=>[xr,"screen","full","dvw","lvw","svw","min","max","fit",...K()],Ce=()=>[xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...K()],re=()=>[e,de,ue],T=()=>[...O(),Eb,Nb,{position:[de,ue]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",NC,bC,{size:[de,ue]}],ee=()=>[dm,Ki,ms],H=()=>["","none","full",p,de,ue],ne=()=>["",De,Ki,ms],fe=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[De,dm,Eb,Nb],Dt=()=>["","none",z,de,ue],jn=()=>["none",De,de,ue],wn=()=>["none",De,de,ue],fa=()=>[De,de,ue],Qt=()=>[xr,"full",...K()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ta],breakpoint:[Ta],color:[M0],container:[Ta],"drop-shadow":[Ta],ease:["in","out","in-out"],font:[yC],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ta],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ta],shadow:[Ta],spacing:["px",De],text:[Ta],"text-shadow":[Ta],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xr,ue,de,E]}],container:["container"],columns:[{columns:[De,ue,de,h]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:P()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Sr,"auto",de,ue]}],basis:[{basis:[xr,"full","auto",h,...K()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,xr,"auto","initial","none",ue]}],grow:[{grow:["",De,de,ue]}],shrink:[{shrink:["",De,de,ue]}],order:[{order:[Sr,"first","last","none",de,ue]}],"grid-cols":[{"grid-cols":Se()}],"col-start-end":[{col:_e()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":Se()}],"row-start-end":[{row:_e()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ve()}],"auto-rows":[{"auto-rows":ve()}],gap:[{gap:K()}],"gap-x":[{"gap-x":K()}],"gap-y":[{"gap-y":K()}],"justify-content":[{justify:[...Te(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...Te()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":Te()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],p:[{p:K()}],px:[{px:K()}],py:[{py:K()}],ps:[{ps:K()}],pe:[{pe:K()}],pbs:[{pbs:K()}],pbe:[{pbe:K()}],pt:[{pt:K()}],pr:[{pr:K()}],pb:[{pb:K()}],pl:[{pl:K()}],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":K()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":K()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...Ce()]}],"min-block-size":[{"min-block":["auto",...Ce()]}],"max-block-size":[{"max-block":["none",...Ce()]}],w:[{w:[h,"screen",...te()]}],"min-w":[{"min-w":[h,"screen","none",...te()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",r,Ki,ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,_C,xC]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dm,ue]}],"font-family":[{font:[wC,SC,a]}],"font-features":[{"font-features":[ue]}],"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:[o,de,ue]}],"line-clamp":[{"line-clamp":[De,"none",de,wb]}],leading:[{leading:[c,...K()]}],"list-image":[{"list-image":["none",de,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:re()}],"text-color":[{text:re()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",de,ms]}],"text-decoration-color":[{decoration:re()}],"underline-offset":[{"underline-offset":[De,"auto",de,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ue]}],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",de,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sr,de,ue],radial:["",de,ue],conic:[Sr,de,ue]},EC,jC]}],"bg-color":[{bg:re()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:re()}],"gradient-via":[{via:re()}],"gradient-to":[{to:re()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:re()}],"border-color-x":[{"border-x":re()}],"border-color-y":[{"border-y":re()}],"border-color-s":[{"border-s":re()}],"border-color-e":[{"border-e":re()}],"border-color-bs":[{"border-bs":re()}],"border-color-be":[{"border-be":re()}],"border-color-t":[{"border-t":re()}],"border-color-r":[{"border-r":re()}],"border-color-b":[{"border-b":re()}],"border-color-l":[{"border-l":re()}],"divide-color":[{divide:re()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,de,ue]}],"outline-w":[{outline:["",De,Ki,ms]}],"outline-color":[{outline:re()}],shadow:[{shadow:["","none",b,Pu,Qu]}],"shadow-color":[{shadow:re()}],"inset-shadow":[{"inset-shadow":["none",x,Pu,Qu]}],"inset-shadow-color":[{"inset-shadow":re()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:re()}],"ring-offset-w":[{"ring-offset":[De,ms]}],"ring-offset-color":[{"ring-offset":re()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":re()}],"text-shadow":[{"text-shadow":["none",j,Pu,Qu]}],"text-shadow-color":[{"text-shadow":re()}],opacity:[{opacity:[De,de,ue]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":re()}],"mask-image-linear-to-color":[{"mask-linear-to":re()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":re()}],"mask-image-t-to-color":[{"mask-t-to":re()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":re()}],"mask-image-r-to-color":[{"mask-r-to":re()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":re()}],"mask-image-b-to-color":[{"mask-b-to":re()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":re()}],"mask-image-l-to-color":[{"mask-l-to":re()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":re()}],"mask-image-x-to-color":[{"mask-x-to":re()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":re()}],"mask-image-y-to-color":[{"mask-y-to":re()}],"mask-image-radial":[{"mask-radial":[de,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":re()}],"mask-image-radial-to-color":[{"mask-radial-to":re()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":re()}],"mask-image-conic-to-color":[{"mask-conic-to":re()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ue]}],filter:[{filter:["","none",de,ue]}],blur:[{blur:Dt()}],brightness:[{brightness:[De,de,ue]}],contrast:[{contrast:[De,de,ue]}],"drop-shadow":[{"drop-shadow":["","none",N,Pu,Qu]}],"drop-shadow-color":[{"drop-shadow":re()}],grayscale:[{grayscale:["",De,de,ue]}],"hue-rotate":[{"hue-rotate":[De,de,ue]}],invert:[{invert:["",De,de,ue]}],saturate:[{saturate:[De,de,ue]}],sepia:[{sepia:["",De,de,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ue]}],"backdrop-blur":[{"backdrop-blur":Dt()}],"backdrop-brightness":[{"backdrop-brightness":[De,de,ue]}],"backdrop-contrast":[{"backdrop-contrast":[De,de,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,de,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,de,ue]}],"backdrop-invert":[{"backdrop-invert":["",De,de,ue]}],"backdrop-opacity":[{"backdrop-opacity":[De,de,ue]}],"backdrop-saturate":[{"backdrop-saturate":[De,de,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",De,de,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":K()}],"border-spacing-x":[{"border-spacing-x":K()}],"border-spacing-y":[{"border-spacing-y":K()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",de,ue]}],ease:[{ease:["linear","initial",M,de,ue]}],delay:[{delay:[De,de,ue]}],animate:[{animate:["none",B,de,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,de,ue]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:jn()}],"rotate-x":[{"rotate-x":jn()}],"rotate-y":[{"rotate-y":jn()}],"rotate-z":[{"rotate-z":jn()}],scale:[{scale:wn()}],"scale-x":[{"scale-x":wn()}],"scale-y":[{"scale-y":wn()}],"scale-z":[{"scale-z":wn()}],"scale-3d":["scale-3d"],skew:[{skew:fa()}],"skew-x":[{"skew-x":fa()}],"skew-y":[{"skew-y":fa()}],transform:[{transform:[de,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qt()}],"translate-x":[{"translate-x":Qt()}],"translate-y":[{"translate-y":Qt()}],"translate-z":[{"translate-z":Qt()}],"translate-none":["translate-none"],accent:[{accent:re()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:re()}],"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",de,ue]}],"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":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mbs":[{"scroll-mbs":K()}],"scroll-mbe":[{"scroll-mbe":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pbs":[{"scroll-pbs":K()}],"scroll-pbe":[{"scroll-pbe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"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",de,ue]}],fill:[{fill:["none",...re()]}],"stroke-w":[{stroke:[De,Ki,ms,wb]}],stroke:[{stroke:["none",...re()]}],"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"]}},AC=iC(kC);function je(...e){return AC(C0(e))}function da(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 zC(e){return Ae.delete(`/clients/${encodeURIComponent(e)}`)}function wc(){return Ae.get("/admin/agents/activity")}function Nc(){return Ae.get("/clients")}function TC(e){return Ae.post(`/clients/${e}/disconnect`)}function H0(){return Ae.post("/connect-tokens")}function RC(e){if(typeof e!="object"||e===null)return null;const a=e;return typeof a.toolUseId!="string"||typeof a.name!="string"||a.status!=="pending"&&a.status!=="ok"&&a.status!=="error"?null:{toolUseId:a.toolUseId,name:a.name,args:a.args,status:a.status,durationMs:typeof a.durationMs=="number"?a.durationMs:void 0,resultPreview:typeof a.resultPreview=="string"?a.resultPreview:void 0}}function OC(e){if(typeof e!="object"||e===null)return null;const a=e;return a.source!=="sdk"&&a.source!=="runtime"&&a.source!=="tool"||typeof a.message!="string"?null:{source:a.source,message:a.message}}function MC(e){if(typeof e!="object"||e===null)return null;const a=e;return typeof a.text!="string"?null:{text:a.text}}function Jl(e,a){const r=new URLSearchParams;a!=null&&a.state&&r.set("state",a.state),a!=null&&a.runtimeState&&r.set("runtimeState",a.runtimeState);const l=r.toString();return Ae.get(`/admin/sessions/agents/${e}${l?`?${l}`:""}`)}function DC(e,a,r){const l=new URLSearchParams;l.set("limit",String(r.limit)),(r==null?void 0:r.cursor)!==void 0&&l.set("cursor",String(r.cursor)),r!=null&&r.direction&&l.set("direction",r.direction);const o=l.toString();return Ae.get(`/admin/sessions/agents/${e}/${a}/events${o?`?${o}`:""}`)}function UC(e,a){return Ae.post(`/admin/sessions/agents/${e}/${a}/suspend`)}function LC(e,a){return Ae.post(`/admin/sessions/agents/${e}/${a}/resume`)}function $C(e,a){return Ae.post(`/admin/sessions/agents/${e}/${a}/terminate`)}var _b=1,qC=.9,BC=.8,ZC=.17,fm=.1,mm=.999,HC=.9999,IC=.99,QC=/[\\\/_+.#"@\[\(\{&]/,PC=/[\\\/_+.#"@\[\(\{&]/g,GC=/[\s-]/,I0=/[\s-]/g;function Jm(e,a,r,l,o,c,m){if(c===a.length)return o===e.length?_b:IC;var h=`${o},${c}`;if(m[h]!==void 0)return m[h];for(var g=l.charAt(c),p=r.indexOf(g,o),b=0,x,j,N,z;p>=0;)x=Jm(e,a,r,l,p+1,c+1,m),x>b&&(p===o?x*=_b:QC.test(e.charAt(p-1))?(x*=BC,N=e.slice(o,p-1).match(PC),N&&o>0&&(x*=Math.pow(mm,N.length))):GC.test(e.charAt(p-1))?(x*=qC,z=e.slice(o,p-1).match(I0),z&&o>0&&(x*=Math.pow(mm,z.length))):(x*=ZC,o>0&&(x*=Math.pow(mm,p-o))),e.charAt(p)!==a.charAt(c)&&(x*=HC)),(x<fm&&r.charAt(p-1)===l.charAt(c+1)||l.charAt(c+1)===l.charAt(c)&&r.charAt(p-1)!==l.charAt(c))&&(j=Jm(e,a,r,l,p+1,c+2,m),j*fm>x&&(x=j*fm)),x>b&&(b=x),p=r.indexOf(g,p+1);return m[h]=b,b}function Cb(e){return e.toLowerCase().replace(I0," ")}function VC(e,a,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Jm(e,a,Cb(e),Cb(a),0,0,{})}function Dr(e,a,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return a==null?void 0:a(o)}}function kb(e,a){if(typeof e=="function")return e(a);e!=null&&(e.current=a)}function Ur(...e){return a=>{let r=!1;const l=e.map(o=>{const c=kb(o,a);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let o=0;o<l.length;o++){const c=l[o];typeof c=="function"?c():kb(e[o],null)}}}}function Rs(...e){return v.useCallback(Ur(...e),e)}function KC(e,a){const r=v.createContext(a),l=c=>{const{children:m,...h}=c,g=v.useMemo(()=>h,Object.values(h));return u.jsx(r.Provider,{value:g,children:m})};l.displayName=e+"Provider";function o(c){const m=v.useContext(r);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[l,o]}function FC(e,a=[]){let r=[];function l(c,m){const h=v.createContext(m),g=r.length;r=[...r,m];const p=x=>{var M;const{scope:j,children:N,...z}=x,w=((M=j==null?void 0:j[e])==null?void 0:M[g])||h,E=v.useMemo(()=>z,Object.values(z));return u.jsx(w.Provider,{value:E,children:N})};p.displayName=c+"Provider";function b(x,j){var w;const N=((w=j==null?void 0:j[e])==null?void 0:w[g])||h,z=v.useContext(N);if(z)return z;if(m!==void 0)return m;throw new Error(`\`${x}\` must be used within \`${c}\``)}return[p,b]}const o=()=>{const c=r.map(m=>v.createContext(m));return function(h){const g=(h==null?void 0:h[e])||c;return v.useMemo(()=>({[`__scope${e}`]:{...h,[e]:g}}),[h,g])}};return o.scopeName=e,[l,YC(o,...a)]}function YC(...e){const a=e[0];if(e.length===1)return a;const r=()=>{const l=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const m=l.reduce((h,{useScope:g,scopeName:p})=>{const x=g(c)[`__scope${p}`];return{...h,...x}},{});return v.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return r.scopeName=a.scopeName,r}var ro=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},XC=fh[" useId ".trim().toString()]||(()=>{}),JC=0;function qa(e){const[a,r]=v.useState(XC());return ro(()=>{r(l=>l??String(JC++))},[e]),a?`radix-${a}`:""}var WC=fh[" useInsertionEffect ".trim().toString()]||ro;function ek({prop:e,defaultProp:a,onChange:r=()=>{},caller:l}){const[o,c,m]=tk({defaultProp:a,onChange:r}),h=e!==void 0,g=h?e:o;{const b=v.useRef(e!==void 0);v.useEffect(()=>{const x=b.current;x!==h&&console.warn(`${l} is changing from ${x?"controlled":"uncontrolled"} to ${h?"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.`),b.current=h},[h,l])}const p=v.useCallback(b=>{var x;if(h){const j=nk(b)?b(e):b;j!==e&&((x=m.current)==null||x.call(m,j))}else c(b)},[h,e,c,m]);return[g,p]}function tk({defaultProp:e,onChange:a}){const[r,l]=v.useState(e),o=v.useRef(r),c=v.useRef(a);return WC(()=>{c.current=a},[a]),v.useEffect(()=>{var m;o.current!==r&&((m=c.current)==null||m.call(c,r),o.current=r)},[r,o]),[r,l,c]}function nk(e){return typeof e=="function"}var Q0=Ux();const ak=Dx(Q0);function P0(e){const a=rk(e),r=v.forwardRef((l,o)=>{const{children:c,...m}=l,h=v.Children.toArray(c),g=h.find(lk);if(g){const p=g.props.children,b=h.map(x=>x===g?v.Children.count(p)>1?v.Children.only(null):v.isValidElement(p)?p.props.children:null:x);return u.jsx(a,{...m,ref:o,children:v.isValidElement(p)?v.cloneElement(p,void 0,b):null})}return u.jsx(a,{...m,ref:o,children:c})});return r.displayName=`${e}.Slot`,r}function rk(e){const a=v.forwardRef((r,l)=>{const{children:o,...c}=r;if(v.isValidElement(o)){const m=ok(o),h=ik(c,o.props);return o.type!==v.Fragment&&(h.ref=l?Ur(l,m):m),v.cloneElement(o,h)}return v.Children.count(o)>1?v.Children.only(null):null});return a.displayName=`${e}.SlotClone`,a}var sk=Symbol("radix.slottable");function lk(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sk}function ik(e,a){const r={...a};for(const l in a){const o=e[l],c=a[l];/^on[A-Z]/.test(l)?o&&c?r[l]=(...h)=>{const g=c(...h);return o(...h),g}:o&&(r[l]=o):l==="style"?r[l]={...o,...c}:l==="className"&&(r[l]=[o,c].filter(Boolean).join(" "))}return{...e,...r}}function ok(e){var l,o;let a=(l=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:l.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var uk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ga=uk.reduce((e,a)=>{const r=P0(`Primitive.${a}`),l=v.forwardRef((o,c)=>{const{asChild:m,...h}=o,g=m?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...h,ref:c})});return l.displayName=`Primitive.${a}`,{...e,[a]:l}},{});function ck(e,a){e&&Q0.flushSync(()=>e.dispatchEvent(a))}function so(e){const a=v.useRef(e);return v.useEffect(()=>{a.current=e}),v.useMemo(()=>(...r)=>{var l;return(l=a.current)==null?void 0:l.call(a,...r)},[])}function dk(e,a=globalThis==null?void 0:globalThis.document){const r=so(e);v.useEffect(()=>{const l=o=>{o.key==="Escape"&&r(o)};return a.addEventListener("keydown",l,{capture:!0}),()=>a.removeEventListener("keydown",l,{capture:!0})},[r,a])}var fk="DismissableLayer",Wm="dismissableLayer.update",mk="dismissableLayer.pointerDownOutside",hk="dismissableLayer.focusOutside",Ab,G0=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),V0=v.forwardRef((e,a)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:l,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:m,onDismiss:h,...g}=e,p=v.useContext(G0),[b,x]=v.useState(null),j=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,N]=v.useState({}),z=Rs(a,L=>x(L)),w=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),M=w.indexOf(E),B=b?w.indexOf(b):-1,D=p.layersWithOutsidePointerEventsDisabled.size>0,O=B>=M,P=vk(L=>{const K=L.target,le=[...p.branches].some(Se=>Se.contains(K));!O||le||(o==null||o(L),m==null||m(L),L.defaultPrevented||h==null||h())},j),I=yk(L=>{const K=L.target;[...p.branches].some(Se=>Se.contains(K))||(c==null||c(L),m==null||m(L),L.defaultPrevented||h==null||h())},j);return dk(L=>{B===p.layers.size-1&&(l==null||l(L),!L.defaultPrevented&&h&&(L.preventDefault(),h()))},j),v.useEffect(()=>{if(b)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Ab=j.body.style.pointerEvents,j.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),zb(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(j.body.style.pointerEvents=Ab)}},[b,j,r,p]),v.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),zb())},[b,p]),v.useEffect(()=>{const L=()=>N({});return document.addEventListener(Wm,L),()=>document.removeEventListener(Wm,L)},[]),u.jsx(Ga.div,{...g,ref:z,style:{pointerEvents:D?O?"auto":"none":void 0,...e.style},onFocusCapture:Dr(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Dr(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Dr(e.onPointerDownCapture,P.onPointerDownCapture)})});V0.displayName=fk;var pk="DismissableLayerBranch",gk=v.forwardRef((e,a)=>{const r=v.useContext(G0),l=v.useRef(null),o=Rs(a,l);return v.useEffect(()=>{const c=l.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),u.jsx(Ga.div,{...e,ref:o})});gk.displayName=pk;function vk(e,a=globalThis==null?void 0:globalThis.document){const r=so(e),l=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const c=h=>{if(h.target&&!l.current){let g=function(){K0(mk,r,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(a.removeEventListener("click",o.current),o.current=g,a.addEventListener("click",o.current,{once:!0})):g()}else a.removeEventListener("click",o.current);l.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",c),a.removeEventListener("click",o.current)}},[a,r]),{onPointerDownCapture:()=>l.current=!0}}function yk(e,a=globalThis==null?void 0:globalThis.document){const r=so(e),l=v.useRef(!1);return v.useEffect(()=>{const o=c=>{c.target&&!l.current&&K0(hk,r,{originalEvent:c},{discrete:!1})};return a.addEventListener("focusin",o),()=>a.removeEventListener("focusin",o)},[a,r]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function zb(){const e=new CustomEvent(Wm);document.dispatchEvent(e)}function K0(e,a,r,{discrete:l}){const o=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});a&&o.addEventListener(e,a,{once:!0}),l?ck(o,c):o.dispatchEvent(c)}var hm="focusScope.autoFocusOnMount",pm="focusScope.autoFocusOnUnmount",Tb={bubbles:!1,cancelable:!0},bk="FocusScope",F0=v.forwardRef((e,a)=>{const{loop:r=!1,trapped:l=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...m}=e,[h,g]=v.useState(null),p=so(o),b=so(c),x=v.useRef(null),j=Rs(a,w=>g(w)),N=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(l){let w=function(D){if(N.paused||!h)return;const O=D.target;h.contains(O)?x.current=O:wr(x.current,{select:!0})},E=function(D){if(N.paused||!h)return;const O=D.relatedTarget;O!==null&&(h.contains(O)||wr(x.current,{select:!0}))},M=function(D){if(document.activeElement===document.body)for(const P of D)P.removedNodes.length>0&&wr(h)};document.addEventListener("focusin",w),document.addEventListener("focusout",E);const B=new MutationObserver(M);return h&&B.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),B.disconnect()}}},[l,h,N.paused]),v.useEffect(()=>{if(h){Ob.add(N);const w=document.activeElement;if(!h.contains(w)){const M=new CustomEvent(hm,Tb);h.addEventListener(hm,p),h.dispatchEvent(M),M.defaultPrevented||(xk(Ek(Y0(h)),{select:!0}),document.activeElement===w&&wr(h))}return()=>{h.removeEventListener(hm,p),setTimeout(()=>{const M=new CustomEvent(pm,Tb);h.addEventListener(pm,b),h.dispatchEvent(M),M.defaultPrevented||wr(w??document.body,{select:!0}),h.removeEventListener(pm,b),Ob.remove(N)},0)}}},[h,p,b,N]);const z=v.useCallback(w=>{if(!r&&!l||N.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,M=document.activeElement;if(E&&M){const B=w.currentTarget,[D,O]=Sk(B);D&&O?!w.shiftKey&&M===O?(w.preventDefault(),r&&wr(D,{select:!0})):w.shiftKey&&M===D&&(w.preventDefault(),r&&wr(O,{select:!0})):M===B&&w.preventDefault()}},[r,l,N.paused]);return u.jsx(Ga.div,{tabIndex:-1,...m,ref:j,onKeyDown:z})});F0.displayName=bk;function xk(e,{select:a=!1}={}){const r=document.activeElement;for(const l of e)if(wr(l,{select:a}),document.activeElement!==r)return}function Sk(e){const a=Y0(e),r=Rb(a,e),l=Rb(a.reverse(),e);return[r,l]}function Y0(e){const a=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const o=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||o?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)a.push(r.currentNode);return a}function Rb(e,a){for(const r of e)if(!jk(r,{upTo:a}))return r}function jk(e,{upTo:a}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(a!==void 0&&e===a)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wk(e){return e instanceof HTMLInputElement&&"select"in e}function wr(e,{select:a=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&wk(e)&&a&&e.select()}}var Ob=Nk();function Nk(){let e=[];return{add(a){const r=e[0];a!==r&&(r==null||r.pause()),e=Mb(e,a),e.unshift(a)},remove(a){var r;e=Mb(e,a),(r=e[0])==null||r.resume()}}}function Mb(e,a){const r=[...e],l=r.indexOf(a);return l!==-1&&r.splice(l,1),r}function Ek(e){return e.filter(a=>a.tagName!=="A")}var _k="Portal",X0=v.forwardRef((e,a)=>{var h;const{container:r,...l}=e,[o,c]=v.useState(!1);ro(()=>c(!0),[]);const m=r||o&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return m?ak.createPortal(u.jsx(Ga.div,{...l,ref:a}),m):null});X0.displayName=_k;function Ck(e,a){return v.useReducer((r,l)=>a[r][l]??r,e)}var Ec=e=>{const{present:a,children:r}=e,l=kk(a),o=typeof r=="function"?r({present:l.isPresent}):v.Children.only(r),c=Rs(l.ref,Ak(o));return typeof r=="function"||l.isPresent?v.cloneElement(o,{ref:c}):null};Ec.displayName="Presence";function kk(e){const[a,r]=v.useState(),l=v.useRef(null),o=v.useRef(e),c=v.useRef("none"),m=e?"mounted":"unmounted",[h,g]=Ck(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const p=Gu(l.current);c.current=h==="mounted"?p:"none"},[h]),ro(()=>{const p=l.current,b=o.current;if(b!==e){const j=c.current,N=Gu(p);e?g("MOUNT"):N==="none"||(p==null?void 0:p.display)==="none"?g("UNMOUNT"):g(b&&j!==N?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,g]),ro(()=>{if(a){let p;const b=a.ownerDocument.defaultView??window,x=N=>{const w=Gu(l.current).includes(CSS.escape(N.animationName));if(N.target===a&&w&&(g("ANIMATION_END"),!o.current)){const E=a.style.animationFillMode;a.style.animationFillMode="forwards",p=b.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=E)})}},j=N=>{N.target===a&&(c.current=Gu(l.current))};return a.addEventListener("animationstart",j),a.addEventListener("animationcancel",x),a.addEventListener("animationend",x),()=>{b.clearTimeout(p),a.removeEventListener("animationstart",j),a.removeEventListener("animationcancel",x),a.removeEventListener("animationend",x)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:v.useCallback(p=>{l.current=p?getComputedStyle(p):null,r(p)},[])}}function Gu(e){return(e==null?void 0:e.animationName)||"none"}function Ak(e){var l,o;let a=(l=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:l.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var gm=0;function zk(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Db()),document.body.insertAdjacentElement("beforeend",e[1]??Db()),gm++,()=>{gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),gm--}},[])}function Db(){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 oa=function(){return oa=Object.assign||function(a){for(var r,l=1,o=arguments.length;l<o;l++){r=arguments[l];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(a[c]=r[c])}return a},oa.apply(this,arguments)};function J0(e,a){var r={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&a.indexOf(l)<0&&(r[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(e);o<l.length;o++)a.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(r[l[o]]=e[l[o]]);return r}function Tk(e,a,r){if(r||arguments.length===2)for(var l=0,o=a.length,c;l<o;l++)(c||!(l in a))&&(c||(c=Array.prototype.slice.call(a,0,l)),c[l]=a[l]);return e.concat(c||Array.prototype.slice.call(a))}var ac="right-scroll-bar-position",rc="width-before-scroll-bar",Rk="with-scroll-bars-hidden",Ok="--removed-body-scroll-bar-size";function vm(e,a){return typeof e=="function"?e(a):e&&(e.current=a),e}function Mk(e,a){var r=v.useState(function(){return{value:e,callback:a,facade:{get current(){return r.value},set current(l){var o=r.value;o!==l&&(r.value=l,r.callback(l,o))}}}})[0];return r.callback=a,r.facade}var Dk=typeof window<"u"?v.useLayoutEffect:v.useEffect,Ub=new WeakMap;function Uk(e,a){var r=Mk(null,function(l){return e.forEach(function(o){return vm(o,l)})});return Dk(function(){var l=Ub.get(r);if(l){var o=new Set(l),c=new Set(e),m=r.current;o.forEach(function(h){c.has(h)||vm(h,null)}),c.forEach(function(h){o.has(h)||vm(h,m)})}Ub.set(r,e)},[e]),r}function Lk(e){return e}function $k(e,a){a===void 0&&(a=Lk);var r=[],l=!1,o={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var m=a(c,l);return r.push(m),function(){r=r.filter(function(h){return h!==m})}},assignSyncMedium:function(c){for(l=!0;r.length;){var m=r;r=[],m.forEach(c)}r={push:function(h){return c(h)},filter:function(){return r}}},assignMedium:function(c){l=!0;var m=[];if(r.length){var h=r;r=[],h.forEach(c),m=r}var g=function(){var b=m;m=[],b.forEach(c)},p=function(){return Promise.resolve().then(g)};p(),r={push:function(b){m.push(b),p()},filter:function(b){return m=m.filter(b),r}}}};return o}function qk(e){e===void 0&&(e={});var a=$k(null);return a.options=oa({async:!0,ssr:!1},e),a}var W0=function(e){var a=e.sideCar,r=J0(e,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=a.read();if(!l)throw new Error("Sidecar medium not found");return v.createElement(l,oa({},r))};W0.isSideCarExport=!0;function Bk(e,a){return e.useMedium(a),W0}var eS=qk(),ym=function(){},_c=v.forwardRef(function(e,a){var r=v.useRef(null),l=v.useState({onScrollCapture:ym,onWheelCapture:ym,onTouchMoveCapture:ym}),o=l[0],c=l[1],m=e.forwardProps,h=e.children,g=e.className,p=e.removeScrollBar,b=e.enabled,x=e.shards,j=e.sideCar,N=e.noRelative,z=e.noIsolation,w=e.inert,E=e.allowPinchZoom,M=e.as,B=M===void 0?"div":M,D=e.gapMode,O=J0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=j,I=Uk([r,a]),L=oa(oa({},O),o);return v.createElement(v.Fragment,null,b&&v.createElement(P,{sideCar:eS,removeScrollBar:p,shards:x,noRelative:N,noIsolation:z,inert:w,setCallbacks:c,allowPinchZoom:!!E,lockRef:r,gapMode:D}),m?v.cloneElement(v.Children.only(h),oa(oa({},L),{ref:I})):v.createElement(B,oa({},L,{className:g,ref:I}),h))});_c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_c.classNames={fullWidth:rc,zeroRight:ac};var Zk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Hk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var a=Zk();return a&&e.setAttribute("nonce",a),e}function Ik(e,a){e.styleSheet?e.styleSheet.cssText=a:e.appendChild(document.createTextNode(a))}function Qk(e){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(e)}var Pk=function(){var e=0,a=null;return{add:function(r){e==0&&(a=Hk())&&(Ik(a,r),Qk(a)),e++},remove:function(){e--,!e&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},Gk=function(){var e=Pk();return function(a,r){v.useEffect(function(){return e.add(a),function(){e.remove()}},[a&&r])}},tS=function(){var e=Gk(),a=function(r){var l=r.styles,o=r.dynamic;return e(l,o),null};return a},Vk={left:0,top:0,right:0,gap:0},bm=function(e){return parseInt(e||"",10)||0},Kk=function(e){var a=window.getComputedStyle(document.body),r=a[e==="padding"?"paddingLeft":"marginLeft"],l=a[e==="padding"?"paddingTop":"marginTop"],o=a[e==="padding"?"paddingRight":"marginRight"];return[bm(r),bm(l),bm(o)]},Fk=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Vk;var a=Kk(e),r=document.documentElement.clientWidth,l=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,l-r+a[2]-a[0])}},Yk=tS(),zl="data-scroll-locked",Xk=function(e,a,r,l){var o=e.left,c=e.top,m=e.right,h=e.gap;return r===void 0&&(r="margin"),`
|
|
251
|
-
.`.concat(Rk,` {
|
|
252
|
-
overflow: hidden `).concat(l,`;
|
|
253
|
-
padding-right: `).concat(h,"px ").concat(l,`;
|
|
254
|
-
}
|
|
255
|
-
body[`).concat(zl,`] {
|
|
256
|
-
overflow: hidden `).concat(l,`;
|
|
257
|
-
overscroll-behavior: contain;
|
|
258
|
-
`).concat([a&&"position: relative ".concat(l,";"),r==="margin"&&`
|
|
259
|
-
padding-left: `.concat(o,`px;
|
|
260
|
-
padding-top: `).concat(c,`px;
|
|
261
|
-
padding-right: `).concat(m,`px;
|
|
262
|
-
margin-left:0;
|
|
263
|
-
margin-top:0;
|
|
264
|
-
margin-right: `).concat(h,"px ").concat(l,`;
|
|
265
|
-
`),r==="padding"&&"padding-right: ".concat(h,"px ").concat(l,";")].filter(Boolean).join(""),`
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.`).concat(ac,` {
|
|
269
|
-
right: `).concat(h,"px ").concat(l,`;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.`).concat(rc,` {
|
|
273
|
-
margin-right: `).concat(h,"px ").concat(l,`;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.`).concat(ac," .").concat(ac,` {
|
|
277
|
-
right: 0 `).concat(l,`;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.`).concat(rc," .").concat(rc,` {
|
|
281
|
-
margin-right: 0 `).concat(l,`;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
body[`).concat(zl,`] {
|
|
285
|
-
`).concat(Ok,": ").concat(h,`px;
|
|
286
|
-
}
|
|
287
|
-
`)},Lb=function(){var e=parseInt(document.body.getAttribute(zl)||"0",10);return isFinite(e)?e:0},Jk=function(){v.useEffect(function(){return document.body.setAttribute(zl,(Lb()+1).toString()),function(){var e=Lb()-1;e<=0?document.body.removeAttribute(zl):document.body.setAttribute(zl,e.toString())}},[])},Wk=function(e){var a=e.noRelative,r=e.noImportant,l=e.gapMode,o=l===void 0?"margin":l;Jk();var c=v.useMemo(function(){return Fk(o)},[o]);return v.createElement(Yk,{styles:Xk(c,!a,o,r?"":"!important")})},eh=!1;if(typeof window<"u")try{var Vu=Object.defineProperty({},"passive",{get:function(){return eh=!0,!0}});window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{eh=!1}var jl=eh?{passive:!1}:!1,eA=function(e){return e.tagName==="TEXTAREA"},nS=function(e,a){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[a]!=="hidden"&&!(r.overflowY===r.overflowX&&!eA(e)&&r[a]==="visible")},tA=function(e){return nS(e,"overflowY")},nA=function(e){return nS(e,"overflowX")},$b=function(e,a){var r=a.ownerDocument,l=a;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var o=aS(e,l);if(o){var c=rS(e,l),m=c[1],h=c[2];if(m>h)return!0}l=l.parentNode}while(l&&l!==r.body);return!1},aA=function(e){var a=e.scrollTop,r=e.scrollHeight,l=e.clientHeight;return[a,r,l]},rA=function(e){var a=e.scrollLeft,r=e.scrollWidth,l=e.clientWidth;return[a,r,l]},aS=function(e,a){return e==="v"?tA(a):nA(a)},rS=function(e,a){return e==="v"?aA(a):rA(a)},sA=function(e,a){return e==="h"&&a==="rtl"?-1:1},lA=function(e,a,r,l,o){var c=sA(e,window.getComputedStyle(a).direction),m=c*l,h=r.target,g=a.contains(h),p=!1,b=m>0,x=0,j=0;do{if(!h)break;var N=rS(e,h),z=N[0],w=N[1],E=N[2],M=w-E-c*z;(z||M)&&aS(e,h)&&(x+=M,j+=z);var B=h.parentNode;h=B&&B.nodeType===Node.DOCUMENT_FRAGMENT_NODE?B.host:B}while(!g&&h!==document.body||g&&(a.contains(h)||a===h));return(b&&Math.abs(x)<1||!b&&Math.abs(j)<1)&&(p=!0),p},Ku=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qb=function(e){return[e.deltaX,e.deltaY]},Bb=function(e){return e&&"current"in e?e.current:e},iA=function(e,a){return e[0]===a[0]&&e[1]===a[1]},oA=function(e){return`
|
|
288
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
289
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
290
|
-
`)},uA=0,wl=[];function cA(e){var a=v.useRef([]),r=v.useRef([0,0]),l=v.useRef(),o=v.useState(uA++)[0],c=v.useState(tS)[0],m=v.useRef(e);v.useEffect(function(){m.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=Tk([e.lockRef.current],(e.shards||[]).map(Bb),!0).filter(Boolean);return w.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var h=v.useCallback(function(w,E){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!m.current.allowPinchZoom;var M=Ku(w),B=r.current,D="deltaX"in w?w.deltaX:B[0]-M[0],O="deltaY"in w?w.deltaY:B[1]-M[1],P,I=w.target,L=Math.abs(D)>Math.abs(O)?"h":"v";if("touches"in w&&L==="h"&&I.type==="range")return!1;var K=window.getSelection(),le=K&&K.anchorNode,Se=le?le===I||le.contains(I):!1;if(Se)return!1;var _e=$b(L,I);if(!_e)return!0;if(_e?P=L:(P=L==="v"?"h":"v",_e=$b(L,I)),!_e)return!1;if(!l.current&&"changedTouches"in w&&(D||O)&&(l.current=P),!P)return!0;var se=l.current||P;return lA(se,E,w,se==="h"?D:O)},[]),g=v.useCallback(function(w){var E=w;if(!(!wl.length||wl[wl.length-1]!==c)){var M="deltaY"in E?qb(E):Ku(E),B=a.current.filter(function(P){return P.name===E.type&&(P.target===E.target||E.target===P.shadowParent)&&iA(P.delta,M)})[0];if(B&&B.should){E.cancelable&&E.preventDefault();return}if(!B){var D=(m.current.shards||[]).map(Bb).filter(Boolean).filter(function(P){return P.contains(E.target)}),O=D.length>0?h(E,D[0]):!m.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),p=v.useCallback(function(w,E,M,B){var D={name:w,delta:E,target:M,should:B,shadowParent:dA(M)};a.current.push(D),setTimeout(function(){a.current=a.current.filter(function(O){return O!==D})},1)},[]),b=v.useCallback(function(w){r.current=Ku(w),l.current=void 0},[]),x=v.useCallback(function(w){p(w.type,qb(w),w.target,h(w,e.lockRef.current))},[]),j=v.useCallback(function(w){p(w.type,Ku(w),w.target,h(w,e.lockRef.current))},[]);v.useEffect(function(){return wl.push(c),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:j}),document.addEventListener("wheel",g,jl),document.addEventListener("touchmove",g,jl),document.addEventListener("touchstart",b,jl),function(){wl=wl.filter(function(w){return w!==c}),document.removeEventListener("wheel",g,jl),document.removeEventListener("touchmove",g,jl),document.removeEventListener("touchstart",b,jl)}},[]);var N=e.removeScrollBar,z=e.inert;return v.createElement(v.Fragment,null,z?v.createElement(c,{styles:oA(o)}):null,N?v.createElement(Wk,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dA(e){for(var a=null;e!==null;)e instanceof ShadowRoot&&(a=e.host,e=e.host),e=e.parentNode;return a}const fA=Bk(eS,cA);var sS=v.forwardRef(function(e,a){return v.createElement(_c,oa({},e,{ref:a,sideCar:fA}))});sS.classNames=_c.classNames;var mA=function(e){if(typeof document>"u")return null;var a=Array.isArray(e)?e[0]:e;return a.ownerDocument.body},Nl=new WeakMap,Fu=new WeakMap,Yu={},xm=0,lS=function(e){return e&&(e.host||lS(e.parentNode))},hA=function(e,a){return a.map(function(r){if(e.contains(r))return r;var l=lS(r);return l&&e.contains(l)?l:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},pA=function(e,a,r,l){var o=hA(a,Array.isArray(e)?e:[e]);Yu[r]||(Yu[r]=new WeakMap);var c=Yu[r],m=[],h=new Set,g=new Set(o),p=function(x){!x||h.has(x)||(h.add(x),p(x.parentNode))};o.forEach(p);var b=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(j){if(h.has(j))b(j);else try{var N=j.getAttribute(l),z=N!==null&&N!=="false",w=(Nl.get(j)||0)+1,E=(c.get(j)||0)+1;Nl.set(j,w),c.set(j,E),m.push(j),w===1&&z&&Fu.set(j,!0),E===1&&j.setAttribute(r,"true"),z||j.setAttribute(l,"true")}catch(M){console.error("aria-hidden: cannot operate on ",j,M)}})};return b(a),h.clear(),xm++,function(){m.forEach(function(x){var j=Nl.get(x)-1,N=c.get(x)-1;Nl.set(x,j),c.set(x,N),j||(Fu.has(x)||x.removeAttribute(l),Fu.delete(x)),N||x.removeAttribute(r)}),xm--,xm||(Nl=new WeakMap,Nl=new WeakMap,Fu=new WeakMap,Yu={})}},gA=function(e,a,r){r===void 0&&(r="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),o=mA(e);return o?(l.push.apply(l,Array.from(o.querySelectorAll("[aria-live], script"))),pA(l,o,r,"aria-hidden")):function(){return null}},Cc="Dialog",[iS]=FC(Cc),[vA,Jn]=iS(Cc),oS=e=>{const{__scopeDialog:a,children:r,open:l,defaultOpen:o,onOpenChange:c,modal:m=!0}=e,h=v.useRef(null),g=v.useRef(null),[p,b]=ek({prop:l,defaultProp:o??!1,onChange:c,caller:Cc});return u.jsx(vA,{scope:a,triggerRef:h,contentRef:g,contentId:qa(),titleId:qa(),descriptionId:qa(),open:p,onOpenChange:b,onOpenToggle:v.useCallback(()=>b(x=>!x),[b]),modal:m,children:r})};oS.displayName=Cc;var uS="DialogTrigger",cS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,o=Jn(uS,r),c=Rs(a,o.triggerRef);return u.jsx(Ga.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Rh(o.open),...l,ref:c,onClick:Dr(e.onClick,o.onOpenToggle)})});cS.displayName=uS;var zh="DialogPortal",[yA,dS]=iS(zh,{forceMount:void 0}),fS=e=>{const{__scopeDialog:a,forceMount:r,children:l,container:o}=e,c=Jn(zh,a);return u.jsx(yA,{scope:a,forceMount:r,children:v.Children.map(l,m=>u.jsx(Ec,{present:r||c.open,children:u.jsx(X0,{asChild:!0,container:o,children:m})}))})};fS.displayName=zh;var dc="DialogOverlay",mS=v.forwardRef((e,a)=>{const r=dS(dc,e.__scopeDialog),{forceMount:l=r.forceMount,...o}=e,c=Jn(dc,e.__scopeDialog);return c.modal?u.jsx(Ec,{present:l||c.open,children:u.jsx(xA,{...o,ref:a})}):null});mS.displayName=dc;var bA=P0("DialogOverlay.RemoveScroll"),xA=v.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,o=Jn(dc,r);return u.jsx(sS,{as:bA,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(Ga.div,{"data-state":Rh(o.open),...l,ref:a,style:{pointerEvents:"auto",...l.style}})})}),_s="DialogContent",hS=v.forwardRef((e,a)=>{const r=dS(_s,e.__scopeDialog),{forceMount:l=r.forceMount,...o}=e,c=Jn(_s,e.__scopeDialog);return u.jsx(Ec,{present:l||c.open,children:c.modal?u.jsx(SA,{...o,ref:a}):u.jsx(jA,{...o,ref:a})})});hS.displayName=_s;var SA=v.forwardRef((e,a)=>{const r=Jn(_s,e.__scopeDialog),l=v.useRef(null),o=Rs(a,r.contentRef,l);return v.useEffect(()=>{const c=l.current;if(c)return gA(c)},[]),u.jsx(pS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Dr(e.onCloseAutoFocus,c=>{var m;c.preventDefault(),(m=r.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Dr(e.onPointerDownOutside,c=>{const m=c.detail.originalEvent,h=m.button===0&&m.ctrlKey===!0;(m.button===2||h)&&c.preventDefault()}),onFocusOutside:Dr(e.onFocusOutside,c=>c.preventDefault())})}),jA=v.forwardRef((e,a)=>{const r=Jn(_s,e.__scopeDialog),l=v.useRef(!1),o=v.useRef(!1);return u.jsx(pS,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var m,h;(m=e.onCloseAutoFocus)==null||m.call(e,c),c.defaultPrevented||(l.current||(h=r.triggerRef.current)==null||h.focus(),c.preventDefault()),l.current=!1,o.current=!1},onInteractOutside:c=>{var g,p;(g=e.onInteractOutside)==null||g.call(e,c),c.defaultPrevented||(l.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const m=c.target;((p=r.triggerRef.current)==null?void 0:p.contains(m))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),pS=v.forwardRef((e,a)=>{const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:o,onCloseAutoFocus:c,...m}=e,h=Jn(_s,r),g=v.useRef(null),p=Rs(a,g);return zk(),u.jsxs(u.Fragment,{children:[u.jsx(F0,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:o,onUnmountAutoFocus:c,children:u.jsx(V0,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":Rh(h.open),...m,ref:p,onDismiss:()=>h.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(wA,{titleId:h.titleId}),u.jsx(EA,{contentRef:g,descriptionId:h.descriptionId})]})]})}),Th="DialogTitle",gS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,o=Jn(Th,r);return u.jsx(Ga.h2,{id:o.titleId,...l,ref:a})});gS.displayName=Th;var vS="DialogDescription",yS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,o=Jn(vS,r);return u.jsx(Ga.p,{id:o.descriptionId,...l,ref:a})});yS.displayName=vS;var bS="DialogClose",xS=v.forwardRef((e,a)=>{const{__scopeDialog:r,...l}=e,o=Jn(bS,r);return u.jsx(Ga.button,{type:"button",...l,ref:a,onClick:Dr(e.onClick,()=>o.onOpenChange(!1))})});xS.displayName=bS;function Rh(e){return e?"open":"closed"}var SS="DialogTitleWarning",[BD,jS]=KC(SS,{contentName:_s,titleName:Th,docsSlug:"dialog"}),wA=({titleId:e})=>{const a=jS(SS),r=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
|
|
291
|
-
|
|
292
|
-
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
293
|
-
|
|
294
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},NA="DialogDescriptionWarning",EA=({contentRef:e,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jS(NA).contentName}}.`;return v.useEffect(()=>{var c;const o=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");a&&o&&(document.getElementById(a)||console.warn(l))},[l,e,a]),null},wS=oS,_A=cS,NS=fS,ES=mS,_S=hS,CA=gS,kA=yS,AA=xS,zA=Symbol.for("react.lazy"),fc=fh[" use ".trim().toString()];function TA(e){return typeof e=="object"&&e!==null&&"then"in e}function CS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zA&&"_payload"in e&&TA(e._payload)}function kS(e){const a=OA(e),r=v.forwardRef((l,o)=>{let{children:c,...m}=l;CS(c)&&typeof fc=="function"&&(c=fc(c._payload));const h=v.Children.toArray(c),g=h.find(DA);if(g){const p=g.props.children,b=h.map(x=>x===g?v.Children.count(p)>1?v.Children.only(null):v.isValidElement(p)?p.props.children:null:x);return u.jsx(a,{...m,ref:o,children:v.isValidElement(p)?v.cloneElement(p,void 0,b):null})}return u.jsx(a,{...m,ref:o,children:c})});return r.displayName=`${e}.Slot`,r}var RA=kS("Slot");function OA(e){const a=v.forwardRef((r,l)=>{let{children:o,...c}=r;if(CS(o)&&typeof fc=="function"&&(o=fc(o._payload)),v.isValidElement(o)){const m=LA(o),h=UA(c,o.props);return o.type!==v.Fragment&&(h.ref=l?Ur(l,m):m),v.cloneElement(o,h)}return v.Children.count(o)>1?v.Children.only(null):null});return a.displayName=`${e}.SlotClone`,a}var MA=Symbol("radix.slottable");function DA(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MA}function UA(e,a){const r={...a};for(const l in a){const o=e[l],c=a[l];/^on[A-Z]/.test(l)?o&&c?r[l]=(...h)=>{const g=c(...h);return o(...h),g}:o&&(r[l]=o):l==="style"?r[l]={...o,...c}:l==="className"&&(r[l]=[o,c].filter(Boolean).join(" "))}return{...e,...r}}function LA(e){var l,o;let a=(l=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:l.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?e.ref:(a=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var $A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Va=$A.reduce((e,a)=>{const r=kS(`Primitive.${a}`),l=v.forwardRef((o,c)=>{const{asChild:m,...h}=o,g=m?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...h,ref:c})});return l.displayName=`Primitive.${a}`,{...e,[a]:l}},{}),Fi='[cmdk-group=""]',Sm='[cmdk-group-items=""]',qA='[cmdk-group-heading=""]',AS='[cmdk-item=""]',Zb=`${AS}:not([aria-disabled="true"])`,th="cmdk-item-select",El="data-value",BA=(e,a,r)=>VC(e,a,r),zS=v.createContext(void 0),bo=()=>v.useContext(zS),TS=v.createContext(void 0),Oh=()=>v.useContext(TS),RS=v.createContext(void 0),OS=v.forwardRef((e,a)=>{let r=_l(()=>{var A,V;return{search:"",value:(V=(A=e.value)!=null?A:e.defaultValue)!=null?V:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),l=_l(()=>new Set),o=_l(()=>new Map),c=_l(()=>new Map),m=_l(()=>new Set),h=MS(e),{label:g,children:p,value:b,onValueChange:x,filter:j,shouldFilter:N,loop:z,disablePointerSelection:w=!1,vimBindings:E=!0,...M}=e,B=qa(),D=qa(),O=qa(),P=v.useRef(null),I=XA();Cs(()=>{if(b!==void 0){let A=b.trim();r.current.value=A,L.emit()}},[b]),Cs(()=>{I(6,ve)},[]);let L=v.useMemo(()=>({subscribe:A=>(m.current.add(A),()=>m.current.delete(A)),snapshot:()=>r.current,setState:(A,V,ee)=>{var H,ne,fe,Me;if(!Object.is(r.current[A],V)){if(r.current[A]=V,A==="search")se(),Se(),I(1,_e);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let pe=document.getElementById(O);pe?pe.focus():(H=document.getElementById(B))==null||H.focus()}if(I(7,()=>{var pe;r.current.selectedItemId=(pe=Te())==null?void 0:pe.id,L.emit()}),ee||I(5,ve),((ne=h.current)==null?void 0:ne.value)!==void 0){let pe=V??"";(Me=(fe=h.current).onValueChange)==null||Me.call(fe,pe);return}}L.emit()}},emit:()=>{m.current.forEach(A=>A())}}),[]),K=v.useMemo(()=>({value:(A,V,ee)=>{var H;V!==((H=c.current.get(A))==null?void 0:H.value)&&(c.current.set(A,{value:V,keywords:ee}),r.current.filtered.items.set(A,le(V,ee)),I(2,()=>{Se(),L.emit()}))},item:(A,V)=>(l.current.add(A),V&&(o.current.has(V)?o.current.get(V).add(A):o.current.set(V,new Set([A]))),I(3,()=>{se(),Se(),r.current.value||_e(),L.emit()}),()=>{c.current.delete(A),l.current.delete(A),r.current.filtered.items.delete(A);let ee=Te();I(4,()=>{se(),(ee==null?void 0:ee.getAttribute("id"))===A&&_e(),L.emit()})}),group:A=>(o.current.has(A)||o.current.set(A,new Set),()=>{c.current.delete(A),o.current.delete(A)}),filter:()=>h.current.shouldFilter,label:g||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:B,inputId:O,labelId:D,listInnerRef:P}),[]);function le(A,V){var ee,H;let ne=(H=(ee=h.current)==null?void 0:ee.filter)!=null?H:BA;return A?ne(A,r.current.search,V):0}function Se(){if(!r.current.search||h.current.shouldFilter===!1)return;let A=r.current.filtered.items,V=[];r.current.filtered.groups.forEach(H=>{let ne=o.current.get(H),fe=0;ne.forEach(Me=>{let pe=A.get(Me);fe=Math.max(pe,fe)}),V.push([H,fe])});let ee=P.current;we().sort((H,ne)=>{var fe,Me;let pe=H.getAttribute("id"),Dt=ne.getAttribute("id");return((fe=A.get(Dt))!=null?fe:0)-((Me=A.get(pe))!=null?Me:0)}).forEach(H=>{let ne=H.closest(Sm);ne?ne.appendChild(H.parentElement===ne?H:H.closest(`${Sm} > *`)):ee.appendChild(H.parentElement===ee?H:H.closest(`${Sm} > *`))}),V.sort((H,ne)=>ne[1]-H[1]).forEach(H=>{var ne;let fe=(ne=P.current)==null?void 0:ne.querySelector(`${Fi}[${El}="${encodeURIComponent(H[0])}"]`);fe==null||fe.parentElement.appendChild(fe)})}function _e(){let A=we().find(ee=>ee.getAttribute("aria-disabled")!=="true"),V=A==null?void 0:A.getAttribute(El);L.setState("value",V||void 0)}function se(){var A,V,ee,H;if(!r.current.search||h.current.shouldFilter===!1){r.current.filtered.count=l.current.size;return}r.current.filtered.groups=new Set;let ne=0;for(let fe of l.current){let Me=(V=(A=c.current.get(fe))==null?void 0:A.value)!=null?V:"",pe=(H=(ee=c.current.get(fe))==null?void 0:ee.keywords)!=null?H:[],Dt=le(Me,pe);r.current.filtered.items.set(fe,Dt),Dt>0&&ne++}for(let[fe,Me]of o.current)for(let pe of Me)if(r.current.filtered.items.get(pe)>0){r.current.filtered.groups.add(fe);break}r.current.filtered.count=ne}function ve(){var A,V,ee;let H=Te();H&&(((A=H.parentElement)==null?void 0:A.firstChild)===H&&((ee=(V=H.closest(Fi))==null?void 0:V.querySelector(qA))==null||ee.scrollIntoView({block:"nearest"})),H.scrollIntoView({block:"nearest"}))}function Te(){var A;return(A=P.current)==null?void 0:A.querySelector(`${AS}[aria-selected="true"]`)}function we(){var A;return Array.from(((A=P.current)==null?void 0:A.querySelectorAll(Zb))||[])}function Q(A){let V=we()[A];V&&L.setState("value",V.getAttribute(El))}function te(A){var V;let ee=Te(),H=we(),ne=H.findIndex(Me=>Me===ee),fe=H[ne+A];(V=h.current)!=null&&V.loop&&(fe=ne+A<0?H[H.length-1]:ne+A===H.length?H[0]:H[ne+A]),fe&&L.setState("value",fe.getAttribute(El))}function ce(A){let V=Te(),ee=V==null?void 0:V.closest(Fi),H;for(;ee&&!H;)ee=A>0?FA(ee,Fi):YA(ee,Fi),H=ee==null?void 0:ee.querySelector(Zb);H?L.setState("value",H.getAttribute(El)):te(A)}let Ce=()=>Q(we().length-1),re=A=>{A.preventDefault(),A.metaKey?Ce():A.altKey?ce(1):te(1)},T=A=>{A.preventDefault(),A.metaKey?Q(0):A.altKey?ce(-1):te(-1)};return v.createElement(Va.div,{ref:a,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:A=>{var V;(V=M.onKeyDown)==null||V.call(M,A);let ee=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||ee))switch(A.key){case"n":case"j":{E&&A.ctrlKey&&re(A);break}case"ArrowDown":{re(A);break}case"p":case"k":{E&&A.ctrlKey&&T(A);break}case"ArrowUp":{T(A);break}case"Home":{A.preventDefault(),Q(0);break}case"End":{A.preventDefault(),Ce();break}case"Enter":{A.preventDefault();let H=Te();if(H){let ne=new Event(th);H.dispatchEvent(ne)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:K.inputId,id:K.labelId,style:WA},g),kc(e,A=>v.createElement(TS.Provider,{value:L},v.createElement(zS.Provider,{value:K},A))))}),ZA=v.forwardRef((e,a)=>{var r,l;let o=qa(),c=v.useRef(null),m=v.useContext(RS),h=bo(),g=MS(e),p=(l=(r=g.current)==null?void 0:r.forceMount)!=null?l:m==null?void 0:m.forceMount;Cs(()=>{if(!p)return h.item(o,m==null?void 0:m.id)},[p]);let b=DS(o,c,[e.value,e.children,c],e.keywords),x=Oh(),j=Lr(I=>I.value&&I.value===b.current),N=Lr(I=>p||h.filter()===!1?!0:I.search?I.filtered.items.get(o)>0:!0);v.useEffect(()=>{let I=c.current;if(!(!I||e.disabled))return I.addEventListener(th,z),()=>I.removeEventListener(th,z)},[N,e.onSelect,e.disabled]);function z(){var I,L;w(),(L=(I=g.current).onSelect)==null||L.call(I,b.current)}function w(){x.setState("value",b.current,!0)}if(!N)return null;let{disabled:E,value:M,onSelect:B,forceMount:D,keywords:O,...P}=e;return v.createElement(Va.div,{ref:Ur(c,a),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!j,"data-disabled":!!E,"data-selected":!!j,onPointerMove:E||h.getDisablePointerSelection()?void 0:w,onClick:E?void 0:z},e.children)}),HA=v.forwardRef((e,a)=>{let{heading:r,children:l,forceMount:o,...c}=e,m=qa(),h=v.useRef(null),g=v.useRef(null),p=qa(),b=bo(),x=Lr(N=>o||b.filter()===!1?!0:N.search?N.filtered.groups.has(m):!0);Cs(()=>b.group(m),[]),DS(m,h,[e.value,e.heading,g]);let j=v.useMemo(()=>({id:m,forceMount:o}),[o]);return v.createElement(Va.div,{ref:Ur(h,a),...c,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},r&&v.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),kc(e,N=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},v.createElement(RS.Provider,{value:j},N))))}),IA=v.forwardRef((e,a)=>{let{alwaysRender:r,...l}=e,o=v.useRef(null),c=Lr(m=>!m.search);return!r&&!c?null:v.createElement(Va.div,{ref:Ur(o,a),...l,"cmdk-separator":"",role:"separator"})}),QA=v.forwardRef((e,a)=>{let{onValueChange:r,...l}=e,o=e.value!=null,c=Oh(),m=Lr(p=>p.search),h=Lr(p=>p.selectedItemId),g=bo();return v.useEffect(()=>{e.value!=null&&c.setState("search",e.value)},[e.value]),v.createElement(Va.input,{ref:a,...l,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":h,id:g.inputId,type:"text",value:o?e.value:m,onChange:p=>{o||c.setState("search",p.target.value),r==null||r(p.target.value)}})}),PA=v.forwardRef((e,a)=>{let{children:r,label:l="Suggestions",...o}=e,c=v.useRef(null),m=v.useRef(null),h=Lr(p=>p.selectedItemId),g=bo();return v.useEffect(()=>{if(m.current&&c.current){let p=m.current,b=c.current,x,j=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let N=p.offsetHeight;b.style.setProperty("--cmdk-list-height",N.toFixed(1)+"px")})});return j.observe(p),()=>{cancelAnimationFrame(x),j.unobserve(p)}}},[]),v.createElement(Va.div,{ref:Ur(c,a),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":l,id:g.listId},kc(e,p=>v.createElement("div",{ref:Ur(m,g.listInnerRef),"cmdk-list-sizer":""},p)))}),GA=v.forwardRef((e,a)=>{let{open:r,onOpenChange:l,overlayClassName:o,contentClassName:c,container:m,...h}=e;return v.createElement(wS,{open:r,onOpenChange:l},v.createElement(NS,{container:m},v.createElement(ES,{"cmdk-overlay":"",className:o}),v.createElement(_S,{"aria-label":e.label,"cmdk-dialog":"",className:c},v.createElement(OS,{ref:a,...h}))))}),VA=v.forwardRef((e,a)=>Lr(r=>r.filtered.count===0)?v.createElement(Va.div,{ref:a,...e,"cmdk-empty":"",role:"presentation"}):null),KA=v.forwardRef((e,a)=>{let{progress:r,children:l,label:o="Loading...",...c}=e;return v.createElement(Va.div,{ref:a,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},kc(e,m=>v.createElement("div",{"aria-hidden":!0},m)))}),cn=Object.assign(OS,{List:PA,Item:ZA,Input:QA,Group:HA,Separator:IA,Dialog:GA,Empty:VA,Loading:KA});function FA(e,a){let r=e.nextElementSibling;for(;r;){if(r.matches(a))return r;r=r.nextElementSibling}}function YA(e,a){let r=e.previousElementSibling;for(;r;){if(r.matches(a))return r;r=r.previousElementSibling}}function MS(e){let a=v.useRef(e);return Cs(()=>{a.current=e}),a}var Cs=typeof window>"u"?v.useEffect:v.useLayoutEffect;function _l(e){let a=v.useRef();return a.current===void 0&&(a.current=e()),a}function Lr(e){let a=Oh(),r=()=>e(a.snapshot());return v.useSyncExternalStore(a.subscribe,r,r)}function DS(e,a,r,l=[]){let o=v.useRef(),c=bo();return Cs(()=>{var m;let h=(()=>{var p;for(let b of r){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(p=b.current.textContent)==null?void 0:p.trim():o.current}})(),g=l.map(p=>p.trim());c.value(e,h,g),(m=a.current)==null||m.setAttribute(El,h),o.current=h}),o}var XA=()=>{let[e,a]=v.useState(),r=_l(()=>new Map);return Cs(()=>{r.current.forEach(l=>l()),r.current=new Map},[e]),(l,o)=>{r.current.set(l,o),a({})}};function JA(e){let a=e.type;return typeof a=="function"?a(e.props):"render"in a?a.render(e.props):e}function kc({asChild:e,children:a},r){return e&&v.isValidElement(a)?v.cloneElement(JA(a),{ref:a.ref},r(a.props.children)):r(a)}var WA={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ln=wS,ez=_A,tz=NS,US=v.forwardRef(({className:e,...a},r)=>u.jsx(ES,{ref:r,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a}));US.displayName="DialogOverlay";const xn=v.forwardRef(({className:e,children:a,...r},l)=>u.jsxs(tz,{children:[u.jsx(US,{}),u.jsxs(_S,{ref:l,className:je("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),...r,children:[a,u.jsxs(AA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(B2,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xn.displayName="DialogContent";function Xn({className:e,...a}){return u.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...a})}function $n({className:e,...a}){return u.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a})}const qn=v.forwardRef(({className:e,...a},r)=>u.jsx(CA,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...a}));qn.displayName="DialogTitle";const nz=v.forwardRef(({className:e,...a},r)=>u.jsx(kA,{ref:r,className:je("text-sm text-muted-foreground",e),...a}));nz.displayName="DialogDescription";const LS=v.forwardRef(({className:e,...a},r)=>u.jsx(cn,{ref:r,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...a}));LS.displayName=cn.displayName;function az({open:e,onOpenChange:a,children:r}){return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsx(xn,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(LS,{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:r})})})}const $S=v.forwardRef(({className:e,...a},r)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(Ch,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(cn.Input,{ref:r,className:je("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...a})]}));$S.displayName=cn.Input.displayName;const qS=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.List,{ref:r,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...a}));qS.displayName=cn.List.displayName;const BS=v.forwardRef((e,a)=>u.jsx(cn.Empty,{ref:a,className:"py-6 text-center text-sm",...e}));BS.displayName=cn.Empty.displayName;const sc=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.Group,{ref:r,className:je("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...a}));sc.displayName=cn.Group.displayName;const nh=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.Separator,{ref:r,className:je("-mx-1 h-px bg-border",e),...a}));nh.displayName=cn.Separator.displayName;const lc=v.forwardRef(({className:e,...a},r)=>u.jsx(cn.Item,{ref:r,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a}));lc.displayName=cn.Item.displayName;function Mh(e){const a=new URLSearchParams;e!=null&&e.limit&&a.set("limit",String(e.limit)),e!=null&&e.cursor&&a.set("cursor",e.cursor),e!=null&&e.type&&a.set("type",e.type);const r=a.toString();return Ae.get(`/admin/agents${r?`?${r}`:""}`)}function ZS(e){return Ae.get(`/admin/agents/${encodeURIComponent(e)}`)}function rz(e){return Ae.post("/admin/agents",e)}function Hb(e,a){return Ae.patch(`/admin/agents/${encodeURIComponent(e)}`,a)}function sz(e){return Ae.delete(`/admin/agents/${encodeURIComponent(e)}`)}function lz(e){return Ae.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function iz(e){return Ae.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function oz(e){return Ae.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Ka(){const{data:e}=Ie({queryKey:["agents","name-map"],queryFn:()=>Mh({limit:100}),staleTime:3e4});return v.useMemo(()=>{const a=new Map;if(e!=null&&e.items)for(const r of e.items)a.set(r.uuid,r.name??r.displayName??r.uuid);return r=>r?a.get(r)??r:"—"},[e])}const uz=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/admin",label:"Admin"}];function cz({open:e,onOpenChange:a}){const r=Pa(),l=Ka(),{data:o}=Ie({queryKey:["activity"],queryFn:wc,enabled:e,staleTime:3e4}),c=(o==null?void 0:o.agents)??[],h=Ie({queryKey:["palette-sessions",c.map(p=>p.agentId).join(",")],queryFn:async()=>{const p=[];for(const b of c)try{const x=await Jl(b.agentId);for(const j of x)p.push({agentId:b.agentId,session:j})}catch{}return p},enabled:e&&c.length>0,staleTime:3e4}).data??[],g=p=>{a(!1),r(p)};return u.jsxs(az,{open:e,onOpenChange:a,children:[u.jsx($S,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(qS,{children:[u.jsx(BS,{children:"No results"}),c.length>0&&u.jsx(sc,{heading:"Agents",children:c.map(p=>{const b=l(p.agentId);return u.jsxs(lc,{value:`agent ${b} ${p.agentId}`,onSelect:()=>g(`/?a=${p.agentId}`),children:[u.jsx(J_,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:b}),u.jsx("span",{className:"text-xs text-muted-foreground font-mono ml-2",children:p.agentId.slice(0,8)})]},p.agentId)})}),h.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(nh,{}),u.jsx(sc,{heading:"Chats",children:h.map(({agentId:p,session:b})=>{const x=l(p);return u.jsxs(lc,{value:`chat ${x} ${b.chatId}`,onSelect:()=>g(`/?a=${p}&c=${b.chatId}`),children:[u.jsx(w0,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:x}),u.jsx("span",{className:"text-xs text-muted-foreground font-mono ml-2",children:b.chatId.slice(0,8)})]},`${p}-${b.chatId}`)})})]}),u.jsx(nh,{}),u.jsx(sc,{heading:"Pages",children:uz.map(p=>u.jsxs(lc,{value:`page ${p.label}`,onSelect:()=>g(p.path),children:[u.jsx(u2,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:p.label})]},p.path))})]})]})}function ah(e){const a=new URLSearchParams;e!=null&&e.limit&&a.set("limit",String(e.limit)),e!=null&&e.cursor&&a.set("cursor",e.cursor),e!=null&&e.severity&&a.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&a.set("read",String(e.read)),e!=null&&e.agentId&&a.set("agentId",e.agentId);const r=a.toString();return Ae.get(`/admin/notifications${r?`?${r}`:""}`)}function HS(e){return Ae.post(`/admin/notifications/${e}/read`)}function dz(){return Ae.post("/admin/notifications/read-all")}function fz(e){switch(e){case"high":return"bg-red-500";case"medium":return"bg-yellow-500";default:return"bg-gray-400"}}function mz(e){const a=Date.now()-new Date(e).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function hz(){var x;const[e,a]=v.useState(!1),r=v.useRef(null),l=Pa(),o=Ka(),{data:c}=Ie({queryKey:["notifications","bell"],queryFn:()=>ah({limit:5}),refetchInterval:1e4}),{data:m}=Ie({queryKey:["notifications","unread-count"],queryFn:()=>ah({read:!1,limit:100}),refetchInterval:1e4}),h=((x=m==null?void 0:m.items)==null?void 0:x.length)??0,g=h>0,p=v.useCallback(async j=>{j.read||HS(j.id).catch(()=>{}),a(!1),j.agentId&&j.chatId?l(`/?a=${j.agentId}&c=${j.chatId}`):j.agentId&&l(`/?a=${j.agentId}`)},[l]),b=v.useCallback(()=>{dz().catch(()=>{})},[]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>a(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[u.jsx(Y_,{className:"h-4 w-4"}),g&&u.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:h>99?"99+":h})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>a(!1)}),u.jsxs("div",{ref:r,className:"absolute right-0 top-full mt-1 z-50 w-80 rounded-md border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[u.jsx("span",{className:"text-sm font-medium",children:"Notifications"}),g&&u.jsx("button",{type:"button",onClick:b,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all"})]}),u.jsx("div",{className:"max-h-80 overflow-y-auto",children:!(c!=null&&c.items)||c.items.length===0?u.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No notifications"}):c.items.map(j=>u.jsxs("button",{type:"button",onClick:()=>p(j),className:je("w-full flex items-start gap-2 px-3 py-2 text-left hover:bg-accent/50 transition-colors",!j.read&&"bg-accent/20"),children:[u.jsx("span",{className:je("mt-1.5 h-2 w-2 shrink-0 rounded-full",fz(j.severity))}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:je("text-sm truncate",!j.read&&"font-medium"),children:j.message}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.agentId?o(j.agentId):""," ",mz(j.createdAt)]})]})]},j.id))})]})]})]})}function pz(){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 gz(){const[e,a]=v.useState(pz);return v.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.jsx("button",{type:"button",onClick:()=>a(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-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?u.jsx(z2,{className:"h-4 w-4"}):u.jsx(y2,{className:"h-4 w-4"})})}const Ib=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"}],vz={to:"/admin",label:"Admin",end:!1,kbd:"⌘4"};function yz(){const{role:e,logout:a}=yo(),r=e==="admin",[l,o]=v.useState(!1),c=r?[...Ib,vz]:Ib,m=Hn(),h=m.pathname==="/"||m.search.includes("a=");return v.useEffect(()=>{const g=p=>{(p.metaKey||p.ctrlKey)&&p.key.toLowerCase()==="k"&&(p.preventDefault(),o(b=>!b))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:40,gridTemplateColumns:"auto 1fr auto",padding:"0 12px",borderBottom:"1px solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx(jc,{className:"h-4 w-4",style:{color:"var(--accent)"}}),u.jsxs("span",{style:{fontWeight:600,fontSize:13,letterSpacing:-.1,color:"var(--fg)"},children:["First Tree ",u.jsx("span",{style:{color:"var(--fg-3)",fontWeight:400},children:"Hub"})]})]}),u.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:c.map(g=>u.jsx(m0,{to:g.to,end:g.end,style:{pointerEvents:"auto"},className:({isActive:p})=>je("inline-flex items-center transition-colors",p?"":"hover:text-[var(--fg)]"),children:({isActive:p})=>u.jsxs("span",{className:"inline-flex items-center",style:{padding:"5px 12px",fontSize:12,fontWeight:500,gap:6,borderRadius:5,color:p?"var(--fg)":"var(--fg-3)",background:p?"var(--bg-hover)":"transparent"},children:[g.label,p&&u.jsx("span",{className:"kbd",children:g.kbd})]})},g.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6},children:[u.jsxs("button",{type:"button",onClick:()=>o(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors",style:{gap:8,padding:"4px 8px",fontSize:11,color:"var(--fg-3)",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg-sunken)"},onMouseEnter:g=>{g.currentTarget.style.color="var(--fg)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(Ch,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),u.jsx(hz,{}),u.jsx(gz,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 4px"}}),u.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center transition-colors hover:text-[var(--fg)]",style:{padding:"4px 8px",color:"var(--fg-3)",borderRadius:4,gap:6,fontSize:11},"aria-label":"Log out",children:u.jsx(p2,{className:"h-3.5 w-3.5"})})]})]}),u.jsx(cz,{open:l,onOpenChange:o}),h?u.jsx(Km,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 max-w-5xl mx-auto",children:u.jsx(Km,{})})})]})}function Y(e,a,r){function l(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:m,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),a(h,g);const p=m.prototype,b=Object.keys(p);for(let x=0;x<b.length;x++){const j=b[x];j in h||(h[j]=p[j].bind(h))}}const o=(r==null?void 0:r.Parent)??Object;class c extends o{}Object.defineProperty(c,"name",{value:e});function m(h){var g;const p=r!=null&&r.Parent?new c:this;l(p,h),(g=p._zod).deferred??(g.deferred=[]);for(const b of p._zod.deferred)b();return p}return Object.defineProperty(m,"init",{value:l}),Object.defineProperty(m,Symbol.hasInstance,{value:h=>{var g,p;return r!=null&&r.Parent&&h instanceof r.Parent?!0:(p=(g=h==null?void 0:h._zod)==null?void 0:g.traits)==null?void 0:p.has(e)}}),Object.defineProperty(m,"name",{value:e}),m}class Tl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class IS extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const QS={};function $r(e){return QS}function PS(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,o])=>a.indexOf(+l)===-1).map(([l,o])=>o)}function rh(e,a){return typeof a=="bigint"?a.toString():a}function Ac(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Dh(e){return e==null}function Uh(e){const a=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(a,r)}function bz(e,a){const r=(e.toString().split(".")[1]||"").length,l=a.toString();let o=(l.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(l)){const g=l.match(/\d?e-(\d?)/);g!=null&&g[1]&&(o=Number.parseInt(g[1]))}const c=r>o?r:o,m=Number.parseInt(e.toFixed(c).replace(".","")),h=Number.parseInt(a.toFixed(c).replace(".",""));return m%h/10**c}const Qb=Symbol("evaluating");function Ye(e,a,r){let l;Object.defineProperty(e,a,{get(){if(l!==Qb)return l===void 0&&(l=Qb,l=r()),l},set(o){Object.defineProperty(e,a,{value:o})},configurable:!0})}function Os(e,a,r){Object.defineProperty(e,a,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Zr(...e){const a={};for(const r of e){const l=Object.getOwnPropertyDescriptors(r);Object.assign(a,l)}return Object.defineProperties({},a)}function Pb(e){return JSON.stringify(e)}function xz(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const GS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function lo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Sz=Ac(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const a=Function;return new a(""),!0}catch{return!1}});function Ql(e){if(lo(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const r=a.prototype;return!(lo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function VS(e){return Ql(e)?{...e}:Array.isArray(e)?[...e]:e}const jz=new Set(["string","number","symbol"]);function Pl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hr(e,a,r){const l=new e._zod.constr(a??e._zod.def);return(!a||r!=null&&r.parent)&&(l._zod.parent=e),l}function ge(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};if((a==null?void 0:a.message)!==void 0){if((a==null?void 0:a.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function wz(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const Nz={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 Ez(e,a){const r=e._zod.def,l=r.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Zr(e._zod.def,{get shape(){const m={};for(const h in a){if(!(h in r.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(m[h]=r.shape[h])}return Os(this,"shape",m),m},checks:[]});return Hr(e,c)}function _z(e,a){const r=e._zod.def,l=r.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Zr(e._zod.def,{get shape(){const m={...e._zod.def.shape};for(const h in a){if(!(h in r.shape))throw new Error(`Unrecognized key: "${h}"`);a[h]&&delete m[h]}return Os(this,"shape",m),m},checks:[]});return Hr(e,c)}function Cz(e,a){if(!Ql(a))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const c=e._zod.def.shape;for(const m in a)if(Object.getOwnPropertyDescriptor(c,m)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Zr(e._zod.def,{get shape(){const c={...e._zod.def.shape,...a};return Os(this,"shape",c),c}});return Hr(e,o)}function kz(e,a){if(!Ql(a))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Zr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return Os(this,"shape",l),l}});return Hr(e,r)}function Az(e,a){const r=Zr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return Os(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:[]});return Hr(e,r)}function zz(e,a,r){const o=a._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const m=Zr(a._zod.def,{get shape(){const h=a._zod.def.shape,g={...h};if(r)for(const p in r){if(!(p in h))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(g[p]=e?new e({type:"optional",innerType:h[p]}):h[p])}else for(const p in h)g[p]=e?new e({type:"optional",innerType:h[p]}):h[p];return Os(this,"shape",g),g},checks:[]});return Hr(a,m)}function Tz(e,a,r){const l=Zr(a._zod.def,{get shape(){const o=a._zod.def.shape,c={...o};if(r)for(const m in r){if(!(m in c))throw new Error(`Unrecognized key: "${m}"`);r[m]&&(c[m]=new e({type:"nonoptional",innerType:o[m]}))}else for(const m in o)c[m]=new e({type:"nonoptional",innerType:o[m]});return Os(this,"shape",c),c}});return Hr(a,l)}function Cl(e,a=0){var r;if(e.aborted===!0)return!0;for(let l=a;l<e.issues.length;l++)if(((r=e.issues[l])==null?void 0:r.continue)!==!0)return!0;return!1}function kl(e,a){return a.map(r=>{var l;return(l=r).path??(l.path=[]),r.path.unshift(e),r})}function Xu(e){return typeof e=="string"?e:e==null?void 0:e.message}function qr(e,a,r){var o,c,m,h,g,p;const l={...e,path:e.path??[]};if(!e.message){const b=Xu((m=(c=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:c.error)==null?void 0:m.call(c,e))??Xu((h=a==null?void 0:a.error)==null?void 0:h.call(a,e))??Xu((g=r.customError)==null?void 0:g.call(r,e))??Xu((p=r.localeError)==null?void 0:p.call(r,e))??"Invalid input";l.message=b}return delete l.inst,delete l.continue,a!=null&&a.reportInput||delete l.input,l}function Lh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function io(...e){const[a,r,l]=e;return typeof a=="string"?{message:a,code:"custom",input:r,inst:l}:{...a}}const KS=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,rh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},FS=Y("$ZodError",KS),YS=Y("$ZodError",KS,{Parent:Error});function Rz(e,a=r=>r.message){const r={},l=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(a(o))):l.push(a(o));return{formErrors:l,fieldErrors:r}}function Oz(e,a=r=>r.message){const r={_errors:[]},l=o=>{for(const c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(m=>l({issues:m}));else if(c.code==="invalid_key")l({issues:c.issues});else if(c.code==="invalid_element")l({issues:c.issues});else if(c.path.length===0)r._errors.push(a(c));else{let m=r,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(m[g]=m[g]||{_errors:[]},m[g]._errors.push(a(c))):m[g]=m[g]||{_errors:[]},m=m[g],h++}}};return l(e),r}const $h=e=>(a,r,l,o)=>{const c=l?Object.assign(l,{async:!1}):{async:!1},m=a._zod.run({value:r,issues:[]},c);if(m instanceof Promise)throw new Tl;if(m.issues.length){const h=new((o==null?void 0:o.Err)??e)(m.issues.map(g=>qr(g,c,$r())));throw GS(h,o==null?void 0:o.callee),h}return m.value},qh=e=>async(a,r,l,o)=>{const c=l?Object.assign(l,{async:!0}):{async:!0};let m=a._zod.run({value:r,issues:[]},c);if(m instanceof Promise&&(m=await m),m.issues.length){const h=new((o==null?void 0:o.Err)??e)(m.issues.map(g=>qr(g,c,$r())));throw GS(h,o==null?void 0:o.callee),h}return m.value},zc=e=>(a,r,l)=>{const o=l?{...l,async:!1}:{async:!1},c=a._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new Tl;return c.issues.length?{success:!1,error:new(e??FS)(c.issues.map(m=>qr(m,o,$r())))}:{success:!0,data:c.value}},Mz=zc(YS),Tc=e=>async(a,r,l)=>{const o=l?Object.assign(l,{async:!0}):{async:!0};let c=a._zod.run({value:r,issues:[]},o);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(m=>qr(m,o,$r())))}:{success:!0,data:c.value}},Dz=Tc(YS),Uz=e=>(a,r,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return $h(e)(a,r,o)},Lz=e=>(a,r,l)=>$h(e)(a,r,l),$z=e=>async(a,r,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return qh(e)(a,r,o)},qz=e=>async(a,r,l)=>qh(e)(a,r,l),Bz=e=>(a,r,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return zc(e)(a,r,o)},Zz=e=>(a,r,l)=>zc(e)(a,r,l),Hz=e=>async(a,r,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Tc(e)(a,r,o)},Iz=e=>async(a,r,l)=>Tc(e)(a,r,l),Qz=/^[cC][^\s-]{8,}$/,Pz=/^[0-9a-z]+$/,Gz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vz=/^[0-9a-vA-V]{20}$/,Kz=/^[A-Za-z0-9]{27}$/,Fz=/^[a-zA-Z0-9_-]{21}$/,Yz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xz=/^([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})$/,Gb=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)$/,Jz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Wz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eT(){return new RegExp(Wz,"u")}const tT=/^(?:(?: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])$/,nT=/^(([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}|:))$/,aT=/^((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])$/,rT=/^(([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])$/,sT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,XS=/^[A-Za-z0-9_-]*$/,lT=/^\+[1-9]\d{6,14}$/,JS="(?:(?:\\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])))",iT=new RegExp(`^${JS}$`);function WS(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oT(e){return new RegExp(`^${WS(e)}$`)}function uT(e){const a=WS({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${r.join("|")})`;return new RegExp(`^${JS}T(?:${l})$`)}const cT=e=>{const a=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},dT=/^-?\d+$/,e1=/^-?\d+(?:\.\d+)?$/,fT=/^(?:true|false)$/i,mT=/^[^A-Z]*$/,hT=/^[^a-z]*$/,dn=Y("$ZodCheck",(e,a)=>{var r;e._zod??(e._zod={}),e._zod.def=a,(r=e._zod).onattach??(r.onattach=[])}),t1={number:"number",bigint:"bigint",object:"date"},n1=Y("$ZodCheckLessThan",(e,a)=>{dn.init(e,a);const r=t1[typeof a.value];e._zod.onattach.push(l=>{const o=l._zod.bag,c=(a.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value<c&&(a.inclusive?o.maximum=a.value:o.exclusiveMaximum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value<=a.value:l.value<a.value)||l.issues.push({origin:r,code:"too_big",maximum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),a1=Y("$ZodCheckGreaterThan",(e,a)=>{dn.init(e,a);const r=t1[typeof a.value];e._zod.onattach.push(l=>{const o=l._zod.bag,c=(a.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>c&&(a.inclusive?o.minimum=a.value:o.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:r,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),pT=Y("$ZodCheckMultipleOf",(e,a)=>{dn.init(e,a),e._zod.onattach.push(r=>{var l;(l=r._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._zod.check=r=>{if(typeof r.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%a.value===BigInt(0):bz(r.value,a.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:a.value,input:r.value,inst:e,continue:!a.abort})}}),gT=Y("$ZodCheckNumberFormat",(e,a)=>{var m;dn.init(e,a),a.format=a.format||"float64";const r=(m=a.format)==null?void 0:m.includes("int"),l=r?"int":"number",[o,c]=Nz[a.format];e._zod.onattach.push(h=>{const g=h._zod.bag;g.format=a.format,g.minimum=o,g.maximum=c,r&&(g.pattern=dT)}),e._zod.check=h=>{const g=h.value;if(r){if(!Number.isInteger(g)){h.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?h.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):h.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}g<o&&h.issues.push({origin:"number",input:g,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!a.abort}),g>c&&h.issues.push({origin:"number",input:g,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!a.abort})}}),vT=Y("$ZodCheckMaxLength",(e,a)=>{var r;dn.init(e,a),(r=e._zod.def).when??(r.when=l=>{const o=l.value;return!Dh(o)&&o.length!==void 0}),e._zod.onattach.push(l=>{const o=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum<o&&(l._zod.bag.maximum=a.maximum)}),e._zod.check=l=>{const o=l.value;if(o.length<=a.maximum)return;const m=Lh(o);l.issues.push({origin:m,code:"too_big",maximum:a.maximum,inclusive:!0,input:o,inst:e,continue:!a.abort})}}),yT=Y("$ZodCheckMinLength",(e,a)=>{var r;dn.init(e,a),(r=e._zod.def).when??(r.when=l=>{const o=l.value;return!Dh(o)&&o.length!==void 0}),e._zod.onattach.push(l=>{const o=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>o&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const o=l.value;if(o.length>=a.minimum)return;const m=Lh(o);l.issues.push({origin:m,code:"too_small",minimum:a.minimum,inclusive:!0,input:o,inst:e,continue:!a.abort})}}),bT=Y("$ZodCheckLengthEquals",(e,a)=>{var r;dn.init(e,a),(r=e._zod.def).when??(r.when=l=>{const o=l.value;return!Dh(o)&&o.length!==void 0}),e._zod.onattach.push(l=>{const o=l._zod.bag;o.minimum=a.length,o.maximum=a.length,o.length=a.length}),e._zod.check=l=>{const o=l.value,c=o.length;if(c===a.length)return;const m=Lh(o),h=c>a.length;l.issues.push({origin:m,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),Rc=Y("$ZodCheckStringFormat",(e,a)=>{var r,l;dn.init(e,a),e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=a.format,a.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(a.pattern))}),a.pattern?(r=e._zod).check??(r.check=o=>{a.pattern.lastIndex=0,!a.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:a.format,input:o.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),xT=Y("$ZodCheckRegex",(e,a)=>{Rc.init(e,a),e._zod.check=r=>{a.pattern.lastIndex=0,!a.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:a.pattern.toString(),inst:e,continue:!a.abort})}}),ST=Y("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=mT),Rc.init(e,a)}),jT=Y("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=hT),Rc.init(e,a)}),wT=Y("$ZodCheckIncludes",(e,a)=>{dn.init(e,a);const r=Pl(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.position}}${r}`:r);a.pattern=l,e._zod.onattach.push(o=>{const c=o._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(l)}),e._zod.check=o=>{o.value.includes(a.includes,a.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:o.value,inst:e,continue:!a.abort})}}),NT=Y("$ZodCheckStartsWith",(e,a)=>{dn.init(e,a);const r=new RegExp(`^${Pl(a.prefix)}.*`);a.pattern??(a.pattern=r),e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),ET=Y("$ZodCheckEndsWith",(e,a)=>{dn.init(e,a);const r=new RegExp(`.*${Pl(a.suffix)}$`);a.pattern??(a.pattern=r),e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),_T=Y("$ZodCheckOverwrite",(e,a)=>{dn.init(e,a),e._zod.check=r=>{r.value=a.tx(r.value)}});class CT{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const l=a.split(`
|
|
295
|
-
`).filter(m=>m),o=Math.min(...l.map(m=>m.length-m.trimStart().length)),c=l.map(m=>m.slice(o)).map(m=>" ".repeat(this.indent*2)+m);for(const m of c)this.content.push(m)}compile(){const a=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(c=>` ${c}`)];return new a(...r,o.join(`
|
|
296
|
-
`))}}const kT={major:4,minor:3,patch:6},ht=Y("$ZodType",(e,a)=>{var o;var r;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=kT;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const c of l)for(const m of c._zod.onattach)m(e);if(l.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const c=(h,g,p)=>{let b=Cl(h),x;for(const j of g){if(j._zod.def.when){if(!j._zod.def.when(h))continue}else if(b)continue;const N=h.issues.length,z=j._zod.check(h);if(z instanceof Promise&&(p==null?void 0:p.async)===!1)throw new Tl;if(x||z instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await z,h.issues.length!==N&&(b||(b=Cl(h,N)))});else{if(h.issues.length===N)continue;b||(b=Cl(h,N))}}return x?x.then(()=>h):h},m=(h,g,p)=>{if(Cl(h))return h.aborted=!0,h;const b=c(g,l,p);if(b instanceof Promise){if(p.async===!1)throw new Tl;return b.then(x=>e._zod.parse(x,p))}return e._zod.parse(b,p)};e._zod.run=(h,g)=>{if(g.skipChecks)return e._zod.parse(h,g);if(g.direction==="backward"){const b=e._zod.parse({value:h.value,issues:[]},{...g,skipChecks:!0});return b instanceof Promise?b.then(x=>m(x,h,g)):m(b,h,g)}const p=e._zod.parse(h,g);if(p instanceof Promise){if(g.async===!1)throw new Tl;return p.then(b=>c(b,l,g))}return c(p,l,g)}}Ye(e,"~standard",()=>({validate:c=>{var m;try{const h=Mz(e,c);return h.success?{value:h.data}:{issues:(m=h.error)==null?void 0:m.issues}}catch{return Dz(e,c).then(g=>{var p;return g.success?{value:g.data}:{issues:(p=g.error)==null?void 0:p.issues}})}},vendor:"zod",version:1}))}),Bh=Y("$ZodString",(e,a)=>{var r;ht.init(e,a),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??cT(e._zod.bag),e._zod.parse=(l,o)=>{if(a.coerce)try{l.value=String(l.value)}catch{}return typeof l.value=="string"||l.issues.push({expected:"string",code:"invalid_type",input:l.value,inst:e}),l}}),mt=Y("$ZodStringFormat",(e,a)=>{Rc.init(e,a),Bh.init(e,a)}),AT=Y("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=Xz),mt.init(e,a)}),zT=Y("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Gb(l))}else a.pattern??(a.pattern=Gb());mt.init(e,a)}),TT=Y("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=Jz),mt.init(e,a)}),RT=Y("$ZodURL",(e,a)=>{mt.init(e,a),e._zod.check=r=>{try{const l=r.value.trim(),o=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:r.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:r.value,inst:e,continue:!a.abort})),a.normalize?r.value=o.href:r.value=l;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!a.abort})}}}),OT=Y("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=eT()),mt.init(e,a)}),MT=Y("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=Fz),mt.init(e,a)}),DT=Y("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=Qz),mt.init(e,a)}),UT=Y("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=Pz),mt.init(e,a)}),LT=Y("$ZodULID",(e,a)=>{a.pattern??(a.pattern=Gz),mt.init(e,a)}),$T=Y("$ZodXID",(e,a)=>{a.pattern??(a.pattern=Vz),mt.init(e,a)}),qT=Y("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=Kz),mt.init(e,a)}),BT=Y("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=uT(a)),mt.init(e,a)}),ZT=Y("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=iT),mt.init(e,a)}),HT=Y("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=oT(a)),mt.init(e,a)}),IT=Y("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=Yz),mt.init(e,a)}),QT=Y("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=tT),mt.init(e,a),e._zod.bag.format="ipv4"}),PT=Y("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=nT),mt.init(e,a),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!a.abort})}}}),GT=Y("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=aT),mt.init(e,a)}),VT=Y("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=rT),mt.init(e,a),e._zod.check=r=>{const l=r.value.split("/");try{if(l.length!==2)throw new Error;const[o,c]=l;if(!c)throw new Error;const m=Number(c);if(`${m}`!==c)throw new Error;if(m<0||m>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!a.abort})}}});function r1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const KT=Y("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=sT),mt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{r1(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!a.abort})}});function FT(e){if(!XS.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),r=a.padEnd(Math.ceil(a.length/4)*4,"=");return r1(r)}const YT=Y("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=XS),mt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{FT(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!a.abort})}}),XT=Y("$ZodE164",(e,a)=>{a.pattern??(a.pattern=lT),mt.init(e,a)});function JT(e,a=null){try{const r=e.split(".");if(r.length!==3)return!1;const[l]=r;if(!l)return!1;const o=JSON.parse(atob(l));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||a&&(!("alg"in o)||o.alg!==a))}catch{return!1}}const WT=Y("$ZodJWT",(e,a)=>{mt.init(e,a),e._zod.check=r=>{JT(r.value,a.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!a.abort})}}),s1=Y("$ZodNumber",(e,a)=>{ht.init(e,a),e._zod.pattern=e._zod.bag.pattern??e1,e._zod.parse=(r,l)=>{if(a.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const c=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...c?{received:c}:{}}),r}}),eR=Y("$ZodNumberFormat",(e,a)=>{gT.init(e,a),s1.init(e,a)}),tR=Y("$ZodBoolean",(e,a)=>{ht.init(e,a),e._zod.pattern=fT,e._zod.parse=(r,l)=>{if(a.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),nR=Y("$ZodUnknown",(e,a)=>{ht.init(e,a),e._zod.parse=r=>r}),aR=Y("$ZodNever",(e,a)=>{ht.init(e,a),e._zod.parse=(r,l)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Vb(e,a,r){e.issues.length&&a.issues.push(...kl(r,e.issues)),a.value[r]=e.value}const rR=Y("$ZodArray",(e,a)=>{ht.init(e,a),e._zod.parse=(r,l)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const c=[];for(let m=0;m<o.length;m++){const h=o[m],g=a.element._zod.run({value:h,issues:[]},l);g instanceof Promise?c.push(g.then(p=>Vb(p,r,m))):Vb(g,r,m)}return c.length?Promise.all(c).then(()=>r):r}});function mc(e,a,r,l,o){if(e.issues.length){if(o&&!(r in l))return;a.issues.push(...kl(r,e.issues))}e.value===void 0?r in l&&(a.value[r]=void 0):a.value[r]=e.value}function l1(e){var l,o,c,m;const a=Object.keys(e.shape);for(const h of a)if(!((m=(c=(o=(l=e.shape)==null?void 0:l[h])==null?void 0:o._zod)==null?void 0:c.traits)!=null&&m.has("$ZodType")))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const r=wz(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(r)}}function i1(e,a,r,l,o,c){const m=[],h=o.keySet,g=o.catchall._zod,p=g.def.type,b=g.optout==="optional";for(const x in a){if(h.has(x))continue;if(p==="never"){m.push(x);continue}const j=g.run({value:a[x],issues:[]},l);j instanceof Promise?e.push(j.then(N=>mc(N,r,x,a,b))):mc(j,r,x,a,b)}return m.length&&r.issues.push({code:"unrecognized_keys",keys:m,input:a,inst:c}),e.length?Promise.all(e).then(()=>r):r}const sR=Y("$ZodObject",(e,a)=>{ht.init(e,a);const r=Object.getOwnPropertyDescriptor(a,"shape");if(!(r!=null&&r.get)){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const g={...h};return Object.defineProperty(a,"shape",{value:g}),g}})}const l=Ac(()=>l1(a));Ye(e._zod,"propValues",()=>{const h=a.shape,g={};for(const p in h){const b=h[p]._zod;if(b.values){g[p]??(g[p]=new Set);for(const x of b.values)g[p].add(x)}}return g});const o=lo,c=a.catchall;let m;e._zod.parse=(h,g)=>{m??(m=l.value);const p=h.value;if(!o(p))return h.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),h;h.value={};const b=[],x=m.shape;for(const j of m.keys){const N=x[j],z=N._zod.optout==="optional",w=N._zod.run({value:p[j],issues:[]},g);w instanceof Promise?b.push(w.then(E=>mc(E,h,j,p,z))):mc(w,h,j,p,z)}return c?i1(b,p,h,g,l.value,e):b.length?Promise.all(b).then(()=>h):h}}),lR=Y("$ZodObjectJIT",(e,a)=>{sR.init(e,a);const r=e._zod.parse,l=Ac(()=>l1(a)),o=j=>{var D;const N=new CT(["shape","payload","ctx"]),z=l.value,w=O=>{const P=Pb(O);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};N.write("const input = payload.value;");const E=Object.create(null);let M=0;for(const O of z.keys)E[O]=`key_${M++}`;N.write("const newResult = {};");for(const O of z.keys){const P=E[O],I=Pb(O),L=j[O],K=((D=L==null?void 0:L._zod)==null?void 0:D.optout)==="optional";N.write(`const ${P} = ${w(O)};`),K?N.write(`
|
|
297
|
-
if (${P}.issues.length) {
|
|
298
|
-
if (${I} in input) {
|
|
299
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
300
|
-
...iss,
|
|
301
|
-
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
302
|
-
})));
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (${P}.value === undefined) {
|
|
307
|
-
if (${I} in input) {
|
|
308
|
-
newResult[${I}] = undefined;
|
|
309
|
-
}
|
|
310
|
-
} else {
|
|
311
|
-
newResult[${I}] = ${P}.value;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
`):N.write(`
|
|
315
|
-
if (${P}.issues.length) {
|
|
316
|
-
payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
|
|
317
|
-
...iss,
|
|
318
|
-
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
319
|
-
})));
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
if (${P}.value === undefined) {
|
|
323
|
-
if (${I} in input) {
|
|
324
|
-
newResult[${I}] = undefined;
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
newResult[${I}] = ${P}.value;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
`)}N.write("payload.value = newResult;"),N.write("return payload;");const B=N.compile();return(O,P)=>B(j,O,P)};let c;const m=lo,h=!QS.jitless,p=h&&Sz.value,b=a.catchall;let x;e._zod.parse=(j,N)=>{x??(x=l.value);const z=j.value;return m(z)?h&&p&&(N==null?void 0:N.async)===!1&&N.jitless!==!0?(c||(c=o(a.shape)),j=c(j,N),b?i1([],z,j,N,x,e):j):r(j,N):(j.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),j)}});function Kb(e,a,r,l){for(const c of e)if(c.issues.length===0)return a.value=c.value,a;const o=e.filter(c=>!Cl(c));return o.length===1?(a.value=o[0].value,o[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:r,errors:e.map(c=>c.issues.map(m=>qr(m,l,$r())))}),a)}const o1=Y("$ZodUnion",(e,a)=>{ht.init(e,a),Ye(e._zod,"optin",()=>a.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ye(e._zod,"optout",()=>a.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ye(e._zod,"values",()=>{if(a.options.every(o=>o._zod.values))return new Set(a.options.flatMap(o=>Array.from(o._zod.values)))}),Ye(e._zod,"pattern",()=>{if(a.options.every(o=>o._zod.pattern)){const o=a.options.map(c=>c._zod.pattern);return new RegExp(`^(${o.map(c=>Uh(c.source)).join("|")})$`)}});const r=a.options.length===1,l=a.options[0]._zod.run;e._zod.parse=(o,c)=>{if(r)return l(o,c);let m=!1;const h=[];for(const g of a.options){const p=g._zod.run({value:o.value,issues:[]},c);if(p instanceof Promise)h.push(p),m=!0;else{if(p.issues.length===0)return p;h.push(p)}}return m?Promise.all(h).then(g=>Kb(g,o,e,c)):Kb(h,o,e,c)}}),iR=Y("$ZodDiscriminatedUnion",(e,a)=>{a.inclusive=!1,o1.init(e,a);const r=e._zod.parse;Ye(e._zod,"propValues",()=>{const o={};for(const c of a.options){const m=c._zod.propValues;if(!m||Object.keys(m).length===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(c)}"`);for(const[h,g]of Object.entries(m)){o[h]||(o[h]=new Set);for(const p of g)o[h].add(p)}}return o});const l=Ac(()=>{var m;const o=a.options,c=new Map;for(const h of o){const g=(m=h._zod.propValues)==null?void 0:m[a.discriminator];if(!g||g.size===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(h)}"`);for(const p of g){if(c.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);c.set(p,h)}}return c});e._zod.parse=(o,c)=>{const m=o.value;if(!lo(m))return o.issues.push({code:"invalid_type",expected:"object",input:m,inst:e}),o;const h=l.value.get(m==null?void 0:m[a.discriminator]);return h?h._zod.run(o,c):a.unionFallback?r(o,c):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:a.discriminator,input:m,path:[a.discriminator],inst:e}),o)}}),oR=Y("$ZodIntersection",(e,a)=>{ht.init(e,a),e._zod.parse=(r,l)=>{const o=r.value,c=a.left._zod.run({value:o,issues:[]},l),m=a.right._zod.run({value:o,issues:[]},l);return c instanceof Promise||m instanceof Promise?Promise.all([c,m]).then(([g,p])=>Fb(r,g,p)):Fb(r,c,m)}});function sh(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(Ql(e)&&Ql(a)){const r=Object.keys(a),l=Object.keys(e).filter(c=>r.indexOf(c)!==-1),o={...e,...a};for(const c of l){const m=sh(e[c],a[c]);if(!m.valid)return{valid:!1,mergeErrorPath:[c,...m.mergeErrorPath]};o[c]=m.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let l=0;l<e.length;l++){const o=e[l],c=a[l],m=sh(o,c);if(!m.valid)return{valid:!1,mergeErrorPath:[l,...m.mergeErrorPath]};r.push(m.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Fb(e,a,r){const l=new Map;let o;for(const h of a.issues)if(h.code==="unrecognized_keys"){o??(o=h);for(const g of h.keys)l.has(g)||l.set(g,{}),l.get(g).l=!0}else e.issues.push(h);for(const h of r.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)l.has(g)||l.set(g,{}),l.get(g).r=!0;else e.issues.push(h);const c=[...l].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&o&&e.issues.push({...o,keys:c}),Cl(e))return e;const m=sh(a.value,r.value);if(!m.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(m.mergeErrorPath)}`);return e.value=m.data,e}const uR=Y("$ZodRecord",(e,a)=>{ht.init(e,a),e._zod.parse=(r,l)=>{const o=r.value;if(!Ql(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const c=[],m=a.keyType._zod.values;if(m){r.value={};const h=new Set;for(const p of m)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){h.add(typeof p=="number"?p.toString():p);const b=a.valueType._zod.run({value:o[p],issues:[]},l);b instanceof Promise?c.push(b.then(x=>{x.issues.length&&r.issues.push(...kl(p,x.issues)),r.value[p]=x.value})):(b.issues.length&&r.issues.push(...kl(p,b.issues)),r.value[p]=b.value)}let g;for(const p in o)h.has(p)||(g=g??[],g.push(p));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:g})}else{r.value={};for(const h of Reflect.ownKeys(o)){if(h==="__proto__")continue;let g=a.keyType._zod.run({value:h,issues:[]},l);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&e1.test(h)&&g.issues.length){const x=a.keyType._zod.run({value:Number(h),issues:[]},l);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(g=x)}if(g.issues.length){a.mode==="loose"?r.value[h]=o[h]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>qr(x,l,$r())),input:h,path:[h],inst:e});continue}const b=a.valueType._zod.run({value:o[h],issues:[]},l);b instanceof Promise?c.push(b.then(x=>{x.issues.length&&r.issues.push(...kl(h,x.issues)),r.value[g.value]=x.value})):(b.issues.length&&r.issues.push(...kl(h,b.issues)),r.value[g.value]=b.value)}}return c.length?Promise.all(c).then(()=>r):r}}),cR=Y("$ZodEnum",(e,a)=>{ht.init(e,a);const r=PS(a.entries),l=new Set(r);e._zod.values=l,e._zod.pattern=new RegExp(`^(${r.filter(o=>jz.has(typeof o)).map(o=>typeof o=="string"?Pl(o):o.toString()).join("|")})$`),e._zod.parse=(o,c)=>{const m=o.value;return l.has(m)||o.issues.push({code:"invalid_value",values:r,input:m,inst:e}),o}}),dR=Y("$ZodLiteral",(e,a)=>{if(ht.init(e,a),a.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(a.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${a.values.map(l=>typeof l=="string"?Pl(l):l?Pl(l.toString()):String(l)).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return r.has(c)||l.issues.push({code:"invalid_value",values:a.values,input:c,inst:e}),l}}),fR=Y("$ZodTransform",(e,a)=>{ht.init(e,a),e._zod.parse=(r,l)=>{if(l.direction==="backward")throw new IS(e.constructor.name);const o=a.transform(r.value,r);if(l.async)return(o instanceof Promise?o:Promise.resolve(o)).then(m=>(r.value=m,r));if(o instanceof Promise)throw new Tl;return r.value=o,r}});function Yb(e,a){return e.issues.length&&a===void 0?{issues:[],value:void 0}:e}const u1=Y("$ZodOptional",(e,a)=>{ht.init(e,a),e._zod.optin="optional",e._zod.optout="optional",Ye(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),Ye(e._zod,"pattern",()=>{const r=a.innerType._zod.pattern;return r?new RegExp(`^(${Uh(r.source)})?$`):void 0}),e._zod.parse=(r,l)=>{if(a.innerType._zod.optin==="optional"){const o=a.innerType._zod.run(r,l);return o instanceof Promise?o.then(c=>Yb(c,r.value)):Yb(o,r.value)}return r.value===void 0?r:a.innerType._zod.run(r,l)}}),mR=Y("$ZodExactOptional",(e,a)=>{u1.init(e,a),Ye(e._zod,"values",()=>a.innerType._zod.values),Ye(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(r,l)=>a.innerType._zod.run(r,l)}),hR=Y("$ZodNullable",(e,a)=>{ht.init(e,a),Ye(e._zod,"optin",()=>a.innerType._zod.optin),Ye(e._zod,"optout",()=>a.innerType._zod.optout),Ye(e._zod,"pattern",()=>{const r=a.innerType._zod.pattern;return r?new RegExp(`^(${Uh(r.source)}|null)$`):void 0}),Ye(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(r,l)=>r.value===null?r:a.innerType._zod.run(r,l)}),pR=Y("$ZodDefault",(e,a)=>{ht.init(e,a),e._zod.optin="optional",Ye(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(r,l)=>{if(l.direction==="backward")return a.innerType._zod.run(r,l);if(r.value===void 0)return r.value=a.defaultValue,r;const o=a.innerType._zod.run(r,l);return o instanceof Promise?o.then(c=>Xb(c,a)):Xb(o,a)}});function Xb(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const gR=Y("$ZodPrefault",(e,a)=>{ht.init(e,a),e._zod.optin="optional",Ye(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(r,l)=>(l.direction==="backward"||r.value===void 0&&(r.value=a.defaultValue),a.innerType._zod.run(r,l))}),vR=Y("$ZodNonOptional",(e,a)=>{ht.init(e,a),Ye(e._zod,"values",()=>{const r=a.innerType._zod.values;return r?new Set([...r].filter(l=>l!==void 0)):void 0}),e._zod.parse=(r,l)=>{const o=a.innerType._zod.run(r,l);return o instanceof Promise?o.then(c=>Jb(c,e)):Jb(o,e)}});function Jb(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const yR=Y("$ZodCatch",(e,a)=>{ht.init(e,a),Ye(e._zod,"optin",()=>a.innerType._zod.optin),Ye(e._zod,"optout",()=>a.innerType._zod.optout),Ye(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(r,l)=>{if(l.direction==="backward")return a.innerType._zod.run(r,l);const o=a.innerType._zod.run(r,l);return o instanceof Promise?o.then(c=>(r.value=c.value,c.issues.length&&(r.value=a.catchValue({...r,error:{issues:c.issues.map(m=>qr(m,l,$r()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=a.catchValue({...r,error:{issues:o.issues.map(c=>qr(c,l,$r()))},input:r.value}),r.issues=[]),r)}}),bR=Y("$ZodPipe",(e,a)=>{ht.init(e,a),Ye(e._zod,"values",()=>a.in._zod.values),Ye(e._zod,"optin",()=>a.in._zod.optin),Ye(e._zod,"optout",()=>a.out._zod.optout),Ye(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(r,l)=>{if(l.direction==="backward"){const c=a.out._zod.run(r,l);return c instanceof Promise?c.then(m=>Ju(m,a.in,l)):Ju(c,a.in,l)}const o=a.in._zod.run(r,l);return o instanceof Promise?o.then(c=>Ju(c,a.out,l)):Ju(o,a.out,l)}});function Ju(e,a,r){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues},r)}const xR=Y("$ZodReadonly",(e,a)=>{ht.init(e,a),Ye(e._zod,"propValues",()=>a.innerType._zod.propValues),Ye(e._zod,"values",()=>a.innerType._zod.values),Ye(e._zod,"optin",()=>{var r,l;return(l=(r=a.innerType)==null?void 0:r._zod)==null?void 0:l.optin}),Ye(e._zod,"optout",()=>{var r,l;return(l=(r=a.innerType)==null?void 0:r._zod)==null?void 0:l.optout}),e._zod.parse=(r,l)=>{if(l.direction==="backward")return a.innerType._zod.run(r,l);const o=a.innerType._zod.run(r,l);return o instanceof Promise?o.then(Wb):Wb(o)}});function Wb(e){return e.value=Object.freeze(e.value),e}const SR=Y("$ZodCustom",(e,a)=>{dn.init(e,a),ht.init(e,a),e._zod.parse=(r,l)=>r,e._zod.check=r=>{const l=r.value,o=a.fn(l);if(o instanceof Promise)return o.then(c=>ex(c,r,l,e));ex(o,r,l,e)}});function ex(e,a,r,l){if(!e){const o={code:"custom",input:r,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(o.params=l._zod.def.params),a.issues.push(io(o))}}var tx;class jR{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...r){const l=r[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const r=this._map.get(a);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(a),this}get(a){const r=a._zod.parent;if(r){const l={...this.get(r)??{}};delete l.id;const o={...l,...this._map.get(a)};return Object.keys(o).length?o:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function wR(){return new jR}(tx=globalThis).__zod_globalRegistry??(tx.__zod_globalRegistry=wR());const Xi=globalThis.__zod_globalRegistry;function NR(e,a){return new e({type:"string",...ge(a)})}function ER(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ge(a)})}function nx(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ge(a)})}function _R(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(a)})}function CR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(a)})}function kR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(a)})}function AR(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(a)})}function zR(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ge(a)})}function TR(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(a)})}function RR(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(a)})}function OR(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(a)})}function MR(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(a)})}function DR(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(a)})}function UR(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ge(a)})}function LR(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(a)})}function $R(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(a)})}function qR(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(a)})}function BR(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(a)})}function ZR(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(a)})}function HR(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ge(a)})}function IR(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(a)})}function QR(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ge(a)})}function PR(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(a)})}function GR(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(a)})}function VR(e,a){return new e({type:"string",format:"date",check:"string_format",...ge(a)})}function KR(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...ge(a)})}function FR(e,a){return new e({type:"string",format:"duration",check:"string_format",...ge(a)})}function YR(e,a){return new e({type:"number",checks:[],...ge(a)})}function XR(e,a){return new e({type:"number",coerce:!0,checks:[],...ge(a)})}function JR(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(a)})}function WR(e,a){return new e({type:"boolean",...ge(a)})}function eO(e){return new e({type:"unknown"})}function tO(e,a){return new e({type:"never",...ge(a)})}function ax(e,a){return new n1({check:"less_than",...ge(a),value:e,inclusive:!1})}function jm(e,a){return new n1({check:"less_than",...ge(a),value:e,inclusive:!0})}function rx(e,a){return new a1({check:"greater_than",...ge(a),value:e,inclusive:!1})}function wm(e,a){return new a1({check:"greater_than",...ge(a),value:e,inclusive:!0})}function sx(e,a){return new pT({check:"multiple_of",...ge(a),value:e})}function c1(e,a){return new vT({check:"max_length",...ge(a),maximum:e})}function hc(e,a){return new yT({check:"min_length",...ge(a),minimum:e})}function d1(e,a){return new bT({check:"length_equals",...ge(a),length:e})}function nO(e,a){return new xT({check:"string_format",format:"regex",...ge(a),pattern:e})}function aO(e){return new ST({check:"string_format",format:"lowercase",...ge(e)})}function rO(e){return new jT({check:"string_format",format:"uppercase",...ge(e)})}function sO(e,a){return new wT({check:"string_format",format:"includes",...ge(a),includes:e})}function lO(e,a){return new NT({check:"string_format",format:"starts_with",...ge(a),prefix:e})}function iO(e,a){return new ET({check:"string_format",format:"ends_with",...ge(a),suffix:e})}function Wl(e){return new _T({check:"overwrite",tx:e})}function oO(e){return Wl(a=>a.normalize(e))}function uO(){return Wl(e=>e.trim())}function cO(){return Wl(e=>e.toLowerCase())}function dO(){return Wl(e=>e.toUpperCase())}function fO(){return Wl(e=>xz(e))}function mO(e,a,r){return new e({type:"array",element:a,...ge(r)})}function hO(e,a,r){return new e({type:"custom",check:"custom",fn:a,...ge(r)})}function pO(e){const a=gO(r=>(r.addIssue=l=>{if(typeof l=="string")r.issues.push(io(l,r.value,a._zod.def));else{const o=l;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=a),o.continue??(o.continue=!a._zod.def.abort),r.issues.push(io(o))}},e(r.value,r)));return a}function gO(e,a){const r=new dn({check:"custom",...ge(a)});return r._zod.check=e,r}function f1(e){let a=(e==null?void 0:e.target)??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Xi,target:a,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 Ct(e,a,r={path:[],schemaPath:[]}){var b,x;var l;const o=e._zod.def,c=a.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;const m={schema:{},count:1,cycle:void 0,path:r.path};a.seen.set(e,m);const h=(x=(b=e._zod).toJSONSchema)==null?void 0:x.call(b);if(h)m.schema=h;else{const j={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,m.schema,j);else{const z=m.schema,w=a.processors[o.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);w(e,a,z,j)}const N=e._zod.parent;N&&(m.ref||(m.ref=N),Ct(N,a,j),a.seen.get(N).isParent=!0)}const g=a.metadataRegistry.get(e);return g&&Object.assign(m.schema,g),a.io==="input"&&Yt(e)&&(delete m.schema.examples,delete m.schema.default),a.io==="input"&&m.schema._prefault&&((l=m.schema).default??(l.default=m.schema._prefault)),delete m.schema._prefault,a.seen.get(e).schema}function m1(e,a){var m,h,g,p;const r=e.seen.get(a);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const b of e.seen.entries()){const x=(m=e.metadataRegistry.get(b[0]))==null?void 0:m.id;if(x){const j=l.get(x);if(j&&j!==b[0])throw new Error(`Duplicate schema id "${x}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(x,b[0])}}const o=b=>{var w;const x=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(w=e.external.registry.get(b[0]))==null?void 0:w.id,M=e.external.uri??(D=>D);if(E)return{ref:M(E)};const B=b[1].defId??b[1].schema.id??`schema${e.counter++}`;return b[1].defId=B,{defId:B,ref:`${M("__shared")}#/${x}/${B}`}}if(b[1]===r)return{ref:"#"};const N=`#/${x}/`,z=b[1].schema.id??`__schema${e.counter++}`;return{defId:z,ref:N+z}},c=b=>{if(b[1].schema.$ref)return;const x=b[1],{ref:j,defId:N}=o(b);x.def={...x.schema},N&&(x.defId=N);const z=x.schema;for(const w in z)delete z[w];z.$ref=j};if(e.cycles==="throw")for(const b of e.seen.entries()){const x=b[1];if(x.cycle)throw new Error(`Cycle detected: #/${(h=x.cycle)==null?void 0:h.join("/")}/<root>
|
|
331
|
-
|
|
332
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const b of e.seen.entries()){const x=b[1];if(a===b[0]){c(b);continue}if(e.external){const N=(g=e.external.registry.get(b[0]))==null?void 0:g.id;if(a!==b[0]&&N){c(b);continue}}if((p=e.metadataRegistry.get(b[0]))==null?void 0:p.id){c(b);continue}if(x.cycle){c(b);continue}if(x.count>1&&e.reused==="ref"){c(b);continue}}}function h1(e,a){var m,h,g;const r=e.seen.get(a);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=p=>{const b=e.seen.get(p);if(b.ref===null)return;const x=b.def??b.schema,j={...x},N=b.ref;if(b.ref=null,N){l(N);const w=e.seen.get(N),E=w.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(x.allOf=x.allOf??[],x.allOf.push(E)):Object.assign(x,E),Object.assign(x,j),p._zod.parent===N)for(const B in x)B==="$ref"||B==="allOf"||B in j||delete x[B];if(E.$ref&&w.def)for(const B in x)B==="$ref"||B==="allOf"||B in w.def&&JSON.stringify(x[B])===JSON.stringify(w.def[B])&&delete x[B]}const z=p._zod.parent;if(z&&z!==N){l(z);const w=e.seen.get(z);if(w!=null&&w.schema.$ref&&(x.$ref=w.schema.$ref,w.def))for(const E in x)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(x[E])===JSON.stringify(w.def[E])&&delete x[E]}e.override({zodSchema:p,jsonSchema:x,path:b.path??[]})};for(const p of[...e.seen.entries()].reverse())l(p[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(m=e.external)!=null&&m.uri){const p=(h=e.external.registry.get(a))==null?void 0:h.id;if(!p)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(p)}Object.assign(o,r.def??r.schema);const c=((g=e.external)==null?void 0:g.defs)??{};for(const p of e.seen.entries()){const b=p[1];b.def&&b.defId&&(c[b.defId]=b.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?o.$defs=c:o.definitions=c);try{const p=JSON.parse(JSON.stringify(o));return Object.defineProperty(p,"~standard",{value:{...a["~standard"],jsonSchema:{input:pc(a,"input",e.processors),output:pc(a,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Yt(e,a){const r=a??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return Yt(l.element,r);if(l.type==="set")return Yt(l.valueType,r);if(l.type==="lazy")return Yt(l.getter(),r);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return Yt(l.innerType,r);if(l.type==="intersection")return Yt(l.left,r)||Yt(l.right,r);if(l.type==="record"||l.type==="map")return Yt(l.keyType,r)||Yt(l.valueType,r);if(l.type==="pipe")return Yt(l.in,r)||Yt(l.out,r);if(l.type==="object"){for(const o in l.shape)if(Yt(l.shape[o],r))return!0;return!1}if(l.type==="union"){for(const o of l.options)if(Yt(o,r))return!0;return!1}if(l.type==="tuple"){for(const o of l.items)if(Yt(o,r))return!0;return!!(l.rest&&Yt(l.rest,r))}return!1}const vO=(e,a={})=>r=>{const l=f1({...r,processors:a});return Ct(e,l),m1(l,e),h1(l,e)},pc=(e,a,r={})=>l=>{const{libraryOptions:o,target:c}=l??{},m=f1({...o??{},target:c,io:a,processors:r});return Ct(e,m),m1(m,e),h1(m,e)},yO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bO=(e,a,r,l)=>{const o=r;o.type="string";const{minimum:c,maximum:m,format:h,patterns:g,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(o.minLength=c),typeof m=="number"&&(o.maxLength=m),h&&(o.format=yO[h]??h,o.format===""&&delete o.format,h==="time"&&delete o.format),p&&(o.contentEncoding=p),g&&g.size>0){const b=[...g];b.length===1?o.pattern=b[0].source:b.length>1&&(o.allOf=[...b.map(x=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},xO=(e,a,r,l)=>{const o=r,{minimum:c,maximum:m,format:h,multipleOf:g,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof h=="string"&&h.includes("int")?o.type="integer":o.type="number",typeof b=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(o.minimum=b,o.exclusiveMinimum=!0):o.exclusiveMinimum=b),typeof c=="number"&&(o.minimum=c,typeof b=="number"&&a.target!=="draft-04"&&(b>=c?delete o.minimum:delete o.exclusiveMinimum)),typeof p=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p),typeof m=="number"&&(o.maximum=m,typeof p=="number"&&a.target!=="draft-04"&&(p<=m?delete o.maximum:delete o.exclusiveMaximum)),typeof g=="number"&&(o.multipleOf=g)},SO=(e,a,r,l)=>{r.type="boolean"},jO=(e,a,r,l)=>{r.not={}},wO=(e,a,r,l)=>{},NO=(e,a,r,l)=>{const o=e._zod.def,c=PS(o.entries);c.every(m=>typeof m=="number")&&(r.type="number"),c.every(m=>typeof m=="string")&&(r.type="string"),r.enum=c},EO=(e,a,r,l)=>{const o=e._zod.def,c=[];for(const m of o.values)if(m===void 0){if(a.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof m=="bigint"){if(a.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(m))}else c.push(m);if(c.length!==0)if(c.length===1){const m=c[0];r.type=m===null?"null":typeof m,a.target==="draft-04"||a.target==="openapi-3.0"?r.enum=[m]:r.const=m}else c.every(m=>typeof m=="number")&&(r.type="number"),c.every(m=>typeof m=="string")&&(r.type="string"),c.every(m=>typeof m=="boolean")&&(r.type="boolean"),c.every(m=>m===null)&&(r.type="null"),r.enum=c},_O=(e,a,r,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},CO=(e,a,r,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kO=(e,a,r,l)=>{const o=r,c=e._zod.def,{minimum:m,maximum:h}=e._zod.bag;typeof m=="number"&&(o.minItems=m),typeof h=="number"&&(o.maxItems=h),o.type="array",o.items=Ct(c.element,a,{...l,path:[...l.path,"items"]})},AO=(e,a,r,l)=>{var p;const o=r,c=e._zod.def;o.type="object",o.properties={};const m=c.shape;for(const b in m)o.properties[b]=Ct(m[b],a,{...l,path:[...l.path,"properties",b]});const h=new Set(Object.keys(m)),g=new Set([...h].filter(b=>{const x=c.shape[b]._zod;return a.io==="input"?x.optin===void 0:x.optout===void 0}));g.size>0&&(o.required=Array.from(g)),((p=c.catchall)==null?void 0:p._zod.def.type)==="never"?o.additionalProperties=!1:c.catchall?c.catchall&&(o.additionalProperties=Ct(c.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(o.additionalProperties=!1)},zO=(e,a,r,l)=>{const o=e._zod.def,c=o.inclusive===!1,m=o.options.map((h,g)=>Ct(h,a,{...l,path:[...l.path,c?"oneOf":"anyOf",g]}));c?r.oneOf=m:r.anyOf=m},TO=(e,a,r,l)=>{const o=e._zod.def,c=Ct(o.left,a,{...l,path:[...l.path,"allOf",0]}),m=Ct(o.right,a,{...l,path:[...l.path,"allOf",1]}),h=p=>"allOf"in p&&Object.keys(p).length===1,g=[...h(c)?c.allOf:[c],...h(m)?m.allOf:[m]];r.allOf=g},RO=(e,a,r,l)=>{const o=r,c=e._zod.def;o.type="object";const m=c.keyType,h=m._zod.bag,g=h==null?void 0:h.patterns;if(c.mode==="loose"&&g&&g.size>0){const b=Ct(c.valueType,a,{...l,path:[...l.path,"patternProperties","*"]});o.patternProperties={};for(const x of g)o.patternProperties[x.source]=b}else(a.target==="draft-07"||a.target==="draft-2020-12")&&(o.propertyNames=Ct(c.keyType,a,{...l,path:[...l.path,"propertyNames"]})),o.additionalProperties=Ct(c.valueType,a,{...l,path:[...l.path,"additionalProperties"]});const p=m._zod.values;if(p){const b=[...p].filter(x=>typeof x=="string"||typeof x=="number");b.length>0&&(o.required=b)}},OO=(e,a,r,l)=>{const o=e._zod.def,c=Ct(o.innerType,a,l),m=a.seen.get(e);a.target==="openapi-3.0"?(m.ref=o.innerType,r.nullable=!0):r.anyOf=[c,{type:"null"}]},MO=(e,a,r,l)=>{const o=e._zod.def;Ct(o.innerType,a,l);const c=a.seen.get(e);c.ref=o.innerType},DO=(e,a,r,l)=>{const o=e._zod.def;Ct(o.innerType,a,l);const c=a.seen.get(e);c.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},UO=(e,a,r,l)=>{const o=e._zod.def;Ct(o.innerType,a,l);const c=a.seen.get(e);c.ref=o.innerType,a.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},LO=(e,a,r,l)=>{const o=e._zod.def;Ct(o.innerType,a,l);const c=a.seen.get(e);c.ref=o.innerType;let m;try{m=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=m},$O=(e,a,r,l)=>{const o=e._zod.def,c=a.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ct(c,a,l);const m=a.seen.get(e);m.ref=c},qO=(e,a,r,l)=>{const o=e._zod.def;Ct(o.innerType,a,l);const c=a.seen.get(e);c.ref=o.innerType,r.readOnly=!0},p1=(e,a,r,l)=>{const o=e._zod.def;Ct(o.innerType,a,l);const c=a.seen.get(e);c.ref=o.innerType},BO=Y("ZodISODateTime",(e,a)=>{BT.init(e,a),gt.init(e,a)});function ZO(e){return GR(BO,e)}const HO=Y("ZodISODate",(e,a)=>{ZT.init(e,a),gt.init(e,a)});function IO(e){return VR(HO,e)}const QO=Y("ZodISOTime",(e,a)=>{HT.init(e,a),gt.init(e,a)});function PO(e){return KR(QO,e)}const GO=Y("ZodISODuration",(e,a)=>{IT.init(e,a),gt.init(e,a)});function VO(e){return FR(GO,e)}const KO=(e,a)=>{FS.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Oz(e,r)},flatten:{value:r=>Rz(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,rh,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,rh,2)}},isEmpty:{get(){return e.issues.length===0}}})},In=Y("ZodError",KO,{Parent:Error}),FO=$h(In),YO=qh(In),XO=zc(In),JO=Tc(In),WO=Uz(In),e4=Lz(In),t4=$z(In),n4=qz(In),a4=Bz(In),r4=Zz(In),s4=Hz(In),l4=Iz(In),pt=Y("ZodType",(e,a)=>(ht.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:pc(e,"input"),output:pc(e,"output")}}),e.toJSONSchema=vO(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.check=(...r)=>e.clone(Zr(a,{checks:[...a.checks??[],...r.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(r,l)=>Hr(e,r,l),e.brand=()=>e,e.register=((r,l)=>(r.add(e,l),e)),e.parse=(r,l)=>FO(e,r,l,{callee:e.parse}),e.safeParse=(r,l)=>XO(e,r,l),e.parseAsync=async(r,l)=>YO(e,r,l,{callee:e.parseAsync}),e.safeParseAsync=async(r,l)=>JO(e,r,l),e.spa=e.safeParseAsync,e.encode=(r,l)=>WO(e,r,l),e.decode=(r,l)=>e4(e,r,l),e.encodeAsync=async(r,l)=>t4(e,r,l),e.decodeAsync=async(r,l)=>n4(e,r,l),e.safeEncode=(r,l)=>a4(e,r,l),e.safeDecode=(r,l)=>r4(e,r,l),e.safeEncodeAsync=async(r,l)=>s4(e,r,l),e.safeDecodeAsync=async(r,l)=>l4(e,r,l),e.refine=(r,l)=>e.check(W4(r,l)),e.superRefine=r=>e.check(eM(r)),e.overwrite=r=>e.check(Wl(r)),e.optional=()=>ox(e),e.exactOptional=()=>B4(e),e.nullable=()=>ux(e),e.nullish=()=>ox(ux(e)),e.nonoptional=r=>G4(e,r),e.array=()=>Yn(e),e.or=r=>y1([e,r]),e.and=r=>M4(e,r),e.transform=r=>cx(e,$4(r)),e.default=r=>I4(e,r),e.prefault=r=>P4(e,r),e.catch=r=>K4(e,r),e.pipe=r=>cx(e,r),e.readonly=()=>X4(e),e.describe=r=>{const l=e.clone();return Xi.add(l,{description:r}),l},Object.defineProperty(e,"description",{get(){var r;return(r=Xi.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Xi.get(e);const l=e.clone();return Xi.add(l,r[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),g1=Y("_ZodString",(e,a)=>{Bh.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(l,o,c)=>bO(e,l,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...l)=>e.check(nO(...l)),e.includes=(...l)=>e.check(sO(...l)),e.startsWith=(...l)=>e.check(lO(...l)),e.endsWith=(...l)=>e.check(iO(...l)),e.min=(...l)=>e.check(hc(...l)),e.max=(...l)=>e.check(c1(...l)),e.length=(...l)=>e.check(d1(...l)),e.nonempty=(...l)=>e.check(hc(1,...l)),e.lowercase=l=>e.check(aO(l)),e.uppercase=l=>e.check(rO(l)),e.trim=()=>e.check(uO()),e.normalize=(...l)=>e.check(oO(...l)),e.toLowerCase=()=>e.check(cO()),e.toUpperCase=()=>e.check(dO()),e.slugify=()=>e.check(fO())}),i4=Y("ZodString",(e,a)=>{Bh.init(e,a),g1.init(e,a),e.email=r=>e.check(ER(o4,r)),e.url=r=>e.check(zR(u4,r)),e.jwt=r=>e.check(PR(N4,r)),e.emoji=r=>e.check(TR(c4,r)),e.guid=r=>e.check(nx(lx,r)),e.uuid=r=>e.check(_R(Wu,r)),e.uuidv4=r=>e.check(CR(Wu,r)),e.uuidv6=r=>e.check(kR(Wu,r)),e.uuidv7=r=>e.check(AR(Wu,r)),e.nanoid=r=>e.check(RR(d4,r)),e.guid=r=>e.check(nx(lx,r)),e.cuid=r=>e.check(OR(f4,r)),e.cuid2=r=>e.check(MR(m4,r)),e.ulid=r=>e.check(DR(h4,r)),e.base64=r=>e.check(HR(S4,r)),e.base64url=r=>e.check(IR(j4,r)),e.xid=r=>e.check(UR(p4,r)),e.ksuid=r=>e.check(LR(g4,r)),e.ipv4=r=>e.check($R(v4,r)),e.ipv6=r=>e.check(qR(y4,r)),e.cidrv4=r=>e.check(BR(b4,r)),e.cidrv6=r=>e.check(ZR(x4,r)),e.e164=r=>e.check(QR(w4,r)),e.datetime=r=>e.check(ZO(r)),e.date=r=>e.check(IO(r)),e.time=r=>e.check(PO(r)),e.duration=r=>e.check(VO(r))});function _(e){return NR(i4,e)}const gt=Y("ZodStringFormat",(e,a)=>{mt.init(e,a),g1.init(e,a)}),o4=Y("ZodEmail",(e,a)=>{TT.init(e,a),gt.init(e,a)}),lx=Y("ZodGUID",(e,a)=>{AT.init(e,a),gt.init(e,a)}),Wu=Y("ZodUUID",(e,a)=>{zT.init(e,a),gt.init(e,a)}),u4=Y("ZodURL",(e,a)=>{RT.init(e,a),gt.init(e,a)}),c4=Y("ZodEmoji",(e,a)=>{OT.init(e,a),gt.init(e,a)}),d4=Y("ZodNanoID",(e,a)=>{MT.init(e,a),gt.init(e,a)}),f4=Y("ZodCUID",(e,a)=>{DT.init(e,a),gt.init(e,a)}),m4=Y("ZodCUID2",(e,a)=>{UT.init(e,a),gt.init(e,a)}),h4=Y("ZodULID",(e,a)=>{LT.init(e,a),gt.init(e,a)}),p4=Y("ZodXID",(e,a)=>{$T.init(e,a),gt.init(e,a)}),g4=Y("ZodKSUID",(e,a)=>{qT.init(e,a),gt.init(e,a)}),v4=Y("ZodIPv4",(e,a)=>{QT.init(e,a),gt.init(e,a)}),y4=Y("ZodIPv6",(e,a)=>{PT.init(e,a),gt.init(e,a)}),b4=Y("ZodCIDRv4",(e,a)=>{GT.init(e,a),gt.init(e,a)}),x4=Y("ZodCIDRv6",(e,a)=>{VT.init(e,a),gt.init(e,a)}),S4=Y("ZodBase64",(e,a)=>{KT.init(e,a),gt.init(e,a)}),j4=Y("ZodBase64URL",(e,a)=>{YT.init(e,a),gt.init(e,a)}),w4=Y("ZodE164",(e,a)=>{XT.init(e,a),gt.init(e,a)}),N4=Y("ZodJWT",(e,a)=>{WT.init(e,a),gt.init(e,a)}),Zh=Y("ZodNumber",(e,a)=>{s1.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(l,o,c)=>xO(e,l,o),e.gt=(l,o)=>e.check(rx(l,o)),e.gte=(l,o)=>e.check(wm(l,o)),e.min=(l,o)=>e.check(wm(l,o)),e.lt=(l,o)=>e.check(ax(l,o)),e.lte=(l,o)=>e.check(jm(l,o)),e.max=(l,o)=>e.check(jm(l,o)),e.int=l=>e.check(ix(l)),e.safe=l=>e.check(ix(l)),e.positive=l=>e.check(rx(0,l)),e.nonnegative=l=>e.check(wm(0,l)),e.negative=l=>e.check(ax(0,l)),e.nonpositive=l=>e.check(jm(0,l)),e.multipleOf=(l,o)=>e.check(sx(l,o)),e.step=(l,o)=>e.check(sx(l,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Qe(e){return YR(Zh,e)}const E4=Y("ZodNumberFormat",(e,a)=>{eR.init(e,a),Zh.init(e,a)});function ix(e){return JR(E4,e)}const _4=Y("ZodBoolean",(e,a)=>{tR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>SO(e,r,l)});function xo(e){return WR(_4,e)}const C4=Y("ZodUnknown",(e,a)=>{nR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>wO()});function it(){return eO(C4)}const k4=Y("ZodNever",(e,a)=>{aR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>jO(e,r,l)});function A4(e){return tO(k4,e)}const z4=Y("ZodArray",(e,a)=>{rR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>kO(e,r,l,o),e.element=a.element,e.min=(r,l)=>e.check(hc(r,l)),e.nonempty=r=>e.check(hc(1,r)),e.max=(r,l)=>e.check(c1(r,l)),e.length=(r,l)=>e.check(d1(r,l)),e.unwrap=()=>e.element});function Yn(e,a){return mO(z4,e,a)}const T4=Y("ZodObject",(e,a)=>{lR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>AO(e,r,l,o),Ye(e,"shape",()=>a.shape),e.keyof=()=>Pe(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:it()}),e.loose=()=>e.clone({...e._zod.def,catchall:it()}),e.strict=()=>e.clone({...e._zod.def,catchall:A4()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Cz(e,r),e.safeExtend=r=>kz(e,r),e.merge=r=>Az(e,r),e.pick=r=>Ez(e,r),e.omit=r=>_z(e,r),e.partial=(...r)=>zz(x1,e,r[0]),e.required=(...r)=>Tz(S1,e,r[0])});function ae(e,a){const r={type:"object",shape:e??{},...ge(a)};return new T4(r)}const v1=Y("ZodUnion",(e,a)=>{o1.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>zO(e,r,l,o),e.options=a.options});function y1(e,a){return new v1({type:"union",options:e,...ge(a)})}const R4=Y("ZodDiscriminatedUnion",(e,a)=>{v1.init(e,a),iR.init(e,a)});function b1(e,a,r){return new R4({type:"union",options:a,discriminator:e,...ge(r)})}const O4=Y("ZodIntersection",(e,a)=>{oR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>TO(e,r,l,o)});function M4(e,a){return new O4({type:"intersection",left:e,right:a})}const D4=Y("ZodRecord",(e,a)=>{uR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>RO(e,r,l,o),e.keyType=a.keyType,e.valueType=a.valueType});function kt(e,a,r){return new D4({type:"record",keyType:e,valueType:a,...ge(r)})}const lh=Y("ZodEnum",(e,a)=>{cR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(l,o,c)=>NO(e,l,o),e.enum=a.entries,e.options=Object.values(a.entries);const r=new Set(Object.keys(a.entries));e.extract=(l,o)=>{const c={};for(const m of l)if(r.has(m))c[m]=a.entries[m];else throw new Error(`Key ${m} not found in enum`);return new lh({...a,checks:[],...ge(o),entries:c})},e.exclude=(l,o)=>{const c={...a.entries};for(const m of l)if(r.has(m))delete c[m];else throw new Error(`Key ${m} not found in enum`);return new lh({...a,checks:[],...ge(o),entries:c})}});function Pe(e,a){const r=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new lh({type:"enum",entries:r,...ge(a)})}const U4=Y("ZodLiteral",(e,a)=>{dR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>EO(e,r,l),e.values=new Set(a.values),Object.defineProperty(e,"value",{get(){if(a.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return a.values[0]}})});function Fn(e,a){return new U4({type:"literal",values:Array.isArray(e)?e:[e],...ge(a)})}const L4=Y("ZodTransform",(e,a)=>{fR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>CO(e,r),e._zod.parse=(r,l)=>{if(l.direction==="backward")throw new IS(e.constructor.name);r.addIssue=c=>{if(typeof c=="string")r.issues.push(io(c,r.value,a));else{const m=c;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=r.value),m.inst??(m.inst=e),r.issues.push(io(m))}};const o=a.transform(r.value,r);return o instanceof Promise?o.then(c=>(r.value=c,r)):(r.value=o,r)}});function $4(e){return new L4({type:"transform",transform:e})}const x1=Y("ZodOptional",(e,a)=>{u1.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>p1(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new x1({type:"optional",innerType:e})}const q4=Y("ZodExactOptional",(e,a)=>{mR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>p1(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function B4(e){return new q4({type:"optional",innerType:e})}const Z4=Y("ZodNullable",(e,a)=>{hR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>OO(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function ux(e){return new Z4({type:"nullable",innerType:e})}const H4=Y("ZodDefault",(e,a)=>{pR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>DO(e,r,l,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function I4(e,a){return new H4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():VS(a)}})}const Q4=Y("ZodPrefault",(e,a)=>{gR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>UO(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function P4(e,a){return new Q4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():VS(a)}})}const S1=Y("ZodNonOptional",(e,a)=>{vR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>MO(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function G4(e,a){return new S1({type:"nonoptional",innerType:e,...ge(a)})}const V4=Y("ZodCatch",(e,a)=>{yR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>LO(e,r,l,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function K4(e,a){return new V4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const F4=Y("ZodPipe",(e,a)=>{bR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>$O(e,r,l,o),e.in=a.in,e.out=a.out});function cx(e,a){return new F4({type:"pipe",in:e,out:a})}const Y4=Y("ZodReadonly",(e,a)=>{xR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>qO(e,r,l,o),e.unwrap=()=>e._zod.def.innerType});function X4(e){return new Y4({type:"readonly",innerType:e})}const J4=Y("ZodCustom",(e,a)=>{SR.init(e,a),pt.init(e,a),e._zod.processJSONSchema=(r,l,o)=>_O(e,r)});function W4(e,a={}){return hO(J4,e,a)}function eM(e){return pO(e)}const Nm={custom:"custom"};function Oc(e){return XR(Zh,e)}const tM={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},j1=Pe(["feishu","slack","kael"]),w1=Pe(["active","inactive"]);ae({platform:j1,agentId:_().min(1),credentials:kt(_(),it()),status:w1.default("active")});ae({agentId:_().min(1).optional(),credentials:kt(_(),it()).optional(),status:w1.optional()});ae({id:Qe(),platform:_(),agentId:_(),hasCredentials:xo(),status:_(),createdAt:_(),updatedAt:_()});const nM=Pe(["code","reverse_token","oauth","manual"]);ae({appId:_().min(1),appSecret:_().min(1)});ae({platform:j1,externalUserId:_().min(1),agentId:_().min(1),boundVia:nM.default("manual"),displayName:_().max(200).optional()});ae({id:Qe(),platform:_(),externalUserId:_(),agentId:_(),boundVia:_().nullable(),displayName:_().nullable(),createdAt:_()});ae({feishuUserId:_().min(1),displayName:_().max(200).optional()});ae({configId:Qe(),platform:_(),agentId:_(),appId:_(),connected:xo(),lastActiveAt:_().nullable()});const N1=Pe(["online","offline"]),E1=Pe(["idle","working","blocked","error"]),aM=Pe(["active","suspended","evicted"]);ae({chatId:_().min(1),state:aM});ae({runtimeState:E1});ae({agentId:_().min(1),runtimeType:_().max(50),runtimeVersion:_().max(50).optional()});Pe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);ae({agentId:_(),status:N1,connectedAt:_().nullable(),lastSeenAt:_(),clientId:_().nullable().optional(),runtimeType:_().nullable().optional(),runtimeVersion:_().nullable().optional(),runtimeState:E1.nullable().optional(),activeSessions:Qe().int().nullable().optional(),totalSessions:Qe().int().nullable().optional(),runtimeUpdatedAt:_().nullable().optional()});ae({total:Qe().int(),running:Qe().int(),byState:ae({idle:Qe().int(),working:Qe().int(),blocked:Qe().int(),error:Qe().int()}),clients:Qe().int()});const rM={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Mc=Pe(["human","personal_assistant","autonomous_agent"]),Hh=Pe(["private","organization"]),sM=Pe(["admin-api","portal"]);Pe(["active","suspended"]);ae({name:_().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Mc,displayName:_().max(200).optional(),delegateMention:_().max(100).optional(),organizationId:_().max(100).optional(),source:sM.optional(),visibility:Hh.optional(),metadata:kt(_(),it()).optional(),managerId:_().optional(),clientId:_().min(1).max(100).optional()});ae({type:Mc.optional(),displayName:_().max(200).nullable().optional(),delegateMention:_().max(100).nullable().optional(),visibility:Hh.optional(),metadata:kt(_(),it()).optional(),managerId:_().nullable().optional(),clientId:_().min(1).max(100).nullable().optional()});ae({uuid:_(),name:_().nullable(),organizationId:_(),type:Mc,displayName:_().nullable(),delegateMention:_().nullable(),inboxId:_(),status:_(),source:_().nullable().optional(),cloudUserId:_().nullable().optional(),visibility:Hh,metadata:kt(_(),it()),managerId:_().nullable(),clientId:_().nullable(),presenceStatus:N1.optional(),createdAt:_(),updatedAt:_()});ae({repo:_().nullable(),branch:_().nullable()});ae({type:Fn("agent:pinned"),agentId:_(),name:_().nullable(),displayName:_().nullable(),agentType:Mc});const lM=32e3,Ih=/^[a-z0-9][a-z0-9_-]{0,63}$/i,iM=/^[A-Z][A-Z0-9_]*$/,oM=ae({append:_().max(lM).default("")}),uM=ae({name:_().regex(Ih,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Fn("stdio"),command:_().min(1),args:Yn(_()).optional()}),cM=ae({name:_().regex(Ih,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Fn("http"),url:_().url(),headers:kt(_(),_()).optional()}),dM=ae({name:_().regex(Ih,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Fn("sse"),url:_().url(),headers:kt(_(),_()).optional()}),fM=b1("transport",[uM,cM,dM]),mM=ae({key:_().regex(iM,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:_(),sensitive:xo().default(!1)}),hM=ae({url:_().min(1),ref:_().min(1).optional(),localPath:_().min(1).optional()}),Qh=ae({prompt:oM.default({append:""}),model:_().default(""),mcpServers:Yn(fM).default([]),env:Yn(mM).default([]),gitRepos:Yn(hM).default([])}),pM=(e,a)=>{const r=new Set;e.mcpServers.forEach((c,m)=>{const h=c.name.toLowerCase();r.has(h)&&a.addIssue({code:Nm.custom,path:["mcpServers",m,"name"],message:`Duplicate MCP server name "${c.name}"`}),r.add(h)});const l=new Set;e.env.forEach((c,m)=>{l.has(c.key)&&a.addIssue({code:Nm.custom,path:["env",m,"key"],message:`Duplicate env key "${c.key}"`}),l.add(c.key)});const o=new Set;e.gitRepos.forEach((c,m)=>{const h=c.localPath??gc(c.url);h&&(o.has(h)&&a.addIssue({code:Nm.custom,path:["gitRepos",m,"localPath"],message:`Duplicate git repo local path "${h}"`}),o.add(h))})},_1=Qh.superRefine(pM),gM=ae({agentId:_(),version:Qe().int().positive(),payload:_1,updatedAt:_(),updatedBy:_()});ae({expectedVersion:Qe().int().positive(),payload:Qh.partial()});ae({payload:Qh.partial()});ae({current:gM,next:_1,diff:Yn(ae({path:_(),op:Pe(["add","remove","replace"]),before:it().optional(),after:it().optional()}))});const ih="***";function gc(e){const a=e.trim();return a?((a.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}ae({username:_().min(1),password:_().min(1)});ae({accessToken:_(),refreshToken:_()});ae({refreshToken:_().min(1)});ae({token:_().min(1)});ae({token:_(),expiresIn:Qe(),command:_()});const vM=Pe(["direct","group","thread"]);ae({type:vM,topic:_().max(500).optional(),participantIds:Yn(_()).min(1),metadata:kt(_(),it()).optional()});const yM=ae({agentId:_(),role:_(),mode:_(),joinedAt:_()}),bM=ae({id:_(),organizationId:_(),type:_(),topic:_().nullable(),lifecyclePolicy:_().nullable().optional(),metadata:kt(_(),it()),createdAt:_(),updatedAt:_()});bM.extend({participants:Yn(yM)});ae({agentId:_().min(1),mode:Pe(["full","mention_only"]).default("full")});ae({agentId:_().min(1)});const xM=Pe(["connected","disconnected"]);ae({id:_(),userId:_().nullable(),status:xM,sdkVersion:_().max(50).nullable(),hostname:_().max(100).nullable(),os:_().max(50).nullable(),agentCount:Qe().int().min(0),connectedAt:_().nullable(),lastSeenAt:_(),metadata:kt(_(),it()).nullable()});ae({clientId:_().min(1).max(100),hostname:_().max(100).optional(),os:_().max(50).optional(),sdkVersion:_().max(50).optional()});ae({limit:Oc().int().min(1).max(100).default(20),cursor:_().optional()});const Ph=Pe(["hub_ui","cli","feishu","github","api"]),C1=Pe(["text","markdown","card","reference","file","task"]);ae({format:C1.default("text"),content:it(),metadata:kt(_(),it()).optional(),inReplyTo:_().optional(),replyToInbox:_().optional(),replyToChat:_().optional(),source:Ph.optional()});ae({format:C1.default("text"),content:it(),metadata:kt(_(),it()).optional(),replyToInbox:_().optional(),replyToChat:_().optional(),source:Ph.optional()});const SM=ae({id:_(),chatId:_(),senderId:_(),format:_(),content:it(),metadata:kt(_(),it()),replyToInbox:_().nullable(),replyToChat:_().nullable(),inReplyTo:_().nullable(),source:Ph.nullable(),createdAt:_()}),jM=SM.extend({configVersion:Qe().int().positive()});Pe(["pending","delivered","acked","failed"]);const wM=ae({id:Qe(),inboxId:_(),messageId:_(),chatId:_().nullable(),status:_(),retryCount:Qe(),createdAt:_(),deliveredAt:_().nullable(),ackedAt:_().nullable()});wM.extend({message:jM});ae({limit:Oc().int().min(1).max(50).default(10)});const NM={ADMIN:"admin",MEMBER:"member"},Gh=Pe(["admin","member"]),EM=ae({id:_(),userId:_(),organizationId:_(),agentId:_(),role:Gh,createdAt:_()});ae({username:_().min(1).max(100),displayName:_().min(1).max(200),role:Gh.default("member")});ae({role:Gh.optional()});EM.extend({username:_(),displayName:_(),password:_()});const _M=Pe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),k1=Pe(["high","medium","low"]);ae({id:_(),organizationId:_(),type:_M,severity:k1,agentId:_().nullable(),chatId:_().nullable(),message:_(),read:xo(),createdAt:_()});ae({limit:Oc().int().min(1).max(100).default(20),cursor:_().optional(),severity:k1.optional(),read:Pe(["true","false"]).transform(e=>e==="true").optional(),agentId:_().optional()});const A1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ae({name:_().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=>!A1.test(e),"Name must not be a UUID format"),displayName:_().min(1).max(200),maxAgents:Qe().int().min(0).default(0),maxMessagesPerMinute:Qe().int().min(0).default(0),features:kt(_(),it()).default({})});ae({name:_().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=>!A1.test(e),"Name must not be a UUID format").optional(),displayName:_().min(1).max(200).optional(),maxAgents:Qe().int().min(0).optional(),maxMessagesPerMinute:Qe().int().min(0).optional(),features:kt(_(),it()).optional()});ae({id:_(),name:_(),displayName:_(),maxAgents:Qe(),maxMessagesPerMinute:Qe(),features:kt(_(),it()),createdAt:_(),updatedAt:_()});const CM=ae({workingCount:Qe().int().nonnegative(),errorMask:xo()}),kM=ae({type:Fn("pulse:tick"),organizationId:_(),agents:kt(_(),Yn(CM).length(32))}),AM=Pe(["tool_call","error","assistant_text","thinking","turn_end"]),z1=ae({toolUseId:_(),name:_(),args:it(),status:Pe(["pending","ok","error"]),durationMs:Qe().int().nonnegative().optional(),resultPreview:_().max(400).optional()}),T1=ae({source:Pe(["sdk","runtime","tool"]),message:_().max(2e3)}),R1=ae({text:_().max(8e3)}),O1=ae({}),M1=ae({status:Pe(["success","error"])}),zM=b1("kind",[ae({kind:Fn("tool_call"),payload:z1}),ae({kind:Fn("error"),payload:T1}),ae({kind:Fn("assistant_text"),payload:R1}),ae({kind:Fn("thinking"),payload:O1}),ae({kind:Fn("turn_end"),payload:M1})]);ae({id:_(),agentId:_(),chatId:_(),seq:Qe().int().positive(),kind:AM,payload:y1([z1,T1,R1,O1,M1]),createdAt:_()});ae({agentId:_(),chatId:_(),event:zM});ae({agentId:_(),chatId:_()});const TM=ae({organizationId:_(),agentCount:Qe(),chatCount:Qe(),messageCount:Qe()});ae({totalAgents:Qe(),totalChats:Qe(),totalMessages:Qe(),byOrganization:Yn(TM)});ae({key:_(),value:it(),updatedAt:_()});kt(_(),it());const $a={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},Em={[$a.INBOX_TIMEOUT_SECONDS]:300,[$a.MAX_RETRY_COUNT]:3,[$a.POLLING_INTERVAL_SECONDS]:5,[$a.PRESENCE_CLEANUP_SECONDS]:60},oo=Pe(["pending","assigned","working","completed","failed","cancelled"]),dx=Pe(["agent","admin"]),RM=Pe(["assigned","status_changed","cancelled"]);ae({taskId:_(),event:RM,title:_(),body:_().default(""),status:oo,fromStatus:oo.optional(),originRef:_().nullable().optional()});const OM=ae({title:_().min(1).max(500),body:_().optional(),assigneeAgentId:_().optional(),originRef:_().max(500).optional(),metadata:kt(_(),it()).optional()});OM.extend({organizationId:_().optional()});ae({status:Pe(["working","completed","failed"]),result:_().optional()});ae({assigneeAgentId:_().nullable().optional(),status:oo.optional(),result:_().optional()});ae({chatId:_().min(1)});const MM=ae({id:_(),organizationId:_(),title:_(),body:_(),status:oo,assigneeAgentId:_().nullable(),createdByType:dx,createdById:_(),originRef:_().nullable(),result:_().nullable(),metadata:kt(_(),it()),createdAt:_(),updatedAt:_(),cancelledAt:_().nullable(),cancelledByType:dx.nullable(),cancelledById:_().nullable()}),DM=ae({taskId:_(),chatId:_(),linkedByAgentId:_().nullable(),linkedAt:_()});MM.extend({chats:Yn(DM)});ae({status:oo.optional(),assigneeAgentId:_().optional(),originRef:_().optional(),limit:Oc().int().min(1).max(100).default(20),cursor:_().optional()});const UM=Pe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ae({taskId:_(),signal:UM,reason:_()});const LM=Pe(["active","suspended"]);ae({id:_(),username:_(),displayName:_(),avatarUrl:_().nullable(),status:LM,createdAt:_(),updatedAt:_()});ae({username:_().min(1).max(100),displayName:_().min(1).max(200),password:_().min(8).max(200)});ae({displayName:_().min(1).max(200).optional(),password:_().min(8).max(200).optional()});ae({type:Fn("auth"),token:_().min(1)});const D1=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function $M(e){const a=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const r of Object.values(e))for(let l=0;l<32&&l<r.length;l++){const o=r[l],c=a[l];!o||!c||(c.workingCount+=o.workingCount,c.errorMask=c.errorMask||o.errorMask)}return a}const qM=2e3,BM=3e4;let Nr=null,vc=!1,_m=0,Wi=null;const oh=new Set;let Ji=null,Al=0;function ZM(e){for(const a of oh)try{a(e)}catch{}Ji&&(e.type==="notification"?Ji.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(Ji.invalidateQueries({queryKey:["activity"]}),Ji.invalidateQueries({queryKey:["sessions"]})))}function U1(){const e=Eh();if(!(e!=null&&e.accessToken))return;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,l=new WebSocket(r);Nr=l,l.onmessage=o=>{if(l===Nr)try{const c=JSON.parse(o.data);ZM(c)}catch{}},l.onopen=()=>{l===Nr&&(_m=0)},l.onclose=()=>{if(l!==Nr||(Nr=null,vc||Al===0))return;_m++;const o=Math.min(qM*2**(_m-1),BM);Wi=setTimeout(()=>{Wi=null,!vc&&Al>0&&U1()},o)}}function HM(){vc=!0,Wi&&(clearTimeout(Wi),Wi=null),Nr&&(Nr.close(1e3,"unmount"),Nr=null)}function L1(e){const{onMessage:a,enabled:r=!0}=e??{},l=Bn(),o=v.useRef(a);o.current=a,v.useEffect(()=>{Ji=l},[l]),v.useEffect(()=>{if(!r)return;const c=m=>{var h;return(h=o.current)==null?void 0:h.call(o,m)};return oh.add(c),Al++,Al===1&&(vc=!1,U1()),()=>{oh.delete(c),Al--,Al===0&&HM()}},[r])}const $1=v.createContext({aggregated:D1,agents:{},receivedAtMs:null,stale:!0});function IM({children:e}){const[a,r]=v.useState({aggregated:D1,agents:{},receivedAtMs:null}),[l,o]=v.useState(()=>Date.now());L1({onMessage:m=>{const h=kM.safeParse(m);h.success&&r({aggregated:$M(h.data.agents),agents:h.data.agents,receivedAtMs:Date.now()})}}),v.useEffect(()=>{const m=setInterval(()=>o(Date.now()),1e4);return()=>clearInterval(m)},[]);const c=v.useMemo(()=>({...a,stale:a.receivedAtMs===null||l-a.receivedAtMs>3e4}),[a,l]);return u.jsx($1.Provider,{value:c,children:e})}function QM(){return v.useContext($1)}function q1(){return Ae.get("/admin/adapter-mappings")}function PM(e){return Ae.post("/admin/adapter-mappings",e)}function GM(e){return Ae.delete(`/admin/adapter-mappings/${e}`)}function B1(){return Ae.get("/admin/adapters/status")}function Z1(){return Ae.get("/admin/adapters")}function VM(e){return Ae.post("/admin/adapters",e)}function KM(e,a){return Ae.patch(`/admin/adapters/${e}`,a)}function FM(e){return Ae.delete(`/admin/adapters/${e}`)}const fx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mx=C0,H1=(e,a)=>r=>{var l;if((a==null?void 0:a.variants)==null)return mx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:c}=a,m=Object.keys(o).map(p=>{const b=r==null?void 0:r[p],x=c==null?void 0:c[p];if(b===null)return null;const j=fx(b)||fx(x);return o[p][j]}),h=r&&Object.entries(r).reduce((p,b)=>{let[x,j]=b;return j===void 0||(p[x]=j),p},{}),g=a==null||(l=a.compoundVariants)===null||l===void 0?void 0:l.reduce((p,b)=>{let{class:x,className:j,...N}=b;return Object.entries(N).every(z=>{let[w,E]=z;return Array.isArray(E)?E.includes({...c,...h}[w]):{...c,...h}[w]===E})?[...p,x,j]:p},[]);return mx(e,m,g,r==null?void 0:r.class,r==null?void 0:r.className)},YM=H1("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive/10 text-destructive",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wt({className:e,variant:a,...r}){return u.jsx("div",{className:je(YM({variant:a}),e),...r})}const ks=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("rounded-xl border bg-card text-card-foreground shadow-sm",e),...a}));ks.displayName="Card";const Gl=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("flex flex-col space-y-1.5 p-6",e),...a}));Gl.displayName="CardHeader";const Vl=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("font-semibold leading-none tracking-tight",e),...a}));Vl.displayName="CardTitle";const I1=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("text-sm text-muted-foreground",e),...a}));I1.displayName="CardDescription";const As=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("p-6 pt-0",e),...a}));As.displayName="CardContent";const XM=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{ref:r,className:je("flex items-center p-6 pt-0",e),...a}));XM.displayName="CardFooter";const Ha=v.forwardRef(({className:e,...a},r)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:r,className:je("w-full caption-bottom text-sm",e),...a})}));Ha.displayName="Table";const Ia=v.forwardRef(({className:e,...a},r)=>u.jsx("thead",{ref:r,className:je("[&_tr]:border-b",e),...a}));Ia.displayName="TableHeader";const Qa=v.forwardRef(({className:e,...a},r)=>u.jsx("tbody",{ref:r,className:je("[&_tr:last-child]:border-0",e),...a}));Qa.displayName="TableBody";const st=v.forwardRef(({className:e,...a},r)=>u.jsx("tr",{ref:r,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));st.displayName="TableRow";const Ne=v.forwardRef(({className:e,...a},r)=>u.jsx("th",{ref:r,className:je("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...a}));Ne.displayName="TableHead";const xe=v.forwardRef(({className:e,...a},r)=>u.jsx("td",{ref:r,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...a}));xe.displayName="TableCell";function JM(){const e=Pa(),a=Ka(),{data:r,isLoading:l}=Ie({queryKey:["adapters"],queryFn:Z1}),{data:o,isLoading:c}=Ie({queryKey:["adapter-mappings"],queryFn:q1}),{data:m}=Ie({queryKey:["adapter-statuses"],queryFn:B1,refetchInterval:15e3}),h=l||c;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold",children:"Platform Bindings"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Overview of all platform bindings. Manage bindings from each Agent's detail page."})]}),u.jsxs(ks,{children:[u.jsx(Gl,{children:u.jsx(Vl,{children:"Bot Bindings"})}),u.jsx(As,{children:u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Agent"}),u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Connection"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Qa,{children:h?u.jsx(st,{children:u.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):r!=null&&r.length?r.map(g=>{const p=m==null?void 0:m.find(b=>b.configId===g.id);return u.jsxs(st,{className:"cursor-pointer",onClick:()=>e(`/agents/${g.agentId}`),children:[u.jsx(xe,{className:"font-mono text-sm",children:a(g.agentId)}),u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:g.platform})}),u.jsx(xe,{children:u.jsx(Wt,{variant:g.status==="active"?"default":"destructive",children:g.status})}),u.jsx(xe,{children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",p!=null&&p.connected?"bg-green-500":"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:p!=null&&p.connected?"Online":"Offline"})]})}),u.jsx(xe,{className:"text-muted-foreground",children:da(g.createdAt)})]},g.id)}):u.jsx(st,{children:u.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No bot bindings"})})})]})})]}),u.jsxs(ks,{children:[u.jsx(Gl,{children:u.jsx(Vl,{children:"User Bindings"})}),u.jsx(As,{children:u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Agent"}),u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"External User ID"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Bound Via"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Qa,{children:h?u.jsx(st,{children:u.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):o!=null&&o.length?o.map(g=>u.jsxs(st,{className:"cursor-pointer",onClick:()=>e(`/agents/${g.agentId}`),children:[u.jsx(xe,{className:"font-mono text-sm",children:a(g.agentId)}),u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:g.platform})}),u.jsx(xe,{className:"font-mono text-sm",children:g.externalUserId}),u.jsx(xe,{children:g.displayName??"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:"outline",children:g.boundVia??"—"})}),u.jsx(xe,{className:"text-muted-foreground",children:da(g.createdAt)})]},g.id)):u.jsx(st,{children:u.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No user bindings"})})})]})})]})]})}function Q1(){return Ae.get("/members")}function WM(e){return Ae.post("/members",e)}function e3(e){return Ae.delete(`/members/${encodeURIComponent(e)}`)}const t3=H1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm 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-white 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 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),he=v.forwardRef(({className:e,variant:a,size:r,asChild:l=!1,...o},c)=>{const m=l?RA:"button";return u.jsx(m,{className:je(t3({variant:a,size:r,className:e})),ref:c,...o})});he.displayName="Button";const ct=v.forwardRef(({className:e,type:a,...r},l)=>u.jsx("input",{type:a,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm 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:l,...r}));ct.displayName="Input";var n3="Label",P1=v.forwardRef((e,a)=>u.jsx(Va.label,{...e,ref:a,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));P1.displayName=n3;var a3=P1;const Fe=v.forwardRef(({className:e,...a},r)=>u.jsx(a3,{ref:r,className:je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...a}));Fe.displayName="Label";const r3=Object.values(NM);function s3(){const e=Bn(),[a,r]=v.useState(!1),[l,o]=v.useState({username:"",displayName:"",role:"member"}),[c,m]=v.useState(null),{data:h,isLoading:g,error:p}=Ie({queryKey:["members"],queryFn:Q1}),b=lt({mutationFn:()=>WM({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:w=>{e.invalidateQueries({queryKey:["members"]}),m(w.password)}}),x=lt({mutationFn:e3,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){r(!1),o({username:"",displayName:"",role:"member"}),m(null)}function N(w){w.preventDefault(),b.mutate()}function z(w){window.confirm("Delete this member? Their human agent will also be deactivated.")&&x.mutate(w)}return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsx("h1",{className:"text-2xl font-semibold",children:"Members"}),u.jsxs(Ln,{open:a,onOpenChange:w=>w?r(!0):j(),children:[u.jsx(ez,{asChild:!0,children:u.jsxs(he,{children:[u.jsx(zs,{className:"h-4 w-4 mr-2"}),"Add Member"]})}),u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:c?"Member Created":"Create Member"})}),c?u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Member created. Share the password below — it will only be shown once."}),u.jsxs("div",{className:"flex items-center gap-2 rounded-md border p-3 bg-muted",children:[u.jsx("code",{className:"flex-1 text-sm font-mono",children:c}),u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(c),title:"Copy password",children:u.jsx(_h,{className:"h-4 w-4"})})]}),u.jsx($n,{children:u.jsx(he,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"member-username",children:"Username"}),u.jsx(ct,{id:"member-username",type:"text",value:l.username,onChange:w=>o({...l,username:w.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"member-name",children:"Display Name"}),u.jsx(ct,{id:"member-name",value:l.displayName,onChange:w=>o({...l,displayName:w.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:l.role,onChange:w=>o({...l,role:w.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r3.map(w=>u.jsx("option",{value:w,children:w},w))})]}),b.error instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:b.error.message}),u.jsx($n,{children:u.jsx(he,{type:"submit",disabled:b.isPending,children:b.isPending?"Creating...":"Create"})})]})]})]})]}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Username"}),u.jsx(Ne,{children:"Name"}),u.jsx(Ne,{children:"Role"}),u.jsx(Ne,{children:"Created"}),u.jsx(Ne,{className:"w-16"})]})}),u.jsx(Qa,{children:g?u.jsx(st,{children:u.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"Loading..."})}):p?u.jsx(st,{children:u.jsxs(xe,{colSpan:5,className:"text-center py-8 text-destructive",children:["Failed to load members: ",p instanceof Error?p.message:"Unknown error"]})}):(h==null?void 0:h.length)===0?u.jsx(st,{children:u.jsx(xe,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No members"})}):h==null?void 0:h.map(w=>u.jsxs(st,{children:[u.jsx(xe,{className:"font-medium",children:w.username}),u.jsx(xe,{children:w.displayName}),u.jsx(xe,{children:u.jsx(Wt,{variant:w.role==="admin"?"default":"secondary",children:w.role})}),u.jsx(xe,{className:"text-muted-foreground",children:da(w.createdAt)}),u.jsx(xe,{children:u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>z(w.id),disabled:x.isPending,title:"Delete",children:u.jsx(ao,{className:"h-4 w-4"})})})]},w.id))})]})})]})}function l3(){return Ae.get("/admin/system/config")}function i3(e){return Ae.patch("/admin/system/config",e)}const o3={[$a.INBOX_TIMEOUT_SECONDS]:"Inbox Timeout (seconds)",[$a.MAX_RETRY_COUNT]:"Max Retry Count",[$a.POLLING_INTERVAL_SECONDS]:"Polling Interval (seconds)",[$a.PRESENCE_CLEANUP_SECONDS]:"Presence Cleanup (seconds)"},hx=Object.values($a);function u3(){const e=Bn(),{data:a,isLoading:r}=Ie({queryKey:["system-config"],queryFn:l3}),[l,o]=v.useState({}),[c,m]=v.useState(!1);v.useEffect(()=>{if(!a)return;const p={};for(const b of hx){const x=a[b]??Em[b]??"";p[b]=String(x)}o(p)},[a]);const h=lt({mutationFn:()=>{const p={};for(const[b,x]of Object.entries(l)){const j=x.trim();if(j==="")p[b]=Em[b]??0;else{const N=Number(j);p[b]=Number.isNaN(N)?j:N}}return i3(p)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),g=p=>{p.preventDefault(),h.mutate()};return r?u.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold mb-6",children:"Settings"}),u.jsxs(ks,{children:[u.jsx(Gl,{children:u.jsx(Vl,{children:"System Configuration"})}),u.jsx(As,{children:u.jsxs("form",{onSubmit:g,className:"space-y-4",children:[hx.map(p=>u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:p,children:o3[p]??p}),u.jsx(ct,{id:p,value:l[p]??"",onChange:b=>o({...l,[p]:b.target.value})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",String(Em[p]??"—")]})]},p)),h.error instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:h.error.message}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(he,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving...":"Save Changes"}),c&&u.jsx("span",{className:"text-sm text-green-600",children:"Saved!"})]})]})})]})]})}const px=[{key:"members",label:"Members"},{key:"settings",label:"Settings"},{key:"bindings",label:"Bindings"}];function c3(){const e=Hn(),a=Pa(),r=e.hash.replace("#",""),l=px.some(c=>c.key===r)?r:"members",o=c=>{a({hash:c},{replace:!0})};return u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Admin"}),u.jsx("div",{className:"flex gap-1 border-b border-border mb-6",children:px.map(c=>u.jsx("button",{type:"button",onClick:()=>o(c.key),className:je("px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",l===c.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:c.label},c.key))}),l==="members"&&u.jsx(s3,{}),l==="settings"&&u.jsx(u3,{}),l==="bindings"&&u.jsx(JM,{})]})}function d3(e){return Ae.get(`/admin/agents/${e}/config`)}function f3(e,a){return Ae.patch(`/admin/agents/${e}/config`,a)}function m3(e,a){return Ae.post(`/admin/agents/${e}/config/dry-run`,{payload:a})}function h3(e){return Ae.get(`/admin/agents/${e}/client-status`)}function p3(e){const{agent:a}=e,[r,l]=v.useState(!1),o=a.displayName||a.name||a.uuid;return u.jsxs("section",{className:"rounded-md border border-red-200 bg-red-50/40",children:[u.jsxs("header",{className:"flex items-center gap-2 border-b border-red-200 px-4 py-2",children:[u.jsx(M2,{className:"h-4 w-4 text-red-700"}),u.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Danger Zone"})]}),u.jsxs("div",{className:"divide-y divide-red-200",children:[a.status==="active"?u.jsx(Cm,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(he,{variant:"outline",size:"sm",onClick:e.onSuspend,disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(Cm,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(he,{variant:"outline",size:"sm",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(Cm,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>l(!0),disabled:e.deletePending,children:[u.jsx(ao,{className:"h-3.5 w-3.5 mr-1.5"}),"Delete"]})})]}),u.jsx(g3,{open:r,onOpenChange:l,expected:o,onDelete:()=>{l(!1),e.onDelete()},deleting:e.deletePending})]})}function Cm(e){return u.jsxs("div",{className:"flex items-start justify-between gap-4 px-4 py-3 text-sm",children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium text-red-900",children:e.title}),u.jsx("p",{className:"text-xs text-red-800/80",children:e.body})]}),u.jsx("div",{children:e.action})]})}function g3({open:e,onOpenChange:a,expected:r,onDelete:l,deleting:o}){const[c,m]=v.useState("");function h(g){g.preventDefault(),c===r&&l()}return u.jsx(Ln,{open:e,onOpenChange:g=>{a(g),g||m("")},children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsxs(qn,{children:['Delete "',r,'"?']})}),u.jsxs("form",{onSubmit:h,className:"space-y-4",children:[u.jsxs("p",{className:"text-sm text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-gray-900",children:r})," ","to confirm."]}),u.jsx(ct,{value:c,onChange:g=>m(g.target.value),autoFocus:!0,placeholder:r,className:"font-mono"}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),disabled:o,children:"Cancel"}),u.jsx(he,{type:"submit",variant:"destructive",disabled:c!==r||o,children:o?"Deleting…":"Delete"})]})]})]})})}const v3={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-green-100 text-green-900"},modified:{label:"changed",tone:"bg-amber-100 text-amber-900"},deleted:{label:"will be removed on save",tone:"bg-red-100 text-red-900"}};function Vh({status:e,onEdit:a,onDelete:r,onUndo:l,children:o,disabled:c}){const m=v3[e],h=e==="deleted";return u.jsxs("div",{className:je("flex items-center gap-2 rounded border px-3 py-2 text-sm",h?"bg-red-50 border-red-200 text-red-900 line-through decoration-red-300":"bg-white"),children:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:o}),m.label&&u.jsx("span",{className:je("text-xs rounded px-1.5 py-0.5 whitespace-nowrap",m.tone),children:m.label}),!c&&(h?u.jsxs(he,{size:"sm",variant:"ghost",onClick:l,children:[u.jsx(U2,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsx(y3,{onEdit:a,onDelete:r}))]})}function y3({onEdit:e,onDelete:a}){return u.jsxs("div",{className:"flex gap-1",children:[u.jsx(he,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),u.jsxs(he,{size:"sm",variant:"ghost",onClick:a,title:"Delete",children:[u.jsx(j0,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function b3(e){const[a,r]=v.useState(null),l=e.items.filter(o=>o.status!=="deleted").length;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium",children:["Environment Variables (",l,")"]}),!e.disabled&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[u.jsx(zs,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No environment variables."}):e.items.map(o=>u.jsxs(Vh,{status:o.status,onEdit:()=>r({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>e.onDelete(o.key),onUndo:()=>e.onUndoDelete(o.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:o.value.key}),u.jsx("span",{className:"font-mono text-xs text-muted-foreground truncate max-w-xs",children:o.value.sensitive?"••••••":o.value.value||u.jsx("em",{children:"(empty)"})}),o.value.sensitive&&u.jsx(m2,{className:"h-3 w-3 text-muted-foreground"})]},o.key))}),a&&u.jsx(x3,{open:!!a,onOpenChange:o=>!o&&r(null),initial:a.mode==="edit"?a.initial:null,forbiddenKeys:e.otherKeys(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?e.onUpdate(a.key,o):e.onAdd(o),r(null)}})]})}function x3({open:e,onOpenChange:a,initial:r,forbiddenKeys:l,onSubmit:o}){const[c,m]=v.useState((r==null?void 0:r.key)??""),[h,g]=v.useState(r!=null&&r.sensitive?"":(r==null?void 0:r.value)??""),[p,b]=v.useState((r==null?void 0:r.sensitive)??!1),[x,j]=v.useState(null);v.useEffect(()=>{e&&(m((r==null?void 0:r.key)??""),g(r!=null&&r.sensitive?"":(r==null?void 0:r.value)??""),b((r==null?void 0:r.sensitive)??!1),j(null))},[e,r]);function N(z){if(z.preventDefault(),!c.match(/^[A-Z][A-Z0-9_]*$/)){j("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(l.has(c)){j(`Another entry already uses key "${c}".`);return}let w=h;if(p&&(r!=null&&r.sensitive)&&!h&&(w=ih),!p&&!r&&!h){j("Value is required for non-sensitive entries.");return}o({key:c,value:w,sensitive:p})}return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:r?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"env-key",children:"Key"}),u.jsx(ct,{id:"env-key",value:c,onChange:z=>m(z.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!r}),r&&u.jsx("p",{className:"text-xs text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"env-value",children:"Value"}),u.jsx(ct,{id:"env-value",type:p?"password":"text",autoComplete:"new-password",value:h,onChange:z=>g(z.target.value),placeholder:r!=null&&r.sensitive?"Leave empty to keep existing value":p?"new secret":"value",className:"font-mono"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[u.jsx("input",{type:"checkbox",checked:p,onChange:z=>b(z.target.checked),className:"h-4 w-4",disabled:!!r&&r.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),x&&u.jsx("p",{className:"text-sm text-destructive",children:x}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:r?"Done":"Add"})]})]})]})})}function S3(e){const[a,r]=v.useState(null),l=e.items.filter(o=>o.status!=="deleted").length;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium",children:["Git Repositories (",l,")"]}),!e.disabled&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[u.jsx(zs,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No Git repositories."}):e.items.map(o=>{const c=o.value.localPath??gc(o.value.url);return u.jsxs(Vh,{status:o.status,onEdit:()=>r({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>e.onDelete(o.key),onUndo:()=>e.onUndoDelete(o.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono text-xs",children:o.value.url}),o.value.ref&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:["@ ",o.value.ref]}),u.jsxs("span",{className:"text-xs text-muted-foreground",children:["→ ",c||"./"]})]},o.key)})}),a&&u.jsx(j3,{open:!!a,onOpenChange:o=>!o&&r(null),initial:a.mode==="edit"?a.initial:null,forbiddenPaths:e.otherPaths(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?e.onUpdate(a.key,o):e.onAdd(o),r(null)}})]})}function j3({open:e,onOpenChange:a,initial:r,forbiddenPaths:l,onSubmit:o}){const[c,m]=v.useState((r==null?void 0:r.url)??""),[h,g]=v.useState((r==null?void 0:r.ref)??""),[p,b]=v.useState((r==null?void 0:r.localPath)??""),[x,j]=v.useState(null);v.useEffect(()=>{e&&(m((r==null?void 0:r.url)??""),g((r==null?void 0:r.ref)??""),b((r==null?void 0:r.localPath)??""),j(null))},[e,r]);function N(z){z.preventDefault();const w=c.trim();if(!w){j("URL is required.");return}const E=p.trim()||gc(w);if(E&&l.has(E)){j(`Another repo already occupies local path "${E}".`);return}const M={url:w,...h.trim()?{ref:h.trim()}:{},...p.trim()?{localPath:p.trim()}:{}};o(M)}return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:r?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:N,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"git-url",children:"URL"}),u.jsx(ct,{id:"git-url",value:c,onChange:z=>m(z.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(ct,{id:"git-ref",value:h,onChange:z=>g(z.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(ct,{id:"git-path",value:p,onChange:z=>b(z.target.value),placeholder:gc(c)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),x&&u.jsx("p",{className:"text-sm text-destructive",children:x}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:r?"Done":"Add"})]})]})]})})}function G1(){const{data:e}=Ie({queryKey:["members","name-map"],queryFn:Q1,staleTime:3e4});return v.useMemo(()=>{const a=new Map;if(e)for(const r of e)a.set(r.id,r.displayName||r.username);return r=>r?a.get(r)??r:"—"},[e])}function w3({agent:e,onSave:a}){const[r,l]=v.useState(!1),o=Ka(),c=G1(),m=e.metadata,h=m==null?void 0:m.tree,g=typeof(h==null?void 0:h.role)=="string"?h.role:null,p=Array.isArray(h==null?void 0:h.domains)?(h==null?void 0:h.domains).filter(j=>typeof j=="string"):[],b=e.managerId?c(e.managerId):null,x=e.delegateMention?o(e.delegateMention):null;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsx("h2",{className:"text-sm font-medium",children:"Identity"}),e.status==="active"&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>l(!0),children:[u.jsx(N0,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]})]}),u.jsxs("div",{className:"px-4 py-3 text-sm space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-mono",children:e.name??e.uuid}),u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsx("span",{children:e.displayName??u.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),x&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx("span",{className:"font-mono",children:x})]})]})]}),u.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-gray-900",children:b??"—"})]}),g&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-gray-900",children:g})]}),u.jsxs("span",{children:["type ",u.jsx(Wt,{variant:"secondary",children:e.type})]}),p.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:p.map(j=>u.jsx(Wt,{variant:"outline",children:j},j))})]})]})]}),u.jsx(N3,{agent:e,open:r,onOpenChange:l,onSave:a})]})}function N3({agent:e,open:a,onOpenChange:r,onSave:l}){var w;const[o,c]=v.useState(e.displayName??""),[m,h]=v.useState(e.delegateMention??""),[g,p]=v.useState(!1),[b,x]=v.useState(null);v.useEffect(()=>{a&&(c(e.displayName??""),h(e.delegateMention??""),x(null))},[a,e]);const j=e.type==="human",N=Ie({queryKey:["agents-for-delegate"],queryFn:async()=>(await Mh({limit:100})).items.filter(M=>M.type==="personal_assistant"&&M.status==="active"),enabled:a&&j});async function z(E){E.preventDefault(),x(null),p(!0);try{await l({displayName:o||null,delegateMention:m||null}),r(!1)}catch(M){x(M instanceof Error?M.message:String(M))}finally{p(!1)}}return u.jsx(Ln,{open:a,onOpenChange:r,children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:z,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{children:"Name (mention)"}),u.jsx(ct,{value:e.name??"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Name is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"id-display",children:"Display Name"}),u.jsx(ct,{id:"id-display",value:o,onChange:E=>c(E.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),j&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:m,onChange:E=>h(E.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"None"}),(w=N.data)==null?void 0:w.map(E=>u.jsx("option",{value:E.uuid,children:E.displayName?`${E.displayName} (${E.name??E.uuid})`:E.name??E.uuid},E.uuid))]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),b&&u.jsx("p",{className:"text-sm text-destructive",children:b}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>r(!1),disabled:g,children:"Cancel"}),u.jsx(he,{type:"submit",disabled:g,children:g?"Saving…":"Save"})]})]})]})})}function E3(e){const[a,r]=v.useState(null),l=e.items.filter(o=>o.status!=="deleted").length;return u.jsxs("section",{className:"rounded-md border bg-white",children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium",children:["MCP Servers (",l,")"]}),!e.disabled&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>r({mode:"add"}),children:[u.jsx(zs,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(o=>u.jsxs(Vh,{status:o.status,onEdit:()=>r({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>e.onDelete(o.key),onUndo:()=>e.onUndoDelete(o.key),disabled:e.disabled,children:[u.jsx("span",{className:"text-xs rounded bg-gray-100 px-1.5 py-0.5 font-mono",children:o.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:o.value.name}),u.jsx("span",{className:"text-xs text-muted-foreground truncate",children:_3(o.value)})]},o.key))}),a&&u.jsx(C3,{open:!!a,onOpenChange:o=>!o&&r(null),initial:a.mode==="edit"?a.initial:null,forbiddenNames:e.otherNames(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?e.onUpdate(a.key,o):e.onAdd(o),r(null)}})]})}function _3(e){var a;if(e.transport==="stdio"){const r=(a=e.args)!=null&&a.length?` ${e.args.join(" ")}`:"";return`${e.command}${r}`}return e.url}function C3({open:e,onOpenChange:a,initial:r,forbiddenNames:l,onSubmit:o}){const[c,m]=v.useState((r==null?void 0:r.transport)??"stdio"),[h,g]=v.useState((r==null?void 0:r.name)??""),[p,b]=v.useState((r==null?void 0:r.transport)==="stdio"?r.command:""),[x,j]=v.useState((r==null?void 0:r.transport)==="stdio"&&r.args?r.args.join(" "):""),[N,z]=v.useState(r&&(r.transport==="http"||r.transport==="sse")?r.url:""),[w,E]=v.useState(null);v.useEffect(()=>{e&&(m((r==null?void 0:r.transport)??"stdio"),g((r==null?void 0:r.name)??""),b((r==null?void 0:r.transport)==="stdio"?r.command:""),j((r==null?void 0:r.transport)==="stdio"&&r.args?r.args.join(" "):""),z(r&&(r.transport==="http"||r.transport==="sse")?r.url:""),E(null))},[e,r]);function M(B){if(B.preventDefault(),!h.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(l.has(h.toLowerCase())){E(`Another MCP server is already named "${h}".`);return}let D;if(c==="stdio"){if(!p.trim()){E("stdio transport requires a command.");return}const O=x.trim().split(/\s+/).filter(P=>P.length>0);D={name:h,transport:"stdio",command:p.trim(),...O.length?{args:O}:{}}}else{const O=N.trim();try{new URL(O)}catch{E("URL is not valid.");return}D={name:h,transport:c,url:O}}o(D)}return u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:r?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:M,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:c,onChange:B=>m(B.target.value),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"mcp-name",children:"Name"}),u.jsx(ct,{id:"mcp-name",value:h,onChange:B=>g(B.target.value),placeholder:"playwright",className:"font-mono"})]}),c==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"mcp-command",children:"Command"}),u.jsx(ct,{id:"mcp-command",value:p,onChange:B=>b(B.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(ct,{id:"mcp-args",value:x,onChange:B=>j(B.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"mcp-url",children:"URL"}),u.jsx(ct,{id:"mcp-url",value:N,onChange:B=>z(B.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),w&&u.jsx("p",{className:"text-sm text-destructive",children:w}),u.jsxs($n,{children:[u.jsx(he,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(he,{type:"submit",children:r?"Done":"Add"})]})]})]})})}const gx=[{value:"claude-opus-4-6",label:"claude-opus-4-6",hint:"most capable"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6",hint:"default"},{value:"claude-haiku-4-5",label:"claude-haiku-4-5",hint:"fastest"}];function k3({value:e,baseline:a,onChange:r,onRevert:l,disabled:o}){const c=e!==a,m=!gx.some(h=>h.value===e)&&e!=="";return u.jsxs("section",{className:`rounded-md border bg-white ${c?"border-amber-300":"border-gray-200"}`,children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:["Model",c&&u.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),c&&u.jsx(he,{size:"sm",variant:"ghost",onClick:l,disabled:o,children:"Revert"})]}),u.jsxs("div",{className:"px-4 py-3 space-y-2",children:[u.jsxs("select",{value:e,onChange:h=>r(h.target.value),disabled:o,className:"flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[u.jsx("option",{value:"",children:"(agent default)"}),gx.map(h=>u.jsxs("option",{value:h.value,children:[h.label,h.hint?` — ${h.hint}`:""]},h.value)),m&&u.jsxs("option",{value:e,children:[e," — custom"]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which Claude model powers this agent. Applies to new sessions immediately; active sessions switch on their next message."})]})]})}function A3({value:e,baseline:a,onChange:r,onRevert:l,disabled:o}){const[c,m]=v.useState(!1),h=v.useRef(null),g=e!==a;return v.useEffect(()=>{var p;c&&((p=h.current)==null||p.focus())},[c]),u.jsxs("section",{className:`rounded-md border bg-white ${g?"border-amber-300":"border-gray-200"}`,children:[u.jsxs("header",{className:"flex items-center justify-between border-b px-4 py-2",children:[u.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:["System Prompt Append",g&&u.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),u.jsx("div",{className:"flex gap-2",children:!c&&!o&&u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>m(!0),children:[u.jsx(N0,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]})})]}),u.jsx("div",{className:"px-4 py-3",children:c?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:h,value:e,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),m(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{size:"sm",variant:"ghost",onClick:()=>{l(),m(!1)},disabled:!g,children:"Revert"}),u.jsx(he,{size:"sm",onClick:()=>m(!1),children:"Done"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):u.jsx("pre",{className:"whitespace-pre-wrap break-words rounded bg-muted p-3 text-sm font-mono max-h-64 overflow-auto min-h-8",children:e||u.jsx("span",{className:"text-muted-foreground italic font-sans",children:"No prompt append."})})})]})}const z3={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function T3(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage?null:u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-yellow-50/95 px-6 py-3 backdrop-blur",children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{"aria-hidden":!0,children:"🟡"}),u.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),u.jsx("span",{className:"text-muted-foreground",children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(a=>u.jsx("button",{type:"button",className:"rounded bg-white px-2 py-0.5 text-xs border hover:bg-amber-100",onClick:()=>e.onJumpTo(a),children:z3[a]},a))})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-xs text-amber-900 font-medium",children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-xs text-red-800 font-medium",children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&u.jsx(he,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(he,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(he,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?"Saving…":"Save"})]})]})})}function hs(e){return`agent-cfg-${e}`}function R3(e){switch(e){case"danger":return"border-red-300 bg-red-50 text-red-900";case"warning":return"border-amber-300 bg-amber-50 text-amber-900";case"muted":return"border-gray-300 bg-gray-50 text-gray-700";default:return"border-gray-200 bg-white text-gray-800"}}function O3(e){switch(e){case"danger":return"bg-red-500";case"warning":return"bg-amber-500";case"muted":return"bg-gray-400";default:return"bg-green-500"}}function M3(e){const{agent:a,clientStatus:r,runtimeState:l,isHuman:o}=e;return a.status==="suspended"?{tone:"muted",symbol:"◌",label:"Suspended"}:o?{tone:"neutral",symbol:"●",label:"Active"}:r!=null&&r.offlineSince&&!r.clientId?{tone:"muted",symbol:"○",label:"Unclaimed"}:r&&!r.online?{tone:"warning",symbol:"⚠",label:"Computer offline"}:l==="error"?{tone:"danger",symbol:"●",label:"Error"}:l==="working"?{tone:"neutral",symbol:"●",label:"Working"}:l==="idle"?{tone:"neutral",symbol:"●",label:"Idle"}:{tone:"neutral",symbol:"●",label:"Online"}}function D3(e){if(!e)return"—";const a=new Date(e).getTime(),r=Date.now()-a;if(!Number.isFinite(r)||r<0)return da(e);const l=Math.floor(r/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const o=Math.floor(l/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function U3(e){const{agent:a,cfg:r,clientStatus:l,runtimeType:o,activeSessions:c,isHuman:m}=e,h=M3(e),g=[];!m&&o&&g.push(o),!m&&typeof c=="number"&&g.push(`${c} session${c===1?"":"s"}`),r&&g.push(`config v${r.version}`);const p=l==null?void 0:l.offlineSince,b=!m&&l&&!l.online;return u.jsxs("div",{className:je("rounded-md border px-4 py-3 text-sm space-y-1",R3(h.tone)),children:[u.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",O3(h.tone)),"aria-hidden":!0}),u.jsx("span",{children:h.symbol==="⚠"?h.symbol:null}),u.jsx("span",{children:h.label}),g.length>0&&u.jsxs("span",{className:"text-muted-foreground font-normal",children:["· ",g.join(" · ")]})]}),!m&&u.jsx("div",{className:"text-xs text-muted-foreground",children:l!=null&&l.clientId?u.jsxs(u.Fragment,{children:["Computer ",u.jsx("span",{className:"font-mono",children:l.clientId}),l.online?null:u.jsxs(u.Fragment,{children:[" · offline since ",u.jsx("span",{children:da(p)})]})]}):u.jsx("span",{children:"No computer bound yet"})}),r&&u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Config updated by ",u.jsx("span",{className:"font-medium",children:r.updatedBy||"—"})," · ",D3(r.updatedAt)]}),b&&u.jsx("p",{className:"mt-1 text-xs text-amber-900",children:"Changes saved here won't take effect until the computer reconnects."}),!m&&!(l!=null&&l.clientId)&&a.status==="active"&&u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Configure now; it will apply when a computer claims this agent."})]})}function L3(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 $3(e,a){let r=a.size+1;for(;a.has(`${e}-${r}`);)r++;return`${e}-${r}`}function q3(e,a){return JSON.stringify(e)===JSON.stringify(a)}function km(e,a){return e.map((r,l)=>({key:`${a}-${l+1}`,value:r,baseline:r,status:"unchanged"}))}function vx(e){return e.map(a=>a.status==="deleted"?a:a.baseline==null?{...a,status:"added"}:q3(a.value,a.baseline)?{...a,status:"unchanged"}:{...a,status:"modified"})}function Am(e,a){const r=e;return{add:l=>a(o=>{const c=o[e],m=new Set(c.map(p=>p.key)),h=$3(r,m),g=[...c,{key:h,value:l,baseline:null,status:"added"}];return{...o,[e]:vx(g)}}),update:(l,o)=>a(c=>{const h=c[e].map(g=>g.key===l?{...g,value:o}:g);return{...c,[e]:vx(h)}}),remove:l=>a(o=>{const m=o[e].map(h=>h.key!==l?h:h.baseline==null?null:{...h,status:"deleted"}).filter(h=>h!==null);return{...o,[e]:m}}),undo:l=>a(o=>{const m=o[e].map(h=>h.key!==l||h.baseline==null?h:{...h,value:h.baseline,status:"unchanged"});return{...o,[e]:m}})}}function B3(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:km(e.payload.mcpServers,"mcp"),env:km(e.payload.env,"env"),git:km(e.payload.gitRepos,"git")}}function Z3(e){const[a,r]=v.useState(null);v.useEffect(()=>{e&&a===null&&r(B3(e))},[e,a]);const l=a??{promptAppend:"",model:"",mcp:[],env:[],git:[]},o=(e==null?void 0:e.payload.prompt.append)??"",c=(e==null?void 0:e.payload.model)??"",m=l.promptAppend!==o,h=l.model!==c,g=v.useMemo(()=>{const D=[],O=K=>K.reduce((le,Se)=>Se.status==="unchanged"?le:le+1,0),P=O(l.mcp),I=O(l.env),L=O(l.git);return m&&D.push("prompt"),h&&D.push("model"),P>0&&D.push("mcp"),I>0&&D.push("env"),L>0&&D.push("git"),{anyDirty:D.length>0,dirtySections:D,counts:{prompt:m?1:0,model:h?1:0,mcp:P,env:I,git:L}}},[l,m,h]),p=v.useCallback(D=>{r(O=>O&&D(O))},[]),b=v.useCallback(D=>p(O=>({...O,promptAppend:D})),[p]),x=v.useCallback(()=>p(D=>({...D,promptAppend:o})),[p,o]),j=v.useCallback(D=>p(O=>({...O,model:D})),[p]),N=v.useCallback(()=>p(D=>({...D,model:c})),[p,c]),z=v.useMemo(()=>Am("mcp",p),[p]),w=v.useMemo(()=>Am("env",p),[p]),E=v.useMemo(()=>Am("git",p),[p]),M=v.useCallback(()=>{r(null)},[]),B=v.useCallback(()=>{if(!a||!e)return{};const D={};m&&(D.prompt={append:a.promptAppend}),h&&(D.model=a.model);const O=g.counts.mcp>0,P=g.counts.env>0,I=g.counts.git>0;return O&&(D.mcpServers=a.mcp.filter(L=>L.status!=="deleted").map(L=>L.value)),P&&(D.env=a.env.filter(L=>L.status!=="deleted").map(L=>{const K=L.value;return K.sensitive&&K.value===ih?{key:K.key,value:ih,sensitive:!0}:K})),I&&(D.gitRepos=a.git.filter(L=>L.status!=="deleted").map(L=>L.value)),D},[a,e,m,h,g]);return{draft:l,summary:g,promptDirty:m,modelDirty:h,setPromptAppend:b,revertPrompt:x,setModel:j,revertModel:N,addMcp:z.add,updateMcp:z.update,deleteMcp:z.remove,undoDeleteMcp:z.undo,addEnv:w.add,updateEnv:w.update,deleteEnv:w.remove,undoDeleteEnv:w.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:M,buildPayloadPatch:B}}const H3=Object.values(tM);function I3(){var No,Eo,Gr,Vr,Kr,ea,Fr,Fa,_o;const a=HE().uuid??"",r=Pa(),l=Bn(),o=Ie({queryKey:["agent",a],queryFn:()=>ZS(a),enabled:!!a}),c=Ie({queryKey:["agent-config",a],queryFn:()=>d3(a),enabled:!!a&&((No=o.data)==null?void 0:No.type)!=="human"}),m=Ie({queryKey:["agent-client-status",a],queryFn:()=>h3(a),enabled:!!a&&((Eo=o.data)==null?void 0:Eo.type)!=="human"}),h=Ie({queryKey:["agent-sessions-active",a],queryFn:()=>Jl(a,{state:"active"}),enabled:!!a&&((Gr=o.data)==null?void 0:Gr.type)!=="human"}),g=Ie({queryKey:["adapters"],queryFn:Z1}),p=Ie({queryKey:["adapter-mappings"],queryFn:q1}),{data:b}=Ie({queryKey:["adapter-statuses"],queryFn:B1,refetchInterval:15e3}),x=((Vr=g.data)==null?void 0:Vr.filter(W=>W.agentId===a))??[],j=((Kr=p.data)==null?void 0:Kr.filter(W=>W.agentId===a))??[],N=Z3(c.data),[z,w]=v.useState(null),[E,M]=v.useState(null),B=lt({mutationFn:async()=>{if(!c.data)throw new Error("config not loaded");const W=N.buildPayloadPatch();return f3(a,{expectedVersion:c.data.version,payload:W})},onSuccess:W=>{l.setQueryData(["agent-config",a],W),w(null),M(null)},onError:W=>{if(W instanceof Sc&&W.status===409){M("Someone else saved a newer version while you were editing."),w(null);return}w(W instanceof Error?W.message:String(W))}}),D=v.useCallback(()=>{M(null),w(null),l.invalidateQueries({queryKey:["agent-config",a]}),N.resetAll()},[l,a,N]),O=v.useCallback(W=>{const $e=document.getElementById(hs(W));$e&&$e.scrollIntoView({behavior:"smooth",block:"start"})},[]),P=lt({mutationFn:W=>Hb(a,W),onSuccess:()=>{l.invalidateQueries({queryKey:["agent",a]}),l.invalidateQueries({queryKey:["agents"]})}}),I=lt({mutationFn:()=>lz(a),onSuccess:()=>l.invalidateQueries({queryKey:["agent",a]})}),L=lt({mutationFn:()=>iz(a),onSuccess:()=>l.invalidateQueries({queryKey:["agent",a]})}),K=lt({mutationFn:()=>sz(a),onSuccess:()=>r("/agents")}),le=lt({mutationFn:()=>oz(a)}),[Se,_e]=v.useState(!1),se=v.useRef(null);v.useEffect(()=>{if(!Se)return;function W($e){se.current&&!se.current.contains($e.target)&&_e(!1)}return window.addEventListener("mousedown",W),()=>window.removeEventListener("mousedown",W)},[Se]);const[ve,Te]=v.useState(!1),[we,Q]=v.useState(""),[te,ce]=v.useState(null),Ce=Ie({queryKey:["clients"],queryFn:Nc,enabled:ve}),re=lt({mutationFn:W=>Hb(a,{clientId:W}),onSuccess:()=>{l.invalidateQueries({queryKey:["agent",a]}),l.invalidateQueries({queryKey:["agent-client-status",a]}),l.invalidateQueries({queryKey:["agents"]}),Te(!1),Q(""),ce(null)},onError:W=>ce(W instanceof Error?W.message:String(W))}),[T,A]=v.useState(!1),[V,ee]=v.useState(null),[H,ne]=v.useState(zm),[fe,Me]=v.useState(""),pe=lt({mutationFn:async()=>{const W=yx(H);if(!W)throw new Error("Credentials are required");return VM({platform:H.platform,agentId:a,credentials:W,status:H.status})},onSuccess:()=>{l.invalidateQueries({queryKey:["adapters"]}),Qr()}}),Dt=lt({mutationFn:()=>{if(!V)throw new Error("No adapter selected");const W={status:H.status},$e=yx(H);return $e&&(W.credentials=$e),KM(V,W)},onSuccess:()=>{l.invalidateQueries({queryKey:["adapters"]}),Qr()}}),jn=lt({mutationFn:FM,onSuccess:()=>l.invalidateQueries({queryKey:["adapters"]})}),wn=lt({mutationFn:()=>PM({platform:H.platform,externalUserId:H.externalUserId,agentId:a,boundVia:"manual",displayName:H.displayName||void 0}),onSuccess:()=>{l.invalidateQueries({queryKey:["adapter-mappings"]}),Qr()}}),fa=lt({mutationFn:GM,onSuccess:()=>l.invalidateQueries({queryKey:["adapter-mappings"]})}),[Qt,Ms]=v.useState(null),Ir=lt({mutationFn:()=>m3(a,N.buildPayloadPatch()),onSuccess:W=>{const $e=W.diff.length?W.diff.map(Kt=>`${Kt.op} ${Kt.path}`).join(`
|
|
333
|
-
`):"(no changes)";Ms($e)},onError:W=>Ms(`Dry run failed: ${W instanceof Error?W.message:String(W)}`)});if(v.useEffect(()=>{if(!N.summary.anyDirty)return;const W=$e=>{$e.preventDefault(),$e.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[N.summary.anyDirty]),o.isLoading)return u.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(o.error)return u.jsxs("div",{className:"text-destructive",children:["Failed to load agent: ",o.error instanceof Error?o.error.message:"Unknown error"]});const xt=o.data;if(!xt)return u.jsx("div",{className:"text-muted-foreground",children:"Agent not found"});const Zt=xt.type==="human",Qn=m.data,Ds=((ea=h.data)==null?void 0:ea.length)??0,Us=!Zt&&!(Qn!=null&&Qn.clientId),Lc=!Zt&&Qn?!Qn.online&&!!Qn.clientId:!1,So=xt,Pt=So.runtimeState??null,$c=So.runtimeType??null;function Qr(){A(!1),ee(null),ne(zm),Me("")}function jo(W){ee(W.id),ne({...zm,platform:W.platform,status:W.status}),A(!0)}function Ls(W){if(W.preventDefault(),Me(""),Zt){if(!H.externalUserId)return;wn.mutate();return}if(H.platform==="feishu"){if(!V&&(!H.feishuAppId||!H.feishuAppSecret)){Me("App ID and App Secret are required");return}}else if(H.platform==="kael"){if(!V&&(!H.kaelUserId||!H.kaelProjectId)){Me("User ID and Project ID are required");return}}else{const $e=H.credentialsJson.trim();if(!V&&!$e){Me("Credentials are required");return}if($e)try{JSON.parse($e)}catch{Me("Invalid JSON");return}}V?Dt.mutate():pe.mutate()}const wo=pe.error??Dt.error??wn.error,ei=pe.isPending||Dt.isPending||wn.isPending,qc=L3({activeSessions:Ds,isUnclaimed:Us,isOffline:Lc}),Bc=N.draft.mcp.filter(W=>W.status!=="deleted"),Pr=N.draft.env.filter(W=>W.status!=="deleted"),Gt=N.draft.git.filter(W=>W.status!=="deleted"),Wn=W=>new Set(Bc.filter($e=>$e.key!==W).map($e=>$e.value.name.toLowerCase())),Vt=W=>new Set(Pr.filter($e=>$e.key!==W).map($e=>$e.value.key)),Zc=W=>new Set(Gt.filter($e=>$e.key!==W).map($e=>{const{value:Kt}=$e;return Kt.localPath?Kt.localPath:((Kt.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean));return u.jsxs("div",{className:"space-y-5 pb-24",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>r("/agents"),children:u.jsx(K_,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("h1",{className:"text-2xl font-semibold truncate",children:xt.displayName??xt.name}),u.jsxs("p",{className:"text-xs text-muted-foreground font-mono truncate",children:["@",xt.name??xt.uuid," · ",xt.type]})]}),u.jsxs("div",{className:"relative",ref:se,children:[u.jsx(he,{variant:"outline",size:"icon",onClick:()=>_e(W=>!W),title:"More actions",children:u.jsx(j0,{className:"h-4 w-4"})}),Se&&u.jsx("div",{className:"absolute right-0 mt-1 z-40 min-w-48 rounded-md border bg-white shadow-lg text-sm",children:u.jsxs("ul",{className:"py-1",children:[!Zt&&xt.status==="active"&&u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{_e(!1),le.reset(),le.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50 flex items-center gap-2",disabled:le.isPending,children:[u.jsx(E0,{className:"h-3.5 w-3.5"}),le.isPending?"Testing…":"Test connection"]})}),xt.status==="active"?u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{_e(!1),confirm("Suspend this agent? All tokens will be revoked.")&&I.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50",children:"Suspend"})}):u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{_e(!1),L.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50",children:"Reactivate"})}),u.jsx("li",{className:"border-t",children:u.jsx("a",{href:`#${hs("prompt")}`,onClick:()=>_e(!1),className:"block px-3 py-1.5 text-xs text-muted-foreground hover:bg-gray-50",children:"Jump to Behavior"})})]})})]})]}),(le.data||le.error)&&u.jsx(K3,{result:le.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>le.reset()}),u.jsx(U3,{agent:xt,cfg:c.data,clientStatus:Qn,runtimeState:Pt,runtimeType:$c,activeSessions:Ds,isHuman:Zt}),Us&&xt.status==="active"&&u.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-4 py-3 flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"text-sm text-amber-900",children:[u.jsx("div",{className:"font-medium",children:"No computer bound"}),u.jsx("div",{className:"text-xs text-amber-800/80",children:"Bind this agent to a computer so it can run. A computer will also claim it on first WebSocket connect."})]}),u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>Te(!0),children:[u.jsx(yb,{className:"h-4 w-4 mr-2"}),"Bind Computer"]})]}),u.jsx(w3,{agent:xt,onSave:async W=>{await P.mutateAsync(W)}}),!Zt&&u.jsxs(Q3,{loaded:!!c.data,loading:c.isLoading,error:c.error?String(c.error):null,version:((Fr=c.data)==null?void 0:Fr.version)??null,dirty:N.summary.anyDirty,children:[u.jsx("div",{id:hs("prompt"),children:u.jsx(A3,{value:N.draft.promptAppend,baseline:((Fa=c.data)==null?void 0:Fa.payload.prompt.append)??"",onChange:N.setPromptAppend,onRevert:N.revertPrompt,disabled:xt.status!=="active"})}),u.jsx("div",{id:hs("model"),children:u.jsx(k3,{value:N.draft.model,baseline:((_o=c.data)==null?void 0:_o.payload.model)??"",onChange:N.setModel,onRevert:N.revertModel,disabled:xt.status!=="active"})}),u.jsx("div",{id:hs("mcp"),children:u.jsx(E3,{items:N.draft.mcp,otherNames:Wn,onAdd:N.addMcp,onUpdate:N.updateMcp,onDelete:N.deleteMcp,onUndoDelete:N.undoDeleteMcp,disabled:xt.status!=="active"})}),u.jsx("div",{id:hs("env"),children:u.jsx(b3,{items:N.draft.env,otherKeys:Vt,onAdd:N.addEnv,onUpdate:N.updateEnv,onDelete:N.deleteEnv,onUndoDelete:N.undoDeleteEnv,disabled:xt.status!=="active"})}),u.jsx("div",{id:hs("git"),children:u.jsx(S3,{items:N.draft.git,otherPaths:Zc,onAdd:N.addGit,onUpdate:N.updateGit,onDelete:N.deleteGit,onUndoDelete:N.undoDeleteGit,disabled:xt.status!=="active"})}),Qt&&u.jsx("pre",{className:"whitespace-pre-wrap rounded border bg-gray-50 p-2 text-xs",children:Qt})]}),u.jsxs(ks,{children:[u.jsxs(Gl,{className:"flex flex-row items-center justify-between",children:[u.jsxs(Vl,{className:"flex items-center gap-2 text-base",children:[Zt?u.jsx(yb,{className:"h-4 w-4"}):u.jsx(e2,{className:"h-4 w-4"}),"Platform Bindings"]}),u.jsxs(he,{size:"sm",variant:"outline",onClick:()=>A(!0),children:[u.jsx(zs,{className:"h-4 w-4 mr-2"}),Zt?"Bind User":"Bind Bot"]})]}),u.jsx(As,{children:Zt?u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"External User ID"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Bound Via"}),u.jsx(Ne,{children:"Created"}),u.jsx(Ne,{className:"w-16"})]})}),u.jsx(Qa,{children:j.length===0?u.jsx(st,{children:u.jsx(xe,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):j.map(W=>u.jsxs(st,{children:[u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:W.platform})}),u.jsx(xe,{className:"font-mono text-sm",children:W.externalUserId}),u.jsx(xe,{children:W.displayName??"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:"outline",children:W.boundVia??"—"})}),u.jsx(xe,{className:"text-muted-foreground",children:da(W.createdAt)}),u.jsx(xe,{children:u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this binding?")&&fa.mutate(W.id)},disabled:fa.isPending,children:u.jsx(ao,{className:"h-4 w-4"})})})]},W.id))})]}):u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Platform"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Connection"}),u.jsx(Ne,{children:"Created"}),u.jsx(Ne,{className:"w-24"})]})}),u.jsx(Qa,{children:x.length===0?u.jsx(st,{children:u.jsx(xe,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):x.map(W=>{const $e=b==null?void 0:b.find(Co=>Co.configId===W.id),Kt=W.platform==="kael"?W.status==="active":!!($e!=null&&$e.connected);return u.jsxs(st,{children:[u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:W.platform})}),u.jsx(xe,{children:u.jsx(Wt,{variant:W.status==="active"?"default":"destructive",children:W.status})}),u.jsx(xe,{children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",Kt?"bg-green-500":"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:Kt?"Online":"Offline"})]})}),u.jsx(xe,{className:"text-muted-foreground",children:da(W.createdAt)}),u.jsx(xe,{children:u.jsxs("div",{className:"flex gap-1",children:[u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>jo(W),title:"Edit",children:"…"}),u.jsx(he,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this bot binding?")&&jn.mutate(W.id)},disabled:jn.isPending,title:"Delete",children:u.jsx(ao,{className:"h-4 w-4"})})]})})]},W.id)})})]})})]}),u.jsx(p3,{agent:xt,suspendPending:I.isPending,reactivatePending:L.isPending,deletePending:K.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&I.mutate()},onReactivate:()=>L.mutate(),onDelete:()=>K.mutate()}),!Zt&&u.jsx(T3,{summary:N.summary,saveHint:qc,conflictMessage:E,errorMessage:z,saving:B.isPending,onSave:()=>B.mutate(),onDiscard:()=>{(!N.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(N.resetAll(),w(null),M(null))},onReloadRemote:D,onJumpTo:O}),!Zt&&N.summary.anyDirty&&u.jsx("div",{className:"text-xs text-muted-foreground",children:u.jsx("button",{type:"button",onClick:()=>Ir.mutate(),className:"underline hover:text-gray-900",disabled:Ir.isPending,children:Ir.isPending?"Computing dry-run…":"Preview server-side diff"})}),u.jsx(Ln,{open:ve,onOpenChange:W=>{Te(W),W||(Q(""),ce(null),re.reset())},children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground",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."}),Ce.isLoading?u.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading computers…"}):Ce.error?u.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load computers: ",Ce.error instanceof Error?Ce.error.message:"Unknown"]}):u.jsx(P3,{clients:Ce.data??[],selected:we,onSelect:Q}),te&&u.jsx("div",{className:"text-sm text-destructive",children:te})]}),u.jsxs($n,{children:[u.jsx(he,{variant:"outline",onClick:()=>Te(!1),children:"Cancel"}),u.jsx(he,{disabled:!we||re.isPending,onClick:()=>{ce(null),re.mutate(we)},children:re.isPending?"Binding…":"Bind"})]})]})}),u.jsx(Ln,{open:T,onOpenChange:W=>W?A(!0):Qr(),children:u.jsxs(xn,{children:[u.jsx(Xn,{children:u.jsx(qn,{children:Zt?"Bind External User":V?"Edit Bot Binding":"Bind Bot"})}),u.jsxs("form",{onSubmit:Ls,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:H.platform,onChange:W=>ne({...H,platform:W.target.value}),disabled:!!V,className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:H3.map(W=>u.jsx("option",{value:W,children:W},W))})]}),Zt?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"binding-ext-id",children:"External User ID"}),u.jsx(ct,{id:"binding-ext-id",value:H.externalUserId,onChange:W=>ne({...H,externalUserId:W.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"binding-name",children:"Display Name (optional)"}),u.jsx(ct,{id:"binding-name",value:H.displayName,onChange:W=>ne({...H,displayName:W.target.value})})]})]}):u.jsxs(u.Fragment,{children:[H.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Fe,{htmlFor:"feishu-app-id",children:["App ID",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"feishu-app-id",value:H.feishuAppId,onChange:W=>ne({...H,feishuAppId:W.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Fe,{htmlFor:"feishu-app-secret",children:["App Secret",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:H.feishuAppSecret,onChange:W=>ne({...H,feishuAppSecret:W.target.value}),placeholder:"••••••••"})]})]}):H.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Fe,{htmlFor:"kael-user-id",children:["User ID",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"kael-user-id",value:H.kaelUserId,onChange:W=>ne({...H,kaelUserId:W.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Fe,{htmlFor:"kael-project-id",children:["Project ID",V?" — leave empty to keep existing":""]}),u.jsx(ct,{id:"kael-project-id",value:H.kaelProjectId,onChange:W=>ne({...H,kaelProjectId:W.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!V&&u.jsx("p",{className:"text-sm text-muted-foreground",children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(Fe,{htmlFor:"binding-creds",children:["Credentials (JSON)",V?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:H.credentialsJson,onChange:W=>ne({...H,credentialsJson:W.target.value}),rows:4,className:"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),fe&&u.jsx("p",{className:"text-sm text-destructive",children:fe}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:H.status,onChange:W=>ne({...H,status:W.target.value}),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),wo instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:wo.message}),u.jsx($n,{children:u.jsx(he,{type:"submit",disabled:ei,children:ei?"Saving...":V?"Update":"Create"})})]})]})})]})}function Q3(e){return u.jsxs("section",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"text-base font-semibold",children:"Behavior"}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.version!=null&&u.jsxs("span",{children:["v",e.version]}),e.dirty&&u.jsx("span",{className:"ml-2 text-amber-700",children:"· draft"})]})]}),e.loading&&u.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration…"}),e.error&&u.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load configuration: ",e.error]}),e.loaded&&u.jsx("div",{className:"space-y-3",children:e.children})]})}const zm={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function yx(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 a=e.credentialsJson.trim();return a?JSON.parse(a):null}function P3({clients:e,selected:a,onSelect:r}){const l=e.filter(o=>o.status==="connected");return l.length===0?u.jsxs("div",{className:"rounded border bg-muted/40 px-3 py-4 text-sm text-muted-foreground",children:["No connected computers available. Run"," ",u.jsx("code",{className:"font-mono text-xs",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):u.jsx("ul",{className:"divide-y rounded border max-h-64 overflow-y-auto",children:l.map(o=>{const c=o.id===a,m=o.status==="online"||o.status==="active";return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>r(o.id),className:je("w-full text-left px-3 py-2 flex items-center gap-3 hover:bg-gray-50",c&&"bg-blue-50"),children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",m?"bg-green-500":"bg-gray-400"),"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-sm font-medium truncate",children:o.hostname??o.id}),u.jsxs("span",{className:"block text-xs text-muted-foreground font-mono truncate",children:[o.id,o.os?` · ${o.os}`:"",o.sdkVersion?` · SDK ${o.sdkVersion}`:""]})]}),u.jsx("span",{className:"text-xs text-muted-foreground",children:o.status})]})},o.id)})})}const G3={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},V3={connected:{icon:"●",color:"text-green-500",label:"Connected"},stale:{icon:"◐",color:"text-yellow-500",label:"Stale"},disconnected:{icon:"○",color:"text-gray-400",label:"Disconnected"}};function K3({result:e,onDismiss:a}){const r={success:"border-l-green-500",timeout:"border-l-yellow-500",offline:"border-l-gray-400",stale:"border-l-yellow-500",error:"border-l-red-500"}[e.status],l=e.status==="success"?"default":e.status==="timeout"||e.status==="stale"?"secondary":"destructive",o=e.connection,c=o?V3[o.health]:null;return u.jsx(ks,{className:je("border-l-4",r),children:u.jsx(As,{className:"pt-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Wt,{variant:l,children:G3[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-sm text-muted-foreground",children:e.message}),o&&u.jsxs("div",{className:"text-xs space-y-1 border-t pt-2 mt-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[c&&u.jsxs("span",{className:c.color,children:[c.icon," ",c.label]}),o.runtimeState&&u.jsxs("span",{className:"text-muted-foreground",children:["runtime: ",o.runtimeState]})]}),o.client?u.jsxs("div",{className:"text-muted-foreground",children:["Computer: ",o.client.hostname??o.client.id,o.client.os&&` (${o.client.os})`,o.client.sdkVersion&&` · SDK ${o.client.sdkVersion}`]}):u.jsx("div",{className:"text-muted-foreground",children:"No computer bound"}),o.lastSeenAt&&u.jsxs("div",{className:"text-muted-foreground",children:["Last seen: ",new Date(o.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.jsx("p",{className:"text-sm mt-2 whitespace-pre-wrap bg-muted rounded p-2 max-h-40 overflow-auto",children:e.responseContent})]}),u.jsx(he,{variant:"ghost",size:"sm",onClick:a,children:"Dismiss"})]})})})}function uo({state:e,size:a=8,className:r}){const l={width:a,height:a,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:je("shrink-0",r),style:l,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"1px solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?u.jsx("span",{className:je("shrink-0",r),style:{...l,border:"1.5px dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:je("shrink-0",r),style:{...l,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:je("shrink-0",r),style:{...l,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:je("shrink-0",r),style:{...l,borderRadius:"50%",border:"1px solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function F3(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Y3({agent:e,open:a,onClose:r,onBound:l}){var x;const[o,c]=v.useState(!1),m=Ie({queryKey:["connect-token",e.uuid],queryFn:()=>H0(),enabled:a,staleTime:6e4}),h=Ie({queryKey:["agent-poll",e.uuid],queryFn:()=>ZS(e.uuid),enabled:a&&!e.clientId,refetchInterval:2e3});v.useEffect(()=>{const j=h.data;j!=null&&j.clientId&&l(j)},[h.data,l]);const g=((x=m.data)==null?void 0:x.command)??"",p=g&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${F3(e.name)} --agent-id ${e.uuid} && `+g:g;function b(){p&&(navigator.clipboard.writeText(p),c(!0),setTimeout(()=>c(!1),2e3))}return u.jsx(Ln,{open:a,onOpenChange:j=>!j&&r(),children:u.jsxs(xn,{className:"max-w-lg",children:[u.jsx(Xn,{children:u.jsx(qn,{children:"Last step — connect your computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[u.jsx("code",{className:"flex-1 text-xs font-mono break-all select-all",children:p||"Generating command…"}),u.jsx(he,{variant:"outline",size:"icon",className:"shrink-0",onClick:b,disabled:!p,children:o?u.jsx(S0,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):u.jsx(_h,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(uo,{state:"working",size:8}),u.jsx("span",{children:"Waiting for your computer to connect…"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),u.jsx($n,{children:u.jsx(he,{variant:"outline",onClick:r,children:"Skip for now"})})]})})}const X3=/^[a-z0-9_-]+$/,Tm=100;function J3(e){if(!e||e.length===0)return{};const a={},r=["name","displayName","clientId"];for(const l of e){const o=l.path[0];if(typeof o=="string"&&r.includes(o)){const c=o;a[c]||(a[c]=l.message)}else a._root=l.message}return a}function W3(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,100)}function eD({open:e,onOpenChange:a,onCreated:r}){const l=Bn(),[o,c]=v.useState(""),[m,h]=v.useState(!1),[g,p]=v.useState("claude-code"),[b,x]=v.useState("form"),[j,N]=v.useState([]),[z,w]=v.useState(null),[E,M]=v.useState(!1),[B,D]=v.useState({});v.useEffect(()=>{e&&(c(""),h(!1),p("claude-code"),x("form"),N([]),w(null),M(!1),D({}))},[e]);const O=W3(o),P=lt({mutationFn:async se=>{const ve=o.trim()||"Untitled assistant";return rz({name:O||void 0,type:"personal_assistant",displayName:ve,clientId:se.clientId})},onSuccess:se=>{l.invalidateQueries({queryKey:["agents"]}),l.invalidateQueries({queryKey:["activity"]}),r(se,g)}}),L={...v.useMemo(()=>{const se=P.error;if(!se)return{};if(se instanceof Sc){const ve=J3(se.issues);return Object.keys(ve).length>0?ve:{_root:se.message}}return se instanceof Error?{_root:se.message}:{}},[P.error]),...B};function K(){const se={};return O?O.length>Tm?se.name=`Hub ID must be at most ${Tm} characters (got ${O.length}).`:X3.test(O)||(se.name="Hub ID must contain only lowercase letters, digits, hyphens (-), and underscores (_)."):o.trim().length>0&&(se.name="Name must contain at least one letter or digit."),se}async function le(se){var Te,we;se.preventDefault();const ve=K();if(D(ve),!(Object.keys(ve).length>0)){if(g!=="claude-code"){P.mutate({clientId:void 0});return}M(!0);try{const te=(await Nc()).filter(Ce=>Ce.status==="connected");if(te.length===0){P.mutate({clientId:void 0});return}if(te.length===1){P.mutate({clientId:(Te=te[0])==null?void 0:Te.id});return}const ce=[...te].sort((Ce,re)=>re.lastSeenAt.localeCompare(Ce.lastSeenAt));N(ce),w(((we=ce[0])==null?void 0:we.id)??null),x("pick-computer")}catch{P.mutate({clientId:void 0})}finally{M(!1)}}}function Se(){z&&P.mutate({clientId:z})}const _e=o.trim().length>0&&!P.isPending&&!E;return b==="pick-computer"?u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{className:"max-w-lg",children:[u.jsx(Xn,{children:u.jsx(qn,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-sm text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:o})," should run:"]}),u.jsx("div",{className:"space-y-2",children:j.map(se=>{const ve=z===se.id;return u.jsxs("label",{className:ve?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"target-computer",checked:ve,onChange:()=>w(se.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-sm font-medium truncate",children:se.hostname??se.id}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[se.os??"unknown OS"," · last seen ",new Date(se.lastSeenAt).toLocaleString()]})]})]},se.id)})}),L.clientId&&u.jsx("p",{className:"text-sm text-destructive",children:L.clientId}),L._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:L._root})]}),u.jsxs($n,{children:[u.jsx(he,{variant:"outline",onClick:()=>x("form"),disabled:P.isPending,children:"Back"}),u.jsx(he,{onClick:Se,disabled:!z||P.isPending,children:P.isPending?"Creating…":"Create"})]})]})}):u.jsx(Ln,{open:e,onOpenChange:a,children:u.jsxs(xn,{className:"max-w-lg",children:[u.jsx(Xn,{children:u.jsx(qn,{children:"New Agent"})}),u.jsxs("form",{onSubmit:le,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"new-agent-name",children:"Name"}),u.jsx(ct,{id:"new-agent-name",value:o,onChange:se=>{c(se.target.value),h(!0),B.name&&D(ve=>({...ve,name:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:80,"aria-invalid":L.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error"}),u.jsxs("p",{id:"new-agent-name-help",className:"text-xs text-muted-foreground",children:["Any text — we'll derive a hub ID (lowercase letters, digits, hyphens, underscores; up to ",Tm," chars) automatically."]}),m&&O&&u.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID on hub: ",u.jsx("span",{className:"font-mono",children:O})]}),L.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-xs text-destructive",children:L.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:g==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:g==="claude-code",onChange:()=>p("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),u.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[u.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),u.jsxs("div",{children:[u.jsxs("div",{className:"text-sm font-medium",children:["Kael ",u.jsx("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:"— coming soon"})]}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),L._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:L._root}),u.jsx($n,{children:u.jsx(he,{type:"submit",disabled:!_e,children:E?"Checking computers…":P.isPending?"Creating…":"Create"})})]})]})})}const tD=Object.values(rM);function bx(e){return[...e].sort((a,r)=>{const l=(a.name??a.displayName??"").toLowerCase(),o=(r.name??r.displayName??"").toLowerCase();return l.localeCompare(o)})}function nD(){const e=Pa(),{memberId:a}=yo(),[r,l]=v.useState(),[o,c]=v.useState(""),[m,h]=v.useState(!1),[g,p]=v.useState(null),b=Ka(),x=G1(),{data:j,isLoading:N,error:z}=Ie({queryKey:["agents",r,o],queryFn:()=>Mh({limit:100,cursor:r,type:o||void 0})}),{myAgents:w,teamAgents:E}=v.useMemo(()=>{if(!(j!=null&&j.items))return{myAgents:[],teamAgents:[]};const D=[],O=[];for(const P of j.items)a&&P.managerId===a?D.push(P):O.push(P);return{myAgents:bx(D),teamAgents:bx(O)}},[j,a]);function M(D,O){if(h(!1),D.clientId){e(`/?a=${D.uuid}`);return}if(O==="claude-code"){p(D);return}e(`/?a=${D.uuid}`)}function B(D){const P=D.runtimeState,I={idle:"bg-green-500",working:"bg-blue-500",error:"bg-red-500"};return u.jsxs(st,{className:"cursor-pointer",onClick:()=>e(`/agents/${D.uuid}`),children:[u.jsx(xe,{className:"font-mono text-sm",children:D.name}),u.jsx(xe,{children:D.displayName??"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:"secondary",children:D.type})}),u.jsx(xe,{className:"font-mono text-sm text-muted-foreground",children:D.delegateMention?b(D.delegateMention):"—"}),u.jsx(xe,{className:"text-sm text-muted-foreground",children:x(D.managerId)}),u.jsx(xe,{children:P?u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",I[P]??"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:P})]}):u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-gray-300",title:"not running"})}),u.jsx(xe,{children:u.jsx(Wt,{variant:D.status==="active"?"default":"destructive",children:D.status})}),u.jsx(xe,{className:"text-muted-foreground",children:da(D.createdAt)})]},D.uuid)}return u.jsxs("div",{className:"space-y-8",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("h1",{className:"text-2xl font-semibold",children:"Agents"}),u.jsxs("select",{value:o,onChange:D=>{c(D.target.value),l(void 0)},className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"All types"}),tD.map(D=>u.jsx("option",{value:D,children:D},D))]})]}),N?u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):z?u.jsxs("div",{className:"text-center py-8 text-destructive",children:["Failed to load agents: ",z instanceof Error?z.message:"Unknown error"]}):u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx("h2",{className:"text-lg font-medium",children:"My Agents"}),u.jsxs(he,{size:"sm",onClick:()=>h(!0),children:[u.jsx(zs,{className:"h-4 w-4 mr-2"}),"New Agent"]})]}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Name"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Type"}),u.jsx(Ne,{children:"Delegate"}),u.jsx(Ne,{children:"Owner"}),u.jsx(Ne,{children:"Runtime"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Qa,{children:w.length===0?u.jsx(st,{children:u.jsx(xe,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"No agents yet — create one to get started"})}):w.map(D=>B(D))})]})})]}),E.length>0&&u.jsxs("section",{children:[u.jsx("h2",{className:"text-lg font-medium mb-3",children:"Team Agents"}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{children:"Name"}),u.jsx(Ne,{children:"Display Name"}),u.jsx(Ne,{children:"Type"}),u.jsx(Ne,{children:"Delegate"}),u.jsx(Ne,{children:"Owner"}),u.jsx(Ne,{children:"Runtime"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{children:"Created"})]})}),u.jsx(Qa,{children:E.map(D=>B(D))})]})})]})]}),(j==null?void 0:j.nextCursor)&&u.jsx("div",{className:"flex justify-end",children:u.jsx(he,{variant:"outline",onClick:()=>l(j.nextCursor??void 0),children:"Next Page"})}),u.jsx(eD,{open:m,onOpenChange:h,onCreated:M}),g&&u.jsx(Y3,{agent:g,open:g!==null,onClose:()=>{const D=g.uuid;p(null),e(`/?a=${D}`)},onBound:D=>{p(null),e(`/?a=${D.uuid}`)}})]})}function aD(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function Dc({state:e,className:a}){const r=e!==null&&aD(e)?e:"offline",l=r==="offline"?"var(--fg-3)":`var(--state-${r})`;return u.jsxs("span",{className:je("mono inline-flex items-center gap-1.5 uppercase tracking-wider",a),style:{fontSize:10,letterSpacing:.06,color:l},children:[u.jsx(uo,{state:r,size:7}),r]})}function rD(){const[e,a]=v.useState(null),[r,l]=v.useState(!1),o=lt({mutationFn:H0,onSuccess:m=>{a(m),l(!1)}}),c=async()=>{e&&(await navigator.clipboard.writeText(e.command),l(!0),setTimeout(()=>l(!1),2e3))};return e?u.jsxs("div",{className:"mb-4 p-3 border border-border rounded-lg bg-muted/30 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(bb,{className:"h-4 w-4 shrink-0"}),u.jsxs("span",{children:["Run this command in your terminal (expires in ",e.expiresIn/60," min):"]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 text-xs bg-background border border-border rounded px-3 py-2 font-mono break-all select-all",children:e.command}),u.jsxs(he,{variant:"outline",size:"sm",onClick:c,className:"shrink-0",children:[r?u.jsx(S0,{className:"h-3 w-3 mr-1"}):u.jsx(_h,{className:"h-3 w-3 mr-1"}),r?"Copied":"Copy"]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"This token is single-use. Generate a new one if it expires."})]}):u.jsxs("div",{className:"flex items-center gap-3 mb-4 p-3 border border-border rounded-lg bg-muted/30",children:[u.jsx(bb,{className:"h-4 w-4 text-muted-foreground shrink-0"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"Connect a new computer to this Hub"}),u.jsx(he,{variant:"outline",size:"sm",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Generating...":"Generate Connect Command"})]})}function sD(){const e=Bn(),a=Ka(),[r,l]=v.useState(null),[o,c]=v.useState(null),[m,h]=v.useState(null),[g,p]=v.useState(null),{data:b}=Ie({queryKey:["clients"],queryFn:Nc,refetchInterval:1e4}),{data:x}=Ie({queryKey:["activity"],queryFn:wc,refetchInterval:1e4}),j=lt({mutationFn:TC,onSuccess:()=>{c(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),N=lt({mutationFn:zC,onSuccess:()=>{h(null),p(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:E=>{E instanceof Sc?p(E.message):p(E instanceof Error?E.message:String(E))}}),z=v.useMemo(()=>{const E=new Map;for(const M of(x==null?void 0:x.agents)??[]){if(!M.clientId)continue;const B=E.get(M.clientId)??[];B.push(M),E.set(M.clientId,B)}return E},[x==null?void 0:x.agents]),w=E=>z.get(E)??[];return u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold mb-4",children:"Computers"}),u.jsx(rD,{}),m&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:u.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["Permanently remove"," ",u.jsx("span",{className:"font-medium text-foreground",children:m.hostname??m.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)."]}),w(m.id).length>0&&u.jsxs("div",{className:"mb-3 p-2 rounded bg-yellow-50 dark:bg-yellow-950/30 border border-yellow-200 dark:border-yellow-900",children:[u.jsx("div",{className:"text-xs font-medium text-yellow-900 dark:text-yellow-200 mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-sm space-y-0.5",children:w(m.id).map(E=>u.jsx("li",{className:"font-medium",children:a(E.agentId)},E.agentId))})]}),g&&u.jsx("div",{className:"mb-3 p-2 rounded bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-900 text-sm text-red-900 dark:text-red-200",children:g}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>{h(null),p(null)},children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>N.mutate(m.id),disabled:N.isPending,children:N.isPending?"Retiring...":"Retire"})]})]})}),o&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:u.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 max-w-md w-full shadow-lg",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["This will disconnect"," ",u.jsx("span",{className:"font-medium text-foreground",children:o.hostname??o.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:w(o.id).length===0?u.jsx("li",{className:"text-sm text-muted-foreground",children:"No bound agents"}):w(o.id).map(E=>u.jsxs("li",{className:"text-sm flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:a(E.agentId)}),u.jsx(Dc,{state:E.runtimeState})]},E.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(he,{variant:"outline",size:"sm",onClick:()=>c(null),children:"Cancel"}),u.jsx(he,{variant:"destructive",size:"sm",onClick:()=>j.mutate(o.id),disabled:j.isPending,children:j.isPending?"Disconnecting...":"Disconnect"})]})]})}),!b||b.length===0?u.jsx("div",{className:"text-center text-muted-foreground py-12",children:"No computers. Use the button above to generate a connect command."}):u.jsx("div",{className:"border rounded-lg overflow-hidden",children:u.jsxs(Ha,{children:[u.jsx(Ia,{children:u.jsxs(st,{children:[u.jsx(Ne,{className:"w-8"}),u.jsx(Ne,{children:"Hostname"}),u.jsx(Ne,{children:"OS"}),u.jsx(Ne,{children:"SDK"}),u.jsx(Ne,{children:"Agents"}),u.jsx(Ne,{children:"Connected"}),u.jsx(Ne,{children:"Status"}),u.jsx(Ne,{})]})}),u.jsx(Qa,{children:b.map(E=>{const M=r===E.id,B=w(E.id);return u.jsx(lD,{client:E,boundAgents:B,isExpanded:M,agentName:a,onToggle:()=>l(M?null:E.id),onDisconnect:()=>c(E),onRetire:()=>{p(null),h(E)}},E.id)})})]})})]})}function lD({client:e,boundAgents:a,isExpanded:r,agentName:l,onToggle:o,onDisconnect:c,onRetire:m}){return u.jsxs(u.Fragment,{children:[u.jsxs(st,{className:"cursor-pointer hover:bg-accent/50",onClick:o,children:[u.jsx(xe,{className:"px-2",children:r?u.jsx(a2,{className:"h-4 w-4"}):u.jsx(s2,{className:"h-4 w-4"})}),u.jsx(xe,{className:"font-medium",children:e.hostname??"—"}),u.jsx(xe,{className:"text-muted-foreground",children:e.os??"—"}),u.jsx(xe,{className:"font-mono text-xs text-muted-foreground",children:e.sdkVersion??"—"}),u.jsx(xe,{children:e.agentCount}),u.jsx(xe,{className:"text-muted-foreground text-sm",children:e.connectedAt?da(e.connectedAt):"—"}),u.jsx(xe,{children:u.jsx(Wt,{variant:e.status==="connected"?"default":"secondary",children:e.status})}),u.jsx(xe,{children:u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsxs(he,{variant:"outline",size:"sm",onClick:h=>{h.stopPropagation(),c()},children:[u.jsx($2,{className:"h-3 w-3 mr-1"}),"Disconnect"]}),u.jsxs(he,{variant:"outline",size:"sm",onClick:h=>{h.stopPropagation(),m()},children:[u.jsx(ao,{className:"h-3 w-3 mr-1"}),"Retire"]})]})})]}),r&&u.jsx(st,{children:u.jsxs(xe,{colSpan:8,className:"bg-muted/30 px-8 py-3",children:[u.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:["Bound Agents (",a.length,")"]}),a.length===0?u.jsx("div",{className:"text-sm text-muted-foreground",children:"No agents bound to this computer"}):u.jsx("div",{className:"space-y-1",children:a.map(h=>u.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[u.jsx("span",{className:"font-medium",children:l(h.agentId)}),u.jsx(Dc,{state:h.runtimeState}),u.jsx("span",{className:"text-xs text-muted-foreground",children:h.activeSessions!==null?`${h.activeSessions}/${h.totalSessions??0} sessions`:""})]},h.agentId))})]})})]})}function iD(){const{isAuthenticated:e,login:a}=yo(),[r,l]=v.useState(""),[o,c]=v.useState(""),[m,h]=v.useState(null),[g,p]=v.useState(!1);if(e)return u.jsx(o0,{to:"/",replace:!0});const b=async x=>{x.preventDefault(),h(null),p(!0);try{await a(r,o)}catch(j){h(j instanceof Error?j.message:"Login failed")}finally{p(!1)}};return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsxs(ks,{className:"w-full max-w-sm",children:[u.jsxs(Gl,{className:"text-center",children:[u.jsx(Vl,{className:"text-2xl",children:"First Tree"}),u.jsx(I1,{children:"Sign in to your workspace"})]}),u.jsx(As,{children:u.jsxs("form",{onSubmit:b,className:"space-y-4",children:[m&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:m}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"username",children:"Username"}),u.jsx(ct,{id:"username",value:r,onChange:x=>l(x.target.value),required:!0,autoFocus:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Fe,{htmlFor:"password",children:"Password"}),u.jsx(ct,{id:"password",type:"password",value:o,onChange:x=>c(x.target.value),required:!0})]}),u.jsx(he,{type:"submit",className:"w-full",disabled:g,children:g?"Signing in...":"Sign in"})]})})]})})}function oD(e,a){return Ae.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:a})}function uD(e){return Ae.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function cD(e,a){const r=new URLSearchParams;r.set("limit",String(a.limit)),a!=null&&a.cursor&&r.set("cursor",a.cursor);const l=r.toString();return Ae.get(`/admin/chats/${encodeURIComponent(e)}/messages${l?`?${l}`:""}`)}function V1(e,a){return a&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function dD(e){let a=-1;for(const o of e)o.kind==="turn_end"&&o.seq>a&&(a=o.seq);const r=e.filter(o=>o.kind==="turn_end"?!1:o.kind==="error"?!0:o.seq>a),l=new Map;for(const o of r){if(o.kind!=="tool_call")continue;const c=xx(o.payload);if(!c)continue;const m=l.get(c)??-1;o.seq>m&&l.set(c,o.seq)}return r.filter(o=>{if(o.kind!=="tool_call")return!0;const c=xx(o.payload);return c?l.get(c)===o.seq:!0})}function xx(e){if(typeof e!="object"||e===null)return;const a=e.toolUseId;return typeof a=="string"?a:void 0}function Uc(e){const a=new Date(e);return new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}).format(a)}function fD(e){if(!e)return"—";const a=Date.now()-new Date(e).getTime(),r=Math.round(a/1e3);if(r<60)return`${r}s ago`;const l=Math.round(r/60);if(l<60)return`${l}m ago`;const o=Math.round(l/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}function mD(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function hD({msg:e,myAgentId:a}){if(!a||e.senderId!==a)return null;const r=e.deliveryStatus??"sent";return r==="acked"?u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):r==="delivered"?u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function pD({agentId:e,chatId:a,session:r}){const l=Bn(),o=()=>l.invalidateQueries({queryKey:["session",e,a]}),c=lt({mutationFn:()=>UC(e,a),onSuccess:o}),m=lt({mutationFn:()=>LC(e,a),onSuccess:o}),h=lt({mutationFn:()=>$C(e,a),onSuccess:o}),g=(r==null?void 0:r.state)==="active",p=(r==null?void 0:r.state)==="suspended",b=(r==null?void 0:r.state)==="evicted";return u.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[g&&u.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:c.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"var(--fg-2)",borderRadius:4},onMouseEnter:x=>x.currentTarget.style.background="var(--bg-hover)",onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[u.jsx(x2,{className:"h-3 w-3"})," Suspend",u.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),p&&u.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:m.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"var(--fg-2)",borderRadius:4},onMouseEnter:x=>x.currentTarget.style.background="var(--bg-hover)",onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[u.jsx(E0,{className:"h-3 w-3"})," Resume"]}),!b&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{width:1,height:16,background:"var(--border)"}}),u.jsxs("button",{type:"button",onClick:()=>{window.confirm("Terminate this session?")&&h.mutate()},disabled:h.isPending,className:"inline-flex items-center transition-colors",style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:4},onMouseEnter:x=>x.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:x=>x.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[u.jsx(k2,{className:"h-3 w-3"})," Terminate"]})]})]})}function gD({event:e}){const a=RC(e.payload);if(!a)return null;const r=a.status==="error",l=a.status==="pending",o=r?"var(--state-error)":l?"var(--state-blocked)":"var(--fg-3)",c=r?"failed":l?"using":"used";return u.jsxs("div",{className:"mono flex items-center",style:{gap:8,fontSize:11,padding:"2px 8px",color:"var(--fg-3)"},children:[l?u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:o,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}):u.jsx("span",{"aria-hidden":!0,style:{color:o,flexShrink:0},children:r?"⚠":"↳"}),u.jsxs("span",{className:"truncate",style:{color:"var(--fg-3)"},children:[c," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:a.name}),a.durationMs!==void 0&&!l?u.jsxs("span",{style:{color:"var(--fg-4)",marginLeft:6,fontSize:10},children:["· ",mD(a.durationMs)]}):null]})]})}function vD({event:e,agentNameFn:a,agentId:r}){const l=MC(e.payload);if(!l||l.text.length===0)return null;const o=a(r);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"4px 0",opacity:.85},children:[u.jsx(K1,{name:o,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono",style:{fontSize:11,fontWeight:600,color:"var(--accent)"},children:o}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:Uc(e.createdAt)}),u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{style:{fontSize:12.5,color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2,lineHeight:1.55},children:l.text})]})]})}function yD({event:e}){return u.jsxs("div",{className:"mono flex items-center",style:{gap:8,fontSize:11,padding:"2px 8px",color:"var(--fg-3)"},children:[u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:Uc(e.createdAt)})]})}function bD({event:e}){const a=OC(e.payload),r=Uc(e.createdAt);return u.jsxs("div",{style:{padding:"6px 10px",borderLeft:"2px solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 4px 4px 0"},children:[u.jsxs("div",{className:"mono uppercase",style:{fontSize:10,letterSpacing:.08,color:"var(--state-error)"},children:["error · ",(a==null?void 0:a.source)??"unknown"," · ",r]}),u.jsx("div",{style:{marginTop:2,fontSize:11.5,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(a==null?void 0:a.message)??"(invalid error payload)"})]})}function K1({name:e,isSelf:a}){const r=e.slice(0,2).toUpperCase();return u.jsx("div",{className:"mono",style:{width:20,height:20,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",fontSize:9,fontWeight:700,flexShrink:0,background:a?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:a?"none":"1px solid var(--border-strong)",color:a?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:a?r:u.jsx(jc,{className:"h-3 w-3",style:{color:"var(--accent)"}})})}function xD({msg:e,myAgentId:a,agentNameFn:r}){const l=r(e.senderId),o=a===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"20px 1fr",columnGap:8,padding:"6px 0"},children:[u.jsx(K1,{name:l,isSelf:o}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:600,color:o?"var(--fg)":"var(--accent)"},children:l}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:Uc(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(hD,{msg:e,myAgentId:a})})]}),u.jsx("div",{style:{fontSize:12.5,color:"var(--fg)",whiteSpace:"pre-wrap",marginTop:2,lineHeight:1.55},children:e.format==="text"?typeof e.content=="string"?e.content:JSON.stringify(e.content):u.jsx("pre",{className:"mono",style:{fontSize:11,background:"var(--bg-sunken)",padding:8,borderRadius:4,overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function SD({agentId:e,chatId:a}){var D;const r=Bn(),l=Ka(),{agentId:o}=yo(),[c,m]=v.useState(""),h=v.useRef(null),{data:g}=Ie({queryKey:["chat-messages",a],queryFn:()=>cD(a,{limit:50}),refetchInterval:5e3}),{data:p}=Ie({queryKey:["session-events",e,a],queryFn:()=>DC(e,a,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:b}=Ie({queryKey:["session",e,a],queryFn:()=>Jl(e).then(O=>O.find(P=>P.chatId===a)??null),refetchInterval:5e3}),x=lt({mutationFn:O=>oD(a,O),onSuccess:()=>{m(""),r.invalidateQueries({queryKey:["chat-messages",a]})}}),j=()=>{const O=c.trim();O&&x.mutate(O)},N=v.useMemo(()=>{const O=(g==null?void 0:g.items)??[],P=dD((p==null?void 0:p.items)??[]),I=[...O.map(L=>({kind:"message",at:L.createdAt,key:`m-${L.id}`,data:L})),...P.map(L=>({kind:"event",at:L.createdAt,key:`e-${L.id}`,data:L}))];return I.sort((L,K)=>L.at.localeCompare(K.at)),I},[g,p]),z=N.length;v.useEffect(()=>{var O;z>0&&((O=h.current)==null||O.scrollIntoView({behavior:"smooth"}))},[z]);const w=l(e),E=(b==null?void 0:b.runtimeState)??"idle",M=V1((b==null?void 0:b.runtimeState)??null,e?"connected":null),B=(b==null?void 0:b.messageCount)??((D=g==null?void 0:g.items)==null?void 0:D.length)??0;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"10px 14px",borderBottom:"1px solid var(--border)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx(uo,{state:M,size:8}),u.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--fg)"},children:["Chat · ",a.slice(0,8)]}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)",padding:"1px 5px",border:"1px solid var(--border)",borderRadius:2},children:a})]}),u.jsxs("div",{className:"flex items-center",style:{fontSize:10.5,color:"var(--fg-3)",marginTop:4,gap:10},children:[u.jsx("span",{className:"mono",children:w}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["started ",fD((b==null?void 0:b.startedAt)??null)]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[B," msgs"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:["runtime"," ",u.jsx("span",{className:"mono",style:{color:M==="error"?"var(--state-error)":"var(--fg-2)"},children:E})]})]})]}),u.jsx(pD,{agentId:e,chatId:a,session:b??null})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",style:{padding:"10px 14px"},children:[z===0&&u.jsxs("div",{className:"flex flex-col items-center",style:{color:"var(--fg-3)",fontSize:13,padding:"32px 0",gap:6},children:[u.jsx(w0,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:N.map(O=>{if(O.kind==="event"){const P=O.data;switch(P.kind){case"tool_call":return u.jsx(gD,{event:P},O.key);case"assistant_text":return u.jsx(vD,{event:P,agentId:e,agentNameFn:l},O.key);case"thinking":return u.jsx(yD,{event:P},O.key);case"error":return u.jsx(bD,{event:P},O.key);default:return null}}return u.jsx(xD,{msg:O.data,myAgentId:o,agentNameFn:l},O.key)})}),u.jsx("div",{ref:h})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"10px 14px",borderTop:"1px solid var(--border)"},children:[u.jsxs("div",{style:{position:"relative",border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[u.jsx("textarea",{value:c,onChange:O=>m(O.target.value),placeholder:`Message @${w} · / for commands · @ to mention`,rows:2,onKeyDown:O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),j())},disabled:x.isPending,className:"w-full outline-none",style:{padding:"9px 12px 30px",fontSize:12.5,background:"transparent",border:"none",resize:"none",fontFamily:"var(--font-sans)",color:"var(--fg)"}}),u.jsxs("div",{className:"flex items-center justify-between",style:{position:"absolute",bottom:6,left:10,right:10,fontSize:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex",style:{gap:8},children:[u.jsx("span",{children:"/suspend"}),u.jsx("span",{children:"/resume"}),u.jsx("span",{children:"/branch"}),u.jsx("span",{children:"/promote"})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[u.jsxs("span",{children:[u.jsx("span",{className:"kbd",children:"⏎"})," send ",u.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),u.jsxs("button",{type:"button",onClick:j,disabled:x.isPending||!c.trim(),className:je("inline-flex items-center transition-colors",(x.isPending||!c.trim())&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"4px 10px",fontSize:11,fontWeight:600,color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"1px solid var(--accent)",borderRadius:5},children:[u.jsx(_2,{className:"h-3 w-3"})," Send"]})]})]})]}),x.isError&&u.jsx("p",{className:"mono",style:{fontSize:11,color:"var(--state-error)",padding:"6px 2px 0"},children:x.error instanceof Error?x.error.message:"Failed to send"})]})]})}function jD(){return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(jc,{className:"h-10 w-10 mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-sm font-medium mb-1",children:"Select a chat"}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function wD({selectedAgentId:e,selectedChatId:a}){return a&&e?u.jsx(SD,{agentId:e,chatId:a}):u.jsx(jD,{})}function F1(){const{data:e}=Ie({queryKey:["clients"],queryFn:Nc,staleTime:1e4,refetchInterval:1e4});return v.useMemo(()=>{const a=e??[],r=new Map;for(const l of a)r.set(l.id,l);return{resolve:l=>l?r.get(l)??null:null,clients:a,connectedClients:a.filter(l=>l.status==="connected")}},[e])}function uh({children:e}){return u.jsx("div",{className:"mono uppercase",style:{fontSize:9,letterSpacing:.1,color:"var(--fg-4)",marginBottom:8},children:e})}function Y1({children:e}){return u.jsx("div",{className:"grid",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4,fontSize:11.5},children:e})}function ua({label:e,children:a}){return u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{color:"var(--fg-3)"},children:e}),u.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})}function Sx(e){if(!e)return"—";const a=Date.now()-new Date(e).getTime(),r=Math.round(a/1e3);if(r<60)return`${r}s ago`;const l=Math.round(r/60);if(l<60)return`${l}m ago`;const o=Math.round(l/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}function jx(e){if(!e)return"—";const a=Date.now()-new Date(e).getTime(),r=Math.floor(a/6e4);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h ${r%60}m`:`${Math.floor(l/24)}d ${l%24}h`}const ND={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 Rm({label:e,value:a,accent:r}){return u.jsxs("div",{style:{padding:"6px 8px",background:"var(--bg-sunken)",borderRadius:4},children:[u.jsx("div",{className:"mono uppercase",style:{fontSize:9,color:"var(--fg-4)",letterSpacing:.08},children:e}),u.jsx("div",{className:"mono",style:{fontSize:13,fontWeight:600,color:r??"var(--fg)"},children:a})]})}function ED({notifications:e,agentId:a}){const[,r]=p0(),l=Bn(),o=lt({mutationFn:c=>HS(c),onSuccess:()=>{l.invalidateQueries({queryKey:["notifications","agent",a]})}});return u.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(c=>{const m=!!c.chatId,h=(ND[c.type]??c.type).toString(),g=c.severity==="high"?"var(--state-error)":c.severity==="medium"?"var(--state-blocked)":"var(--accent-dim)";return u.jsxs("button",{type:"button",className:je("w-full text-left transition-colors",m&&"cursor-pointer"),style:{padding:"6px 8px",background:c.read?"transparent":"var(--bg-sunken)",borderLeft:`2px solid ${g}`,borderRadius:"0 3px 3px 0",fontSize:11},onMouseEnter:p=>{m&&(p.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:p=>{p.currentTarget.style.background=c.read?"transparent":"var(--bg-sunken)"},onClick:()=>{c.read||o.mutate(c.id),c.chatId&&r({a,c:c.chatId})},children:[u.jsxs("div",{className:"flex items-baseline justify-between",children:[u.jsx("span",{className:"mono uppercase",style:{fontSize:9,letterSpacing:.08,color:c.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:h.replace("_"," ")}),u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:da(c.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1},children:c.message})]},c.id)})})}function X1({agentId:e}){var p;const a=Ka(),{resolve:r}=F1(),{data:l}=Ie({queryKey:["activity"],queryFn:wc,refetchInterval:1e4}),o=(p=l==null?void 0:l.agents)==null?void 0:p.find(b=>b.agentId===e),c=r(o==null?void 0:o.clientId),{data:m}=Ie({queryKey:["notifications","agent",e],queryFn:()=>ah({agentId:e,limit:3}),refetchInterval:3e4}),h=a(e),g=(o==null?void 0:o.runtimeState)??"offline";return u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:10},children:[u.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"1px solid var(--border-strong)"},children:u.jsx(jc,{className:"h-4 w-4",style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--fg)"},children:h}),u.jsx("div",{className:"mono truncate",style:{fontSize:10,color:"var(--fg-4)"},children:e})]}),u.jsx(Dc,{state:g})]}),u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[u.jsx(Rm,{label:"sessions",value:(o==null?void 0:o.totalSessions)??0,accent:((o==null?void 0:o.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),u.jsx(Rm,{label:"active",value:(o==null?void 0:o.activeSessions)??0,accent:((o==null?void 0:o.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),u.jsx(Rm,{label:"uptime",value:jx((c==null?void 0:c.connectedAt)??null)})]})]}),u.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsx(uh,{children:"Computer · runtime"}),u.jsxs(Y1,{children:[u.jsx(ua,{label:"host",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:(c==null?void 0:c.hostname)??"—"})}),u.jsx(ua,{label:"os",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:(c==null?void 0:c.os)??"—"})}),u.jsx(ua,{label:"runtime",children:u.jsx("span",{className:"mono",children:(o==null?void 0:o.runtimeType)??"—"})}),u.jsx(ua,{label:"sdk",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:(c==null?void 0:c.sdkVersion)??"—"})}),u.jsx(ua,{label:"connected",children:u.jsx("span",{className:"mono",style:{fontSize:11},children:jx((c==null?void 0:c.connectedAt)??null)})})]})]}),u.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border-faint)"},className:"flex flex-col",children:[u.jsx("a",{href:`/agents/${e}`,style:{fontSize:11,color:"var(--accent)"},className:"hover:underline",children:"Manage agent →"}),u.jsx("a",{href:"/admin#clients",style:{fontSize:11,color:"var(--accent)",marginTop:4},className:"hover:underline",children:"Admin · Computers →"})]}),u.jsxs("div",{style:{padding:"12px 14px"},children:[u.jsx(uh,{children:"Notifications"}),!(m!=null&&m.items)||m.items.length===0?u.jsx("div",{className:"text-center",style:{fontSize:11,color:"var(--fg-3)",padding:"12px 0"},children:"No notifications for this agent"}):u.jsx(ED,{notifications:m.items,agentId:e})]})]})}function _D({agentId:e,chatId:a}){const{data:r}=Ie({queryKey:["session",e,a],queryFn:()=>Jl(e).then(l=>l.find(o=>o.chatId===a)??null),refetchInterval:5e3});return u.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[u.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsx(uh,{children:"Session"}),u.jsxs(Y1,{children:[u.jsx(ua,{label:"state",children:u.jsx(Dc,{state:(r==null?void 0:r.runtimeState)??(r==null?void 0:r.state)??null})}),u.jsx(ua,{label:"chat",children:u.jsx("span",{className:"mono",style:{fontSize:10.5},children:a.slice(0,12)})}),u.jsx(ua,{label:"started",children:Sx((r==null?void 0:r.startedAt)??null)}),u.jsx(ua,{label:"last",children:Sx((r==null?void 0:r.lastActivityAt)??null)}),u.jsx(ua,{label:"messages",children:u.jsx("span",{className:"mono",children:(r==null?void 0:r.messageCount)??0})})]})]}),u.jsx(X1,{agentId:e})]})}function CD({selectedAgentId:e,selectedChatId:a}){return a&&e?u.jsx(_D,{agentId:e,chatId:a}):e?u.jsx(X1,{agentId:e}):null}const kD=32;function AD({aggregated:e,stale:a,className:r}){const l=Math.max(1,...e.map(o=>o.workingCount));return u.jsx("div",{className:je("flex items-end gap-[2px]",a&&"opacity-40",r),style:{height:22},"aria-hidden":!0,children:Array.from({length:kD}).map((o,c)=>{const m=e[c]??{workingCount:0,errorMask:!1},h=m.workingCount===0?.08:m.workingCount/l,g=.25+h*.7,p=m.errorMask?"var(--state-error)":"var(--accent)";return u.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,h*100)}%`,background:p,opacity:g,borderRadius:.5}},c)})})}const zD={error:0,blocked:1,working:2,idle:3};function TD(e,a){return a?e?zD[e]??4:4:5}function RD(e,a){return a==="all"?!0:a==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function OD({selectedAgentId:e,selectedChatId:a,onSelectAgent:r,onSelectChat:l}){const o=Ka(),{resolve:c}=F1(),m=Bn(),h=QM(),[g,p]=v.useState(""),[b,x]=v.useState("all"),{data:j}=Ie({queryKey:["activity"],queryFn:wc,refetchInterval:1e4}),{data:N}=Ie({queryKey:["agent-sessions",e],queryFn:()=>e?Jl(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),z=lt({mutationFn:I=>uD(I),onSuccess:(I,L)=>{m.invalidateQueries({queryKey:["agent-sessions",L]}),l(L,I.id)}}),{humans:w,agents:E,totalAll:M}=v.useMemo(()=>{const I=(j==null?void 0:j.agents)??[],L=g.trim().toLowerCase(),K=I.filter(se=>{var we;if(!RD(se,b))return!1;if(!L)return!0;const ve=o(se.agentId).toLowerCase(),Te=se.clientId?(((we=c(se.clientId))==null?void 0:we.hostname)??"").toLowerCase():"";return ve.includes(L)||Te.includes(L)||se.agentId.toLowerCase().includes(L)}),le=se=>TD(se.runtimeState,se.clientId),Se=[],_e=[];for(const se of K)(se.type==="human"?Se:_e).push(se);return Se.sort((se,ve)=>le(se)-le(ve)),_e.sort((se,ve)=>le(se)-le(ve)),{humans:Se,agents:_e,totalAll:I.length}},[j,g,b,o,c]),B=v.useMemo(()=>{const I=(j==null?void 0:j.agents)??[];return{working:I.filter(L=>L.runtimeState==="working").length,blocked:I.filter(L=>L.runtimeState==="blocked").length,error:I.filter(L=>L.runtimeState==="error").length}},[j]),D=[{value:"all",label:"all",count:M},{value:"active",label:"active",count:B.working},{value:"attn",label:"attn",count:B.blocked+B.error,warn:B.blocked+B.error>0}],O=I=>{var se;const L=e===I.agentId,K=V1(I.runtimeState,I.clientId),le=I.clientId?((se=c(I.clientId))==null?void 0:se.hostname)??I.clientId.slice(0,8):null,Se=I.activeSessions??0,_e=I.totalSessions??0;return u.jsxs("div",{style:{borderBottom:"1px solid var(--border-faint)"},children:[u.jsxs("button",{type:"button",onClick:()=>r(L?null:I.agentId),className:je("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"14px 1fr auto",columnGap:8,padding:"7px 10px 7px 12px",background:L?"var(--bg-active)":"transparent",borderLeft:`2px solid ${L?"var(--accent)":"transparent"}`},children:[u.jsx(uo,{state:K,size:8}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"mono truncate",style:{fontSize:12,fontWeight:500,color:"var(--fg)",letterSpacing:-.1},children:o(I.agentId)}),I.type==="human"&&u.jsx("span",{className:"mono",style:{fontSize:9,padding:"1px 5px",borderRadius:2,textTransform:"uppercase",letterSpacing:.08,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),u.jsx("div",{className:"truncate",style:{fontSize:10.5,color:"var(--fg-3)"},children:K==="offline"?"disconnected":le||"—"})]}),u.jsx("div",{className:"flex flex-col items-end gap-0.5",children:_e>0&&u.jsxs("span",{className:"mono tnum",style:{fontSize:9,color:"var(--fg-3)"},children:[Se,u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",_e]})]})})]}),L&&u.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!N||N.length===0)&&u.jsx("div",{style:{padding:"4px 10px 4px 28px",fontSize:10.5,color:"var(--fg-4)"},children:"No sessions yet"}),N==null?void 0:N.map(ve=>{const Te=ve.state==="active"?"working":ve.state==="suspended"?"idle":"offline";return u.jsxs("button",{type:"button",onClick:()=>l(I.agentId,ve.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"14px 1fr auto",columnGap:6,padding:"4px 10px 4px 28px",background:a===ve.chatId?"var(--bg-hover)":"transparent",color:ve.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:we=>{a!==ve.chatId&&(we.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:we=>{a!==ve.chatId&&(we.currentTarget.style.background="transparent")},children:[u.jsx(uo,{state:Te,size:6}),u.jsx("span",{className:"truncate",style:{fontSize:11},children:ve.chatId.slice(0,8)}),u.jsx("span",{className:"mono",style:{fontSize:9,color:"var(--fg-4)"},children:ve.state})]},ve.chatId)}),u.jsxs("button",{type:"button",onClick:()=>z.mutate(I.agentId),disabled:z.isPending,className:"w-full flex items-center text-left transition-colors",style:{gap:6,padding:"4px 10px 4px 28px",fontSize:10.5,color:"var(--fg-3)"},onMouseEnter:ve=>{ve.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:ve=>{ve.currentTarget.style.background="transparent"},children:[u.jsx(zs,{className:"h-3 w-3"}),"New chat"]})]})]},I.agentId)},P=w.length+E.length;return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"1px solid var(--border)"},children:[u.jsxs("div",{className:"shrink-0",style:{padding:"10px 12px 8px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsx("div",{style:{marginBottom:8},children:u.jsxs("span",{className:"mono uppercase",style:{fontSize:10,color:"var(--fg-3)",letterSpacing:.08},children:[M," members"]})}),u.jsxs("div",{className:"relative",children:[u.jsx(Ch,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:g,onChange:I=>p(I.target.value),placeholder:"Filter…",className:"w-full outline-none",style:{padding:"5px 8px 5px 26px",fontSize:12,background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:4,color:"var(--fg)"}})]}),u.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:D.map(I=>{const L=b===I.value;return u.jsxs("button",{type:"button",onClick:()=>x(I.value),className:"inline-flex items-center",style:{fontSize:10,padding:"3px 7px",borderRadius:3,gap:4,color:L?"var(--fg)":"var(--fg-3)",background:L?"var(--bg-active)":"transparent",border:`1px solid ${L?"var(--border-strong)":"var(--border)"}`},children:[I.label,u.jsx("span",{className:"mono",style:{color:I.warn&&I.count>0?"var(--state-error)":"var(--fg-4)"},children:I.count})]},I.value)})})]}),u.jsxs("div",{className:"shrink-0",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-faint)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[u.jsxs("span",{className:"mono uppercase flex items-center gap-1.5",style:{fontSize:10,color:"var(--fg-3)",letterSpacing:.08},children:[u.jsx(MD,{}),"Pulse · 5m"]}),u.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--fg-4)"},children:h.stale?"stale":"live"})]}),u.jsx(AD,{aggregated:h.aggregated,stale:h.stale}),u.jsxs("div",{className:"flex",style:{gap:10,marginTop:6,fontSize:10},children:[u.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:["●",B.working," working"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:["●",B.blocked," blocked"]}),u.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:["●",B.error," error"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[P===0&&u.jsx("div",{className:"text-center",style:{padding:"24px 12px",fontSize:12,color:"var(--fg-3)"},children:g||b!=="all"?"No matches":"No agents"}),E.length>0&&u.jsxs("div",{children:[u.jsx(wx,{label:"Agents",count:E.length}),E.map(O)]}),w.length>0&&u.jsxs("div",{children:[u.jsx(wx,{label:"Humans",count:w.length}),w.map(O)]})]})]})}function wx({label:e,count:a}){return u.jsxs("div",{className:"mono uppercase sticky top-0 z-10",style:{padding:"5px 12px",fontSize:9,letterSpacing:.12,color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"1px solid var(--border-faint)"},children:[e," · ",a]})}function MD(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[u.jsx("title",{children:"pulse"}),u.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function DD(){const[e,a]=p0(),r=e.get("a"),l=e.get("c");L1();const o=v.useCallback(h=>{a(h?{a:h}:{})},[a]),c=v.useCallback((h,g)=>{a({a:h,c:g})},[a]),{data:m}=Ie({queryKey:["agent-sessions",r],queryFn:()=>r?Jl(r):Promise.resolve([]),enabled:!!r&&!l});return v.useEffect(()=>{if(!r||l||!m||m.length===0)return;const h=[...m].sort((g,p)=>(p.lastActivityAt??"").localeCompare(g.lastActivityAt??""))[0];h&&a({a:r,c:h.chatId},{replace:!0})},[r,l,m,a]),u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(OD,{selectedAgentId:r,selectedChatId:l,onSelectAgent:o,onSelectChat:c}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(wD,{selectedAgentId:r,selectedChatId:l})}),r&&u.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"1px solid var(--border)",background:"var(--bg-raised)"},children:u.jsx(CD,{selectedAgentId:r,selectedChatId:l})})]})}const UD=new PN({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function LD(){return u.jsx(GN,{client:UD,children:u.jsx(B_,{children:u.jsx(k_,{children:u.jsxs(a_,{children:[u.jsx(Oa,{path:"/login",element:u.jsx(iD,{})}),u.jsx(Oa,{element:u.jsx(Z_,{}),children:u.jsxs(Oa,{element:u.jsx(IM,{children:u.jsx(yz,{})}),children:[u.jsx(Oa,{index:!0,element:u.jsx(DD,{})}),u.jsx(Oa,{path:"agents",element:u.jsx(nD,{})}),u.jsx(Oa,{path:"agents/:uuid",element:u.jsx(I3,{})}),u.jsx(Oa,{path:"clients",element:u.jsx(sD,{})}),u.jsx(Oa,{path:"admin",element:u.jsx(c3,{})})]})})]})})})})}const J1=document.getElementById("root");if(!J1)throw new Error("Root element not found");xN.createRoot(J1).render(u.jsx(v.StrictMode,{children:u.jsx(LD,{})}));
|