@agent-team-foundation/first-tree-hub 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-DNL1cEwv.mjs → bootstrap-CRDR6NwE.mjs} +1 -1
- package/dist/cli/index.mjs +35 -11
- package/dist/{core-B10jgThe.mjs → core-4nvleGlC.mjs} +567 -158
- package/dist/drizzle/0022_session_events.sql +32 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/{feishu-BoMJHlOv.mjs → feishu-CJ08ntOD.mjs} +54 -6
- package/dist/index.mjs +3 -3
- package/dist/web/assets/index-30C-bada.js +333 -0
- package/dist/web/assets/index-COlVuDVR.css +1 -0
- package/dist/web/index.html +9 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CTl4pHIL.css +0 -1
- package/dist/web/assets/index-CnLpaSBg.js +0 -308
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
var iy=t=>{throw TypeError(t)};var Cf=(t,a,l)=>a.has(t)||iy("Cannot "+l);var T=(t,a,l)=>(Cf(t,a,"read from private field"),l?l.call(t):a.get(t)),pe=(t,a,l)=>a.has(t)?iy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,l),re=(t,a,l,s)=>(Cf(t,a,"write to private field"),s?s.call(t,l):a.set(t,l),l),Ae=(t,a,l)=>(Cf(t,a,"access private method"),l);var xu=(t,a,l,s)=>({set _(o){re(t,a,o,l)},get _(){return T(t,a,s)}});function Yj(t,a){for(var l=0;l<a.length;l++){const s=a[l];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in t)){const d=Object.getOwnPropertyDescriptor(s,o);d&&Object.defineProperty(t,o,d.get?d:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(t,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"]'))s(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function l(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(o){if(o.ep)return;o.ep=!0;const d=l(o);fetch(o.href,d)}})();function Vb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Af={exports:{}},Ai={};/**
|
|
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 oy;function Kj(){if(oy)return Ai;oy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(s,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:t,type:s,key:h,ref:o!==void 0?o:null,props:d}}return Ai.Fragment=a,Ai.jsx=l,Ai.jsxs=l,Ai}var uy;function Pj(){return uy||(uy=1,Af.exports=Kj()),Af.exports}var u=Pj(),Tf={exports:{}},Ne={};/**
|
|
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 cy;function Fj(){if(cy)return Ne;cy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),j=Symbol.iterator;function w(O){return O===null||typeof O!="object"?null:(O=j&&O[j]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,_={};function R(O,Y,te){this.props=O,this.context=Y,this.refs=_,this.updater=te||C}R.prototype.isReactComponent={},R.prototype.setState=function(O,Y){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Y,"setState")},R.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function Q(){}Q.prototype=R.prototype;function q(O,Y,te){this.props=O,this.context=Y,this.refs=_,this.updater=te||C}var B=q.prototype=new Q;B.constructor=q,N(B,R.prototype),B.isPureReactComponent=!0;var F=Array.isArray;function J(){}var K={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function ee(O,Y,te){var le=te.ref;return{$$typeof:t,type:O,key:Y,ref:le!==void 0?le:null,props:te}}function be(O,Y){return ee(O.type,Y,O.props)}function _e(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Ue(O){var Y={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(te){return Y[te]})}var jt=/\/+/g;function Ge(O,Y){return typeof O=="object"&&O!==null&&O.key!=null?Ue(""+O.key):Y.toString(36)}function xe(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(J,J):(O.status="pending",O.then(function(Y){O.status==="pending"&&(O.status="fulfilled",O.value=Y)},function(Y){O.status==="pending"&&(O.status="rejected",O.reason=Y)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function $(O,Y,te,le,ue){var me=typeof O;(me==="undefined"||me==="boolean")&&(O=null);var Oe=!1;if(O===null)Oe=!0;else switch(me){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(O.$$typeof){case t:case a:Oe=!0;break;case x:return Oe=O._init,$(Oe(O._payload),Y,te,le,ue)}}if(Oe)return ue=ue(O),Oe=le===""?"."+Ge(O,0):le,F(ue)?(te="",Oe!=null&&(te=Oe.replace(jt,"$&/")+"/"),$(ue,Y,te,"",function(gt){return gt})):ue!=null&&(_e(ue)&&(ue=be(ue,te+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(jt,"$&/")+"/")+Oe)),Y.push(ue)),1;Oe=0;var pt=le===""?".":le+":";if(F(O))for(var fe=0;fe<O.length;fe++)le=O[fe],me=pt+Ge(le,fe),Oe+=$(le,Y,te,me,ue);else if(fe=w(O),typeof fe=="function")for(O=fe.call(O),fe=0;!(le=O.next()).done;)le=le.value,me=pt+Ge(le,fe++),Oe+=$(le,Y,te,me,ue);else if(me==="object"){if(typeof O.then=="function")return $(xe(O),Y,te,le,ue);throw Y=String(O),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function D(O,Y,te){if(O==null)return O;var le=[],ue=0;return $(O,le,"","",function(me){return Y.call(te,me,ue++)}),le}function ae(O){if(O._status===-1){var Y=O._result;Y=Y(),Y.then(function(te){(O._status===0||O._status===-1)&&(O._status=1,O._result=te)},function(te){(O._status===0||O._status===-1)&&(O._status=2,O._result=te)}),O._status===-1&&(O._status=0,O._result=Y)}if(O._status===1)return O._result.default;throw O._result}var ze=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},W={map:D,forEach:function(O,Y,te){D(O,function(){Y.apply(this,arguments)},te)},count:function(O){var Y=0;return D(O,function(){Y++}),Y},toArray:function(O){return D(O,function(Y){return Y})||[]},only:function(O){if(!_e(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ne.Activity=b,Ne.Children=W,Ne.Component=R,Ne.Fragment=l,Ne.Profiler=o,Ne.PureComponent=q,Ne.StrictMode=s,Ne.Suspense=g,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(O){return K.H.useMemoCache(O)}},Ne.cache=function(O){return function(){return O.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(O,Y,te){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var le=N({},O.props),ue=O.key;if(Y!=null)for(me in Y.key!==void 0&&(ue=""+Y.key),Y)!k.call(Y,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&Y.ref===void 0||(le[me]=Y[me]);var me=arguments.length-2;if(me===1)le.children=te;else if(1<me){for(var Oe=Array(me),pt=0;pt<me;pt++)Oe[pt]=arguments[pt+2];le.children=Oe}return ee(O.type,ue,le)},Ne.createContext=function(O){return O={$$typeof:h,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:d,_context:O},O},Ne.createElement=function(O,Y,te){var le,ue={},me=null;if(Y!=null)for(le in Y.key!==void 0&&(me=""+Y.key),Y)k.call(Y,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ue[le]=Y[le]);var Oe=arguments.length-2;if(Oe===1)ue.children=te;else if(1<Oe){for(var pt=Array(Oe),fe=0;fe<Oe;fe++)pt[fe]=arguments[fe+2];ue.children=pt}if(O&&O.defaultProps)for(le in Oe=O.defaultProps,Oe)ue[le]===void 0&&(ue[le]=Oe[le]);return ee(O,me,ue)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(O){return{$$typeof:m,render:O}},Ne.isValidElement=_e,Ne.lazy=function(O){return{$$typeof:x,_payload:{_status:-1,_result:O},_init:ae}},Ne.memo=function(O,Y){return{$$typeof:p,type:O,compare:Y===void 0?null:Y}},Ne.startTransition=function(O){var Y=K.T,te={};K.T=te;try{var le=O(),ue=K.S;ue!==null&&ue(te,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(J,ze)}catch(me){ze(me)}finally{Y!==null&&te.types!==null&&(Y.types=te.types),K.T=Y}},Ne.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Ne.use=function(O){return K.H.use(O)},Ne.useActionState=function(O,Y,te){return K.H.useActionState(O,Y,te)},Ne.useCallback=function(O,Y){return K.H.useCallback(O,Y)},Ne.useContext=function(O){return K.H.useContext(O)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(O,Y){return K.H.useDeferredValue(O,Y)},Ne.useEffect=function(O,Y){return K.H.useEffect(O,Y)},Ne.useEffectEvent=function(O){return K.H.useEffectEvent(O)},Ne.useId=function(){return K.H.useId()},Ne.useImperativeHandle=function(O,Y,te){return K.H.useImperativeHandle(O,Y,te)},Ne.useInsertionEffect=function(O,Y){return K.H.useInsertionEffect(O,Y)},Ne.useLayoutEffect=function(O,Y){return K.H.useLayoutEffect(O,Y)},Ne.useMemo=function(O,Y){return K.H.useMemo(O,Y)},Ne.useOptimistic=function(O,Y){return K.H.useOptimistic(O,Y)},Ne.useReducer=function(O,Y,te){return K.H.useReducer(O,Y,te)},Ne.useRef=function(O){return K.H.useRef(O)},Ne.useState=function(O){return K.H.useState(O)},Ne.useSyncExternalStore=function(O,Y,te){return K.H.useSyncExternalStore(O,Y,te)},Ne.useTransition=function(){return K.H.useTransition()},Ne.version="19.2.4",Ne}var dy;function Eh(){return dy||(dy=1,Tf.exports=Fj()),Tf.exports}var y=Eh();const Xj=Vb(y),Ch=Yj({__proto__:null,default:Xj},[y]);var zf={exports:{}},Ti={},Of={exports:{}},Rf={};/**
|
|
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 fy;function Jj(){return fy||(fy=1,(function(t){function a($,D){var ae=$.length;$.push(D);e:for(;0<ae;){var ze=ae-1>>>1,W=$[ze];if(0<o(W,D))$[ze]=D,$[ae]=W,ae=ze;else break e}}function l($){return $.length===0?null:$[0]}function s($){if($.length===0)return null;var D=$[0],ae=$.pop();if(ae!==D){$[0]=ae;e:for(var ze=0,W=$.length,O=W>>>1;ze<O;){var Y=2*(ze+1)-1,te=$[Y],le=Y+1,ue=$[le];if(0>o(te,ae))le<W&&0>o(ue,te)?($[ze]=ue,$[le]=ae,ze=le):($[ze]=te,$[Y]=ae,ze=Y);else if(le<W&&0>o(ue,ae))$[ze]=ue,$[le]=ae,ze=le;else break e}}return D}function o($,D){var ae=$.sortIndex-D.sortIndex;return ae!==0?ae:$.id-D.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;t.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();t.unstable_now=function(){return h.now()-m}}var g=[],p=[],x=1,b=null,j=3,w=!1,C=!1,N=!1,_=!1,R=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function B($){for(var D=l(p);D!==null;){if(D.callback===null)s(p);else if(D.startTime<=$)s(p),D.sortIndex=D.expirationTime,a(g,D);else break;D=l(p)}}function F($){if(N=!1,B($),!C)if(l(g)!==null)C=!0,J||(J=!0,Ue());else{var D=l(p);D!==null&&xe(F,D.startTime-$)}}var J=!1,K=-1,k=5,ee=-1;function be(){return _?!0:!(t.unstable_now()-ee<k)}function _e(){if(_=!1,J){var $=t.unstable_now();ee=$;var D=!0;try{e:{C=!1,N&&(N=!1,Q(K),K=-1),w=!0;var ae=j;try{t:{for(B($),b=l(g);b!==null&&!(b.expirationTime>$&&be());){var ze=b.callback;if(typeof ze=="function"){b.callback=null,j=b.priorityLevel;var W=ze(b.expirationTime<=$);if($=t.unstable_now(),typeof W=="function"){b.callback=W,B($),D=!0;break t}b===l(g)&&s(g),B($)}else s(g);b=l(g)}if(b!==null)D=!0;else{var O=l(p);O!==null&&xe(F,O.startTime-$),D=!1}}break e}finally{b=null,j=ae,w=!1}D=void 0}}finally{D?Ue():J=!1}}}var Ue;if(typeof q=="function")Ue=function(){q(_e)};else if(typeof MessageChannel<"u"){var jt=new MessageChannel,Ge=jt.port2;jt.port1.onmessage=_e,Ue=function(){Ge.postMessage(null)}}else Ue=function(){R(_e,0)};function xe($,D){K=R(function(){$(t.unstable_now())},D)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return j},t.unstable_next=function($){switch(j){case 1:case 2:case 3:var D=3;break;default:D=j}var ae=j;j=D;try{return $()}finally{j=ae}},t.unstable_requestPaint=function(){_=!0},t.unstable_runWithPriority=function($,D){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ae=j;j=$;try{return D()}finally{j=ae}},t.unstable_scheduleCallback=function($,D,ae){var ze=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ze+ae:ze):ae=ze,$){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=ae+W,$={id:x++,callback:D,priorityLevel:$,startTime:ae,expirationTime:W,sortIndex:-1},ae>ze?($.sortIndex=ae,a(p,$),l(g)===null&&$===l(p)&&(N?(Q(K),K=-1):N=!0,xe(F,ae-ze))):($.sortIndex=W,a(g,$),C||w||(C=!0,J||(J=!0,Ue()))),$},t.unstable_shouldYield=be,t.unstable_wrapCallback=function($){var D=j;return function(){var ae=j;j=D;try{return $.apply(this,arguments)}finally{j=ae}}}})(Rf)),Rf}var hy;function Wj(){return hy||(hy=1,Of.exports=Jj()),Of.exports}var Mf={exports:{}},Gt={};/**
|
|
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 my;function eN(){if(my)return Gt;my=1;var t=Eh();function a(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)p+="&args[]="+encodeURIComponent(arguments[x])}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 l(){}var s={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,p,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:g,containerInfo:p,implementation:x}}var h=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Gt.createPortal=function(g,p){var x=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 d(g,p,null,x)},Gt.flushSync=function(g){var p=h.T,x=s.p;try{if(h.T=null,s.p=2,g)return g()}finally{h.T=p,s.p=x,s.d.f()}},Gt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(g,p))},Gt.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},Gt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var x=p.as,b=m(x,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;x==="style"?s.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:j,fetchPriority:w}):x==="script"&&s.d.X(g,{crossOrigin:b,integrity:j,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Gt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var x=m(p.as,p.crossOrigin);s.d.M(g,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(g)},Gt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var x=p.as,b=m(x,p.crossOrigin);s.d.L(g,x,{crossOrigin:b,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})}},Gt.preloadModule=function(g,p){if(typeof g=="string")if(p){var x=m(p.as,p.crossOrigin);s.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(g)},Gt.requestFormReset=function(g){s.d.r(g)},Gt.unstable_batchedUpdates=function(g,p){return g(p)},Gt.useFormState=function(g,p,x){return h.H.useFormState(g,p,x)},Gt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Gt.version="19.2.4",Gt}var py;function Yb(){if(py)return Mf.exports;py=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),Mf.exports=eN(),Mf.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 gy;function tN(){if(gy)return Ti;gy=1;var t=Wj(),a=Eh(),l=Yb();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(s(188))}function p(e){var n=e.alternate;if(!n){if(n=d(e),n===null)throw Error(s(188));return n!==e?null:e}for(var r=e,i=n;;){var c=r.return;if(c===null)break;var f=c.alternate;if(f===null){if(i=c.return,i!==null){r=i;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===r)return g(c),e;if(f===i)return g(c),n;f=f.sibling}throw Error(s(188))}if(r.return!==i.return)r=c,i=f;else{for(var v=!1,S=c.child;S;){if(S===r){v=!0,r=c,i=f;break}if(S===i){v=!0,i=c,r=f;break}S=S.sibling}if(!v){for(S=f.child;S;){if(S===r){v=!0,r=f,i=c;break}if(S===i){v=!0,i=f,r=c;break}S=S.sibling}if(!v)throw Error(s(189))}}if(r.alternate!==i)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),q=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function Ue(e){return e===null||typeof e!="object"?null:(e=_e&&e[_e]||e["@@iterator"],typeof e=="function"?e:null)}var jt=Symbol.for("react.client.reference");function Ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===jt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case R:return"Profiler";case _:return"StrictMode";case F:return"Suspense";case J:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case q:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case B:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return n=e.displayName||null,n!==null?n:Ge(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return Ge(e(n))}catch{}}return null}var xe=Array.isArray,$=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ze=[],W=-1;function O(e){return{current:e}}function Y(e){0>W||(e.current=ze[W],ze[W]=null,W--)}function te(e,n){W++,ze[W]=e.current,e.current=n}var le=O(null),ue=O(null),me=O(null),Oe=O(null);function pt(e,n){switch(te(me,n),te(ue,e),te(le,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?zv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=zv(n),e=Ov(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(le),te(le,e)}function fe(){Y(le),Y(ue),Y(me)}function gt(e){e.memoizedState!==null&&te(Oe,e);var n=le.current,r=Ov(n,e.type);n!==r&&(te(ue,e),te(le,r))}function Dt(e){ue.current===e&&(Y(le),Y(ue)),Oe.current===e&&(Y(Oe),wi._currentValue=ae)}var Ln,La;function Xt(e){if(Ln===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ln=n&&n[1]||"",La=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ln+e+La}var vl=!1;function Ms(e,n){if(!e||vl)return"";vl=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(H){var Z=H}Reflect.construct(e,[],P)}else{try{P.call()}catch(H){Z=H}e.call(P.prototype)}}else{try{throw Error()}catch(H){Z=H}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(H){if(H&&Z&&typeof H.stack=="string")return[H.stack,Z.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),v=f[0],S=f[1];if(v&&S){var A=v.split(`
|
|
44
|
-
`),L=S.split(`
|
|
45
|
-
`);for(c=i=0;i<A.length&&!A[i].includes("DetermineComponentFrameRoot");)i++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(i===A.length||c===L.length)for(i=A.length-1,c=L.length-1;1<=i&&0<=c&&A[i]!==L[c];)c--;for(;1<=i&&0<=c;i--,c--)if(A[i]!==L[c]){if(i!==1||c!==1)do if(i--,c--,0>c||A[i]!==L[c]){var G=`
|
|
46
|
-
`+A[i].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=i&&0<=c);break}}}finally{vl=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Xt(r):""}function cc(e,n){switch(e.tag){case 26:case 27:case 5:return Xt(e.type);case 16:return Xt("Lazy");case 13:return e.child!==n&&n!==null?Xt("Suspense Fallback"):Xt("Suspense");case 19:return Xt("SuspenseList");case 0:case 15:return Ms(e.type,!1);case 11:return Ms(e.type.render,!1);case 1:return Ms(e.type,!0);case 31:return Xt("Activity");default:return""}}function Rr(e){try{var n="",r=null;do n+=cc(e,r),r=e,e=e.return;while(e);return n}catch(i){return`
|
|
47
|
-
Error generating stack: `+i.message+`
|
|
48
|
-
`+i.stack}}var ks=Object.prototype.hasOwnProperty,Ds=t.unstable_scheduleCallback,yl=t.unstable_cancelCallback,Wi=t.unstable_shouldYield,dc=t.unstable_requestPaint,Vt=t.unstable_now,fc=t.unstable_getCurrentPriorityLevel,eo=t.unstable_ImmediatePriority,to=t.unstable_UserBlockingPriority,bl=t.unstable_NormalPriority,hc=t.unstable_LowPriority,Us=t.unstable_IdlePriority,no=t.log,ao=t.unstable_setDisableYieldValue,Za=null,Ht=null;function Zn(e){if(typeof no=="function"&&ao(e),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(Za,e)}catch{}}var Qt=Math.clz32?Math.clz32:X,ro=Math.log,lo=Math.LN2;function X(e){return e>>>=0,e===0?32:31-(ro(e)/lo|0)|0}var Re=256,Jt=262144,Mr=4194304;function qa(e){var n=e&42;if(n!==0)return n;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function so(e,n,r){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~f,i!==0?c=qa(i):(v&=S,v!==0?c=qa(v):r||(r=S&~e,r!==0&&(c=qa(r))))):(S=i&~f,S!==0?c=qa(S):v!==0?c=qa(v):r||(r=i&~e,r!==0&&(c=qa(r)))),c===0?0:n!==0&&n!==c&&(n&f)===0&&(f=c&-c,r=n&-n,f>=r||f===32&&(r&4194048)!==0)?n:c}function Ls(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function kS(e,n){switch(e){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 dm(){var e=Mr;return Mr<<=1,(Mr&62914560)===0&&(Mr=4194304),e}function mc(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function Zs(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function DS(e,n,r,i,c,f){var v=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var S=e.entanglements,A=e.expirationTimes,L=e.hiddenUpdates;for(r=v&~r;0<r;){var G=31-Qt(r),P=1<<G;S[G]=0,A[G]=-1;var Z=L[G];if(Z!==null)for(L[G]=null,G=0;G<Z.length;G++){var H=Z[G];H!==null&&(H.lane&=-536870913)}r&=~P}i!==0&&fm(e,i,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(v&~n))}function fm(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var i=31-Qt(n);e.entangledLanes|=n,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function hm(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var i=31-Qt(r),c=1<<i;c&n|e[i]&n&&(e[i]|=n),r&=~c}}function mm(e,n){var r=n&-n;return r=(r&42)!==0?1:pc(r),(r&(e.suspendedLanes|n))!==0?0:r}function pc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function gc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pm(){var e=D.p;return e!==0?e:(e=window.event,e===void 0?32:ey(e.type))}function gm(e,n){var r=D.p;try{return D.p=e,n()}finally{D.p=r}}var Ba=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Ba,Wt="__reactProps$"+Ba,xl="__reactContainer$"+Ba,vc="__reactEvents$"+Ba,US="__reactListeners$"+Ba,LS="__reactHandles$"+Ba,vm="__reactResources$"+Ba,qs="__reactMarker$"+Ba;function yc(e){delete e[Ut],delete e[Wt],delete e[vc],delete e[US],delete e[LS]}function Sl(e){var n=e[Ut];if(n)return n;for(var r=e.parentNode;r;){if(n=r[xl]||r[Ut]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Zv(e);e!==null;){if(r=e[Ut])return r;e=Zv(e)}return n}e=r,r=e.parentNode}return null}function jl(e){if(e=e[Ut]||e[xl]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Bs(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function Nl(e){var n=e[vm];return n||(n=e[vm]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Rt(e){e[qs]=!0}var ym=new Set,bm={};function kr(e,n){wl(e,n),wl(e+"Capture",n)}function wl(e,n){for(bm[e]=n,e=0;e<n.length;e++)ym.add(n[e])}var ZS=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]*$"),xm={},Sm={};function qS(e){return ks.call(Sm,e)?!0:ks.call(xm,e)?!1:ZS.test(e)?Sm[e]=!0:(xm[e]=!0,!1)}function io(e,n,r){if(qS(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function oo(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function ra(e,n,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+i)}}function xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jm(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function BS(e,n,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,f=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(v){r=""+v,f.call(this,v)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(v){r=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function bc(e){if(!e._valueTracker){var n=jm(e)?"checked":"value";e._valueTracker=BS(e,n,""+e[n])}}function Nm(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),i="";return e&&(i=jm(e)?e.checked?"true":"false":e.value),e=i,e!==r?(n.setValue(e),!0):!1}function uo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var $S=/[\n"\\]/g;function Sn(e){return e.replace($S,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function xc(e,n,r,i,c,f,v,S){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),n!=null?v==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+xn(n)):e.value!==""+xn(n)&&(e.value=""+xn(n)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),n!=null?Sc(e,v,xn(n)):r!=null?Sc(e,v,xn(r)):i!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+xn(S):e.removeAttribute("name")}function wm(e,n,r,i,c,f,v,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){bc(e);return}r=r!=null?""+xn(r):"",n=n!=null?""+xn(n):r,S||n===e.value||(e.value=n),e.defaultValue=n}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=S?e.checked:!!i,e.defaultChecked=!!i,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),bc(e)}function Sc(e,n,r){n==="number"&&uo(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function _l(e,n,r,i){if(e=e.options,n){n={};for(var c=0;c<r.length;c++)n["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=n.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&i&&(e[r].defaultSelected=!0)}else{for(r=""+xn(r),n=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function _m(e,n,r){if(n!=null&&(n=""+xn(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+xn(r):""}function Em(e,n,r,i){if(n==null){if(i!=null){if(r!=null)throw Error(s(92));if(xe(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),n=r}r=xn(n),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),bc(e)}function El(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var HS=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 Cm(e,n,r){var i=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":i?e.setProperty(n,r):typeof r!="number"||r===0||HS.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function Am(e,n,r){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var c in n)i=n[c],n.hasOwnProperty(c)&&r[c]!==i&&Cm(e,c,i)}else for(var f in n)n.hasOwnProperty(f)&&Cm(e,f,n[f])}function jc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 QS=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"]]),GS=/^[\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 co(e){return GS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function la(){}var Nc=null;function wc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cl=null,Al=null;function Tm(e){var n=jl(e);if(n&&(e=n.stateNode)){var r=e[Wt]||null;e:switch(e=n.stateNode,n.type){case"input":if(xc(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Sn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var i=r[n];if(i!==e&&i.form===e.form){var c=i[Wt]||null;if(!c)throw Error(s(90));xc(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<r.length;n++)i=r[n],i.form===e.form&&Nm(i)}break e;case"textarea":_m(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&_l(e,!!r.multiple,n,!1)}}}var _c=!1;function zm(e,n,r){if(_c)return e(n,r);_c=!0;try{var i=e(n);return i}finally{if(_c=!1,(Cl!==null||Al!==null)&&(Jo(),Cl&&(n=Cl,e=Al,Al=Cl=null,Tm(n),e)))for(n=0;n<e.length;n++)Tm(e[n])}}function $s(e,n){var r=e.stateNode;if(r===null)return null;var i=r[Wt]||null;if(i===null)return null;r=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)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,n,typeof r));return r}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ec=!1;if(sa)try{var Hs={};Object.defineProperty(Hs,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Ec=!1}var $a=null,Cc=null,fo=null;function Om(){if(fo)return fo;var e,n=Cc,r=n.length,i,c="value"in $a?$a.value:$a.textContent,f=c.length;for(e=0;e<r&&n[e]===c[e];e++);var v=r-e;for(i=1;i<=v&&n[r-i]===c[f-i];i++);return fo=c.slice(e,1<i?1-i:void 0)}function ho(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function mo(){return!0}function Rm(){return!1}function en(e){function n(r,i,c,f,v){this._reactName=r,this._targetInst=c,this.type=i,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(r=e[S],this[S]=r?r(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?mo:Rm,this.isPropagationStopped=Rm,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=mo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=mo)},persist:function(){},isPersistent:mo}),n}var Dr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},po=en(Dr),Qs=b({},Dr,{view:0,detail:0}),IS=en(Qs),Ac,Tc,Gs,go=b({},Qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gs&&(Gs&&e.type==="mousemove"?(Ac=e.screenX-Gs.screenX,Tc=e.screenY-Gs.screenY):Tc=Ac=0,Gs=e),Ac)},movementY:function(e){return"movementY"in e?e.movementY:Tc}}),Mm=en(go),VS=b({},go,{dataTransfer:0}),YS=en(VS),KS=b({},Qs,{relatedTarget:0}),zc=en(KS),PS=b({},Dr,{animationName:0,elapsedTime:0,pseudoElement:0}),FS=en(PS),XS=b({},Dr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JS=en(XS),WS=b({},Dr,{data:0}),km=en(WS),e1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t1={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"},n1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=n1[e])?!!n[e]:!1}function Oc(){return a1}var r1=b({},Qs,{key:function(e){if(e.key){var n=e1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=ho(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?t1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oc,charCode:function(e){return e.type==="keypress"?ho(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ho(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),l1=en(r1),s1=b({},go,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dm=en(s1),i1=b({},Qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oc}),o1=en(i1),u1=b({},Dr,{propertyName:0,elapsedTime:0,pseudoElement:0}),c1=en(u1),d1=b({},go,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),f1=en(d1),h1=b({},Dr,{newState:0,oldState:0}),m1=en(h1),p1=[9,13,27,32],Rc=sa&&"CompositionEvent"in window,Is=null;sa&&"documentMode"in document&&(Is=document.documentMode);var g1=sa&&"TextEvent"in window&&!Is,Um=sa&&(!Rc||Is&&8<Is&&11>=Is),Lm=" ",Zm=!1;function qm(e,n){switch(e){case"keyup":return p1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tl=!1;function v1(e,n){switch(e){case"compositionend":return Bm(n);case"keypress":return n.which!==32?null:(Zm=!0,Lm);case"textInput":return e=n.data,e===Lm&&Zm?null:e;default:return null}}function y1(e,n){if(Tl)return e==="compositionend"||!Rc&&qm(e,n)?(e=Om(),fo=Cc=$a=null,Tl=!1,e):null;switch(e){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 Um&&n.locale!=="ko"?null:n.data;default:return null}}var b1={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 $m(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!b1[e.type]:n==="textarea"}function Hm(e,n,r,i){Cl?Al?Al.push(i):Al=[i]:Cl=i,n=lu(n,"onChange"),0<n.length&&(r=new po("onChange","change",null,r,i),e.push({event:r,listeners:n}))}var Vs=null,Ys=null;function x1(e){wv(e,0)}function vo(e){var n=Bs(e);if(Nm(n))return e}function Qm(e,n){if(e==="change")return n}var Gm=!1;if(sa){var Mc;if(sa){var kc="oninput"in document;if(!kc){var Im=document.createElement("div");Im.setAttribute("oninput","return;"),kc=typeof Im.oninput=="function"}Mc=kc}else Mc=!1;Gm=Mc&&(!document.documentMode||9<document.documentMode)}function Vm(){Vs&&(Vs.detachEvent("onpropertychange",Ym),Ys=Vs=null)}function Ym(e){if(e.propertyName==="value"&&vo(Ys)){var n=[];Hm(n,Ys,e,wc(e)),zm(x1,n)}}function S1(e,n,r){e==="focusin"?(Vm(),Vs=n,Ys=r,Vs.attachEvent("onpropertychange",Ym)):e==="focusout"&&Vm()}function j1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vo(Ys)}function N1(e,n){if(e==="click")return vo(n)}function w1(e,n){if(e==="input"||e==="change")return vo(n)}function _1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var dn=typeof Object.is=="function"?Object.is:_1;function Ks(e,n){if(dn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),i=Object.keys(n);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var c=r[i];if(!ks.call(n,c)||!dn(e[c],n[c]))return!1}return!0}function Km(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pm(e,n){var r=Km(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=n&&i>=n)return{node:r,offset:n-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Km(r)}}function Fm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Fm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Xm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=uo(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=uo(e.document)}return n}function Dc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var E1=sa&&"documentMode"in document&&11>=document.documentMode,zl=null,Uc=null,Ps=null,Lc=!1;function Jm(e,n,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Lc||zl==null||zl!==uo(i)||(i=zl,"selectionStart"in i&&Dc(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}),Ps&&Ks(Ps,i)||(Ps=i,i=lu(Uc,"onSelect"),0<i.length&&(n=new po("onSelect","select",null,n,r),e.push({event:n,listeners:i}),n.target=zl)))}function Ur(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Ol={animationend:Ur("Animation","AnimationEnd"),animationiteration:Ur("Animation","AnimationIteration"),animationstart:Ur("Animation","AnimationStart"),transitionrun:Ur("Transition","TransitionRun"),transitionstart:Ur("Transition","TransitionStart"),transitioncancel:Ur("Transition","TransitionCancel"),transitionend:Ur("Transition","TransitionEnd")},Zc={},Wm={};sa&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function Lr(e){if(Zc[e])return Zc[e];if(!Ol[e])return e;var n=Ol[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Wm)return Zc[e]=n[r];return e}var ep=Lr("animationend"),tp=Lr("animationiteration"),np=Lr("animationstart"),C1=Lr("transitionrun"),A1=Lr("transitionstart"),T1=Lr("transitioncancel"),ap=Lr("transitionend"),rp=new Map,qc="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(" ");qc.push("scrollEnd");function qn(e,n){rp.set(e,n),kr(n,[e])}var yo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},jn=[],Rl=0,Bc=0;function bo(){for(var e=Rl,n=Bc=Rl=0;n<e;){var r=jn[n];jn[n++]=null;var i=jn[n];jn[n++]=null;var c=jn[n];jn[n++]=null;var f=jn[n];if(jn[n++]=null,i!==null&&c!==null){var v=i.pending;v===null?c.next=c:(c.next=v.next,v.next=c),i.pending=c}f!==0&&lp(r,c,f)}}function xo(e,n,r,i){jn[Rl++]=e,jn[Rl++]=n,jn[Rl++]=r,jn[Rl++]=i,Bc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function $c(e,n,r,i){return xo(e,n,r,i),So(e)}function Zr(e,n){return xo(e,null,null,n),So(e)}function lp(e,n,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var c=!1,f=e.return;f!==null;)f.childLanes|=r,i=f.alternate,i!==null&&(i.childLanes|=r),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&n!==null&&(c=31-Qt(r),e=f.hiddenUpdates,i=e[c],i===null?e[c]=[n]:i.push(n),n.lane=r|536870912),f):null}function So(e){if(50<vi)throw vi=0,Fd=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ml={};function z1(e,n,r,i){this.tag=e,this.key=r,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 fn(e,n,r,i){return new z1(e,n,r,i)}function Hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ia(e,n){var r=e.alternate;return r===null?(r=fn(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function sp(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function jo(e,n,r,i,c,f){var v=0;if(i=e,typeof e=="function")Hc(e)&&(v=1);else if(typeof e=="string")v=Dj(e,r,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=fn(31,r,n,c),e.elementType=ee,e.lanes=f,e;case N:return qr(r.children,c,f,n);case _:v=8,c|=24;break;case R:return e=fn(12,r,n,c|2),e.elementType=R,e.lanes=f,e;case F:return e=fn(13,r,n,c),e.elementType=F,e.lanes=f,e;case J:return e=fn(19,r,n,c),e.elementType=J,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:v=10;break e;case Q:v=9;break e;case B:v=11;break e;case K:v=14;break e;case k:v=16,i=null;break e}v=29,r=Error(s(130,e===null?"null":typeof e,"")),i=null}return n=fn(v,r,n,c),n.elementType=e,n.type=i,n.lanes=f,n}function qr(e,n,r,i){return e=fn(7,e,i,n),e.lanes=r,e}function Qc(e,n,r){return e=fn(6,e,null,n),e.lanes=r,e}function ip(e){var n=fn(18,null,null,0);return n.stateNode=e,n}function Gc(e,n,r){return n=fn(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var op=new WeakMap;function Nn(e,n){if(typeof e=="object"&&e!==null){var r=op.get(e);return r!==void 0?r:(n={value:e,source:n,stack:Rr(n)},op.set(e,n),n)}return{value:e,source:n,stack:Rr(n)}}var kl=[],Dl=0,No=null,Fs=0,wn=[],_n=0,Ha=null,In=1,Vn="";function oa(e,n){kl[Dl++]=Fs,kl[Dl++]=No,No=e,Fs=n}function up(e,n,r){wn[_n++]=In,wn[_n++]=Vn,wn[_n++]=Ha,Ha=e;var i=In;e=Vn;var c=32-Qt(i)-1;i&=~(1<<c),r+=1;var f=32-Qt(n)+c;if(30<f){var v=c-c%5;f=(i&(1<<v)-1).toString(32),i>>=v,c-=v,In=1<<32-Qt(n)+c|r<<c|i,Vn=f+e}else In=1<<f|r<<c|i,Vn=e}function Ic(e){e.return!==null&&(oa(e,1),up(e,1,0))}function Vc(e){for(;e===No;)No=kl[--Dl],kl[Dl]=null,Fs=kl[--Dl],kl[Dl]=null;for(;e===Ha;)Ha=wn[--_n],wn[_n]=null,Vn=wn[--_n],wn[_n]=null,In=wn[--_n],wn[_n]=null}function cp(e,n){wn[_n++]=In,wn[_n++]=Vn,wn[_n++]=Ha,In=n.id,Vn=n.overflow,Ha=e}var Lt=null,rt=null,qe=!1,Qa=null,En=!1,Yc=Error(s(519));function Ga(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xs(Nn(n,e)),Yc}function dp(e){var n=e.stateNode,r=e.type,i=e.memoizedProps;switch(n[Ut]=e,n[Wt]=i,r){case"dialog":ke("cancel",n),ke("close",n);break;case"iframe":case"object":case"embed":ke("load",n);break;case"video":case"audio":for(r=0;r<bi.length;r++)ke(bi[r],n);break;case"source":ke("error",n);break;case"img":case"image":case"link":ke("error",n),ke("load",n);break;case"details":ke("toggle",n);break;case"input":ke("invalid",n),wm(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ke("invalid",n);break;case"textarea":ke("invalid",n),Em(n,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||i.suppressHydrationWarning===!0||Av(n.textContent,r)?(i.popover!=null&&(ke("beforetoggle",n),ke("toggle",n)),i.onScroll!=null&&ke("scroll",n),i.onScrollEnd!=null&&ke("scrollend",n),i.onClick!=null&&(n.onclick=la),n=!0):n=!1,n||Ga(e,!0)}function fp(e){for(Lt=e.return;Lt;)switch(Lt.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Lt=Lt.return}}function Ul(e){if(e!==Lt)return!1;if(!qe)return fp(e),qe=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||ff(e.type,e.memoizedProps)),r=!r),r&&rt&&Ga(e),fp(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rt=Lv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rt=Lv(e)}else n===27?(n=rt,rr(e.type)?(e=vf,vf=null,rt=e):rt=n):rt=Lt?An(e.stateNode.nextSibling):null;return!0}function Br(){rt=Lt=null,qe=!1}function Kc(){var e=Qa;return e!==null&&(rn===null?rn=e:rn.push.apply(rn,e),Qa=null),e}function Xs(e){Qa===null?Qa=[e]:Qa.push(e)}var Pc=O(null),$r=null,ua=null;function Ia(e,n,r){te(Pc,n._currentValue),n._currentValue=r}function ca(e){e._currentValue=Pc.current,Y(Pc)}function Fc(e,n,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===r)break;e=e.return}}function Xc(e,n,r,i){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var v=c.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=c;for(var A=0;A<n.length;A++)if(S.context===n[A]){f.lanes|=r,S=f.alternate,S!==null&&(S.lanes|=r),Fc(f.return,r,e),i||(v=null);break e}f=S.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(s(341));v.lanes|=r,f=v.alternate,f!==null&&(f.lanes|=r),Fc(v,r,e),v=null}else v=c.child;if(v!==null)v.return=c;else for(v=c;v!==null;){if(v===e){v=null;break}if(c=v.sibling,c!==null){c.return=v.return,v=c;break}v=v.return}c=v}}function Ll(e,n,r,i){e=null;for(var c=n,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var v=c.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var S=c.type;dn(c.pendingProps.value,v.value)||(e!==null?e.push(S):e=[S])}}else if(c===Oe.current){if(v=c.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(wi):e=[wi])}c=c.return}e!==null&&Xc(n,e,r,i),n.flags|=262144}function wo(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hr(e){$r=e,ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zt(e){return hp($r,e)}function _o(e,n){return $r===null&&Hr(e),hp(e,n)}function hp(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},ua===null){if(e===null)throw Error(s(308));ua=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else ua=ua.next=n;return r}var O1=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},R1=t.unstable_scheduleCallback,M1=t.unstable_NormalPriority,Nt={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jc(){return{controller:new O1,data:new Map,refCount:0}}function Js(e){e.refCount--,e.refCount===0&&R1(M1,function(){e.controller.abort()})}var Ws=null,Wc=0,Zl=0,ql=null;function k1(e,n){if(Ws===null){var r=Ws=[];Wc=0,Zl=nf(),ql={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Wc++,n.then(mp,mp),n}function mp(){if(--Wc===0&&Ws!==null){ql!==null&&(ql.status="fulfilled");var e=Ws;Ws=null,Zl=0,ql=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function D1(e,n){var r=[],i={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return e.then(function(){i.status="fulfilled",i.value=n;for(var c=0;c<r.length;c++)(0,r[c])(n)},function(c){for(i.status="rejected",i.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),i}var pp=$.S;$.S=function(e,n){Jg=Vt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&k1(e,n),pp!==null&&pp(e,n)};var Qr=O(null);function ed(){var e=Qr.current;return e!==null?e:nt.pooledCache}function Eo(e,n){n===null?te(Qr,Qr.current):te(Qr,n.pool)}function gp(){var e=ed();return e===null?null:{parent:Nt._currentValue,pool:e}}var Bl=Error(s(460)),td=Error(s(474)),Co=Error(s(542)),Ao={then:function(){}};function vp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yp(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(la,la),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,xp(e),e;default:if(typeof n.status=="string")n.then(la,la);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(i){if(n.status==="pending"){var c=n;c.status="fulfilled",c.value=i}},function(i){if(n.status==="pending"){var c=n;c.status="rejected",c.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,xp(e),e}throw Ir=n,Bl}}function Gr(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Ir=r,Bl):r}}var Ir=null;function bp(){if(Ir===null)throw Error(s(459));var e=Ir;return Ir=null,e}function xp(e){if(e===Bl||e===Co)throw Error(s(483))}var $l=null,ei=0;function To(e){var n=ei;return ei+=1,$l===null&&($l=[]),yp($l,e,n)}function ti(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function zo(e,n){throw n.$$typeof===j?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Sp(e){function n(M,z){if(e){var U=M.deletions;U===null?(M.deletions=[z],M.flags|=16):U.push(z)}}function r(M,z){if(!e)return null;for(;z!==null;)n(M,z),z=z.sibling;return null}function i(M){for(var z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function c(M,z){return M=ia(M,z),M.index=0,M.sibling=null,M}function f(M,z,U){return M.index=U,e?(U=M.alternate,U!==null?(U=U.index,U<z?(M.flags|=67108866,z):U):(M.flags|=67108866,z)):(M.flags|=1048576,z)}function v(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function S(M,z,U,V){return z===null||z.tag!==6?(z=Qc(U,M.mode,V),z.return=M,z):(z=c(z,U),z.return=M,z)}function A(M,z,U,V){var ge=U.type;return ge===N?G(M,z,U.props.children,V,U.key):z!==null&&(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===k&&Gr(ge)===z.type)?(z=c(z,U.props),ti(z,U),z.return=M,z):(z=jo(U.type,U.key,U.props,null,M.mode,V),ti(z,U),z.return=M,z)}function L(M,z,U,V){return z===null||z.tag!==4||z.stateNode.containerInfo!==U.containerInfo||z.stateNode.implementation!==U.implementation?(z=Gc(U,M.mode,V),z.return=M,z):(z=c(z,U.children||[]),z.return=M,z)}function G(M,z,U,V,ge){return z===null||z.tag!==7?(z=qr(U,M.mode,V,ge),z.return=M,z):(z=c(z,U),z.return=M,z)}function P(M,z,U){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Qc(""+z,M.mode,U),z.return=M,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case w:return U=jo(z.type,z.key,z.props,null,M.mode,U),ti(U,z),U.return=M,U;case C:return z=Gc(z,M.mode,U),z.return=M,z;case k:return z=Gr(z),P(M,z,U)}if(xe(z)||Ue(z))return z=qr(z,M.mode,U,null),z.return=M,z;if(typeof z.then=="function")return P(M,To(z),U);if(z.$$typeof===q)return P(M,_o(M,z),U);zo(M,z)}return null}function Z(M,z,U,V){var ge=z!==null?z.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ge!==null?null:S(M,z,""+U,V);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case w:return U.key===ge?A(M,z,U,V):null;case C:return U.key===ge?L(M,z,U,V):null;case k:return U=Gr(U),Z(M,z,U,V)}if(xe(U)||Ue(U))return ge!==null?null:G(M,z,U,V,null);if(typeof U.then=="function")return Z(M,z,To(U),V);if(U.$$typeof===q)return Z(M,z,_o(M,U),V);zo(M,U)}return null}function H(M,z,U,V,ge){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return M=M.get(U)||null,S(z,M,""+V,ge);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return M=M.get(V.key===null?U:V.key)||null,A(z,M,V,ge);case C:return M=M.get(V.key===null?U:V.key)||null,L(z,M,V,ge);case k:return V=Gr(V),H(M,z,U,V,ge)}if(xe(V)||Ue(V))return M=M.get(U)||null,G(z,M,V,ge,null);if(typeof V.then=="function")return H(M,z,U,To(V),ge);if(V.$$typeof===q)return H(M,z,U,_o(z,V),ge);zo(z,V)}return null}function se(M,z,U,V){for(var ge=null,He=null,ce=z,Ce=z=0,Ze=null;ce!==null&&Ce<U.length;Ce++){ce.index>Ce?(Ze=ce,ce=null):Ze=ce.sibling;var Qe=Z(M,ce,U[Ce],V);if(Qe===null){ce===null&&(ce=Ze);break}e&&ce&&Qe.alternate===null&&n(M,ce),z=f(Qe,z,Ce),He===null?ge=Qe:He.sibling=Qe,He=Qe,ce=Ze}if(Ce===U.length)return r(M,ce),qe&&oa(M,Ce),ge;if(ce===null){for(;Ce<U.length;Ce++)ce=P(M,U[Ce],V),ce!==null&&(z=f(ce,z,Ce),He===null?ge=ce:He.sibling=ce,He=ce);return qe&&oa(M,Ce),ge}for(ce=i(ce);Ce<U.length;Ce++)Ze=H(ce,M,Ce,U[Ce],V),Ze!==null&&(e&&Ze.alternate!==null&&ce.delete(Ze.key===null?Ce:Ze.key),z=f(Ze,z,Ce),He===null?ge=Ze:He.sibling=Ze,He=Ze);return e&&ce.forEach(function(ur){return n(M,ur)}),qe&&oa(M,Ce),ge}function Se(M,z,U,V){if(U==null)throw Error(s(151));for(var ge=null,He=null,ce=z,Ce=z=0,Ze=null,Qe=U.next();ce!==null&&!Qe.done;Ce++,Qe=U.next()){ce.index>Ce?(Ze=ce,ce=null):Ze=ce.sibling;var ur=Z(M,ce,Qe.value,V);if(ur===null){ce===null&&(ce=Ze);break}e&&ce&&ur.alternate===null&&n(M,ce),z=f(ur,z,Ce),He===null?ge=ur:He.sibling=ur,He=ur,ce=Ze}if(Qe.done)return r(M,ce),qe&&oa(M,Ce),ge;if(ce===null){for(;!Qe.done;Ce++,Qe=U.next())Qe=P(M,Qe.value,V),Qe!==null&&(z=f(Qe,z,Ce),He===null?ge=Qe:He.sibling=Qe,He=Qe);return qe&&oa(M,Ce),ge}for(ce=i(ce);!Qe.done;Ce++,Qe=U.next())Qe=H(ce,M,Ce,Qe.value,V),Qe!==null&&(e&&Qe.alternate!==null&&ce.delete(Qe.key===null?Ce:Qe.key),z=f(Qe,z,Ce),He===null?ge=Qe:He.sibling=Qe,He=Qe);return e&&ce.forEach(function(Vj){return n(M,Vj)}),qe&&oa(M,Ce),ge}function et(M,z,U,V){if(typeof U=="object"&&U!==null&&U.type===N&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case w:e:{for(var ge=U.key;z!==null;){if(z.key===ge){if(ge=U.type,ge===N){if(z.tag===7){r(M,z.sibling),V=c(z,U.props.children),V.return=M,M=V;break e}}else if(z.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===k&&Gr(ge)===z.type){r(M,z.sibling),V=c(z,U.props),ti(V,U),V.return=M,M=V;break e}r(M,z);break}else n(M,z);z=z.sibling}U.type===N?(V=qr(U.props.children,M.mode,V,U.key),V.return=M,M=V):(V=jo(U.type,U.key,U.props,null,M.mode,V),ti(V,U),V.return=M,M=V)}return v(M);case C:e:{for(ge=U.key;z!==null;){if(z.key===ge)if(z.tag===4&&z.stateNode.containerInfo===U.containerInfo&&z.stateNode.implementation===U.implementation){r(M,z.sibling),V=c(z,U.children||[]),V.return=M,M=V;break e}else{r(M,z);break}else n(M,z);z=z.sibling}V=Gc(U,M.mode,V),V.return=M,M=V}return v(M);case k:return U=Gr(U),et(M,z,U,V)}if(xe(U))return se(M,z,U,V);if(Ue(U)){if(ge=Ue(U),typeof ge!="function")throw Error(s(150));return U=ge.call(U),Se(M,z,U,V)}if(typeof U.then=="function")return et(M,z,To(U),V);if(U.$$typeof===q)return et(M,z,_o(M,U),V);zo(M,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,z!==null&&z.tag===6?(r(M,z.sibling),V=c(z,U),V.return=M,M=V):(r(M,z),V=Qc(U,M.mode,V),V.return=M,M=V),v(M)):r(M,z)}return function(M,z,U,V){try{ei=0;var ge=et(M,z,U,V);return $l=null,ge}catch(ce){if(ce===Bl||ce===Co)throw ce;var He=fn(29,ce,null,M.mode);return He.lanes=V,He.return=M,He}finally{}}}var Vr=Sp(!0),jp=Sp(!1),Va=!1;function nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ad(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,n,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ie&2)!==0){var c=i.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),i.pending=n,n=So(e),lp(e,null,r),n}return xo(e,i,n,r),So(e)}function ni(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,hm(e,r)}}function rd(e,n){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var c=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var v={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};f===null?c=f=v:f=f.next=v,r=r.next}while(r!==null);f===null?c=f=n:f=f.next=n}else c=f=n;r={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var ld=!1;function ai(){if(ld){var e=ql;if(e!==null)throw e}}function ri(e,n,r,i){ld=!1;var c=e.updateQueue;Va=!1;var f=c.firstBaseUpdate,v=c.lastBaseUpdate,S=c.shared.pending;if(S!==null){c.shared.pending=null;var A=S,L=A.next;A.next=null,v===null?f=L:v.next=L,v=A;var G=e.alternate;G!==null&&(G=G.updateQueue,S=G.lastBaseUpdate,S!==v&&(S===null?G.firstBaseUpdate=L:S.next=L,G.lastBaseUpdate=A))}if(f!==null){var P=c.baseState;v=0,G=L=A=null,S=f;do{var Z=S.lane&-536870913,H=Z!==S.lane;if(H?(Le&Z)===Z:(i&Z)===Z){Z!==0&&Z===Zl&&(ld=!0),G!==null&&(G=G.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var se=e,Se=S;Z=n;var et=r;switch(Se.tag){case 1:if(se=Se.payload,typeof se=="function"){P=se.call(et,P,Z);break e}P=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=Se.payload,Z=typeof se=="function"?se.call(et,P,Z):se,Z==null)break e;P=b({},P,Z);break e;case 2:Va=!0}}Z=S.callback,Z!==null&&(e.flags|=64,H&&(e.flags|=8192),H=c.callbacks,H===null?c.callbacks=[Z]:H.push(Z))}else H={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},G===null?(L=G=H,A=P):G=G.next=H,v|=Z;if(S=S.next,S===null){if(S=c.shared.pending,S===null)break;H=S,S=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);G===null&&(A=P),c.baseState=A,c.firstBaseUpdate=L,c.lastBaseUpdate=G,f===null&&(c.shared.lanes=0),Wa|=v,e.lanes=v,e.memoizedState=P}}function Np(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function wp(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Np(r[e],n)}var Hl=O(null),Oo=O(0);function _p(e,n){e=ba,te(Oo,e),te(Hl,n),ba=e|n.baseLanes}function sd(){te(Oo,ba),te(Hl,Hl.current)}function id(){ba=Oo.current,Y(Hl),Y(Oo)}var hn=O(null),Cn=null;function Pa(e){var n=e.alternate;te(xt,xt.current&1),te(hn,e),Cn===null&&(n===null||Hl.current!==null||n.memoizedState!==null)&&(Cn=e)}function od(e){te(xt,xt.current),te(hn,e),Cn===null&&(Cn=e)}function Ep(e){e.tag===22?(te(xt,xt.current),te(hn,e),Cn===null&&(Cn=e)):Fa()}function Fa(){te(xt,xt.current),te(hn,hn.current)}function mn(e){Y(hn),Cn===e&&(Cn=null),Y(xt)}var xt=O(0);function Ro(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||pf(r)||gf(r)))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===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var da=0,Ee=null,Je=null,wt=null,Mo=!1,Ql=!1,Yr=!1,ko=0,li=0,Gl=null,U1=0;function vt(){throw Error(s(321))}function ud(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!dn(e[r],n[r]))return!1;return!0}function cd(e,n,r,i,c,f){return da=f,Ee=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=e===null||e.memoizedState===null?ug:_d,Yr=!1,f=r(i,c),Yr=!1,Ql&&(f=Ap(n,r,i,c)),Cp(e),f}function Cp(e){$.H=oi;var n=Je!==null&&Je.next!==null;if(da=0,wt=Je=Ee=null,Mo=!1,li=0,Gl=null,n)throw Error(s(300));e===null||_t||(e=e.dependencies,e!==null&&wo(e)&&(_t=!0))}function Ap(e,n,r,i){Ee=e;var c=0;do{if(Ql&&(Gl=null),li=0,Ql=!1,25<=c)throw Error(s(301));if(c+=1,wt=Je=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}$.H=cg,f=n(r,i)}while(Ql);return f}function L1(){var e=$.H,n=e.useState()[0];return n=typeof n.then=="function"?si(n):n,e=e.useState()[0],(Je!==null?Je.memoizedState:null)!==e&&(Ee.flags|=1024),n}function dd(){var e=ko!==0;return ko=0,e}function fd(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function hd(e){if(Mo){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Mo=!1}da=0,wt=Je=Ee=null,Ql=!1,li=ko=0,Gl=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?Ee.memoizedState=wt=e:wt=wt.next=e,wt}function St(){if(Je===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var n=wt===null?Ee.memoizedState:wt.next;if(n!==null)wt=n,Je=e;else{if(e===null)throw Ee.alternate===null?Error(s(467)):Error(s(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},wt===null?Ee.memoizedState=wt=e:wt=wt.next=e}return wt}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function si(e){var n=li;return li+=1,Gl===null&&(Gl=[]),e=yp(Gl,e,n),n=Ee,(wt===null?n.memoizedState:wt.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?ug:_d),e}function Uo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return si(e);if(e.$$typeof===q)return Zt(e)}throw Error(s(438,String(e)))}function md(e){var n=null,r=Ee.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var i=Ee.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(c){return c.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=Do(),Ee.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),i=0;i<e;i++)r[i]=be;return n.index++,r}function fa(e,n){return typeof n=="function"?n(e):n}function Lo(e){var n=St();return pd(n,Je,e)}function pd(e,n,r){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=r;var c=e.baseQueue,f=i.pending;if(f!==null){if(c!==null){var v=c.next;c.next=f.next,f.next=v}n.baseQueue=c=f,i.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{n=c.next;var S=v=null,A=null,L=n,G=!1;do{var P=L.lane&-536870913;if(P!==L.lane?(Le&P)===P:(da&P)===P){var Z=L.revertLane;if(Z===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),P===Zl&&(G=!0);else if((da&Z)===Z){L=L.next,Z===Zl&&(G=!0);continue}else P={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(S=A=P,v=f):A=A.next=P,Ee.lanes|=Z,Wa|=Z;P=L.action,Yr&&r(f,P),f=L.hasEagerState?L.eagerState:r(f,P)}else Z={lane:P,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(S=A=Z,v=f):A=A.next=Z,Ee.lanes|=P,Wa|=P;L=L.next}while(L!==null&&L!==n);if(A===null?v=f:A.next=S,!dn(f,e.memoizedState)&&(_t=!0,G&&(r=ql,r!==null)))throw r;e.memoizedState=f,e.baseState=v,e.baseQueue=A,i.lastRenderedState=f}return c===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function gd(e){var n=St(),r=n.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var i=r.dispatch,c=r.pending,f=n.memoizedState;if(c!==null){r.pending=null;var v=c=c.next;do f=e(f,v.action),v=v.next;while(v!==c);dn(f,n.memoizedState)||(_t=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),r.lastRenderedState=f}return[f,i]}function Tp(e,n,r){var i=Ee,c=St(),f=qe;if(f){if(r===void 0)throw Error(s(407));r=r()}else r=n();var v=!dn((Je||c).memoizedState,r);if(v&&(c.memoizedState=r,_t=!0),c=c.queue,bd(Rp.bind(null,i,c,e),[e]),c.getSnapshot!==n||v||wt!==null&&wt.memoizedState.tag&1){if(i.flags|=2048,Il(9,{destroy:void 0},Op.bind(null,i,c,r,n),null),nt===null)throw Error(s(349));f||(da&127)!==0||zp(i,n,r)}return r}function zp(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=Ee.updateQueue,n===null?(n=Do(),Ee.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function Op(e,n,r,i){n.value=r,n.getSnapshot=i,Mp(n)&&kp(e)}function Rp(e,n,r){return r(function(){Mp(n)&&kp(e)})}function Mp(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!dn(e,r)}catch{return!0}}function kp(e){var n=Zr(e,2);n!==null&&ln(n,e,2)}function vd(e){var n=Yt();if(typeof e=="function"){var r=e;if(e=r(),Yr){Zn(!0);try{r()}finally{Zn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:e},n}function Dp(e,n,r,i){return e.baseState=r,pd(e,Je,typeof i=="function"?i:fa)}function Z1(e,n,r,i,c){if(Bo(e))throw Error(s(485));if(e=n.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){f.listeners.push(v)}};$.T!==null?r(!0):f.isTransition=!1,i(f),r=n.pending,r===null?(f.next=n.pending=f,Up(n,f)):(f.next=r.next,n.pending=r.next=f)}}function Up(e,n){var r=n.action,i=n.payload,c=e.state;if(n.isTransition){var f=$.T,v={};$.T=v;try{var S=r(c,i),A=$.S;A!==null&&A(v,S),Lp(e,n,S)}catch(L){yd(e,n,L)}finally{f!==null&&v.types!==null&&(f.types=v.types),$.T=f}}else try{f=r(c,i),Lp(e,n,f)}catch(L){yd(e,n,L)}}function Lp(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){Zp(e,n,i)},function(i){return yd(e,n,i)}):Zp(e,n,r)}function Zp(e,n,r){n.status="fulfilled",n.value=r,qp(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Up(e,r)))}function yd(e,n,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=r,qp(n),n=n.next;while(n!==i)}e.action=null}function qp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Bp(e,n){return n}function $p(e,n){if(qe){var r=nt.formState;if(r!==null){e:{var i=Ee;if(qe){if(rt){t:{for(var c=rt,f=En;c.nodeType!==8;){if(!f){c=null;break t}if(c=An(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){rt=An(c.nextSibling),i=c.data==="F!";break e}}Ga(i)}i=!1}i&&(n=r[0])}}return r=Yt(),r.memoizedState=r.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bp,lastRenderedState:n},r.queue=i,r=sg.bind(null,Ee,i),i.dispatch=r,i=vd(!1),f=wd.bind(null,Ee,!1,i.queue),i=Yt(),c={state:n,dispatch:null,action:e,pending:null},i.queue=c,r=Z1.bind(null,Ee,c,f,r),c.dispatch=r,i.memoizedState=e,[n,r,!1]}function Hp(e){var n=St();return Qp(n,Je,e)}function Qp(e,n,r){if(n=pd(e,n,Bp)[0],e=Lo(fa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=si(n)}catch(v){throw v===Bl?Co:v}else i=n;n=St();var c=n.queue,f=c.dispatch;return r!==n.memoizedState&&(Ee.flags|=2048,Il(9,{destroy:void 0},q1.bind(null,c,r),null)),[i,f,e]}function q1(e,n){e.action=n}function Gp(e){var n=St(),r=Je;if(r!==null)return Qp(n,r,e);St(),n=n.memoizedState,r=St();var i=r.queue.dispatch;return r.memoizedState=e,[n,i,!1]}function Il(e,n,r,i){return e={tag:e,create:r,deps:i,inst:n,next:null},n=Ee.updateQueue,n===null&&(n=Do(),Ee.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,n.lastEffect=e),e}function Ip(){return St().memoizedState}function Zo(e,n,r,i){var c=Yt();Ee.flags|=e,c.memoizedState=Il(1|n,{destroy:void 0},r,i===void 0?null:i)}function qo(e,n,r,i){var c=St();i=i===void 0?null:i;var f=c.memoizedState.inst;Je!==null&&i!==null&&ud(i,Je.memoizedState.deps)?c.memoizedState=Il(n,f,r,i):(Ee.flags|=e,c.memoizedState=Il(1|n,f,r,i))}function Vp(e,n){Zo(8390656,8,e,n)}function bd(e,n){qo(2048,8,e,n)}function B1(e){Ee.flags|=4;var n=Ee.updateQueue;if(n===null)n=Do(),Ee.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Yp(e){var n=St().memoizedState;return B1({ref:n,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function Kp(e,n){return qo(4,2,e,n)}function Pp(e,n){return qo(4,4,e,n)}function Fp(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Xp(e,n,r){r=r!=null?r.concat([e]):null,qo(4,4,Fp.bind(null,n,e),r)}function xd(){}function Jp(e,n){var r=St();n=n===void 0?null:n;var i=r.memoizedState;return n!==null&&ud(n,i[1])?i[0]:(r.memoizedState=[e,n],e)}function Wp(e,n){var r=St();n=n===void 0?null:n;var i=r.memoizedState;if(n!==null&&ud(n,i[1]))return i[0];if(i=e(),Yr){Zn(!0);try{e()}finally{Zn(!1)}}return r.memoizedState=[i,n],i}function Sd(e,n,r){return r===void 0||(da&1073741824)!==0&&(Le&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=ev(),Ee.lanes|=e,Wa|=e,r)}function eg(e,n,r,i){return dn(r,n)?r:Hl.current!==null?(e=Sd(e,r,i),dn(e,n)||(_t=!0),e):(da&42)===0||(da&1073741824)!==0&&(Le&261930)===0?(_t=!0,e.memoizedState=r):(e=ev(),Ee.lanes|=e,Wa|=e,n)}function tg(e,n,r,i,c){var f=D.p;D.p=f!==0&&8>f?f:8;var v=$.T,S={};$.T=S,wd(e,!1,n,r);try{var A=c(),L=$.S;if(L!==null&&L(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var G=D1(A,i);ii(e,n,G,vn(e))}else ii(e,n,i,vn(e))}catch(P){ii(e,n,{then:function(){},status:"rejected",reason:P},vn())}finally{D.p=f,v!==null&&S.types!==null&&(v.types=S.types),$.T=v}}function $1(){}function jd(e,n,r,i){if(e.tag!==5)throw Error(s(476));var c=ng(e).queue;tg(e,c,n,ae,r===null?$1:function(){return ag(e),r(i)})}function ng(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:ae},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function ag(e){var n=ng(e);n.next===null&&(n=e.alternate.memoizedState),ii(e,n.next.queue,{},vn())}function Nd(){return Zt(wi)}function rg(){return St().memoizedState}function lg(){return St().memoizedState}function H1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=vn();e=Ya(r);var i=Ka(n,e,r);i!==null&&(ln(i,n,r),ni(i,n,r)),n={cache:Jc()},e.payload=n;return}n=n.return}}function Q1(e,n,r){var i=vn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bo(e)?ig(n,r):(r=$c(e,n,r,i),r!==null&&(ln(r,e,i),og(r,n,i)))}function sg(e,n,r){var i=vn();ii(e,n,r,i)}function ii(e,n,r,i){var c={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Bo(e))ig(n,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var v=n.lastRenderedState,S=f(v,r);if(c.hasEagerState=!0,c.eagerState=S,dn(S,v))return xo(e,n,c,0),nt===null&&bo(),!1}catch{}finally{}if(r=$c(e,n,c,i),r!==null)return ln(r,e,i),og(r,n,i),!0}return!1}function wd(e,n,r,i){if(i={lane:2,revertLane:nf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bo(e)){if(n)throw Error(s(479))}else n=$c(e,r,i,2),n!==null&&ln(n,e,2)}function Bo(e){var n=e.alternate;return e===Ee||n!==null&&n===Ee}function ig(e,n){Ql=Mo=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function og(e,n,r){if((r&4194048)!==0){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,hm(e,r)}}var oi={readContext:Zt,use:Uo,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};oi.useEffectEvent=vt;var ug={readContext:Zt,use:Uo,useCallback:function(e,n){return Yt().memoizedState=[e,n===void 0?null:n],e},useContext:Zt,useEffect:Vp,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Zo(4194308,4,Fp.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Zo(4194308,4,e,n)},useInsertionEffect:function(e,n){Zo(4,2,e,n)},useMemo:function(e,n){var r=Yt();n=n===void 0?null:n;var i=e();if(Yr){Zn(!0);try{e()}finally{Zn(!1)}}return r.memoizedState=[i,n],i},useReducer:function(e,n,r){var i=Yt();if(r!==void 0){var c=r(n);if(Yr){Zn(!0);try{r(n)}finally{Zn(!1)}}}else c=n;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=Q1.bind(null,Ee,e),[i.memoizedState,e]},useRef:function(e){var n=Yt();return e={current:e},n.memoizedState=e},useState:function(e){e=vd(e);var n=e.queue,r=sg.bind(null,Ee,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:xd,useDeferredValue:function(e,n){var r=Yt();return Sd(r,e,n)},useTransition:function(){var e=vd(!1);return e=tg.bind(null,Ee,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var i=Ee,c=Yt();if(qe){if(r===void 0)throw Error(s(407));r=r()}else{if(r=n(),nt===null)throw Error(s(349));(Le&127)!==0||zp(i,n,r)}c.memoizedState=r;var f={value:r,getSnapshot:n};return c.queue=f,Vp(Rp.bind(null,i,f,e),[e]),i.flags|=2048,Il(9,{destroy:void 0},Op.bind(null,i,f,r,n),null),r},useId:function(){var e=Yt(),n=nt.identifierPrefix;if(qe){var r=Vn,i=In;r=(i&~(1<<32-Qt(i)-1)).toString(32)+r,n="_"+n+"R_"+r,r=ko++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=U1++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Nd,useFormState:$p,useActionState:$p,useOptimistic:function(e){var n=Yt();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=wd.bind(null,Ee,!0,r),r.dispatch=n,[e,n]},useMemoCache:md,useCacheRefresh:function(){return Yt().memoizedState=H1.bind(null,Ee)},useEffectEvent:function(e){var n=Yt(),r={impl:e};return n.memoizedState=r,function(){if((Ie&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},_d={readContext:Zt,use:Uo,useCallback:Jp,useContext:Zt,useEffect:bd,useImperativeHandle:Xp,useInsertionEffect:Kp,useLayoutEffect:Pp,useMemo:Wp,useReducer:Lo,useRef:Ip,useState:function(){return Lo(fa)},useDebugValue:xd,useDeferredValue:function(e,n){var r=St();return eg(r,Je.memoizedState,e,n)},useTransition:function(){var e=Lo(fa)[0],n=St().memoizedState;return[typeof e=="boolean"?e:si(e),n]},useSyncExternalStore:Tp,useId:rg,useHostTransitionStatus:Nd,useFormState:Hp,useActionState:Hp,useOptimistic:function(e,n){var r=St();return Dp(r,Je,e,n)},useMemoCache:md,useCacheRefresh:lg};_d.useEffectEvent=Yp;var cg={readContext:Zt,use:Uo,useCallback:Jp,useContext:Zt,useEffect:bd,useImperativeHandle:Xp,useInsertionEffect:Kp,useLayoutEffect:Pp,useMemo:Wp,useReducer:gd,useRef:Ip,useState:function(){return gd(fa)},useDebugValue:xd,useDeferredValue:function(e,n){var r=St();return Je===null?Sd(r,e,n):eg(r,Je.memoizedState,e,n)},useTransition:function(){var e=gd(fa)[0],n=St().memoizedState;return[typeof e=="boolean"?e:si(e),n]},useSyncExternalStore:Tp,useId:rg,useHostTransitionStatus:Nd,useFormState:Gp,useActionState:Gp,useOptimistic:function(e,n){var r=St();return Je!==null?Dp(r,Je,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:md,useCacheRefresh:lg};cg.useEffectEvent=Yp;function Ed(e,n,r,i){n=e.memoizedState,r=r(i,n),r=r==null?n:b({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Cd={enqueueSetState:function(e,n,r){e=e._reactInternals;var i=vn(),c=Ya(i);c.payload=n,r!=null&&(c.callback=r),n=Ka(e,c,i),n!==null&&(ln(n,e,i),ni(n,e,i))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var i=vn(),c=Ya(i);c.tag=1,c.payload=n,r!=null&&(c.callback=r),n=Ka(e,c,i),n!==null&&(ln(n,e,i),ni(n,e,i))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=vn(),i=Ya(r);i.tag=2,n!=null&&(i.callback=n),n=Ka(e,i,r),n!==null&&(ln(n,e,r),ni(n,e,r))}};function dg(e,n,r,i,c,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,v):n.prototype&&n.prototype.isPureReactComponent?!Ks(r,i)||!Ks(c,f):!0}function fg(e,n,r,i){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,i),n.state!==e&&Cd.enqueueReplaceState(n,n.state,null)}function Kr(e,n){var r=n;if("ref"in n){r={};for(var i in n)i!=="ref"&&(r[i]=n[i])}if(e=e.defaultProps){r===n&&(r=b({},r));for(var c in e)r[c]===void 0&&(r[c]=e[c])}return r}function hg(e){yo(e)}function mg(e){console.error(e)}function pg(e){yo(e)}function $o(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function gg(e,n,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ad(e,n,r){return r=Ya(r),r.tag=3,r.payload={element:null},r.callback=function(){$o(e,n)},r}function vg(e){return e=Ya(e),e.tag=3,e}function yg(e,n,r,i){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var f=i.value;e.payload=function(){return c(f)},e.callback=function(){gg(n,r,i)}}var v=r.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){gg(n,r,i),typeof c!="function"&&(er===null?er=new Set([this]):er.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function G1(e,n,r,i,c){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=r.alternate,n!==null&&Ll(n,r,c,!0),r=hn.current,r!==null){switch(r.tag){case 31:case 13:return Cn===null?Wo():r.alternate===null&&yt===0&&(yt=3),r.flags&=-257,r.flags|=65536,r.lanes=c,i===Ao?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([i]):n.add(i),Wd(e,i,c)),!1;case 22:return r.flags|=65536,i===Ao?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([i]):r.add(i)),Wd(e,i,c)),!1}throw Error(s(435,r.tag))}return Wd(e,i,c),Wo(),!1}if(qe)return n=hn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,i!==Yc&&(e=Error(s(422),{cause:i}),Xs(Nn(e,r)))):(i!==Yc&&(n=Error(s(423),{cause:i}),Xs(Nn(n,r))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,i=Nn(i,r),c=Ad(e.stateNode,i,c),rd(e,c),yt!==4&&(yt=2)),!1;var f=Error(s(520),{cause:i});if(f=Nn(f,r),gi===null?gi=[f]:gi.push(f),yt!==4&&(yt=2),n===null)return!0;i=Nn(i,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=c&-c,r.lanes|=e,e=Ad(r.stateNode,i,e),rd(r,e),!1;case 1:if(n=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(er===null||!er.has(f))))return r.flags|=65536,c&=-c,r.lanes|=c,c=vg(c),yg(c,e,r,i),rd(r,c),!1}r=r.return}while(r!==null);return!1}var Td=Error(s(461)),_t=!1;function qt(e,n,r,i){n.child=e===null?jp(n,null,r,i):Vr(n,e.child,r,i)}function bg(e,n,r,i,c){r=r.render;var f=n.ref;if("ref"in i){var v={};for(var S in i)S!=="ref"&&(v[S]=i[S])}else v=i;return Hr(n),i=cd(e,n,r,v,f,c),S=dd(),e!==null&&!_t?(fd(e,n,c),ha(e,n,c)):(qe&&S&&Ic(n),n.flags|=1,qt(e,n,i,c),n.child)}function xg(e,n,r,i,c){if(e===null){var f=r.type;return typeof f=="function"&&!Hc(f)&&f.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=f,Sg(e,n,f,i,c)):(e=jo(r.type,null,i,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,!Ld(e,c)){var v=f.memoizedProps;if(r=r.compare,r=r!==null?r:Ks,r(v,i)&&e.ref===n.ref)return ha(e,n,c)}return n.flags|=1,e=ia(f,i),e.ref=n.ref,e.return=n,n.child=e}function Sg(e,n,r,i,c){if(e!==null){var f=e.memoizedProps;if(Ks(f,i)&&e.ref===n.ref)if(_t=!1,n.pendingProps=i=f,Ld(e,c))(e.flags&131072)!==0&&(_t=!0);else return n.lanes=e.lanes,ha(e,n,c)}return zd(e,n,r,i,c)}function jg(e,n,r,i){var c=i.children,f=e!==null?e.memoizedState:null;if(e===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|r:r,e!==null){for(i=n.child=e.child,c=0;i!==null;)c=c|i.lanes|i.childLanes,i=i.sibling;i=c&~f}else i=0,n.child=null;return Ng(e,n,f,r,i)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Eo(n,f!==null?f.cachePool:null),f!==null?_p(n,f):sd(),Ep(n);else return i=n.lanes=536870912,Ng(e,n,f!==null?f.baseLanes|r:r,r,i)}else f!==null?(Eo(n,f.cachePool),_p(n,f),Fa(),n.memoizedState=null):(e!==null&&Eo(n,null),sd(),Fa());return qt(e,n,c,r),n.child}function ui(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Ng(e,n,r,i,c){var f=ed();return f=f===null?null:{parent:Nt._currentValue,pool:f},n.memoizedState={baseLanes:r,cachePool:f},e!==null&&Eo(n,null),sd(),Ep(n),e!==null&&Ll(e,n,i,!0),n.childLanes=c,null}function Ho(e,n){return n=Go({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function wg(e,n,r){return Vr(n,e.child,null,r),e=Ho(n,n.pendingProps),e.flags|=2,mn(n),n.memoizedState=null,e}function I1(e,n,r){var i=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(qe){if(i.mode==="hidden")return e=Ho(n,i),n.lanes=536870912,ui(null,e);if(od(n),(e=rt)?(e=Uv(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ha!==null?{id:In,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},r=ip(e),r.return=n,n.child=r,Lt=n,rt=null)):e=null,e===null)throw Ga(n);return n.lanes=536870912,null}return Ho(n,i)}var f=e.memoizedState;if(f!==null){var v=f.dehydrated;if(od(n),c)if(n.flags&256)n.flags&=-257,n=wg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(_t||Ll(e,n,r,!1),c=(r&e.childLanes)!==0,_t||c){if(i=nt,i!==null&&(v=mm(i,r),v!==0&&v!==f.retryLane))throw f.retryLane=v,Zr(e,v),ln(i,e,v),Td;Wo(),n=wg(e,n,r)}else e=f.treeContext,rt=An(v.nextSibling),Lt=n,qe=!0,Qa=null,En=!1,e!==null&&cp(n,e),n=Ho(n,i),n.flags|=4096;return n}return e=ia(e.child,{mode:i.mode,children:i.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Qo(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function zd(e,n,r,i,c){return Hr(n),r=cd(e,n,r,i,void 0,c),i=dd(),e!==null&&!_t?(fd(e,n,c),ha(e,n,c)):(qe&&i&&Ic(n),n.flags|=1,qt(e,n,r,c),n.child)}function _g(e,n,r,i,c,f){return Hr(n),n.updateQueue=null,r=Ap(n,i,r,c),Cp(e),i=dd(),e!==null&&!_t?(fd(e,n,f),ha(e,n,f)):(qe&&i&&Ic(n),n.flags|=1,qt(e,n,r,f),n.child)}function Eg(e,n,r,i,c){if(Hr(n),n.stateNode===null){var f=Ml,v=r.contextType;typeof v=="object"&&v!==null&&(f=Zt(v)),f=new r(i,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Cd,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=i,f.state=n.memoizedState,f.refs={},nd(n),v=r.contextType,f.context=typeof v=="object"&&v!==null?Zt(v):Ml,f.state=n.memoizedState,v=r.getDerivedStateFromProps,typeof v=="function"&&(Ed(n,r,v,i),f.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&Cd.enqueueReplaceState(f,f.state,null),ri(n,i,f,c),ai(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(e===null){f=n.stateNode;var S=n.memoizedProps,A=Kr(r,S);f.props=A;var L=f.context,G=r.contextType;v=Ml,typeof G=="object"&&G!==null&&(v=Zt(G));var P=r.getDerivedStateFromProps;G=typeof P=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,G||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||L!==v)&&fg(n,f,i,v),Va=!1;var Z=n.memoizedState;f.state=Z,ri(n,i,f,c),ai(),L=n.memoizedState,S||Z!==L||Va?(typeof P=="function"&&(Ed(n,r,P,i),L=n.memoizedState),(A=Va||dg(n,r,A,i,Z,L,v))?(G||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=L),f.props=i,f.state=L,f.context=v,i=A):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{f=n.stateNode,ad(e,n),v=n.memoizedProps,G=Kr(r,v),f.props=G,P=n.pendingProps,Z=f.context,L=r.contextType,A=Ml,typeof L=="object"&&L!==null&&(A=Zt(L)),S=r.getDerivedStateFromProps,(L=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==P||Z!==A)&&fg(n,f,i,A),Va=!1,Z=n.memoizedState,f.state=Z,ri(n,i,f,c),ai();var H=n.memoizedState;v!==P||Z!==H||Va||e!==null&&e.dependencies!==null&&wo(e.dependencies)?(typeof S=="function"&&(Ed(n,r,S,i),H=n.memoizedState),(G=Va||dg(n,r,G,i,Z,H,A)||e!==null&&e.dependencies!==null&&wo(e.dependencies))?(L||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,H,A),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,H,A)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=H),f.props=i,f.state=H,f.context=A,i=G):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&Z===e.memoizedState||(n.flags|=1024),i=!1)}return f=i,Qo(e,n),i=(n.flags&128)!==0,f||i?(f=n.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,e!==null&&i?(n.child=Vr(n,e.child,null,c),n.child=Vr(n,null,r,c)):qt(e,n,r,c),n.memoizedState=f.state,e=n.child):e=ha(e,n,c),e}function Cg(e,n,r,i){return Br(),n.flags|=256,qt(e,n,r,i),n.child}var Od={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rd(e){return{baseLanes:e,cachePool:gp()}}function Md(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=gn),e}function Ag(e,n,r){var i=n.pendingProps,c=!1,f=(n.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),v&&(c=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,e===null){if(qe){if(c?Pa(n):Fa(),(e=rt)?(e=Uv(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ha!==null?{id:In,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},r=ip(e),r.return=n,n.child=r,Lt=n,rt=null)):e=null,e===null)throw Ga(n);return gf(e)?n.lanes=32:n.lanes=536870912,null}var S=i.children;return i=i.fallback,c?(Fa(),c=n.mode,S=Go({mode:"hidden",children:S},c),i=qr(i,c,r,null),S.return=n,i.return=n,S.sibling=i,n.child=S,i=n.child,i.memoizedState=Rd(r),i.childLanes=Md(e,v,r),n.memoizedState=Od,ui(null,i)):(Pa(n),kd(n,S))}var A=e.memoizedState;if(A!==null&&(S=A.dehydrated,S!==null)){if(f)n.flags&256?(Pa(n),n.flags&=-257,n=Dd(e,n,r)):n.memoizedState!==null?(Fa(),n.child=e.child,n.flags|=128,n=null):(Fa(),S=i.fallback,c=n.mode,i=Go({mode:"visible",children:i.children},c),S=qr(S,c,r,null),S.flags|=2,i.return=n,S.return=n,i.sibling=S,n.child=i,Vr(n,e.child,null,r),i=n.child,i.memoizedState=Rd(r),i.childLanes=Md(e,v,r),n.memoizedState=Od,n=ui(null,i));else if(Pa(n),gf(S)){if(v=S.nextSibling&&S.nextSibling.dataset,v)var L=v.dgst;v=L,i=Error(s(419)),i.stack="",i.digest=v,Xs({value:i,source:null,stack:null}),n=Dd(e,n,r)}else if(_t||Ll(e,n,r,!1),v=(r&e.childLanes)!==0,_t||v){if(v=nt,v!==null&&(i=mm(v,r),i!==0&&i!==A.retryLane))throw A.retryLane=i,Zr(e,i),ln(v,e,i),Td;pf(S)||Wo(),n=Dd(e,n,r)}else pf(S)?(n.flags|=192,n.child=e.child,n=null):(e=A.treeContext,rt=An(S.nextSibling),Lt=n,qe=!0,Qa=null,En=!1,e!==null&&cp(n,e),n=kd(n,i.children),n.flags|=4096);return n}return c?(Fa(),S=i.fallback,c=n.mode,A=e.child,L=A.sibling,i=ia(A,{mode:"hidden",children:i.children}),i.subtreeFlags=A.subtreeFlags&65011712,L!==null?S=ia(L,S):(S=qr(S,c,r,null),S.flags|=2),S.return=n,i.return=n,i.sibling=S,n.child=i,ui(null,i),i=n.child,S=e.child.memoizedState,S===null?S=Rd(r):(c=S.cachePool,c!==null?(A=Nt._currentValue,c=c.parent!==A?{parent:A,pool:A}:c):c=gp(),S={baseLanes:S.baseLanes|r,cachePool:c}),i.memoizedState=S,i.childLanes=Md(e,v,r),n.memoizedState=Od,ui(e.child,i)):(Pa(n),r=e.child,e=r.sibling,r=ia(r,{mode:"visible",children:i.children}),r.return=n,r.sibling=null,e!==null&&(v=n.deletions,v===null?(n.deletions=[e],n.flags|=16):v.push(e)),n.child=r,n.memoizedState=null,r)}function kd(e,n){return n=Go({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Go(e,n){return e=fn(22,e,null,n),e.lanes=0,e}function Dd(e,n,r){return Vr(n,e.child,null,r),e=kd(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Tg(e,n,r){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),Fc(e.return,n,r)}function Ud(e,n,r,i,c,f){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:c,treeForkCount:f}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=i,v.tail=r,v.tailMode=c,v.treeForkCount=f)}function zg(e,n,r){var i=n.pendingProps,c=i.revealOrder,f=i.tail;i=i.children;var v=xt.current,S=(v&2)!==0;if(S?(v=v&1|2,n.flags|=128):v&=1,te(xt,v),qt(e,n,i,r),i=qe?Fs:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tg(e,r,n);else if(e.tag===19)Tg(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(r=n.child,c=null;r!==null;)e=r.alternate,e!==null&&Ro(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=n.child,n.child=null):(c=r.sibling,r.sibling=null),Ud(n,!1,c,r,f,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&Ro(e)===null){n.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}Ud(n,!0,r,null,f,i);break;case"together":Ud(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function ha(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),Wa|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Ll(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,r=ia(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=ia(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function Ld(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&wo(e)))}function V1(e,n,r){switch(n.tag){case 3:pt(n,n.stateNode.containerInfo),Ia(n,Nt,e.memoizedState.cache),Br();break;case 27:case 5:gt(n);break;case 4:pt(n,n.stateNode.containerInfo);break;case 10:Ia(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,od(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(Pa(n),n.flags|=128,null):(r&n.child.childLanes)!==0?Ag(e,n,r):(Pa(n),e=ha(e,n,r),e!==null?e.sibling:null);Pa(n);break;case 19:var c=(e.flags&128)!==0;if(i=(r&n.childLanes)!==0,i||(Ll(e,n,r,!1),i=(r&n.childLanes)!==0),c){if(i)return zg(e,n,r);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),te(xt,xt.current),i)break;return null;case 22:return n.lanes=0,jg(e,n,r,n.pendingProps);case 24:Ia(n,Nt,e.memoizedState.cache)}return ha(e,n,r)}function Og(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)_t=!0;else{if(!Ld(e,r)&&(n.flags&128)===0)return _t=!1,V1(e,n,r);_t=(e.flags&131072)!==0}else _t=!1,qe&&(n.flags&1048576)!==0&&up(n,Fs,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(e=Gr(n.elementType),n.type=e,typeof e=="function")Hc(e)?(i=Kr(e,i),n.tag=1,n=Eg(null,n,e,i,r)):(n.tag=0,n=zd(null,n,e,i,r));else{if(e!=null){var c=e.$$typeof;if(c===B){n.tag=11,n=bg(null,n,e,i,r);break e}else if(c===K){n.tag=14,n=xg(null,n,e,i,r);break e}}throw n=Ge(e)||e,Error(s(306,n,""))}}return n;case 0:return zd(e,n,n.type,n.pendingProps,r);case 1:return i=n.type,c=Kr(i,n.pendingProps),Eg(e,n,i,c,r);case 3:e:{if(pt(n,n.stateNode.containerInfo),e===null)throw Error(s(387));i=n.pendingProps;var f=n.memoizedState;c=f.element,ad(e,n),ri(n,i,null,r);var v=n.memoizedState;if(i=v.cache,Ia(n,Nt,i),i!==f.cache&&Xc(n,[Nt],r,!0),ai(),i=v.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=Cg(e,n,i,r);break e}else if(i!==c){c=Nn(Error(s(424)),n),Xs(c),n=Cg(e,n,i,r);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(rt=An(e.firstChild),Lt=n,qe=!0,Qa=null,En=!0,r=jp(n,null,i,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Br(),i===c){n=ha(e,n,r);break e}qt(e,n,i,r)}n=n.child}return n;case 26:return Qo(e,n),e===null?(r=Hv(n.type,null,n.pendingProps,null))?n.memoizedState=r:qe||(r=n.type,e=n.pendingProps,i=su(me.current).createElement(r),i[Ut]=n,i[Wt]=e,Bt(i,r,e),Rt(i),n.stateNode=i):n.memoizedState=Hv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return gt(n),e===null&&qe&&(i=n.stateNode=qv(n.type,n.pendingProps,me.current),Lt=n,En=!0,c=rt,rr(n.type)?(vf=c,rt=An(i.firstChild)):rt=c),qt(e,n,n.pendingProps.children,r),Qo(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&qe&&((c=i=rt)&&(i=jj(i,n.type,n.pendingProps,En),i!==null?(n.stateNode=i,Lt=n,rt=An(i.firstChild),En=!1,c=!0):c=!1),c||Ga(n)),gt(n),c=n.type,f=n.pendingProps,v=e!==null?e.memoizedProps:null,i=f.children,ff(c,f)?i=null:v!==null&&ff(c,v)&&(n.flags|=32),n.memoizedState!==null&&(c=cd(e,n,L1,null,null,r),wi._currentValue=c),Qo(e,n),qt(e,n,i,r),n.child;case 6:return e===null&&qe&&((e=r=rt)&&(r=Nj(r,n.pendingProps,En),r!==null?(n.stateNode=r,Lt=n,rt=null,e=!0):e=!1),e||Ga(n)),null;case 13:return Ag(e,n,r);case 4:return pt(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=Vr(n,null,i,r):qt(e,n,i,r),n.child;case 11:return bg(e,n,n.type,n.pendingProps,r);case 7:return qt(e,n,n.pendingProps,r),n.child;case 8:return qt(e,n,n.pendingProps.children,r),n.child;case 12:return qt(e,n,n.pendingProps.children,r),n.child;case 10:return i=n.pendingProps,Ia(n,n.type,i.value),qt(e,n,i.children,r),n.child;case 9:return c=n.type._context,i=n.pendingProps.children,Hr(n),c=Zt(c),i=i(c),n.flags|=1,qt(e,n,i,r),n.child;case 14:return xg(e,n,n.type,n.pendingProps,r);case 15:return Sg(e,n,n.type,n.pendingProps,r);case 19:return zg(e,n,r);case 31:return I1(e,n,r);case 22:return jg(e,n,r,n.pendingProps);case 24:return Hr(n),i=Zt(Nt),e===null?(c=ed(),c===null&&(c=nt,f=Jc(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=r),c=f),n.memoizedState={parent:i,cache:c},nd(n),Ia(n,Nt,c)):((e.lanes&r)!==0&&(ad(e,n),ri(n,null,null,r),ai()),c=e.memoizedState,f=n.memoizedState,c.parent!==i?(c={parent:i,cache:i},n.memoizedState=c,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=c),Ia(n,Nt,i)):(i=f.cache,Ia(n,Nt,i),i!==c.cache&&Xc(n,[Nt],r,!0))),qt(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function ma(e){e.flags|=4}function Zd(e,n,r,i,c){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(rv())e.flags|=8192;else throw Ir=Ao,td}else e.flags&=-16777217}function Rg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Yv(n))if(rv())e.flags|=8192;else throw Ir=Ao,td}function Io(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?dm():536870912,e.lanes|=n,Pl|=n)}function ci(e,n){if(!qe)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function lt(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(n)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags&65011712,i|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=r,n}function Y1(e,n,r){var i=n.pendingProps;switch(Vc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(n),null;case 1:return lt(n),null;case 3:return r=n.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),ca(Nt),fe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ul(n)?ma(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kc())),lt(n),null;case 26:var c=n.type,f=n.memoizedState;return e===null?(ma(n),f!==null?(lt(n),Rg(n,f)):(lt(n),Zd(n,c,null,i,r))):f?f!==e.memoizedState?(ma(n),lt(n),Rg(n,f)):(lt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==i&&ma(n),lt(n),Zd(n,c,e,i,r)),null;case 27:if(Dt(n),r=me.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&ma(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return lt(n),null}e=le.current,Ul(n)?dp(n):(e=qv(c,i,r),n.stateNode=e,ma(n))}return lt(n),null;case 5:if(Dt(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&ma(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return lt(n),null}if(f=le.current,Ul(n))dp(n);else{var v=su(me.current);switch(f){case 1:f=v.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=v.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=v.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?v.createElement("select",{is:i.is}):v.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?v.createElement(c,{is:i.is}):v.createElement(c)}}f[Ut]=n,f[Wt]=i;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)f.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=f;e:switch(Bt(f,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ma(n)}}return lt(n),Zd(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==i&&ma(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(s(166));if(e=me.current,Ul(n)){if(e=n.stateNode,r=n.memoizedProps,i=null,c=Lt,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[Ut]=n,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Av(e.nodeValue,r)),e||Ga(n,!0)}else e=su(e).createTextNode(i),e[Ut]=n,n.stateNode=e}return lt(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(i=Ul(n),r!==null){if(e===null){if(!i)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Ut]=n}else Br(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;lt(n),e=!1}else r=Kc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(mn(n),n):(mn(n),null);if((n.flags&128)!==0)throw Error(s(558))}return lt(n),null;case 13:if(i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ul(n),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(s(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(317));c[Ut]=n}else Br(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;lt(n),c=!1}else c=Kc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(mn(n),n):(mn(n),null)}return mn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=n.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==c&&(i.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Io(n,n.updateQueue),lt(n),null);case 4:return fe(),e===null&&sf(n.stateNode.containerInfo),lt(n),null;case 10:return ca(n.type),lt(n),null;case 19:if(Y(xt),i=n.memoizedState,i===null)return lt(n),null;if(c=(n.flags&128)!==0,f=i.rendering,f===null)if(c)ci(i,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=Ro(e),f!==null){for(n.flags|=128,ci(i,!1),e=f.updateQueue,n.updateQueue=e,Io(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)sp(r,e),r=r.sibling;return te(xt,xt.current&1|2),qe&&oa(n,i.treeForkCount),n.child}e=e.sibling}i.tail!==null&&Vt()>Fo&&(n.flags|=128,c=!0,ci(i,!1),n.lanes=4194304)}else{if(!c)if(e=Ro(f),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,Io(n,e),ci(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!qe)return lt(n),null}else 2*Vt()-i.renderingStartTime>Fo&&r!==536870912&&(n.flags|=128,c=!0,ci(i,!1),n.lanes=4194304);i.isBackwards?(f.sibling=n.child,n.child=f):(e=i.last,e!==null?e.sibling=f:n.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Vt(),e.sibling=null,r=xt.current,te(xt,c?r&1|2:r&1),qe&&oa(n,i.treeForkCount),e):(lt(n),null);case 22:case 23:return mn(n),id(),i=n.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(r&536870912)!==0&&(n.flags&128)===0&&(lt(n),n.subtreeFlags&6&&(n.flags|=8192)):lt(n),r=n.updateQueue,r!==null&&Io(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==r&&(n.flags|=2048),e!==null&&Y(Qr),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ca(Nt),lt(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function K1(e,n){switch(Vc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ca(Nt),fe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Dt(n),null;case 31:if(n.memoizedState!==null){if(mn(n),n.alternate===null)throw Error(s(340));Br()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(mn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Br()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Y(xt),null;case 4:return fe(),null;case 10:return ca(n.type),null;case 22:case 23:return mn(n),id(),e!==null&&Y(Qr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return ca(Nt),null;case 25:return null;default:return null}}function Mg(e,n){switch(Vc(n),n.tag){case 3:ca(Nt),fe();break;case 26:case 27:case 5:Dt(n);break;case 4:fe();break;case 31:n.memoizedState!==null&&mn(n);break;case 13:mn(n);break;case 19:Y(xt);break;case 10:ca(n.type);break;case 22:case 23:mn(n),id(),e!==null&&Y(Qr);break;case 24:ca(Nt)}}function di(e,n){try{var r=n.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var c=i.next;r=c;do{if((r.tag&e)===e){i=void 0;var f=r.create,v=r.inst;i=f(),v.destroy=i}r=r.next}while(r!==c)}}catch(S){Fe(n,n.return,S)}}function Xa(e,n,r){try{var i=n.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var f=c.next;i=f;do{if((i.tag&e)===e){var v=i.inst,S=v.destroy;if(S!==void 0){v.destroy=void 0,c=n;var A=r,L=S;try{L()}catch(G){Fe(c,A,G)}}}i=i.next}while(i!==f)}}catch(G){Fe(n,n.return,G)}}function kg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{wp(n,r)}catch(i){Fe(e,e.return,i)}}}function Dg(e,n,r){r.props=Kr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){Fe(e,n,i)}}function fi(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(c){Fe(e,n,c)}}function Yn(e,n){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(c){Fe(e,n,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Fe(e,n,c)}else r.current=null}function Ug(e){var n=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(c){Fe(e,e.return,c)}}function qd(e,n,r){try{var i=e.stateNode;gj(i,e.type,r,n),i[Wt]=n}catch(c){Fe(e,e.return,c)}}function Lg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rr(e.type)||e.tag===4}function Bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $d(e,n,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=la));else if(i!==4&&(i===27&&rr(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for($d(e,n,r),e=e.sibling;e!==null;)$d(e,n,r),e=e.sibling}function Vo(e,n,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(i!==4&&(i===27&&rr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Vo(e,n,r),e=e.sibling;e!==null;)Vo(e,n,r),e=e.sibling}function Zg(e){var n=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);Bt(n,i,r),n[Ut]=e,n[Wt]=r}catch(f){Fe(e,e.return,f)}}var pa=!1,Et=!1,Hd=!1,qg=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function P1(e,n){if(e=e.containerInfo,cf=hu,e=Xm(e),Dc(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var c=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var v=0,S=-1,A=-1,L=0,G=0,P=e,Z=null;t:for(;;){for(var H;P!==r||c!==0&&P.nodeType!==3||(S=v+c),P!==f||i!==0&&P.nodeType!==3||(A=v+i),P.nodeType===3&&(v+=P.nodeValue.length),(H=P.firstChild)!==null;)Z=P,P=H;for(;;){if(P===e)break t;if(Z===r&&++L===c&&(S=v),Z===f&&++G===i&&(A=v),(H=P.nextSibling)!==null)break;P=Z,Z=P.parentNode}P=H}r=S===-1||A===-1?null:{start:S,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;for(df={focusedElem:e,selectionRange:r},hu=!1,Mt=n;Mt!==null;)if(n=Mt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Mt=e;else for(;Mt!==null;){switch(n=Mt,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)c=e[r],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,r=n,c=f.memoizedProps,f=f.memoizedState,i=r.stateNode;try{var se=Kr(r.type,c);e=i.getSnapshotBeforeUpdate(se,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Fe(r,r.return,Se)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)mf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,Mt=e;break}Mt=n.return}}function Bg(e,n,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:va(e,r),i&4&&di(5,r);break;case 1:if(va(e,r),i&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(v){Fe(r,r.return,v)}else{var c=Kr(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(v){Fe(r,r.return,v)}}i&64&&kg(r),i&512&&fi(r,r.return);break;case 3:if(va(e,r),i&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{wp(e,n)}catch(v){Fe(r,r.return,v)}}break;case 27:n===null&&i&4&&Zg(r);case 26:case 5:va(e,r),n===null&&i&4&&Ug(r),i&512&&fi(r,r.return);break;case 12:va(e,r);break;case 31:va(e,r),i&4&&Qg(e,r);break;case 13:va(e,r),i&4&&Gg(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=rj.bind(null,r),wj(e,r))));break;case 22:if(i=r.memoizedState!==null||pa,!i){n=n!==null&&n.memoizedState!==null||Et,c=pa;var f=Et;pa=i,(Et=n)&&!f?ya(e,r,(r.subtreeFlags&8772)!==0):va(e,r),pa=c,Et=f}break;case 30:break;default:va(e,r)}}function $g(e){var n=e.alternate;n!==null&&(e.alternate=null,$g(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&yc(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ut=null,tn=!1;function ga(e,n,r){for(r=r.child;r!==null;)Hg(e,n,r),r=r.sibling}function Hg(e,n,r){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Za,r)}catch{}switch(r.tag){case 26:Et||Yn(r,n),ga(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Et||Yn(r,n);var i=ut,c=tn;rr(r.type)&&(ut=r.stateNode,tn=!1),ga(e,n,r),Si(r.stateNode),ut=i,tn=c;break;case 5:Et||Yn(r,n);case 6:if(i=ut,c=tn,ut=null,ga(e,n,r),ut=i,tn=c,ut!==null)if(tn)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(r.stateNode)}catch(f){Fe(r,n,f)}else try{ut.removeChild(r.stateNode)}catch(f){Fe(r,n,f)}break;case 18:ut!==null&&(tn?(e=ut,kv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),as(e)):kv(ut,r.stateNode));break;case 4:i=ut,c=tn,ut=r.stateNode.containerInfo,tn=!0,ga(e,n,r),ut=i,tn=c;break;case 0:case 11:case 14:case 15:Xa(2,r,n),Et||Xa(4,r,n),ga(e,n,r);break;case 1:Et||(Yn(r,n),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Dg(r,n,i)),ga(e,n,r);break;case 21:ga(e,n,r);break;case 22:Et=(i=Et)||r.memoizedState!==null,ga(e,n,r),Et=i;break;default:ga(e,n,r)}}function Qg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{as(e)}catch(r){Fe(n,n.return,r)}}}function Gg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{as(e)}catch(r){Fe(n,n.return,r)}}function F1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new qg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new qg),n;default:throw Error(s(435,e.tag))}}function Yo(e,n){var r=F1(e);n.forEach(function(i){if(!r.has(i)){r.add(i);var c=lj.bind(null,e,i);i.then(c,c)}})}function nn(e,n){var r=n.deletions;if(r!==null)for(var i=0;i<r.length;i++){var c=r[i],f=e,v=n,S=v;e:for(;S!==null;){switch(S.tag){case 27:if(rr(S.type)){ut=S.stateNode,tn=!1;break e}break;case 5:ut=S.stateNode,tn=!1;break e;case 3:case 4:ut=S.stateNode.containerInfo,tn=!0;break e}S=S.return}if(ut===null)throw Error(s(160));Hg(f,v,c),ut=null,tn=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ig(n,e),n=n.sibling}var Bn=null;function Ig(e,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:nn(n,e),an(e),i&4&&(Xa(3,e,e.return),di(3,e),Xa(5,e,e.return));break;case 1:nn(n,e),an(e),i&512&&(Et||r===null||Yn(r,r.return)),i&64&&pa&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var c=Bn;if(nn(n,e),an(e),i&512&&(Et||r===null||Yn(r,r.return)),i&4){var f=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,c=c.ownerDocument||c;t:switch(i){case"title":f=c.getElementsByTagName("title")[0],(!f||f[qs]||f[Ut]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(i),c.head.insertBefore(f,c.querySelector("head > title"))),Bt(f,i,r),f[Ut]=e,Rt(f),i=f;break e;case"link":var v=Iv("link","href",c).get(i+(r.href||""));if(v){for(var S=0;S<v.length;S++)if(f=v[S],f.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&f.getAttribute("rel")===(r.rel==null?null:r.rel)&&f.getAttribute("title")===(r.title==null?null:r.title)&&f.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){v.splice(S,1);break t}}f=c.createElement(i),Bt(f,i,r),c.head.appendChild(f);break;case"meta":if(v=Iv("meta","content",c).get(i+(r.content||""))){for(S=0;S<v.length;S++)if(f=v[S],f.getAttribute("content")===(r.content==null?null:""+r.content)&&f.getAttribute("name")===(r.name==null?null:r.name)&&f.getAttribute("property")===(r.property==null?null:r.property)&&f.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&f.getAttribute("charset")===(r.charSet==null?null:r.charSet)){v.splice(S,1);break t}}f=c.createElement(i),Bt(f,i,r),c.head.appendChild(f);break;default:throw Error(s(468,i))}f[Ut]=e,Rt(f),i=f}e.stateNode=i}else Vv(c,e.type,e.stateNode);else e.stateNode=Gv(c,i,e.memoizedProps);else f!==i?(f===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):f.count--,i===null?Vv(c,e.type,e.stateNode):Gv(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&qd(e,e.memoizedProps,r.memoizedProps)}break;case 27:nn(n,e),an(e),i&512&&(Et||r===null||Yn(r,r.return)),r!==null&&i&4&&qd(e,e.memoizedProps,r.memoizedProps);break;case 5:if(nn(n,e),an(e),i&512&&(Et||r===null||Yn(r,r.return)),e.flags&32){c=e.stateNode;try{El(c,"")}catch(se){Fe(e,e.return,se)}}i&4&&e.stateNode!=null&&(c=e.memoizedProps,qd(e,c,r!==null?r.memoizedProps:c)),i&1024&&(Hd=!0);break;case 6:if(nn(n,e),an(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(se){Fe(e,e.return,se)}}break;case 3:if(uu=null,c=Bn,Bn=iu(n.containerInfo),nn(n,e),Bn=c,an(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{as(n.containerInfo)}catch(se){Fe(e,e.return,se)}Hd&&(Hd=!1,Vg(e));break;case 4:i=Bn,Bn=iu(e.stateNode.containerInfo),nn(n,e),an(e),Bn=i;break;case 12:nn(n,e),an(e);break;case 31:nn(n,e),an(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Yo(e,i)));break;case 13:nn(n,e),an(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Po=Vt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Yo(e,i)));break;case 22:c=e.memoizedState!==null;var A=r!==null&&r.memoizedState!==null,L=pa,G=Et;if(pa=L||c,Et=G||A,nn(n,e),Et=G,pa=L,an(e),i&8192)e:for(n=e.stateNode,n._visibility=c?n._visibility&-2:n._visibility|1,c&&(r===null||A||pa||Et||Pr(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){A=r=n;try{if(f=A.stateNode,c)v=f.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{S=A.stateNode;var P=A.memoizedProps.style,Z=P!=null&&P.hasOwnProperty("display")?P.display:null;S.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(se){Fe(A,A.return,se)}}}else if(n.tag===6){if(r===null){A=n;try{A.stateNode.nodeValue=c?"":A.memoizedProps}catch(se){Fe(A,A.return,se)}}}else if(n.tag===18){if(r===null){A=n;try{var H=A.stateNode;c?Dv(H,!0):Dv(A.stateNode,!1)}catch(se){Fe(A,A.return,se)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,Yo(e,r))));break;case 19:nn(n,e),an(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Yo(e,i)));break;case 30:break;case 21:break;default:nn(n,e),an(e)}}function an(e){var n=e.flags;if(n&2){try{for(var r,i=e.return;i!==null;){if(Lg(i)){r=i;break}i=i.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var c=r.stateNode,f=Bd(e);Vo(e,f,c);break;case 5:var v=r.stateNode;r.flags&32&&(El(v,""),r.flags&=-33);var S=Bd(e);Vo(e,S,v);break;case 3:case 4:var A=r.stateNode.containerInfo,L=Bd(e);$d(e,L,A);break;default:throw Error(s(161))}}catch(G){Fe(e,e.return,G)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Vg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Vg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function va(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Bg(e,n.alternate,n),n=n.sibling}function Pr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Xa(4,n,n.return),Pr(n);break;case 1:Yn(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Dg(n,n.return,r),Pr(n);break;case 27:Si(n.stateNode);case 26:case 5:Yn(n,n.return),Pr(n);break;case 22:n.memoizedState===null&&Pr(n);break;case 30:Pr(n);break;default:Pr(n)}e=e.sibling}}function ya(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,c=e,f=n,v=f.flags;switch(f.tag){case 0:case 11:case 15:ya(c,f,r),di(4,f);break;case 1:if(ya(c,f,r),i=f,c=i.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){Fe(i,i.return,L)}if(i=f,c=i.updateQueue,c!==null){var S=i.stateNode;try{var A=c.shared.hiddenCallbacks;if(A!==null)for(c.shared.hiddenCallbacks=null,c=0;c<A.length;c++)Np(A[c],S)}catch(L){Fe(i,i.return,L)}}r&&v&64&&kg(f),fi(f,f.return);break;case 27:Zg(f);case 26:case 5:ya(c,f,r),r&&i===null&&v&4&&Ug(f),fi(f,f.return);break;case 12:ya(c,f,r);break;case 31:ya(c,f,r),r&&v&4&&Qg(c,f);break;case 13:ya(c,f,r),r&&v&4&&Gg(c,f);break;case 22:f.memoizedState===null&&ya(c,f,r),fi(f,f.return);break;case 30:break;default:ya(c,f,r)}n=n.sibling}}function Qd(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Js(r))}function Gd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Js(e))}function $n(e,n,r,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Yg(e,n,r,i),n=n.sibling}function Yg(e,n,r,i){var c=n.flags;switch(n.tag){case 0:case 11:case 15:$n(e,n,r,i),c&2048&&di(9,n);break;case 1:$n(e,n,r,i);break;case 3:$n(e,n,r,i),c&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Js(e)));break;case 12:if(c&2048){$n(e,n,r,i),e=n.stateNode;try{var f=n.memoizedProps,v=f.id,S=f.onPostCommit;typeof S=="function"&&S(v,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Fe(n,n.return,A)}}else $n(e,n,r,i);break;case 31:$n(e,n,r,i);break;case 13:$n(e,n,r,i);break;case 23:break;case 22:f=n.stateNode,v=n.alternate,n.memoizedState!==null?f._visibility&2?$n(e,n,r,i):hi(e,n):f._visibility&2?$n(e,n,r,i):(f._visibility|=2,Vl(e,n,r,i,(n.subtreeFlags&10256)!==0||!1)),c&2048&&Qd(v,n);break;case 24:$n(e,n,r,i),c&2048&&Gd(n.alternate,n);break;default:$n(e,n,r,i)}}function Vl(e,n,r,i,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=e,v=n,S=r,A=i,L=v.flags;switch(v.tag){case 0:case 11:case 15:Vl(f,v,S,A,c),di(8,v);break;case 23:break;case 22:var G=v.stateNode;v.memoizedState!==null?G._visibility&2?Vl(f,v,S,A,c):hi(f,v):(G._visibility|=2,Vl(f,v,S,A,c)),c&&L&2048&&Qd(v.alternate,v);break;case 24:Vl(f,v,S,A,c),c&&L&2048&&Gd(v.alternate,v);break;default:Vl(f,v,S,A,c)}n=n.sibling}}function hi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,i=n,c=i.flags;switch(i.tag){case 22:hi(r,i),c&2048&&Qd(i.alternate,i);break;case 24:hi(r,i),c&2048&&Gd(i.alternate,i);break;default:hi(r,i)}n=n.sibling}}var mi=8192;function Yl(e,n,r){if(e.subtreeFlags&mi)for(e=e.child;e!==null;)Kg(e,n,r),e=e.sibling}function Kg(e,n,r){switch(e.tag){case 26:Yl(e,n,r),e.flags&mi&&e.memoizedState!==null&&Uj(r,Bn,e.memoizedState,e.memoizedProps);break;case 5:Yl(e,n,r);break;case 3:case 4:var i=Bn;Bn=iu(e.stateNode.containerInfo),Yl(e,n,r),Bn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=mi,mi=16777216,Yl(e,n,r),mi=i):Yl(e,n,r));break;default:Yl(e,n,r)}}function Pg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function pi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];Mt=i,Xg(i,e)}Pg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fg(e),e=e.sibling}function Fg(e){switch(e.tag){case 0:case 11:case 15:pi(e),e.flags&2048&&Xa(9,e,e.return);break;case 3:pi(e);break;case 12:pi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Ko(e)):pi(e);break;default:pi(e)}}function Ko(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];Mt=i,Xg(i,e)}Pg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Xa(8,n,n.return),Ko(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,Ko(n));break;default:Ko(n)}e=e.sibling}}function Xg(e,n){for(;Mt!==null;){var r=Mt;switch(r.tag){case 0:case 11:case 15:Xa(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Js(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,Mt=i;else e:for(r=e;Mt!==null;){i=Mt;var c=i.sibling,f=i.return;if($g(i),i===r){Mt=null;break e}if(c!==null){c.return=f,Mt=c;break e}Mt=f}}}var X1={getCacheForType:function(e){var n=Zt(Nt),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Zt(Nt).controller.signal}},J1=typeof WeakMap=="function"?WeakMap:Map,Ie=0,nt=null,Me=null,Le=0,Pe=0,pn=null,Ja=!1,Kl=!1,Id=!1,ba=0,yt=0,Wa=0,Fr=0,Vd=0,gn=0,Pl=0,gi=null,rn=null,Yd=!1,Po=0,Jg=0,Fo=1/0,Xo=null,er=null,At=0,tr=null,Fl=null,xa=0,Kd=0,Pd=null,Wg=null,vi=0,Fd=null;function vn(){return(Ie&2)!==0&&Le!==0?Le&-Le:$.T!==null?nf():pm()}function ev(){if(gn===0)if((Le&536870912)===0||qe){var e=Jt;Jt<<=1,(Jt&3932160)===0&&(Jt=262144),gn=e}else gn=536870912;return e=hn.current,e!==null&&(e.flags|=32),gn}function ln(e,n,r){(e===nt&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(Xl(e,0),nr(e,Le,gn,!1)),Zs(e,r),((Ie&2)===0||e!==nt)&&(e===nt&&((Ie&2)===0&&(Fr|=r),yt===4&&nr(e,Le,gn,!1)),Kn(e))}function tv(e,n,r){if((Ie&6)!==0)throw Error(s(327));var i=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Ls(e,n),c=i?tj(e,n):Jd(e,n,!0),f=i;do{if(c===0){Kl&&!i&&nr(e,n,0,!1);break}else{if(r=e.current.alternate,f&&!W1(r)){c=Jd(e,n,!1),f=!1;continue}if(c===2){if(f=n,e.errorRecoveryDisabledLanes&f)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var S=e;c=gi;var A=S.current.memoizedState.isDehydrated;if(A&&(Xl(S,v).flags|=256),v=Jd(S,v,!1),v!==2){if(Id&&!A){S.errorRecoveryDisabledLanes|=f,Fr|=f,c=4;break e}f=rn,rn=c,f!==null&&(rn===null?rn=f:rn.push.apply(rn,f))}c=v}if(f=!1,c!==2)continue}}if(c===1){Xl(e,0),nr(e,n,0,!0);break}e:{switch(i=e,f=c,f){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:nr(i,n,gn,!Ja);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(c=Po+300-Vt(),10<c)){if(nr(i,n,gn,!Ja),so(i,0,!0)!==0)break e;xa=n,i.timeoutHandle=Rv(nv.bind(null,i,r,rn,Xo,Yd,n,gn,Fr,Pl,Ja,f,"Throttled",-0,0),c);break e}nv(i,r,rn,Xo,Yd,n,gn,Fr,Pl,Ja,f,null,-0,0)}}break}while(!0);Kn(e)}function nv(e,n,r,i,c,f,v,S,A,L,G,P,Z,H){if(e.timeoutHandle=-1,P=n.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},Kg(n,f,P);var se=(f&62914560)===f?Po-Vt():(f&4194048)===f?Jg-Vt():0;if(se=Lj(P,se),se!==null){xa=f,e.cancelPendingCommit=se(cv.bind(null,e,n,f,r,i,c,v,S,A,G,P,null,Z,H)),nr(e,f,v,!L);return}}cv(e,n,f,r,i,c,v,S,A)}function W1(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var c=r[i],f=c.getSnapshot;c=c.value;try{if(!dn(f(),c))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function nr(e,n,r,i){n&=~Vd,n&=~Fr,e.suspendedLanes|=n,e.pingedLanes&=~n,i&&(e.warmLanes|=n),i=e.expirationTimes;for(var c=n;0<c;){var f=31-Qt(c),v=1<<f;i[f]=-1,c&=~v}r!==0&&fm(e,r,n)}function Jo(){return(Ie&6)===0?(yi(0),!1):!0}function Xd(){if(Me!==null){if(Pe===0)var e=Me.return;else e=Me,ua=$r=null,hd(e),$l=null,ei=0,e=Me;for(;e!==null;)Mg(e.alternate,e),e=e.return;Me=null}}function Xl(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,bj(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),xa=0,Xd(),nt=e,Me=r=ia(e.current,null),Le=n,Pe=0,pn=null,Ja=!1,Kl=Ls(e,n),Id=!1,Pl=gn=Vd=Fr=Wa=yt=0,rn=gi=null,Yd=!1,(n&8)!==0&&(n|=n&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=n;0<i;){var c=31-Qt(i),f=1<<c;n|=e[c],i&=~f}return ba=n,bo(),r}function av(e,n){Ee=null,$.H=oi,n===Bl||n===Co?(n=bp(),Pe=3):n===td?(n=bp(),Pe=4):Pe=n===Td?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,pn=n,Me===null&&(yt=1,$o(e,Nn(n,e.current)))}function rv(){var e=hn.current;return e===null?!0:(Le&4194048)===Le?Cn===null:(Le&62914560)===Le||(Le&536870912)!==0?e===Cn:!1}function lv(){var e=$.H;return $.H=oi,e===null?oi:e}function sv(){var e=$.A;return $.A=X1,e}function Wo(){yt=4,Ja||(Le&4194048)!==Le&&hn.current!==null||(Kl=!0),(Wa&134217727)===0&&(Fr&134217727)===0||nt===null||nr(nt,Le,gn,!1)}function Jd(e,n,r){var i=Ie;Ie|=2;var c=lv(),f=sv();(nt!==e||Le!==n)&&(Xo=null,Xl(e,n)),n=!1;var v=yt;e:do try{if(Pe!==0&&Me!==null){var S=Me,A=pn;switch(Pe){case 8:Xd(),v=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(n=!0);var L=Pe;if(Pe=0,pn=null,Jl(e,S,A,L),r&&Kl){v=0;break e}break;default:L=Pe,Pe=0,pn=null,Jl(e,S,A,L)}}ej(),v=yt;break}catch(G){av(e,G)}while(!0);return n&&e.shellSuspendCounter++,ua=$r=null,Ie=i,$.H=c,$.A=f,Me===null&&(nt=null,Le=0,bo()),v}function ej(){for(;Me!==null;)iv(Me)}function tj(e,n){var r=Ie;Ie|=2;var i=lv(),c=sv();nt!==e||Le!==n?(Xo=null,Fo=Vt()+500,Xl(e,n)):Kl=Ls(e,n);e:do try{if(Pe!==0&&Me!==null){n=Me;var f=pn;t:switch(Pe){case 1:Pe=0,pn=null,Jl(e,n,f,1);break;case 2:case 9:if(vp(f)){Pe=0,pn=null,ov(n);break}n=function(){Pe!==2&&Pe!==9||nt!==e||(Pe=7),Kn(e)},f.then(n,n);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:vp(f)?(Pe=0,pn=null,ov(n)):(Pe=0,pn=null,Jl(e,n,f,7));break;case 5:var v=null;switch(Me.tag){case 26:v=Me.memoizedState;case 5:case 27:var S=Me;if(v?Yv(v):S.stateNode.complete){Pe=0,pn=null;var A=S.sibling;if(A!==null)Me=A;else{var L=S.return;L!==null?(Me=L,eu(L)):Me=null}break t}}Pe=0,pn=null,Jl(e,n,f,5);break;case 6:Pe=0,pn=null,Jl(e,n,f,6);break;case 8:Xd(),yt=6;break e;default:throw Error(s(462))}}nj();break}catch(G){av(e,G)}while(!0);return ua=$r=null,$.H=i,$.A=c,Ie=r,Me!==null?0:(nt=null,Le=0,bo(),yt)}function nj(){for(;Me!==null&&!Wi();)iv(Me)}function iv(e){var n=Og(e.alternate,e,ba);e.memoizedProps=e.pendingProps,n===null?eu(e):Me=n}function ov(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=_g(r,n,n.pendingProps,n.type,void 0,Le);break;case 11:n=_g(r,n,n.pendingProps,n.type.render,n.ref,Le);break;case 5:hd(n);default:Mg(r,n),n=Me=sp(n,ba),n=Og(r,n,ba)}e.memoizedProps=e.pendingProps,n===null?eu(e):Me=n}function Jl(e,n,r,i){ua=$r=null,hd(n),$l=null,ei=0;var c=n.return;try{if(G1(e,c,n,r,Le)){yt=1,$o(e,Nn(r,e.current)),Me=null;return}}catch(f){if(c!==null)throw Me=c,f;yt=1,$o(e,Nn(r,e.current)),Me=null;return}n.flags&32768?(qe||i===1?e=!0:Kl||(Le&536870912)!==0?e=!1:(Ja=e=!0,(i===2||i===9||i===3||i===6)&&(i=hn.current,i!==null&&i.tag===13&&(i.flags|=16384))),uv(n,e)):eu(n)}function eu(e){var n=e;do{if((n.flags&32768)!==0){uv(n,Ja);return}e=n.return;var r=Y1(n.alternate,n,ba);if(r!==null){Me=r;return}if(n=n.sibling,n!==null){Me=n;return}Me=n=e}while(n!==null);yt===0&&(yt=5)}function uv(e,n){do{var r=K1(e.alternate,e);if(r!==null){r.flags&=32767,Me=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Me=e;return}Me=e=r}while(e!==null);yt=6,Me=null}function cv(e,n,r,i,c,f,v,S,A){e.cancelPendingCommit=null;do tu();while(At!==0);if((Ie&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(f=n.lanes|n.childLanes,f|=Bc,DS(e,r,f,v,S,A),e===nt&&(Me=nt=null,Le=0),Fl=n,tr=e,xa=r,Kd=f,Pd=c,Wg=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,sj(bl,function(){return pv(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=$.T,$.T=null,c=D.p,D.p=2,v=Ie,Ie|=4;try{P1(e,n,r)}finally{Ie=v,D.p=c,$.T=i}}At=1,dv(),fv(),hv()}}function dv(){if(At===1){At=0;var e=tr,n=Fl,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=$.T,$.T=null;var i=D.p;D.p=2;var c=Ie;Ie|=4;try{Ig(n,e);var f=df,v=Xm(e.containerInfo),S=f.focusedElem,A=f.selectionRange;if(v!==S&&S&&S.ownerDocument&&Fm(S.ownerDocument.documentElement,S)){if(A!==null&&Dc(S)){var L=A.start,G=A.end;if(G===void 0&&(G=L),"selectionStart"in S)S.selectionStart=L,S.selectionEnd=Math.min(G,S.value.length);else{var P=S.ownerDocument||document,Z=P&&P.defaultView||window;if(Z.getSelection){var H=Z.getSelection(),se=S.textContent.length,Se=Math.min(A.start,se),et=A.end===void 0?Se:Math.min(A.end,se);!H.extend&&Se>et&&(v=et,et=Se,Se=v);var M=Pm(S,Se),z=Pm(S,et);if(M&&z&&(H.rangeCount!==1||H.anchorNode!==M.node||H.anchorOffset!==M.offset||H.focusNode!==z.node||H.focusOffset!==z.offset)){var U=P.createRange();U.setStart(M.node,M.offset),H.removeAllRanges(),Se>et?(H.addRange(U),H.extend(z.node,z.offset)):(U.setEnd(z.node,z.offset),H.addRange(U))}}}}for(P=[],H=S;H=H.parentNode;)H.nodeType===1&&P.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<P.length;S++){var V=P[S];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}hu=!!cf,df=cf=null}finally{Ie=c,D.p=i,$.T=r}}e.current=n,At=2}}function fv(){if(At===2){At=0;var e=tr,n=Fl,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=$.T,$.T=null;var i=D.p;D.p=2;var c=Ie;Ie|=4;try{Bg(e,n.alternate,n)}finally{Ie=c,D.p=i,$.T=r}}At=3}}function hv(){if(At===4||At===3){At=0,dc();var e=tr,n=Fl,r=xa,i=Wg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?At=5:(At=0,Fl=tr=null,mv(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(er=null),gc(r),n=n.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(Za,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=$.T,c=D.p,D.p=2,$.T=null;try{for(var f=e.onRecoverableError,v=0;v<i.length;v++){var S=i[v];f(S.value,{componentStack:S.stack})}}finally{$.T=n,D.p=c}}(xa&3)!==0&&tu(),Kn(e),c=e.pendingLanes,(r&261930)!==0&&(c&42)!==0?e===Fd?vi++:(vi=0,Fd=e):vi=0,yi(0)}}function mv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Js(n)))}function tu(){return dv(),fv(),hv(),pv()}function pv(){if(At!==5)return!1;var e=tr,n=Kd;Kd=0;var r=gc(xa),i=$.T,c=D.p;try{D.p=32>r?32:r,$.T=null,r=Pd,Pd=null;var f=tr,v=xa;if(At=0,Fl=tr=null,xa=0,(Ie&6)!==0)throw Error(s(331));var S=Ie;if(Ie|=4,Fg(f.current),Yg(f,f.current,v,r),Ie=S,yi(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(Za,f)}catch{}return!0}finally{D.p=c,$.T=i,mv(e,n)}}function gv(e,n,r){n=Nn(r,n),n=Ad(e.stateNode,n,2),e=Ka(e,n,2),e!==null&&(Zs(e,2),Kn(e))}function Fe(e,n,r){if(e.tag===3)gv(e,e,r);else for(;n!==null;){if(n.tag===3){gv(n,e,r);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(er===null||!er.has(i))){e=Nn(r,e),r=vg(2),i=Ka(n,r,2),i!==null&&(yg(r,i,n,e),Zs(i,2),Kn(i));break}}n=n.return}}function Wd(e,n,r){var i=e.pingCache;if(i===null){i=e.pingCache=new J1;var c=new Set;i.set(n,c)}else c=i.get(n),c===void 0&&(c=new Set,i.set(n,c));c.has(r)||(Id=!0,c.add(r),e=aj.bind(null,e,n,r),n.then(e,e))}function aj(e,n,r){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,nt===e&&(Le&r)===r&&(yt===4||yt===3&&(Le&62914560)===Le&&300>Vt()-Po?(Ie&2)===0&&Xl(e,0):Vd|=r,Pl===Le&&(Pl=0)),Kn(e)}function vv(e,n){n===0&&(n=dm()),e=Zr(e,n),e!==null&&(Zs(e,n),Kn(e))}function rj(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),vv(e,r)}function lj(e,n){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(n),vv(e,r)}function sj(e,n){return Ds(e,n)}var nu=null,Wl=null,ef=!1,au=!1,tf=!1,ar=0;function Kn(e){e!==Wl&&e.next===null&&(Wl===null?nu=Wl=e:Wl=Wl.next=e),au=!0,ef||(ef=!0,oj())}function yi(e,n){if(!tf&&au){tf=!0;do for(var r=!1,i=nu;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var f=0;else{var v=i.suspendedLanes,S=i.pingedLanes;f=(1<<31-Qt(42|e)+1)-1,f&=c&~(v&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,Sv(i,f))}else f=Le,f=so(i,i===nt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Ls(i,f)||(r=!0,Sv(i,f));i=i.next}while(r);tf=!1}}function ij(){yv()}function yv(){au=ef=!1;var e=0;ar!==0&&yj()&&(e=ar);for(var n=Vt(),r=null,i=nu;i!==null;){var c=i.next,f=bv(i,n);f===0?(i.next=null,r===null?nu=c:r.next=c,c===null&&(Wl=r)):(r=i,(e!==0||(f&3)!==0)&&(au=!0)),i=c}At!==0&&At!==5||yi(e),ar!==0&&(ar=0)}function bv(e,n){for(var r=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var v=31-Qt(f),S=1<<v,A=c[v];A===-1?((S&r)===0||(S&i)!==0)&&(c[v]=kS(S,n)):A<=n&&(e.expiredLanes|=S),f&=~S}if(n=nt,r=Le,r=so(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===n&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&yl(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ls(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(i!==null&&yl(i),gc(r)){case 2:case 8:r=to;break;case 32:r=bl;break;case 268435456:r=Us;break;default:r=bl}return i=xv.bind(null,e),r=Ds(r,i),e.callbackPriority=n,e.callbackNode=r,n}return i!==null&&i!==null&&yl(i),e.callbackPriority=2,e.callbackNode=null,2}function xv(e,n){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(tu()&&e.callbackNode!==r)return null;var i=Le;return i=so(e,e===nt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(tv(e,i,n),bv(e,Vt()),e.callbackNode!=null&&e.callbackNode===r?xv.bind(null,e):null)}function Sv(e,n){if(tu())return null;tv(e,n,!0)}function oj(){xj(function(){(Ie&6)!==0?Ds(eo,ij):yv()})}function nf(){if(ar===0){var e=Zl;e===0&&(e=Re,Re<<=1,(Re&261888)===0&&(Re=256)),ar=e}return ar}function jv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:co(""+e)}function Nv(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function uj(e,n,r,i,c){if(n==="submit"&&r&&r.stateNode===c){var f=jv((c[Wt]||null).action),v=i.submitter;v&&(n=(n=v[Wt]||null)?jv(n.formAction):v.getAttribute("formAction"),n!==null&&(f=n,v=null));var S=new po("action","action",null,i,c);e.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ar!==0){var A=v?Nv(c,v):new FormData(c);jd(r,{pending:!0,data:A,method:c.method,action:f},null,A)}}else typeof f=="function"&&(S.preventDefault(),A=v?Nv(c,v):new FormData(c),jd(r,{pending:!0,data:A,method:c.method,action:f},f,A))},currentTarget:c}]})}}for(var af=0;af<qc.length;af++){var rf=qc[af],cj=rf.toLowerCase(),dj=rf[0].toUpperCase()+rf.slice(1);qn(cj,"on"+dj)}qn(ep,"onAnimationEnd"),qn(tp,"onAnimationIteration"),qn(np,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(C1,"onTransitionRun"),qn(A1,"onTransitionStart"),qn(T1,"onTransitionCancel"),qn(ap,"onTransitionEnd"),wl("onMouseEnter",["mouseout","mouseover"]),wl("onMouseLeave",["mouseout","mouseover"]),wl("onPointerEnter",["pointerout","pointerover"]),wl("onPointerLeave",["pointerout","pointerover"]),kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kr("onBeforeInput",["compositionend","keypress","textInput","paste"]),kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="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(" "),fj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bi));function wv(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],c=i.event;i=i.listeners;e:{var f=void 0;if(n)for(var v=i.length-1;0<=v;v--){var S=i[v],A=S.instance,L=S.currentTarget;if(S=S.listener,A!==f&&c.isPropagationStopped())break e;f=S,c.currentTarget=L;try{f(c)}catch(G){yo(G)}c.currentTarget=null,f=A}else for(v=0;v<i.length;v++){if(S=i[v],A=S.instance,L=S.currentTarget,S=S.listener,A!==f&&c.isPropagationStopped())break e;f=S,c.currentTarget=L;try{f(c)}catch(G){yo(G)}c.currentTarget=null,f=A}}}}function ke(e,n){var r=n[vc];r===void 0&&(r=n[vc]=new Set);var i=e+"__bubble";r.has(i)||(_v(n,e,2,!1),r.add(i))}function lf(e,n,r){var i=0;n&&(i|=4),_v(r,e,i,n)}var ru="_reactListening"+Math.random().toString(36).slice(2);function sf(e){if(!e[ru]){e[ru]=!0,ym.forEach(function(r){r!=="selectionchange"&&(fj.has(r)||lf(r,!1,e),lf(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ru]||(n[ru]=!0,lf("selectionchange",!1,n))}}function _v(e,n,r,i){switch(ey(n)){case 2:var c=Bj;break;case 8:c=$j;break;default:c=jf}r=c.bind(null,n,r,e),c=void 0,!Ec||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(n,r,{capture:!0,passive:c}):e.addEventListener(n,r,!0):c!==void 0?e.addEventListener(n,r,{passive:c}):e.addEventListener(n,r,!1)}function of(e,n,r,i,c){var f=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var v=i.tag;if(v===3||v===4){var S=i.stateNode.containerInfo;if(S===c)break;if(v===4)for(v=i.return;v!==null;){var A=v.tag;if((A===3||A===4)&&v.stateNode.containerInfo===c)return;v=v.return}for(;S!==null;){if(v=Sl(S),v===null)return;if(A=v.tag,A===5||A===6||A===26||A===27){i=f=v;continue e}S=S.parentNode}}i=i.return}zm(function(){var L=f,G=wc(r),P=[];e:{var Z=rp.get(e);if(Z!==void 0){var H=po,se=e;switch(e){case"keypress":if(ho(r)===0)break e;case"keydown":case"keyup":H=l1;break;case"focusin":se="focus",H=zc;break;case"focusout":se="blur",H=zc;break;case"beforeblur":case"afterblur":H=zc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Mm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=YS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=o1;break;case ep:case tp:case np:H=FS;break;case ap:H=c1;break;case"scroll":case"scrollend":H=IS;break;case"wheel":H=f1;break;case"copy":case"cut":case"paste":H=JS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Dm;break;case"toggle":case"beforetoggle":H=m1}var Se=(n&4)!==0,et=!Se&&(e==="scroll"||e==="scrollend"),M=Se?Z!==null?Z+"Capture":null:Z;Se=[];for(var z=L,U;z!==null;){var V=z;if(U=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||U===null||M===null||(V=$s(z,M),V!=null&&Se.push(xi(z,V,U))),et)break;z=z.return}0<Se.length&&(Z=new H(Z,se,null,r,G),P.push({event:Z,listeners:Se}))}}if((n&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",Z&&r!==Nc&&(se=r.relatedTarget||r.fromElement)&&(Sl(se)||se[xl]))break e;if((H||Z)&&(Z=G.window===G?G:(Z=G.ownerDocument)?Z.defaultView||Z.parentWindow:window,H?(se=r.relatedTarget||r.toElement,H=L,se=se?Sl(se):null,se!==null&&(et=d(se),Se=se.tag,se!==et||Se!==5&&Se!==27&&Se!==6)&&(se=null)):(H=null,se=L),H!==se)){if(Se=Mm,V="onMouseLeave",M="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Dm,V="onPointerLeave",M="onPointerEnter",z="pointer"),et=H==null?Z:Bs(H),U=se==null?Z:Bs(se),Z=new Se(V,z+"leave",H,r,G),Z.target=et,Z.relatedTarget=U,V=null,Sl(G)===L&&(Se=new Se(M,z+"enter",se,r,G),Se.target=U,Se.relatedTarget=et,V=Se),et=V,H&&se)t:{for(Se=hj,M=H,z=se,U=0,V=M;V;V=Se(V))U++;V=0;for(var ge=z;ge;ge=Se(ge))V++;for(;0<U-V;)M=Se(M),U--;for(;0<V-U;)z=Se(z),V--;for(;U--;){if(M===z||z!==null&&M===z.alternate){Se=M;break t}M=Se(M),z=Se(z)}Se=null}else Se=null;H!==null&&Ev(P,Z,H,Se,!1),se!==null&&et!==null&&Ev(P,et,se,Se,!0)}}e:{if(Z=L?Bs(L):window,H=Z.nodeName&&Z.nodeName.toLowerCase(),H==="select"||H==="input"&&Z.type==="file")var He=Qm;else if($m(Z))if(Gm)He=w1;else{He=j1;var ce=S1}else H=Z.nodeName,!H||H.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?L&&jc(L.elementType)&&(He=Qm):He=N1;if(He&&(He=He(e,L))){Hm(P,He,r,G);break e}ce&&ce(e,Z,L),e==="focusout"&&L&&Z.type==="number"&&L.memoizedProps.value!=null&&Sc(Z,"number",Z.value)}switch(ce=L?Bs(L):window,e){case"focusin":($m(ce)||ce.contentEditable==="true")&&(zl=ce,Uc=L,Ps=null);break;case"focusout":Ps=Uc=zl=null;break;case"mousedown":Lc=!0;break;case"contextmenu":case"mouseup":case"dragend":Lc=!1,Jm(P,r,G);break;case"selectionchange":if(E1)break;case"keydown":case"keyup":Jm(P,r,G)}var Ce;if(Rc)e:{switch(e){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Tl?qm(e,r)&&(Ze="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ze="onCompositionStart");Ze&&(Um&&r.locale!=="ko"&&(Tl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Tl&&(Ce=Om()):($a=G,Cc="value"in $a?$a.value:$a.textContent,Tl=!0)),ce=lu(L,Ze),0<ce.length&&(Ze=new km(Ze,e,null,r,G),P.push({event:Ze,listeners:ce}),Ce?Ze.data=Ce:(Ce=Bm(r),Ce!==null&&(Ze.data=Ce)))),(Ce=g1?v1(e,r):y1(e,r))&&(Ze=lu(L,"onBeforeInput"),0<Ze.length&&(ce=new km("onBeforeInput","beforeinput",null,r,G),P.push({event:ce,listeners:Ze}),ce.data=Ce)),uj(P,e,L,r,G)}wv(P,n)})}function xi(e,n,r){return{instance:e,listener:n,currentTarget:r}}function lu(e,n){for(var r=n+"Capture",i=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=$s(e,r),c!=null&&i.unshift(xi(e,c,f)),c=$s(e,n),c!=null&&i.push(xi(e,c,f))),e.tag===3)return i;e=e.return}return[]}function hj(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ev(e,n,r,i,c){for(var f=n._reactName,v=[];r!==null&&r!==i;){var S=r,A=S.alternate,L=S.stateNode;if(S=S.tag,A!==null&&A===i)break;S!==5&&S!==26&&S!==27||L===null||(A=L,c?(L=$s(r,f),L!=null&&v.unshift(xi(r,L,A))):c||(L=$s(r,f),L!=null&&v.push(xi(r,L,A)))),r=r.return}v.length!==0&&e.push({event:n,listeners:v})}var mj=/\r\n?/g,pj=/\u0000|\uFFFD/g;function Cv(e){return(typeof e=="string"?e:""+e).replace(mj,`
|
|
49
|
-
`).replace(pj,"")}function Av(e,n){return n=Cv(n),Cv(e)===n}function We(e,n,r,i,c,f){switch(r){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||El(e,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&El(e,""+i);break;case"className":oo(e,"class",i);break;case"tabIndex":oo(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":oo(e,r,i);break;case"style":Am(e,i,f);break;case"data":if(n!=="object"){oo(e,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=co(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"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"&&(r==="formAction"?(n!=="input"&&We(e,n,"name",c.name,c,null),We(e,n,"formEncType",c.formEncType,c,null),We(e,n,"formMethod",c.formMethod,c,null),We(e,n,"formTarget",c.formTarget,c,null)):(We(e,n,"encType",c.encType,c,null),We(e,n,"method",c.method,c,null),We(e,n,"target",c.target,c,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=co(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=la);break;case"onScroll":i!=null&&ke("scroll",e);break;case"onScrollEnd":i!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(c.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.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"){e.removeAttribute("xlink:href");break}r=co(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);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"?e.setAttribute(r,""+i):e.removeAttribute(r);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"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":ke("beforetoggle",e),ke("toggle",e),io(e,"popover",i);break;case"xlinkActuate":ra(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ra(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ra(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ra(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ra(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ra(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ra(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ra(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ra(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":io(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=QS.get(r)||r,io(e,r,i))}}function uf(e,n,r,i,c,f){switch(r){case"style":Am(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(c.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof i=="string"?El(e,i):(typeof i=="number"||typeof i=="bigint")&&El(e,""+i);break;case"onScroll":i!=null&&ke("scroll",e);break;case"onScrollEnd":i!=null&&ke("scrollend",e);break;case"onClick":i!=null&&(e.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bm.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),n=r.slice(2,c?r.length-7:void 0),f=e[Wt]||null,f=f!=null?f[r]:null,typeof f=="function"&&e.removeEventListener(n,f,c),typeof i=="function")){typeof f!="function"&&f!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,i,c);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):io(e,r,i)}}}function Bt(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var i=!1,c=!1,f;for(f in r)if(r.hasOwnProperty(f)){var v=r[f];if(v!=null)switch(f){case"src":i=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:We(e,n,f,v,r,null)}}c&&We(e,n,"srcSet",r.srcSet,r,null),i&&We(e,n,"src",r.src,r,null);return;case"input":ke("invalid",e);var S=f=v=c=null,A=null,L=null;for(i in r)if(r.hasOwnProperty(i)){var G=r[i];if(G!=null)switch(i){case"name":c=G;break;case"type":v=G;break;case"checked":A=G;break;case"defaultChecked":L=G;break;case"value":f=G;break;case"defaultValue":S=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,n));break;default:We(e,n,i,G,r,null)}}wm(e,f,S,A,L,v,c,!1);return;case"select":ke("invalid",e),i=v=f=null;for(c in r)if(r.hasOwnProperty(c)&&(S=r[c],S!=null))switch(c){case"value":f=S;break;case"defaultValue":v=S;break;case"multiple":i=S;default:We(e,n,c,S,r,null)}n=f,r=v,e.multiple=!!i,n!=null?_l(e,!!i,n,!1):r!=null&&_l(e,!!i,r,!0);return;case"textarea":ke("invalid",e),f=c=i=null;for(v in r)if(r.hasOwnProperty(v)&&(S=r[v],S!=null))switch(v){case"value":i=S;break;case"defaultValue":c=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:We(e,n,v,S,r,null)}Em(e,i,c,f);return;case"option":for(A in r)if(r.hasOwnProperty(A)&&(i=r[A],i!=null))switch(A){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:We(e,n,A,i,r,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(i=0;i<bi.length;i++)ke(bi[i],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in r)if(r.hasOwnProperty(L)&&(i=r[L],i!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:We(e,n,L,i,r,null)}return;default:if(jc(n)){for(G in r)r.hasOwnProperty(G)&&(i=r[G],i!==void 0&&uf(e,n,G,i,r,void 0));return}}for(S in r)r.hasOwnProperty(S)&&(i=r[S],i!=null&&We(e,n,S,i,r,null))}function gj(e,n,r,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,v=null,S=null,A=null,L=null,G=null;for(H in r){var P=r[H];if(r.hasOwnProperty(H)&&P!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":A=P;default:i.hasOwnProperty(H)||We(e,n,H,null,i,P)}}for(var Z in i){var H=i[Z];if(P=r[Z],i.hasOwnProperty(Z)&&(H!=null||P!=null))switch(Z){case"type":f=H;break;case"name":c=H;break;case"checked":L=H;break;case"defaultChecked":G=H;break;case"value":v=H;break;case"defaultValue":S=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,n));break;default:H!==P&&We(e,n,Z,H,i,P)}}xc(e,v,S,A,L,G,f,c);return;case"select":H=v=S=Z=null;for(f in r)if(A=r[f],r.hasOwnProperty(f)&&A!=null)switch(f){case"value":break;case"multiple":H=A;default:i.hasOwnProperty(f)||We(e,n,f,null,i,A)}for(c in i)if(f=i[c],A=r[c],i.hasOwnProperty(c)&&(f!=null||A!=null))switch(c){case"value":Z=f;break;case"defaultValue":S=f;break;case"multiple":v=f;default:f!==A&&We(e,n,c,f,i,A)}n=S,r=v,i=H,Z!=null?_l(e,!!r,Z,!1):!!i!=!!r&&(n!=null?_l(e,!!r,n,!0):_l(e,!!r,r?[]:"",!1));return;case"textarea":H=Z=null;for(S in r)if(c=r[S],r.hasOwnProperty(S)&&c!=null&&!i.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:We(e,n,S,null,i,c)}for(v in i)if(c=i[v],f=r[v],i.hasOwnProperty(v)&&(c!=null||f!=null))switch(v){case"value":Z=c;break;case"defaultValue":H=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(s(91));break;default:c!==f&&We(e,n,v,c,i,f)}_m(e,Z,H);return;case"option":for(var se in r)if(Z=r[se],r.hasOwnProperty(se)&&Z!=null&&!i.hasOwnProperty(se))switch(se){case"selected":e.selected=!1;break;default:We(e,n,se,null,i,Z)}for(A in i)if(Z=i[A],H=r[A],i.hasOwnProperty(A)&&Z!==H&&(Z!=null||H!=null))switch(A){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:We(e,n,A,Z,i,H)}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 Se in r)Z=r[Se],r.hasOwnProperty(Se)&&Z!=null&&!i.hasOwnProperty(Se)&&We(e,n,Se,null,i,Z);for(L in i)if(Z=i[L],H=r[L],i.hasOwnProperty(L)&&Z!==H&&(Z!=null||H!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,n));break;default:We(e,n,L,Z,i,H)}return;default:if(jc(n)){for(var et in r)Z=r[et],r.hasOwnProperty(et)&&Z!==void 0&&!i.hasOwnProperty(et)&&uf(e,n,et,void 0,i,Z);for(G in i)Z=i[G],H=r[G],!i.hasOwnProperty(G)||Z===H||Z===void 0&&H===void 0||uf(e,n,G,Z,i,H);return}}for(var M in r)Z=r[M],r.hasOwnProperty(M)&&Z!=null&&!i.hasOwnProperty(M)&&We(e,n,M,null,i,Z);for(P in i)Z=i[P],H=r[P],!i.hasOwnProperty(P)||Z===H||Z==null&&H==null||We(e,n,P,Z,i,H)}function Tv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var c=r[i],f=c.transferSize,v=c.initiatorType,S=c.duration;if(f&&S&&Tv(v)){for(v=0,S=c.responseEnd,i+=1;i<r.length;i++){var A=r[i],L=A.startTime;if(L>S)break;var G=A.transferSize,P=A.initiatorType;G&&Tv(P)&&(A=A.responseEnd,v+=G*(A<S?1:(S-L)/(A-L)))}if(--i,n+=8*(f+v)/(c.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var cf=null,df=null;function su(e){return e.nodeType===9?e:e.ownerDocument}function zv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ov(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function ff(e,n){return e==="textarea"||e==="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 hf=null;function yj(){var e=window.event;return e&&e.type==="popstate"?e===hf?!1:(hf=e,!0):(hf=null,!1)}var Rv=typeof setTimeout=="function"?setTimeout:void 0,bj=typeof clearTimeout=="function"?clearTimeout:void 0,Mv=typeof Promise=="function"?Promise:void 0,xj=typeof queueMicrotask=="function"?queueMicrotask:typeof Mv<"u"?function(e){return Mv.resolve(null).then(e).catch(Sj)}:Rv;function Sj(e){setTimeout(function(){throw e})}function rr(e){return e==="head"}function kv(e,n){var r=n,i=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(c),as(n);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Si(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Si(r);for(var f=r.firstChild;f;){var v=f.nextSibling,S=f.nodeName;f[qs]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||r.removeChild(f),f=v}}else r==="body"&&Si(e.ownerDocument.body);r=c}while(r);as(n)}function Dv(e,n){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function mf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":mf(r),yc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function jj(e,n,r,i){for(;e.nodeType===1;){var c=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[qs])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=An(e.nextSibling),e===null)break}return null}function Nj(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=An(e.nextSibling),e===null))return null;return e}function Uv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=An(e.nextSibling),e===null))return null;return e}function pf(e){return e.data==="$?"||e.data==="$~"}function gf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function wj(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var i=function(){n(),r.removeEventListener("DOMContentLoaded",i)};r.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function An(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var vf=null;function Lv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return An(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Zv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function qv(e,n,r){switch(n=su(r),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Si(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);yc(e)}var Tn=new Map,Bv=new Set;function iu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sa=D.d;D.d={f:_j,r:Ej,D:Cj,C:Aj,L:Tj,m:zj,X:Rj,S:Oj,M:Mj};function _j(){var e=Sa.f(),n=Jo();return e||n}function Ej(e){var n=jl(e);n!==null&&n.tag===5&&n.type==="form"?ag(n):Sa.r(e)}var es=typeof document>"u"?null:document;function $v(e,n,r){var i=es;if(i&&typeof n=="string"&&n){var c=Sn(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Bv.has(c)||(Bv.add(c),e={rel:e,crossOrigin:r,href:n},i.querySelector(c)===null&&(n=i.createElement("link"),Bt(n,"link",e),Rt(n),i.head.appendChild(n)))}}function Cj(e){Sa.D(e),$v("dns-prefetch",e,null)}function Aj(e,n){Sa.C(e,n),$v("preconnect",e,n)}function Tj(e,n,r){Sa.L(e,n,r);var i=es;if(i&&e&&n){var c='link[rel="preload"][as="'+Sn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+Sn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+Sn(r.imageSizes)+'"]')):c+='[href="'+Sn(e)+'"]';var f=c;switch(n){case"style":f=ts(e);break;case"script":f=ns(e)}Tn.has(f)||(e=b({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Tn.set(f,e),i.querySelector(c)!==null||n==="style"&&i.querySelector(ji(f))||n==="script"&&i.querySelector(Ni(f))||(n=i.createElement("link"),Bt(n,"link",e),Rt(n),i.head.appendChild(n)))}}function zj(e,n){Sa.m(e,n);var r=es;if(r&&e){var i=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+Sn(i)+'"][href="'+Sn(e)+'"]',f=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=ns(e)}if(!Tn.has(f)&&(e=b({rel:"modulepreload",href:e},n),Tn.set(f,e),r.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ni(f)))return}i=r.createElement("link"),Bt(i,"link",e),Rt(i),r.head.appendChild(i)}}}function Oj(e,n,r){Sa.S(e,n,r);var i=es;if(i&&e){var c=Nl(i).hoistableStyles,f=ts(e);n=n||"default";var v=c.get(f);if(!v){var S={loading:0,preload:null};if(v=i.querySelector(ji(f)))S.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Tn.get(f))&&yf(e,r);var A=v=i.createElement("link");Rt(A),Bt(A,"link",e),A._p=new Promise(function(L,G){A.onload=L,A.onerror=G}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ou(v,n,i)}v={type:"stylesheet",instance:v,count:1,state:S},c.set(f,v)}}}function Rj(e,n){Sa.X(e,n);var r=es;if(r&&e){var i=Nl(r).hoistableScripts,c=ns(e),f=i.get(c);f||(f=r.querySelector(Ni(c)),f||(e=b({src:e,async:!0},n),(n=Tn.get(c))&&bf(e,n),f=r.createElement("script"),Rt(f),Bt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(c,f))}}function Mj(e,n){Sa.M(e,n);var r=es;if(r&&e){var i=Nl(r).hoistableScripts,c=ns(e),f=i.get(c);f||(f=r.querySelector(Ni(c)),f||(e=b({src:e,async:!0,type:"module"},n),(n=Tn.get(c))&&bf(e,n),f=r.createElement("script"),Rt(f),Bt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(c,f))}}function Hv(e,n,r,i){var c=(c=me.current)?iu(c):null;if(!c)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=ts(r.href),r=Nl(c).hoistableStyles,i=r.get(n),i||(i={type:"style",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=ts(r.href);var f=Nl(c).hoistableStyles,v=f.get(e);if(v||(c=c.ownerDocument||c,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,v),(f=c.querySelector(ji(e)))&&!f._p&&(v.instance=f,v.state.loading=5),Tn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Tn.set(e,r),f||kj(c,e,r,v.state))),n&&i===null)throw Error(s(528,""));return v}if(n&&i!==null)throw Error(s(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ns(r),r=Nl(c).hoistableScripts,i=r.get(n),i||(i={type:"script",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function ts(e){return'href="'+Sn(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function Qv(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function kj(e,n,r,i){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=e.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),Bt(n,"link",r),Rt(n),e.head.appendChild(n))}function ns(e){return'[src="'+Sn(e)+'"]'}function Ni(e){return"script[async]"+e}function Gv(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var i=e.querySelector('style[data-href~="'+Sn(r.href)+'"]');if(i)return n.instance=i,Rt(i),i;var c=b({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Rt(i),Bt(i,"style",c),ou(i,r.precedence,e),n.instance=i;case"stylesheet":c=ts(r.href);var f=e.querySelector(ji(c));if(f)return n.state.loading|=4,n.instance=f,Rt(f),f;i=Qv(r),(c=Tn.get(c))&&yf(i,c),f=(e.ownerDocument||e).createElement("link"),Rt(f);var v=f;return v._p=new Promise(function(S,A){v.onload=S,v.onerror=A}),Bt(f,"link",i),n.state.loading|=4,ou(f,r.precedence,e),n.instance=f;case"script":return f=ns(r.src),(c=e.querySelector(Ni(f)))?(n.instance=c,Rt(c),c):(i=r,(c=Tn.get(f))&&(i=b({},r),bf(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),Rt(c),Bt(c,"link",i),e.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,ou(i,r.precedence,e));return n.instance}function ou(e,n,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,f=c,v=0;v<i.length;v++){var S=i[v];if(S.dataset.precedence===n)f=S;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function yf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function bf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var uu=null;function Iv(e,n,r){if(uu===null){var i=new Map,c=uu=new Map;c.set(r,i)}else c=uu,i=c.get(r),i||(i=new Map,c.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),c=0;c<r.length;c++){var f=r[c];if(!(f[qs]||f[Ut]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var v=f.getAttribute(n)||"";v=e+v;var S=i.get(v);S?S.push(f):i.set(v,[f])}}return i}function Vv(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function Dj(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){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 e=n.disabled,typeof n.precedence=="string"&&e==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 Yv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Uj(e,n,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=ts(i.href),f=n.querySelector(ji(c));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=cu.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=f,Rt(f);return}f=n.ownerDocument||n,i=Qv(i),(c=Tn.get(c))&&yf(i,c),f=f.createElement("link"),Rt(f);var v=f;v._p=new Promise(function(S,A){v.onload=S,v.onerror=A}),Bt(f,"link",i),r.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=cu.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var xf=0;function Lj(e,n){return e.stylesheets&&e.count===0&&fu(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&fu(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+n);0<e.imgBytes&&xf===0&&(xf=62500*vj());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fu(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>xf?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function cu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var du=null;function fu(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,du=new Map,n.forEach(Zj,e),du=null,cu.call(e))}function Zj(e,n){if(!(n.state.loading&4)){var r=du.get(e);if(r)var i=r.get(null);else{r=new Map,du.set(e,r);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var v=c[f];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(r.set(v.dataset.precedence,v),i=v)}i&&r.set(null,i)}c=n.instance,v=c.getAttribute("data-precedence"),f=r.get(v)||i,f===i&&r.set(null,c),r.set(v,c),this.count++,i=cu.bind(this),c.addEventListener("load",i),c.addEventListener("error",i),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),n.state.loading|=4}}var wi={$$typeof:q,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function qj(e,n,r,i,c,f,v,S,A){this.tag=1,this.containerInfo=e,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=mc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mc(0),this.hiddenUpdates=mc(null),this.identifierPrefix=i,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Kv(e,n,r,i,c,f,v,S,A,L,G,P){return e=new qj(e,n,r,v,A,L,G,P,S),n=1,f===!0&&(n|=24),f=fn(3,null,null,n),e.current=f,f.stateNode=e,n=Jc(),n.refCount++,e.pooledCache=n,n.refCount++,f.memoizedState={element:i,isDehydrated:r,cache:n},nd(f),e}function Pv(e){return e?(e=Ml,e):Ml}function Fv(e,n,r,i,c,f){c=Pv(c),i.context===null?i.context=c:i.pendingContext=c,i=Ya(n),i.payload={element:r},f=f===void 0?null:f,f!==null&&(i.callback=f),r=Ka(e,i,n),r!==null&&(ln(r,e,n),ni(r,e,n))}function Xv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Sf(e,n){Xv(e,n),(e=e.alternate)&&Xv(e,n)}function Jv(e){if(e.tag===13||e.tag===31){var n=Zr(e,67108864);n!==null&&ln(n,e,67108864),Sf(e,67108864)}}function Wv(e){if(e.tag===13||e.tag===31){var n=vn();n=pc(n);var r=Zr(e,n);r!==null&&ln(r,e,n),Sf(e,n)}}var hu=!0;function Bj(e,n,r,i){var c=$.T;$.T=null;var f=D.p;try{D.p=2,jf(e,n,r,i)}finally{D.p=f,$.T=c}}function $j(e,n,r,i){var c=$.T;$.T=null;var f=D.p;try{D.p=8,jf(e,n,r,i)}finally{D.p=f,$.T=c}}function jf(e,n,r,i){if(hu){var c=Nf(i);if(c===null)of(e,n,i,mu,r),ty(e,i);else if(Qj(c,e,n,r,i))i.stopPropagation();else if(ty(e,i),n&4&&-1<Hj.indexOf(e)){for(;c!==null;){var f=jl(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var v=qa(f.pendingLanes);if(v!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;v;){var A=1<<31-Qt(v);S.entanglements[1]|=A,v&=~A}Kn(f),(Ie&6)===0&&(Fo=Vt()+500,yi(0))}}break;case 31:case 13:S=Zr(f,2),S!==null&&ln(S,f,2),Jo(),Sf(f,2)}if(f=Nf(i),f===null&&of(e,n,i,mu,r),f===c)break;c=f}c!==null&&i.stopPropagation()}else of(e,n,i,null,r)}}function Nf(e){return e=wc(e),wf(e)}var mu=null;function wf(e){if(mu=null,e=Sl(e),e!==null){var n=d(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=h(n),e!==null)return e;e=null}else if(r===31){if(e=m(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return mu=e,null}function ey(e){switch(e){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(fc()){case eo:return 2;case to:return 8;case bl:case hc:return 32;case Us:return 268435456;default:return 32}default:return 32}}var _f=!1,lr=null,sr=null,ir=null,_i=new Map,Ei=new Map,or=[],Hj="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 ty(e,n){switch(e){case"focusin":case"focusout":lr=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":ir=null;break;case"pointerover":case"pointerout":_i.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ei.delete(n.pointerId)}}function Ci(e,n,r,i,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:r,eventSystemFlags:i,nativeEvent:f,targetContainers:[c]},n!==null&&(n=jl(n),n!==null&&Jv(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function Qj(e,n,r,i,c){switch(n){case"focusin":return lr=Ci(lr,e,n,r,i,c),!0;case"dragenter":return sr=Ci(sr,e,n,r,i,c),!0;case"mouseover":return ir=Ci(ir,e,n,r,i,c),!0;case"pointerover":var f=c.pointerId;return _i.set(f,Ci(_i.get(f)||null,e,n,r,i,c)),!0;case"gotpointercapture":return f=c.pointerId,Ei.set(f,Ci(Ei.get(f)||null,e,n,r,i,c)),!0}return!1}function ny(e){var n=Sl(e.target);if(n!==null){var r=d(n);if(r!==null){if(n=r.tag,n===13){if(n=h(r),n!==null){e.blockedOn=n,gm(e.priority,function(){Wv(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,gm(e.priority,function(){Wv(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Nf(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Nc=i,r.target.dispatchEvent(i),Nc=null}else return n=jl(r),n!==null&&Jv(n),e.blockedOn=r,!1;n.shift()}return!0}function ay(e,n,r){pu(e)&&r.delete(n)}function Gj(){_f=!1,lr!==null&&pu(lr)&&(lr=null),sr!==null&&pu(sr)&&(sr=null),ir!==null&&pu(ir)&&(ir=null),_i.forEach(ay),Ei.forEach(ay)}function gu(e,n){e.blockedOn===n&&(e.blockedOn=null,_f||(_f=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gj)))}var vu=null;function ry(e){vu!==e&&(vu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){vu===e&&(vu=null);for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1],c=e[n+2];if(typeof i!="function"){if(wf(i||r)===null)continue;break}var f=jl(r);f!==null&&(e.splice(n,3),n-=3,jd(f,{pending:!0,data:c,method:r.method,action:i},i,c))}}))}function as(e){function n(A){return gu(A,e)}lr!==null&&gu(lr,e),sr!==null&&gu(sr,e),ir!==null&&gu(ir,e),_i.forEach(n),Ei.forEach(n);for(var r=0;r<or.length;r++){var i=or[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<or.length&&(r=or[0],r.blockedOn===null);)ny(r),r.blockedOn===null&&or.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var c=r[i],f=r[i+1],v=c[Wt]||null;if(typeof f=="function")v||ry(r);else if(v){var S=null;if(f&&f.hasAttribute("formAction")){if(c=f,v=f[Wt]||null)S=v.formAction;else if(wf(c)!==null)continue}else S=v.action;typeof S=="function"?r[i+1]=S:(r.splice(i,3),i-=3),ry(r)}}}function ly(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(v){return c=v})},focusReset:"manual",scroll:"manual"})}function n(){c!==null&&(c(),c=null),i||setTimeout(r,20)}function r(){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,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function Ef(e){this._internalRoot=e}yu.prototype.render=Ef.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var r=n.current,i=vn();Fv(r,i,e,n,null,null)},yu.prototype.unmount=Ef.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Fv(e.current,2,null,e,null,null),Jo(),n[xl]=null}};function yu(e){this._internalRoot=e}yu.prototype.unstable_scheduleHydration=function(e){if(e){var n=pm();e={blockedOn:null,target:e,priority:n};for(var r=0;r<or.length&&n!==0&&n<or[r].priority;r++);or.splice(r,0,e),r===0&&ny(e)}};var sy=a.version;if(sy!=="19.2.4")throw Error(s(527,sy,"19.2.4"));D.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(n),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Ij={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bu.isDisabled&&bu.supportsFiber)try{Za=bu.inject(Ij),Ht=bu}catch{}}return Ti.createRoot=function(e,n){if(!o(e))throw Error(s(299));var r=!1,i="",c=hg,f=mg,v=pg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=Kv(e,1,!1,null,null,r,i,null,c,f,v,ly),e[xl]=n.current,sf(e),new Ef(n)},Ti.hydrateRoot=function(e,n,r){if(!o(e))throw Error(s(299));var i=!1,c="",f=hg,v=mg,S=pg,A=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(v=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError),r.formState!==void 0&&(A=r.formState)),n=Kv(e,1,!0,n,r??null,i,c,A,f,v,S,ly),n.context=Pv(null),r=n.current,i=vn(),i=pc(i),c=Ya(i),c.callback=null,Ka(r,c,i),r=i,n.current.lanes=r,Zs(n,r),Kn(n),e[xl]=n.current,sf(e),new yu(n)},Ti.version="19.2.4",Ti}var vy;function nN(){if(vy)return zf.exports;vy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),zf.exports=tN(),zf.exports}var aN=nN(),Cs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},el,pr,ds,Db,rN=(Db=class extends Cs{constructor(){super();pe(this,el);pe(this,pr);pe(this,ds);re(this,ds,a=>{if(typeof window<"u"&&window.addEventListener){const l=()=>a();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}})}onSubscribe(){T(this,pr)||this.setEventListener(T(this,ds))}onUnsubscribe(){var a;this.hasListeners()||((a=T(this,pr))==null||a.call(this),re(this,pr,void 0))}setEventListener(a){var l;re(this,ds,a),(l=T(this,pr))==null||l.call(this),re(this,pr,a(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(a){T(this,el)!==a&&(re(this,el,a),this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(l=>{l(a)})}isFocused(){var a;return typeof T(this,el)=="boolean"?T(this,el):((a=globalThis.document)==null?void 0:a.visibilityState)!=="hidden"}},el=new WeakMap,pr=new WeakMap,ds=new WeakMap,Db),Ah=new rN,lN={setTimeout:(t,a)=>setTimeout(t,a),clearTimeout:t=>clearTimeout(t),setInterval:(t,a)=>setInterval(t,a),clearInterval:t=>clearInterval(t)},gr,_h,Ub,sN=(Ub=class{constructor(){pe(this,gr,lN);pe(this,_h,!1)}setTimeoutProvider(t){re(this,gr,t)}setTimeout(t,a){return T(this,gr).setTimeout(t,a)}clearTimeout(t){T(this,gr).clearTimeout(t)}setInterval(t,a){return T(this,gr).setInterval(t,a)}clearInterval(t){T(this,gr).clearInterval(t)}},gr=new WeakMap,_h=new WeakMap,Ub),Wr=new sN;function iN(t){setTimeout(t,0)}var oN=typeof window>"u"||"Deno"in globalThis;function Ft(){}function uN(t,a){return typeof t=="function"?t(a):t}function eh(t){return typeof t=="number"&&t>=0&&t!==1/0}function Kb(t,a){return Math.max(t+(a||0)-Date.now(),0)}function wr(t,a){return typeof t=="function"?t(a):t}function On(t,a){return typeof t=="function"?t(a):t}function yy(t,a){const{type:l="all",exact:s,fetchStatus:o,predicate:d,queryKey:h,stale:m}=t;if(h){if(s){if(a.queryHash!==Th(h,a.options))return!1}else if(!Di(a.queryKey,h))return!1}if(l!=="all"){const g=a.isActive();if(l==="active"&&!g||l==="inactive"&&g)return!1}return!(typeof m=="boolean"&&a.isStale()!==m||o&&o!==a.state.fetchStatus||d&&!d(a))}function by(t,a){const{exact:l,status:s,predicate:o,mutationKey:d}=t;if(d){if(!a.options.mutationKey)return!1;if(l){if(ul(a.options.mutationKey)!==ul(d))return!1}else if(!Di(a.options.mutationKey,d))return!1}return!(s&&a.state.status!==s||o&&!o(a))}function Th(t,a){return((a==null?void 0:a.queryKeyHashFn)||ul)(t)}function ul(t){return JSON.stringify(t,(a,l)=>th(l)?Object.keys(l).sort().reduce((s,o)=>(s[o]=l[o],s),{}):l)}function Di(t,a){return t===a?!0:typeof t!=typeof a?!1:t&&a&&typeof t=="object"&&typeof a=="object"?Object.keys(a).every(l=>Di(t[l],a[l])):!1}var cN=Object.prototype.hasOwnProperty;function Pb(t,a,l=0){if(t===a)return t;if(l>500)return a;const s=xy(t)&&xy(a);if(!s&&!(th(t)&&th(a)))return a;const d=(s?t:Object.keys(t)).length,h=s?a:Object.keys(a),m=h.length,g=s?new Array(m):{};let p=0;for(let x=0;x<m;x++){const b=s?x:h[x],j=t[b],w=a[b];if(j===w){g[b]=j,(s?x<d:cN.call(t,b))&&p++;continue}if(j===null||w===null||typeof j!="object"||typeof w!="object"){g[b]=w;continue}const C=Pb(j,w,l+1);g[b]=C,C===j&&p++}return d===m&&p===d?t:g}function qu(t,a){if(!a||Object.keys(t).length!==Object.keys(a).length)return!1;for(const l in t)if(t[l]!==a[l])return!1;return!0}function xy(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function th(t){if(!Sy(t))return!1;const a=t.constructor;if(a===void 0)return!0;const l=a.prototype;return!(!Sy(l)||!l.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Sy(t){return Object.prototype.toString.call(t)==="[object Object]"}function dN(t){return new Promise(a=>{Wr.setTimeout(a,t)})}function nh(t,a,l){return typeof l.structuralSharing=="function"?l.structuralSharing(t,a):l.structuralSharing!==!1?Pb(t,a):a}function fN(t,a,l=0){const s=[...t,a];return l&&s.length>l?s.slice(1):s}function hN(t,a,l=0){const s=[a,...t];return l&&s.length>l?s.slice(0,-1):s}var zh=Symbol();function Fb(t,a){return!t.queryFn&&(a!=null&&a.initialPromise)?()=>a.initialPromise:!t.queryFn||t.queryFn===zh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Oh(t,a){return typeof t=="function"?t(...a):!!t}function mN(t,a,l){let s=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??(o=a()),s||(s=!0,o.aborted?l():o.addEventListener("abort",l,{once:!0})),o)}),t}var Ui=(()=>{let t=()=>oN;return{isServer(){return t()},setIsServer(a){t=a}}})();function ah(){let t,a;const l=new Promise((o,d)=>{t=o,a=d});l.status="pending",l.catch(()=>{});function s(o){Object.assign(l,o),delete l.resolve,delete l.reject}return l.resolve=o=>{s({status:"fulfilled",value:o}),t(o)},l.reject=o=>{s({status:"rejected",reason:o}),a(o)},l}var pN=iN;function gN(){let t=[],a=0,l=m=>{m()},s=m=>{m()},o=pN;const d=m=>{a?t.push(m):o(()=>{l(m)})},h=()=>{const m=t;t=[],m.length&&o(()=>{s(()=>{m.forEach(g=>{l(g)})})})};return{batch:m=>{let g;a++;try{g=m()}finally{a--,a||h()}return g},batchCalls:m=>(...g)=>{d(()=>{m(...g)})},schedule:d,setNotifyFunction:m=>{l=m},setBatchNotifyFunction:m=>{s=m},setScheduler:m=>{o=m}}}var zt=gN(),fs,vr,hs,Lb,vN=(Lb=class extends Cs{constructor(){super();pe(this,fs,!0);pe(this,vr);pe(this,hs);re(this,hs,a=>{if(typeof window<"u"&&window.addEventListener){const l=()=>a(!0),s=()=>a(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",s)}}})}onSubscribe(){T(this,vr)||this.setEventListener(T(this,hs))}onUnsubscribe(){var a;this.hasListeners()||((a=T(this,vr))==null||a.call(this),re(this,vr,void 0))}setEventListener(a){var l;re(this,hs,a),(l=T(this,vr))==null||l.call(this),re(this,vr,a(this.setOnline.bind(this)))}setOnline(a){T(this,fs)!==a&&(re(this,fs,a),this.listeners.forEach(s=>{s(a)}))}isOnline(){return T(this,fs)}},fs=new WeakMap,vr=new WeakMap,hs=new WeakMap,Lb),Bu=new vN;function yN(t){return Math.min(1e3*2**t,3e4)}function Xb(t){return(t??"online")==="online"?Bu.isOnline():!0}var rh=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Jb(t){let a=!1,l=0,s;const o=ah(),d=()=>o.status!=="pending",h=N=>{var _;if(!d()){const R=new rh(N);j(R),(_=t.onCancel)==null||_.call(t,R)}},m=()=>{a=!0},g=()=>{a=!1},p=()=>Ah.isFocused()&&(t.networkMode==="always"||Bu.isOnline())&&t.canRun(),x=()=>Xb(t.networkMode)&&t.canRun(),b=N=>{d()||(s==null||s(),o.resolve(N))},j=N=>{d()||(s==null||s(),o.reject(N))},w=()=>new Promise(N=>{var _;s=R=>{(d()||p())&&N(R)},(_=t.onPause)==null||_.call(t)}).then(()=>{var N;s=void 0,d()||(N=t.onContinue)==null||N.call(t)}),C=()=>{if(d())return;let N;const _=l===0?t.initialPromise:void 0;try{N=_??t.fn()}catch(R){N=Promise.reject(R)}Promise.resolve(N).then(b).catch(R=>{var J;if(d())return;const Q=t.retry??(Ui.isServer()?0:3),q=t.retryDelay??yN,B=typeof q=="function"?q(l,R):q,F=Q===!0||typeof Q=="number"&&l<Q||typeof Q=="function"&&Q(l,R);if(a||!F){j(R);return}l++,(J=t.onFail)==null||J.call(t,l,R),dN(B).then(()=>p()?void 0:w()).then(()=>{a?j(R):C()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(s==null||s(),o),cancelRetry:m,continueRetry:g,canStart:x,start:()=>(x()?C():w().then(C),o)}}var tl,Zb,Wb=(Zb=class{constructor(){pe(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eh(this.gcTime)&&re(this,tl,Wr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ui.isServer()?1/0:300*1e3))}clearGcTimeout(){T(this,tl)&&(Wr.clearTimeout(T(this,tl)),re(this,tl,void 0))}},tl=new WeakMap,Zb),nl,ms,zn,al,kt,Ii,rl,yn,ex,Na,qb,bN=(qb=class extends Wb{constructor(a){super();pe(this,yn);pe(this,nl);pe(this,ms);pe(this,zn);pe(this,al);pe(this,kt);pe(this,Ii);pe(this,rl);re(this,rl,!1),re(this,Ii,a.defaultOptions),this.setOptions(a.options),this.observers=[],re(this,al,a.client),re(this,zn,T(this,al).getQueryCache()),this.queryKey=a.queryKey,this.queryHash=a.queryHash,re(this,nl,Ny(this.options)),this.state=a.state??T(this,nl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var a;return(a=T(this,kt))==null?void 0:a.promise}setOptions(a){if(this.options={...T(this,Ii),...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=Ny(this.options);l.data!==void 0&&(this.setState(jy(l.data,l.dataUpdatedAt)),re(this,nl,l))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,zn).remove(this)}setData(a,l){const s=nh(this.state.data,a,this.options);return Ae(this,yn,Na).call(this,{data:s,type:"success",dataUpdatedAt:l==null?void 0:l.updatedAt,manual:l==null?void 0:l.manual}),s}setState(a,l){Ae(this,yn,Na).call(this,{type:"setState",state:a,setStateOptions:l})}cancel(a){var s,o;const l=(s=T(this,kt))==null?void 0:s.promise;return(o=T(this,kt))==null||o.cancel(a),l?l.then(Ft).catch(Ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return T(this,nl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(a=>On(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>wr(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:!Kb(this.state.dataUpdatedAt,a)}onFocus(){var l;const a=this.observers.find(s=>s.shouldFetchOnWindowFocus());a==null||a.refetch({cancelRefetch:!1}),(l=T(this,kt))==null||l.continue()}onOnline(){var l;const a=this.observers.find(s=>s.shouldFetchOnReconnect());a==null||a.refetch({cancelRefetch:!1}),(l=T(this,kt))==null||l.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),T(this,zn).notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(l=>l!==a),this.observers.length||(T(this,kt)&&(T(this,rl)||Ae(this,yn,ex).call(this)?T(this,kt).cancel({revert:!0}):T(this,kt).cancelRetry()),this.scheduleGc()),T(this,zn).notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ae(this,yn,Na).call(this,{type:"invalidate"})}async fetch(a,l){var g,p,x,b,j,w,C,N,_,R,Q,q;if(this.state.fetchStatus!=="idle"&&((g=T(this,kt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(l!=null&&l.cancelRefetch))this.cancel({silent:!0});else if(T(this,kt))return T(this,kt).continueRetry(),T(this,kt).promise}if(a&&this.setOptions(a),!this.options.queryFn){const B=this.observers.find(F=>F.options.queryFn);B&&this.setOptions(B.options)}const s=new AbortController,o=B=>{Object.defineProperty(B,"signal",{enumerable:!0,get:()=>(re(this,rl,!0),s.signal)})},d=()=>{const B=Fb(this.options,l),J=(()=>{const K={client:T(this,al),queryKey:this.queryKey,meta:this.meta};return o(K),K})();return re(this,rl,!1),this.options.persister?this.options.persister(B,J,this):B(J)},m=(()=>{const B={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:T(this,al),state:this.state,fetchFn:d};return o(B),B})();(p=this.options.behavior)==null||p.onFetch(m,this),re(this,ms,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=m.fetchOptions)==null?void 0:x.meta))&&Ae(this,yn,Na).call(this,{type:"fetch",meta:(b=m.fetchOptions)==null?void 0:b.meta}),re(this,kt,Jb({initialPromise:l==null?void 0:l.initialPromise,fn:m.fetchFn,onCancel:B=>{B instanceof rh&&B.revert&&this.setState({...T(this,ms),fetchStatus:"idle"}),s.abort()},onFail:(B,F)=>{Ae(this,yn,Na).call(this,{type:"failed",failureCount:B,error:F})},onPause:()=>{Ae(this,yn,Na).call(this,{type:"pause"})},onContinue:()=>{Ae(this,yn,Na).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const B=await T(this,kt).start();if(B===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(B),(w=(j=T(this,zn).config).onSuccess)==null||w.call(j,B,this),(N=(C=T(this,zn).config).onSettled)==null||N.call(C,B,this.state.error,this),B}catch(B){if(B instanceof rh){if(B.silent)return T(this,kt).promise;if(B.revert){if(this.state.data===void 0)throw B;return this.state.data}}throw Ae(this,yn,Na).call(this,{type:"error",error:B}),(R=(_=T(this,zn).config).onError)==null||R.call(_,B,this),(q=(Q=T(this,zn).config).onSettled)==null||q.call(Q,this.state.data,B,this),B}finally{this.scheduleGc()}}},nl=new WeakMap,ms=new WeakMap,zn=new WeakMap,al=new WeakMap,kt=new WeakMap,Ii=new WeakMap,rl=new WeakMap,yn=new WeakSet,ex=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Na=function(a){const l=s=>{switch(a.type){case"failed":return{...s,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...tx(s.data,this.options),fetchMeta:a.meta??null};case"success":const o={...s,...jy(a.data,a.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return re(this,ms,a.manual?o:void 0),o;case"error":const d=a.error;return{...s,error:d,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...a.state}}};this.state=l(this.state),zt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),T(this,zn).notify({query:this,type:"updated",action:a})})},qb);function tx(t,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xb(a.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jy(t,a){return{data:t,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ny(t){const a=typeof t.initialData=="function"?t.initialData():t.initialData,l=a!==void 0,s=l?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:l?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:l?"success":"pending",fetchStatus:"idle"}}var sn,Be,Vi,Pt,ll,ps,wa,yr,Yi,gs,vs,sl,il,br,ys,Ke,Mi,lh,sh,ih,oh,uh,ch,dh,nx,Bb,xN=(Bb=class extends Cs{constructor(a,l){super();pe(this,Ke);pe(this,sn);pe(this,Be);pe(this,Vi);pe(this,Pt);pe(this,ll);pe(this,ps);pe(this,wa);pe(this,yr);pe(this,Yi);pe(this,gs);pe(this,vs);pe(this,sl);pe(this,il);pe(this,br);pe(this,ys,new Set);this.options=l,re(this,sn,a),re(this,yr,null),re(this,wa,ah()),this.bindMethods(),this.setOptions(l)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Be).addObserver(this),wy(T(this,Be),this.options)?Ae(this,Ke,Mi).call(this):this.updateResult(),Ae(this,Ke,oh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fh(T(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fh(T(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ae(this,Ke,uh).call(this),Ae(this,Ke,ch).call(this),T(this,Be).removeObserver(this)}setOptions(a){const l=this.options,s=T(this,Be);if(this.options=T(this,sn).defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof On(this.options.enabled,T(this,Be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ae(this,Ke,dh).call(this),T(this,Be).setOptions(this.options),l._defaulted&&!qu(this.options,l)&&T(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Be),observer:this});const o=this.hasListeners();o&&_y(T(this,Be),s,this.options,l)&&Ae(this,Ke,Mi).call(this),this.updateResult(),o&&(T(this,Be)!==s||On(this.options.enabled,T(this,Be))!==On(l.enabled,T(this,Be))||wr(this.options.staleTime,T(this,Be))!==wr(l.staleTime,T(this,Be)))&&Ae(this,Ke,lh).call(this);const d=Ae(this,Ke,sh).call(this);o&&(T(this,Be)!==s||On(this.options.enabled,T(this,Be))!==On(l.enabled,T(this,Be))||d!==T(this,br))&&Ae(this,Ke,ih).call(this,d)}getOptimisticResult(a){const l=T(this,sn).getQueryCache().build(T(this,sn),a),s=this.createResult(l,a);return jN(this,s)&&(re(this,Pt,s),re(this,ps,this.options),re(this,ll,T(this,Be).state)),s}getCurrentResult(){return T(this,Pt)}trackResult(a,l){return new Proxy(a,{get:(s,o)=>(this.trackProp(o),l==null||l(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&T(this,wa).status==="pending"&&T(this,wa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,o))})}trackProp(a){T(this,ys).add(a)}getCurrentQuery(){return T(this,Be)}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const l=T(this,sn).defaultQueryOptions(a),s=T(this,sn).getQueryCache().build(T(this,sn),l);return s.fetch().then(()=>this.createResult(s,l))}fetch(a){return Ae(this,Ke,Mi).call(this,{...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Pt)))}createResult(a,l){var ee;const s=T(this,Be),o=this.options,d=T(this,Pt),h=T(this,ll),m=T(this,ps),p=a!==s?a.state:T(this,Vi),{state:x}=a;let b={...x},j=!1,w;if(l._optimisticResults){const be=this.hasListeners(),_e=!be&&wy(a,l),Ue=be&&_y(a,s,l,o);(_e||Ue)&&(b={...b,...tx(x.data,a.options)}),l._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:C,errorUpdatedAt:N,status:_}=b;w=b.data;let R=!1;if(l.placeholderData!==void 0&&w===void 0&&_==="pending"){let be;d!=null&&d.isPlaceholderData&&l.placeholderData===(m==null?void 0:m.placeholderData)?(be=d.data,R=!0):be=typeof l.placeholderData=="function"?l.placeholderData((ee=T(this,vs))==null?void 0:ee.state.data,T(this,vs)):l.placeholderData,be!==void 0&&(_="success",w=nh(d==null?void 0:d.data,be,l),j=!0)}if(l.select&&w!==void 0&&!R)if(d&&w===(h==null?void 0:h.data)&&l.select===T(this,Yi))w=T(this,gs);else try{re(this,Yi,l.select),w=l.select(w),w=nh(d==null?void 0:d.data,w,l),re(this,gs,w),re(this,yr,null)}catch(be){re(this,yr,be)}T(this,yr)&&(C=T(this,yr),w=T(this,gs),N=Date.now(),_="error");const Q=b.fetchStatus==="fetching",q=_==="pending",B=_==="error",F=q&&Q,J=w!==void 0,k={status:_,fetchStatus:b.fetchStatus,isPending:q,isSuccess:_==="success",isError:B,isInitialLoading:F,isLoading:F,data:w,dataUpdatedAt:b.dataUpdatedAt,error:C,errorUpdatedAt:N,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:a.isFetched(),isFetchedAfterMount:b.dataUpdateCount>p.dataUpdateCount||b.errorUpdateCount>p.errorUpdateCount,isFetching:Q,isRefetching:Q&&!q,isLoadingError:B&&!J,isPaused:b.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:B&&J,isStale:Rh(a,l),refetch:this.refetch,promise:T(this,wa),isEnabled:On(l.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const be=k.data!==void 0,_e=k.status==="error"&&!be,Ue=xe=>{_e?xe.reject(k.error):be&&xe.resolve(k.data)},jt=()=>{const xe=re(this,wa,k.promise=ah());Ue(xe)},Ge=T(this,wa);switch(Ge.status){case"pending":a.queryHash===s.queryHash&&Ue(Ge);break;case"fulfilled":(_e||k.data!==Ge.value)&&jt();break;case"rejected":(!_e||k.error!==Ge.reason)&&jt();break}}return k}updateResult(){const a=T(this,Pt),l=this.createResult(T(this,Be),this.options);if(re(this,ll,T(this,Be).state),re(this,ps,this.options),T(this,ll).data!==void 0&&re(this,vs,T(this,Be)),qu(l,a))return;re(this,Pt,l);const s=()=>{if(!a)return!0;const{notifyOnChangeProps:o}=this.options,d=typeof o=="function"?o():o;if(d==="all"||!d&&!T(this,ys).size)return!0;const h=new Set(d??T(this,ys));return this.options.throwOnError&&h.add("error"),Object.keys(T(this,Pt)).some(m=>{const g=m;return T(this,Pt)[g]!==a[g]&&h.has(g)})};Ae(this,Ke,nx).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ae(this,Ke,oh).call(this)}},sn=new WeakMap,Be=new WeakMap,Vi=new WeakMap,Pt=new WeakMap,ll=new WeakMap,ps=new WeakMap,wa=new WeakMap,yr=new WeakMap,Yi=new WeakMap,gs=new WeakMap,vs=new WeakMap,sl=new WeakMap,il=new WeakMap,br=new WeakMap,ys=new WeakMap,Ke=new WeakSet,Mi=function(a){Ae(this,Ke,dh).call(this);let l=T(this,Be).fetch(this.options,a);return a!=null&&a.throwOnError||(l=l.catch(Ft)),l},lh=function(){Ae(this,Ke,uh).call(this);const a=wr(this.options.staleTime,T(this,Be));if(Ui.isServer()||T(this,Pt).isStale||!eh(a))return;const s=Kb(T(this,Pt).dataUpdatedAt,a)+1;re(this,sl,Wr.setTimeout(()=>{T(this,Pt).isStale||this.updateResult()},s))},sh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Be)):this.options.refetchInterval)??!1},ih=function(a){Ae(this,Ke,ch).call(this),re(this,br,a),!(Ui.isServer()||On(this.options.enabled,T(this,Be))===!1||!eh(T(this,br))||T(this,br)===0)&&re(this,il,Wr.setInterval(()=>{(this.options.refetchIntervalInBackground||Ah.isFocused())&&Ae(this,Ke,Mi).call(this)},T(this,br)))},oh=function(){Ae(this,Ke,lh).call(this),Ae(this,Ke,ih).call(this,Ae(this,Ke,sh).call(this))},uh=function(){T(this,sl)&&(Wr.clearTimeout(T(this,sl)),re(this,sl,void 0))},ch=function(){T(this,il)&&(Wr.clearInterval(T(this,il)),re(this,il,void 0))},dh=function(){const a=T(this,sn).getQueryCache().build(T(this,sn),this.options);if(a===T(this,Be))return;const l=T(this,Be);re(this,Be,a),re(this,Vi,a.state),this.hasListeners()&&(l==null||l.removeObserver(this),a.addObserver(this))},nx=function(a){zt.batch(()=>{a.listeners&&this.listeners.forEach(l=>{l(T(this,Pt))}),T(this,sn).getQueryCache().notify({query:T(this,Be),type:"observerResultsUpdated"})})},Bb);function SN(t,a){return On(a.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&a.retryOnMount===!1)}function wy(t,a){return SN(t,a)||t.state.data!==void 0&&fh(t,a,a.refetchOnMount)}function fh(t,a,l){if(On(a.enabled,t)!==!1&&wr(a.staleTime,t)!=="static"){const s=typeof l=="function"?l(t):l;return s==="always"||s!==!1&&Rh(t,a)}return!1}function _y(t,a,l,s){return(t!==a||On(s.enabled,t)===!1)&&(!l.suspense||t.state.status!=="error")&&Rh(t,l)}function Rh(t,a){return On(a.enabled,t)!==!1&&t.isStaleByTime(wr(a.staleTime,t))}function jN(t,a){return!qu(t.getCurrentResult(),a)}function Ey(t){return{onFetch:(a,l)=>{var x,b,j,w,C;const s=a.options,o=(j=(b=(x=a.fetchOptions)==null?void 0:x.meta)==null?void 0:b.fetchMore)==null?void 0:j.direction,d=((w=a.state.data)==null?void 0:w.pages)||[],h=((C=a.state.data)==null?void 0:C.pageParams)||[];let m={pages:[],pageParams:[]},g=0;const p=async()=>{let N=!1;const _=q=>{mN(q,()=>a.signal,()=>N=!0)},R=Fb(a.options,a.fetchOptions),Q=async(q,B,F)=>{if(N)return Promise.reject();if(B==null&&q.pages.length)return Promise.resolve(q);const K=(()=>{const _e={client:a.client,queryKey:a.queryKey,pageParam:B,direction:F?"backward":"forward",meta:a.options.meta};return _(_e),_e})(),k=await R(K),{maxPages:ee}=a.options,be=F?hN:fN;return{pages:be(q.pages,k,ee),pageParams:be(q.pageParams,B,ee)}};if(o&&d.length){const q=o==="backward",B=q?NN:Cy,F={pages:d,pageParams:h},J=B(s,F);m=await Q(F,J,q)}else{const q=t??d.length;do{const B=g===0?h[0]??s.initialPageParam:Cy(s,m);if(g>0&&B==null)break;m=await Q(m,B),g++}while(g<q)}return m};a.options.persister?a.fetchFn=()=>{var N,_;return(_=(N=a.options).persister)==null?void 0:_.call(N,p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},l)}:a.fetchFn=p}}}function Cy(t,{pages:a,pageParams:l}){const s=a.length-1;return a.length>0?t.getNextPageParam(a[s],a,l[s],l):void 0}function NN(t,{pages:a,pageParams:l}){var s;return a.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,a[0],a,l[0],l):void 0}var Ki,Pn,It,ol,Fn,fr,$b,wN=($b=class extends Wb{constructor(a){super();pe(this,Fn);pe(this,Ki);pe(this,Pn);pe(this,It);pe(this,ol);re(this,Ki,a.client),this.mutationId=a.mutationId,re(this,It,a.mutationCache),re(this,Pn,[]),this.state=a.state||ax(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){T(this,Pn).includes(a)||(T(this,Pn).push(a),this.clearGcTimeout(),T(this,It).notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){re(this,Pn,T(this,Pn).filter(l=>l!==a)),this.scheduleGc(),T(this,It).notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){T(this,Pn).length||(this.state.status==="pending"?this.scheduleGc():T(this,It).remove(this))}continue(){var a;return((a=T(this,ol))==null?void 0:a.continue())??this.execute(this.state.variables)}async execute(a){var h,m,g,p,x,b,j,w,C,N,_,R,Q,q,B,F,J,K;const l=()=>{Ae(this,Fn,fr).call(this,{type:"continue"})},s={client:T(this,Ki),meta:this.options.meta,mutationKey:this.options.mutationKey};re(this,ol,Jb({fn:()=>this.options.mutationFn?this.options.mutationFn(a,s):Promise.reject(new Error("No mutationFn found")),onFail:(k,ee)=>{Ae(this,Fn,fr).call(this,{type:"failed",failureCount:k,error:ee})},onPause:()=>{Ae(this,Fn,fr).call(this,{type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,It).canRun(this)}));const o=this.state.status==="pending",d=!T(this,ol).canStart();try{if(o)l();else{Ae(this,Fn,fr).call(this,{type:"pending",variables:a,isPaused:d}),T(this,It).config.onMutate&&await T(this,It).config.onMutate(a,this,s);const ee=await((m=(h=this.options).onMutate)==null?void 0:m.call(h,a,s));ee!==this.state.context&&Ae(this,Fn,fr).call(this,{type:"pending",context:ee,variables:a,isPaused:d})}const k=await T(this,ol).start();return await((p=(g=T(this,It).config).onSuccess)==null?void 0:p.call(g,k,a,this.state.context,this,s)),await((b=(x=this.options).onSuccess)==null?void 0:b.call(x,k,a,this.state.context,s)),await((w=(j=T(this,It).config).onSettled)==null?void 0:w.call(j,k,null,this.state.variables,this.state.context,this,s)),await((N=(C=this.options).onSettled)==null?void 0:N.call(C,k,null,a,this.state.context,s)),Ae(this,Fn,fr).call(this,{type:"success",data:k}),k}catch(k){try{await((R=(_=T(this,It).config).onError)==null?void 0:R.call(_,k,a,this.state.context,this,s))}catch(ee){Promise.reject(ee)}try{await((q=(Q=this.options).onError)==null?void 0:q.call(Q,k,a,this.state.context,s))}catch(ee){Promise.reject(ee)}try{await((F=(B=T(this,It).config).onSettled)==null?void 0:F.call(B,void 0,k,this.state.variables,this.state.context,this,s))}catch(ee){Promise.reject(ee)}try{await((K=(J=this.options).onSettled)==null?void 0:K.call(J,void 0,k,a,this.state.context,s))}catch(ee){Promise.reject(ee)}throw Ae(this,Fn,fr).call(this,{type:"error",error:k}),k}finally{T(this,It).runNext(this)}}},Ki=new WeakMap,Pn=new WeakMap,It=new WeakMap,ol=new WeakMap,Fn=new WeakSet,fr=function(a){const l=s=>{switch(a.type){case"failed":return{...s,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:a.error,failureCount:s.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=l(this.state),zt.batch(()=>{T(this,Pn).forEach(s=>{s.onMutationUpdate(a)}),T(this,It).notify({mutation:this,type:"updated",action:a})})},$b);function ax(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _a,Hn,Pi,Hb,_N=(Hb=class extends Cs{constructor(a={}){super();pe(this,_a);pe(this,Hn);pe(this,Pi);this.config=a,re(this,_a,new Set),re(this,Hn,new Map),re(this,Pi,0)}build(a,l,s){const o=new wN({client:a,mutationCache:this,mutationId:++xu(this,Pi)._,options:a.defaultMutationOptions(l),state:s});return this.add(o),o}add(a){T(this,_a).add(a);const l=Su(a);if(typeof l=="string"){const s=T(this,Hn).get(l);s?s.push(a):T(this,Hn).set(l,[a])}this.notify({type:"added",mutation:a})}remove(a){if(T(this,_a).delete(a)){const l=Su(a);if(typeof l=="string"){const s=T(this,Hn).get(l);if(s)if(s.length>1){const o=s.indexOf(a);o!==-1&&s.splice(o,1)}else s[0]===a&&T(this,Hn).delete(l)}}this.notify({type:"removed",mutation:a})}canRun(a){const l=Su(a);if(typeof l=="string"){const s=T(this,Hn).get(l),o=s==null?void 0:s.find(d=>d.state.status==="pending");return!o||o===a}else return!0}runNext(a){var s;const l=Su(a);if(typeof l=="string"){const o=(s=T(this,Hn).get(l))==null?void 0:s.find(d=>d!==a&&d.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zt.batch(()=>{T(this,_a).forEach(a=>{this.notify({type:"removed",mutation:a})}),T(this,_a).clear(),T(this,Hn).clear()})}getAll(){return Array.from(T(this,_a))}find(a){const l={exact:!0,...a};return this.getAll().find(s=>by(l,s))}findAll(a={}){return this.getAll().filter(l=>by(a,l))}notify(a){zt.batch(()=>{this.listeners.forEach(l=>{l(a)})})}resumePausedMutations(){const a=this.getAll().filter(l=>l.state.isPaused);return zt.batch(()=>Promise.all(a.map(l=>l.continue().catch(Ft))))}},_a=new WeakMap,Hn=new WeakMap,Pi=new WeakMap,Hb);function Su(t){var a;return(a=t.options.scope)==null?void 0:a.id}var Ea,xr,on,Ca,Ta,ku,hh,Qb,EN=(Qb=class extends Cs{constructor(l,s){super();pe(this,Ta);pe(this,Ea);pe(this,xr);pe(this,on);pe(this,Ca);re(this,Ea,l),this.setOptions(s),this.bindMethods(),Ae(this,Ta,ku).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(l){var o;const s=this.options;this.options=T(this,Ea).defaultMutationOptions(l),qu(this.options,s)||T(this,Ea).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,on),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&ul(s.mutationKey)!==ul(this.options.mutationKey)?this.reset():((o=T(this,on))==null?void 0:o.state.status)==="pending"&&T(this,on).setOptions(this.options)}onUnsubscribe(){var l;this.hasListeners()||(l=T(this,on))==null||l.removeObserver(this)}onMutationUpdate(l){Ae(this,Ta,ku).call(this),Ae(this,Ta,hh).call(this,l)}getCurrentResult(){return T(this,xr)}reset(){var l;(l=T(this,on))==null||l.removeObserver(this),re(this,on,void 0),Ae(this,Ta,ku).call(this),Ae(this,Ta,hh).call(this)}mutate(l,s){var o;return re(this,Ca,s),(o=T(this,on))==null||o.removeObserver(this),re(this,on,T(this,Ea).getMutationCache().build(T(this,Ea),this.options)),T(this,on).addObserver(this),T(this,on).execute(l)}},Ea=new WeakMap,xr=new WeakMap,on=new WeakMap,Ca=new WeakMap,Ta=new WeakSet,ku=function(){var s;const l=((s=T(this,on))==null?void 0:s.state)??ax();re(this,xr,{...l,isPending:l.status==="pending",isSuccess:l.status==="success",isError:l.status==="error",isIdle:l.status==="idle",mutate:this.mutate,reset:this.reset})},hh=function(l){zt.batch(()=>{var s,o,d,h,m,g,p,x;if(T(this,Ca)&&this.hasListeners()){const b=T(this,xr).variables,j=T(this,xr).context,w={client:T(this,Ea),meta:this.options.meta,mutationKey:this.options.mutationKey};if((l==null?void 0:l.type)==="success"){try{(o=(s=T(this,Ca)).onSuccess)==null||o.call(s,l.data,b,j,w)}catch(C){Promise.reject(C)}try{(h=(d=T(this,Ca)).onSettled)==null||h.call(d,l.data,null,b,j,w)}catch(C){Promise.reject(C)}}else if((l==null?void 0:l.type)==="error"){try{(g=(m=T(this,Ca)).onError)==null||g.call(m,l.error,b,j,w)}catch(C){Promise.reject(C)}try{(x=(p=T(this,Ca)).onSettled)==null||x.call(p,void 0,l.error,b,j,w)}catch(C){Promise.reject(C)}}}this.listeners.forEach(b=>{b(T(this,xr))})})},Qb),Xn,Gb,CN=(Gb=class extends Cs{constructor(a={}){super();pe(this,Xn);this.config=a,re(this,Xn,new Map)}build(a,l,s){const o=l.queryKey,d=l.queryHash??Th(o,l);let h=this.get(d);return h||(h=new bN({client:a,queryKey:o,queryHash:d,options:a.defaultQueryOptions(l),state:s,defaultOptions:a.getQueryDefaults(o)}),this.add(h)),h}add(a){T(this,Xn).has(a.queryHash)||(T(this,Xn).set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const l=T(this,Xn).get(a.queryHash);l&&(a.destroy(),l===a&&T(this,Xn).delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){zt.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return T(this,Xn).get(a)}getAll(){return[...T(this,Xn).values()]}find(a){const l={exact:!0,...a};return this.getAll().find(s=>yy(l,s))}findAll(a={}){const l=this.getAll();return Object.keys(a).length>0?l.filter(s=>yy(a,s)):l}notify(a){zt.batch(()=>{this.listeners.forEach(l=>{l(a)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},Xn=new WeakMap,Gb),bt,Sr,jr,bs,xs,Nr,Ss,js,Ib,AN=(Ib=class{constructor(t={}){pe(this,bt);pe(this,Sr);pe(this,jr);pe(this,bs);pe(this,xs);pe(this,Nr);pe(this,Ss);pe(this,js);re(this,bt,t.queryCache||new CN),re(this,Sr,t.mutationCache||new _N),re(this,jr,t.defaultOptions||{}),re(this,bs,new Map),re(this,xs,new Map),re(this,Nr,0)}mount(){xu(this,Nr)._++,T(this,Nr)===1&&(re(this,Ss,Ah.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,bt).onFocus())})),re(this,js,Bu.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,bt).onOnline())})))}unmount(){var t,a;xu(this,Nr)._--,T(this,Nr)===0&&((t=T(this,Ss))==null||t.call(this),re(this,Ss,void 0),(a=T(this,js))==null||a.call(this),re(this,js,void 0))}isFetching(t){return T(this,bt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return T(this,Sr).findAll({...t,status:"pending"}).length}getQueryData(t){var l;const a=this.defaultQueryOptions({queryKey:t});return(l=T(this,bt).get(a.queryHash))==null?void 0:l.state.data}ensureQueryData(t){const a=this.defaultQueryOptions(t),l=T(this,bt).build(this,a),s=l.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&l.isStaleByTime(wr(a.staleTime,l))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(t){return T(this,bt).findAll(t).map(({queryKey:a,state:l})=>{const s=l.data;return[a,s]})}setQueryData(t,a,l){const s=this.defaultQueryOptions({queryKey:t}),o=T(this,bt).get(s.queryHash),d=o==null?void 0:o.state.data,h=uN(a,d);if(h!==void 0)return T(this,bt).build(this,s).setData(h,{...l,manual:!0})}setQueriesData(t,a,l){return zt.batch(()=>T(this,bt).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,a,l)]))}getQueryState(t){var l;const a=this.defaultQueryOptions({queryKey:t});return(l=T(this,bt).get(a.queryHash))==null?void 0:l.state}removeQueries(t){const a=T(this,bt);zt.batch(()=>{a.findAll(t).forEach(l=>{a.remove(l)})})}resetQueries(t,a){const l=T(this,bt);return zt.batch(()=>(l.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},a)))}cancelQueries(t,a={}){const l={revert:!0,...a},s=zt.batch(()=>T(this,bt).findAll(t).map(o=>o.cancel(l)));return Promise.all(s).then(Ft).catch(Ft)}invalidateQueries(t,a={}){return zt.batch(()=>(T(this,bt).findAll(t).forEach(l=>{l.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},a)))}refetchQueries(t,a={}){const l={...a,cancelRefetch:a.cancelRefetch??!0},s=zt.batch(()=>T(this,bt).findAll(t).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let d=o.fetch(void 0,l);return l.throwOnError||(d=d.catch(Ft)),o.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(s).then(Ft)}fetchQuery(t){const a=this.defaultQueryOptions(t);a.retry===void 0&&(a.retry=!1);const l=T(this,bt).build(this,a);return l.isStaleByTime(wr(a.staleTime,l))?l.fetch(a):Promise.resolve(l.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ft).catch(Ft)}fetchInfiniteQuery(t){return t.behavior=Ey(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ft).catch(Ft)}ensureInfiniteQueryData(t){return t.behavior=Ey(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Bu.isOnline()?T(this,Sr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,bt)}getMutationCache(){return T(this,Sr)}getDefaultOptions(){return T(this,jr)}setDefaultOptions(t){re(this,jr,t)}setQueryDefaults(t,a){T(this,bs).set(ul(t),{queryKey:t,defaultOptions:a})}getQueryDefaults(t){const a=[...T(this,bs).values()],l={};return a.forEach(s=>{Di(t,s.queryKey)&&Object.assign(l,s.defaultOptions)}),l}setMutationDefaults(t,a){T(this,xs).set(ul(t),{mutationKey:t,defaultOptions:a})}getMutationDefaults(t){const a=[...T(this,xs).values()],l={};return a.forEach(s=>{Di(t,s.mutationKey)&&Object.assign(l,s.defaultOptions)}),l}defaultQueryOptions(t){if(t._defaulted)return t;const a={...T(this,jr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return a.queryHash||(a.queryHash=Th(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===zh&&(a.enabled=!1),a}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...T(this,jr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){T(this,bt).clear(),T(this,Sr).clear()}},bt=new WeakMap,Sr=new WeakMap,jr=new WeakMap,bs=new WeakMap,xs=new WeakMap,Nr=new WeakMap,Ss=new WeakMap,js=new WeakMap,Ib),rx=y.createContext(void 0),Mn=t=>{const a=y.useContext(rx);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},TN=({client:t,children:a})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),u.jsx(rx.Provider,{value:t,children:a})),lx=y.createContext(!1),zN=()=>y.useContext(lx);lx.Provider;function ON(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var RN=y.createContext(ON()),MN=()=>y.useContext(RN),kN=(t,a,l)=>{const s=l!=null&&l.state.error&&typeof t.throwOnError=="function"?Oh(t.throwOnError,[l.state.error,l]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(a.isReset()||(t.retryOnMount=!1))},DN=t=>{y.useEffect(()=>{t.clearReset()},[t])},UN=({result:t,errorResetBoundary:a,throwOnError:l,query:s,suspense:o})=>t.isError&&!a.isReset()&&!t.isFetching&&s&&(o&&t.data===void 0||Oh(l,[t.error,s])),LN=t=>{if(t.suspense){const l=o=>o==="static"?o:Math.max(o??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...o)=>l(s(...o)):l(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ZN=(t,a)=>t.isLoading&&t.isFetching&&!a,qN=(t,a)=>(t==null?void 0:t.suspense)&&a.isPending,Ay=(t,a,l)=>a.fetchOptimistic(t).catch(()=>{l.clearReset()});function BN(t,a,l){var j,w,C,N;const s=zN(),o=MN(),d=Mn(),h=d.defaultQueryOptions(t);(w=(j=d.getDefaultOptions().queries)==null?void 0:j._experimental_beforeQuery)==null||w.call(j,h);const m=d.getQueryCache().get(h.queryHash);h._optimisticResults=s?"isRestoring":"optimistic",LN(h),kN(h,o,m),DN(o);const g=!d.getQueryCache().get(h.queryHash),[p]=y.useState(()=>new a(d,h)),x=p.getOptimisticResult(h),b=!s&&t.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(_=>{const R=b?p.subscribe(zt.batchCalls(_)):Ft;return p.updateResult(),R},[p,b]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setOptions(h)},[h,p]),qN(h,x))throw Ay(h,p,o);if(UN({result:x,errorResetBoundary:o,throwOnError:h.throwOnError,query:m,suspense:h.suspense}))throw x.error;if((N=(C=d.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||N.call(C,h,x),h.experimental_prefetchInRender&&!Ui.isServer()&&ZN(x,s)){const _=g?Ay(h,p,o):m==null?void 0:m.promise;_==null||_.catch(Ft).finally(()=>{p.updateResult()})}return h.notifyOnChangeProps?x:p.trackResult(x)}function De(t,a){return BN(t,xN)}function st(t,a){const l=Mn(),[s]=y.useState(()=>new EN(l,t));y.useEffect(()=>{s.setOptions(t)},[s,t]);const o=y.useSyncExternalStore(y.useCallback(h=>s.subscribe(zt.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),d=y.useCallback((h,m)=>{s.mutate(h,m).catch(Ft)},[s]);if(o.error&&Oh(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:d,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 Ty="popstate";function zy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function $N(t={}){function a(s,o){var p;let d=(p=o.state)==null?void 0:p.masked,{pathname:h,search:m,hash:g}=d||s.location;return mh("",{pathname:h,search:m,hash:g},o.state&&o.state.usr||null,o.state&&o.state.key||"default",d?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function l(s,o){return typeof o=="string"?o:Li(o)}return QN(a,l,null,t)}function ct(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Rn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function HN(){return Math.random().toString(36).substring(2,10)}function Oy(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function mh(t,a,l=null,s,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?As(a):a,state:l,key:a&&a.key||s||HN(),unstable_mask:o}}function Li({pathname:t="/",search:a="",hash:l=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(t+=l.charAt(0)==="#"?l:"#"+l),t}function As(t){let a={};if(t){let l=t.indexOf("#");l>=0&&(a.hash=t.substring(l),t=t.substring(0,l));let s=t.indexOf("?");s>=0&&(a.search=t.substring(s),t=t.substring(0,s)),t&&(a.pathname=t)}return a}function QN(t,a,l,s={}){let{window:o=document.defaultView,v5Compat:d=!1}=s,h=o.history,m="POP",g=null,p=x();p==null&&(p=0,h.replaceState({...h.state,idx:p},""));function x(){return(h.state||{idx:null}).idx}function b(){m="POP";let _=x(),R=_==null?null:_-p;p=_,g&&g({action:m,location:N.location,delta:R})}function j(_,R){m="PUSH";let Q=zy(_)?_:mh(N.location,_,R);p=x()+1;let q=Oy(Q,p),B=N.createHref(Q.unstable_mask||Q);try{h.pushState(q,"",B)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;o.location.assign(B)}d&&g&&g({action:m,location:N.location,delta:1})}function w(_,R){m="REPLACE";let Q=zy(_)?_:mh(N.location,_,R);p=x();let q=Oy(Q,p),B=N.createHref(Q.unstable_mask||Q);h.replaceState(q,"",B),d&&g&&g({action:m,location:N.location,delta:0})}function C(_){return GN(_)}let N={get action(){return m},get location(){return t(o,h)},listen(_){if(g)throw new Error("A history only accepts one active listener");return o.addEventListener(Ty,b),g=_,()=>{o.removeEventListener(Ty,b),g=null}},createHref(_){return a(o,_)},createURL:C,encodeLocation(_){let R=C(_);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:j,replace:w,go(_){return h.go(_)}};return N}function GN(t,a=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),ct(l,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:Li(t);return s=s.replace(/ $/,"%20"),!a&&s.startsWith("//")&&(s=l+s),new URL(s,l)}function sx(t,a,l="/"){return IN(t,a,l,!1)}function IN(t,a,l,s){let o=typeof a=="string"?As(a):a,d=za(o.pathname||"/",l);if(d==null)return null;let h=ix(t);VN(h);let m=null;for(let g=0;m==null&&g<h.length;++g){let p=aw(d);m=tw(h[g],p,s)}return m}function ix(t,a=[],l=[],s="",o=!1){let d=(h,m,g=o,p)=>{let x={relativePath:p===void 0?h.path||"":p,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&g)return;ct(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let b=Wn([s,x.relativePath]),j=l.concat(x);h.children&&h.children.length>0&&(ct(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ix(h.children,a,j,b,g)),!(h.path==null&&!h.index)&&a.push({path:b,score:WN(b,h.index),routesMeta:j})};return t.forEach((h,m)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,m);else for(let p of ox(h.path))d(h,m,!0,p)}),a}function ox(t){let a=t.split("/");if(a.length===0)return[];let[l,...s]=a,o=l.endsWith("?"),d=l.replace(/\?$/,"");if(s.length===0)return o?[d,""]:[d];let h=ox(s.join("/")),m=[];return m.push(...h.map(g=>g===""?d:[d,g].join("/"))),o&&m.push(...h),m.map(g=>t.startsWith("/")&&g===""?"/":g)}function VN(t){t.sort((a,l)=>a.score!==l.score?l.score-a.score:ew(a.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var YN=/^:[\w-]+$/,KN=3,PN=2,FN=1,XN=10,JN=-2,Ry=t=>t==="*";function WN(t,a){let l=t.split("/"),s=l.length;return l.some(Ry)&&(s+=JN),a&&(s+=PN),l.filter(o=>!Ry(o)).reduce((o,d)=>o+(YN.test(d)?KN:d===""?FN:XN),s)}function ew(t,a){return t.length===a.length&&t.slice(0,-1).every((s,o)=>s===a[o])?t[t.length-1]-a[a.length-1]:0}function tw(t,a,l=!1){let{routesMeta:s}=t,o={},d="/",h=[];for(let m=0;m<s.length;++m){let g=s[m],p=m===s.length-1,x=d==="/"?a:a.slice(d.length)||"/",b=$u({path:g.relativePath,caseSensitive:g.caseSensitive,end:p},x),j=g.route;if(!b&&p&&l&&!s[s.length-1].route.index&&(b=$u({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(o,b.params),h.push({params:o,pathname:Wn([d,b.pathname]),pathnameBase:iw(Wn([d,b.pathnameBase])),route:j}),b.pathnameBase!=="/"&&(d=Wn([d,b.pathnameBase]))}return h}function $u(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,s]=nw(t.path,t.caseSensitive,t.end),o=a.match(l);if(!o)return null;let d=o[0],h=d.replace(/(.)\/+$/,"$1"),m=o.slice(1);return{params:s.reduce((p,{paramName:x,isOptional:b},j)=>{if(x==="*"){let C=m[j]||"";h=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const w=m[j];return b&&!w?p[x]=void 0:p[x]=(w||"").replace(/%2F/g,"/"),p},{}),pathname:d,pathnameBase:h,pattern:t}}function nw(t,a=!1,l=!0){Rn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,g,p,x)=>{if(s.push({paramName:m,isOptional:g!=null}),g){let b=x.charAt(p+h.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),s]}function aw(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Rn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function za(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,s=t.charAt(l);return s&&s!=="/"?null:t.slice(l)||"/"}var rw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function lw(t,a="/"){let{pathname:l,search:s="",hash:o=""}=typeof t=="string"?As(t):t,d;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?d=My(l.substring(1),"/"):d=My(l,a)):d=a,{pathname:d,search:ow(s),hash:uw(o)}}function My(t,a){let l=a.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?l.length>1&&l.pop():o!=="."&&l.push(o)}),l.length>1?l.join("/"):"/"}function kf(t,a,l,s){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function sw(t){return t.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Mh(t){let a=sw(t);return a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase)}function Pu(t,a,l,s=!1){let o;typeof t=="string"?o=As(t):(o={...t},ct(!o.pathname||!o.pathname.includes("?"),kf("?","pathname","search",o)),ct(!o.pathname||!o.pathname.includes("#"),kf("#","pathname","hash",o)),ct(!o.search||!o.search.includes("#"),kf("#","search","hash",o)));let d=t===""||o.pathname==="",h=d?"/":o.pathname,m;if(h==null)m=l;else{let b=a.length-1;if(!s&&h.startsWith("..")){let j=h.split("/");for(;j[0]==="..";)j.shift(),b-=1;o.pathname=j.join("/")}m=b>=0?a[b]:"/"}let g=lw(o,m),p=h&&h!=="/"&&h.endsWith("/"),x=(d||h===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(p||x)&&(g.pathname+="/"),g}var Wn=t=>t.join("/").replace(/\/\/+/g,"/"),iw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),ow=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,uw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,cw=class{constructor(t,a,l,s=!1){this.status=t,this.statusText=a||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function dw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function fw(t){return t.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ux=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function cx(t,a){let l=t;if(typeof l!="string"||!rw.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,o=!1;if(ux)try{let d=new URL(window.location.href),h=l.startsWith("//")?new URL(d.protocol+l):new URL(l),m=za(h.pathname,a);h.origin===d.origin&&m!=null?l=m+h.search+h.hash:o=!0}catch{Rn(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var dx=["POST","PUT","PATCH","DELETE"];new Set(dx);var hw=["GET",...dx];new Set(hw);var Ts=y.createContext(null);Ts.displayName="DataRouter";var Fu=y.createContext(null);Fu.displayName="DataRouterState";var mw=y.createContext(!1),fx=y.createContext({isTransitioning:!1});fx.displayName="ViewTransition";var pw=y.createContext(new Map);pw.displayName="Fetchers";var gw=y.createContext(null);gw.displayName="Await";var bn=y.createContext(null);bn.displayName="Navigation";var Fi=y.createContext(null);Fi.displayName="Location";var kn=y.createContext({outlet:null,matches:[],isDataRoute:!1});kn.displayName="Route";var kh=y.createContext(null);kh.displayName="RouteError";var hx="REACT_ROUTER_ERROR",vw="REDIRECT",yw="ROUTE_ERROR_RESPONSE";function bw(t){if(t.startsWith(`${hx}:${vw}:{`))try{let a=JSON.parse(t.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 xw(t){if(t.startsWith(`${hx}:${yw}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new cw(a.status,a.statusText,a.data)}catch{}}function Sw(t,{relative:a}={}){ct(zs(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=y.useContext(bn),{hash:o,pathname:d,search:h}=Xi(t,{relative:a}),m=d;return l!=="/"&&(m=d==="/"?l:Wn([l,d])),s.createHref({pathname:m,search:h,hash:o})}function zs(){return y.useContext(Fi)!=null}function Dn(){return ct(zs(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Fi).location}var mx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function px(t){y.useContext(bn).static||y.useLayoutEffect(t)}function Ar(){let{isDataRoute:t}=y.useContext(kn);return t?Lw():jw()}function jw(){ct(zs(),"useNavigate() may be used only in the context of a <Router> component.");let t=y.useContext(Ts),{basename:a,navigator:l}=y.useContext(bn),{matches:s}=y.useContext(kn),{pathname:o}=Dn(),d=JSON.stringify(Mh(s)),h=y.useRef(!1);return px(()=>{h.current=!0}),y.useCallback((g,p={})=>{if(Rn(h.current,mx),!h.current)return;if(typeof g=="number"){l.go(g);return}let x=Pu(g,JSON.parse(d),o,p.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Wn([a,x.pathname])),(p.replace?l.replace:l.push)(x,p.state,p)},[a,l,d,o,t])}var Nw=y.createContext(null);function ww(t){let a=y.useContext(kn).outlet;return y.useMemo(()=>a&&y.createElement(Nw.Provider,{value:t},a),[a,t])}function _w(){let{matches:t}=y.useContext(kn),a=t[t.length-1];return a?a.params:{}}function Xi(t,{relative:a}={}){let{matches:l}=y.useContext(kn),{pathname:s}=Dn(),o=JSON.stringify(Mh(l));return y.useMemo(()=>Pu(t,JSON.parse(o),s,a==="path"),[t,o,s,a])}function Ew(t,a){return gx(t,a)}function gx(t,a,l){var _;ct(zs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=y.useContext(bn),{matches:o}=y.useContext(kn),d=o[o.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",p=d&&d.route;{let R=p&&p.path||"";yx(m,!p||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${R}">) 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="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=Dn(),b;if(a){let R=typeof a=="string"?As(a):a;ct(g==="/"||((_=R.pathname)==null?void 0:_.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 "${R.pathname}" was given in the \`location\` prop.`),b=R}else b=x;let j=b.pathname||"/",w=j;if(g!=="/"){let R=g.replace(/^\//,"").split("/");w="/"+j.replace(/^\//,"").split("/").slice(R.length).join("/")}let C=sx(t,{pathname:w});Rn(p||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Rn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=Ow(C&&C.map(R=>Object.assign({},R,{params:Object.assign({},h,R.params),pathname:Wn([g,s.encodeLocation?s.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Wn([g,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,l);return a&&N?y.createElement(Fi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},N):N}function Cw(){let t=Uw(),a=dw(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),l=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},d={padding:"2px 4px",backgroundColor:s},h=null;return console.error("Error handled by React Router default ErrorBoundary:",t),h=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},a),l?y.createElement("pre",{style:o},l):null,h)}var Aw=y.createElement(Cw,null),vx=class extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const l=xw(t.digest);l&&(t=l)}let a=t!==void 0?y.createElement(kn.Provider,{value:this.props.routeContext},y.createElement(kh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?y.createElement(Tw,{error:t},a):a}};vx.contextType=mw;var Df=new WeakMap;function Tw({children:t,error:a}){let{basename:l}=y.useContext(bn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=bw(a.digest);if(s){let o=Df.get(a);if(o)throw o;let d=cx(s.location,l);if(ux&&!Df.get(a))if(d.isExternal||s.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:s.replace}));throw Df.set(a,h),h}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return t}function zw({routeContext:t,match:a,children:l}){let s=y.useContext(Ts);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),y.createElement(kn.Provider,{value:t},l)}function Ow(t,a=[],l){let s=l==null?void 0:l.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(a.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let o=t,d=s==null?void 0:s.errors;if(d!=null){let x=o.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);ct(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let h=!1,m=-1;if(l&&s){h=s.renderFallback;for(let x=0;x<o.length;x++){let b=o[x];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=x),b.route.id){let{loaderData:j,errors:w}=s,C=b.route.loader&&!j.hasOwnProperty(b.route.id)&&(!w||w[b.route.id]===void 0);if(b.route.lazy||C){l.isStatic&&(h=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let g=l==null?void 0:l.onError,p=s&&g?(x,b)=>{var j,w;g(x,{location:s.location,params:((w=(j=s.matches)==null?void 0:j[0])==null?void 0:w.params)??{},unstable_pattern:fw(s.matches),errorInfo:b})}:void 0;return o.reduceRight((x,b,j)=>{let w,C=!1,N=null,_=null;s&&(w=d&&b.route.id?d[b.route.id]:void 0,N=b.route.errorElement||Aw,h&&(m<0&&j===0?(yx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,_=null):m===j&&(C=!0,_=b.route.hydrateFallbackElement||null)));let R=a.concat(o.slice(0,j+1)),Q=()=>{let q;return w?q=N:C?q=_:b.route.Component?q=y.createElement(b.route.Component,null):b.route.element?q=b.route.element:q=x,y.createElement(zw,{match:b,routeContext:{outlet:x,matches:R,isDataRoute:s!=null},children:q})};return s&&(b.route.ErrorBoundary||b.route.errorElement||j===0)?y.createElement(vx,{location:s.location,revalidation:s.revalidation,component:N,error:w,children:Q(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:p}):Q()},null)}function Dh(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rw(t){let a=y.useContext(Ts);return ct(a,Dh(t)),a}function Mw(t){let a=y.useContext(Fu);return ct(a,Dh(t)),a}function kw(t){let a=y.useContext(kn);return ct(a,Dh(t)),a}function Uh(t){let a=kw(t),l=a.matches[a.matches.length-1];return ct(l.route.id,`${t} can only be used on routes that contain a unique "id"`),l.route.id}function Dw(){return Uh("useRouteId")}function Uw(){var s;let t=y.useContext(kh),a=Mw("useRouteError"),l=Uh("useRouteError");return t!==void 0?t:(s=a.errors)==null?void 0:s[l]}function Lw(){let{router:t}=Rw("useNavigate"),a=Uh("useNavigate"),l=y.useRef(!1);return px(()=>{l.current=!0}),y.useCallback(async(o,d={})=>{Rn(l.current,mx),l.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:a,...d}))},[t,a])}var ky={};function yx(t,a,l){!a&&!ky[t]&&(ky[t]=!0,Rn(!1,l))}y.memo(Zw);function Zw({routes:t,future:a,state:l,isStatic:s,onError:o}){return gx(t,void 0,{state:l,isStatic:s,onError:o})}function bx({to:t,replace:a,state:l,relative:s}){ct(zs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=y.useContext(bn);Rn(!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:d}=y.useContext(kn),{pathname:h}=Dn(),m=Ar(),g=Pu(t,Mh(d),h,s==="path"),p=JSON.stringify(g);return y.useEffect(()=>{m(JSON.parse(p),{replace:a,state:l,relative:s})},[m,p,s,a,l]),null}function ph(t){return ww(t.context)}function hr(t){ct(!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 qw({basename:t="/",children:a=null,location:l,navigationType:s="POP",navigator:o,static:d=!1,unstable_useTransitions:h}){ct(!zs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),g=y.useMemo(()=>({basename:m,navigator:o,static:d,unstable_useTransitions:h,future:{}}),[m,o,d,h]);typeof l=="string"&&(l=As(l));let{pathname:p="/",search:x="",hash:b="",state:j=null,key:w="default",unstable_mask:C}=l,N=y.useMemo(()=>{let _=za(p,m);return _==null?null:{location:{pathname:_,search:x,hash:b,state:j,key:w,unstable_mask:C},navigationType:s}},[m,p,x,b,j,w,s,C]);return Rn(N!=null,`<Router basename="${m}"> is not able to match the URL "${p}${x}${b}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:y.createElement(bn.Provider,{value:g},y.createElement(Fi.Provider,{children:a,value:N}))}function Bw({children:t,location:a}){return Ew(gh(t),a)}function gh(t,a=[]){let l=[];return y.Children.forEach(t,(s,o)=>{if(!y.isValidElement(s))return;let d=[...a,o];if(s.type===y.Fragment){l.push.apply(l,gh(s.props.children,d));return}ct(s.type===hr,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ct(!s.props.index||!s.props.children,"An index route cannot have child routes.");let h={id:s.props.id||d.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(h.children=gh(s.props.children,d)),l.push(h)}),l}var Du="get",Uu="application/x-www-form-urlencoded";function Xu(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function $w(t){return Xu(t)&&t.tagName.toLowerCase()==="button"}function Hw(t){return Xu(t)&&t.tagName.toLowerCase()==="form"}function Qw(t){return Xu(t)&&t.tagName.toLowerCase()==="input"}function Gw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Iw(t,a){return t.button===0&&(!a||a==="_self")&&!Gw(t)}function vh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,l)=>{let s=t[l];return a.concat(Array.isArray(s)?s.map(o=>[l,o]):[[l,s]])},[]))}function Vw(t,a){let l=vh(t);return a&&a.forEach((s,o)=>{l.has(o)||a.getAll(o).forEach(d=>{l.append(o,d)})}),l}var ju=null;function Yw(){if(ju===null)try{new FormData(document.createElement("form"),0),ju=!1}catch{ju=!0}return ju}var Kw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Uf(t){return t!=null&&!Kw.has(t)?(Rn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Uu}"`),null):t}function Pw(t,a){let l,s,o,d,h;if(Hw(t)){let m=t.getAttribute("action");s=m?za(m,a):null,l=t.getAttribute("method")||Du,o=Uf(t.getAttribute("enctype"))||Uu,d=new FormData(t)}else if($w(t)||Qw(t)&&(t.type==="submit"||t.type==="image")){let m=t.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=t.getAttribute("formaction")||m.getAttribute("action");if(s=g?za(g,a):null,l=t.getAttribute("formmethod")||m.getAttribute("method")||Du,o=Uf(t.getAttribute("formenctype"))||Uf(m.getAttribute("enctype"))||Uu,d=new FormData(m,t),!Yw()){let{name:p,type:x,value:b}=t;if(x==="image"){let j=p?`${p}.`:"";d.append(`${j}x`,"0"),d.append(`${j}y`,"0")}else p&&d.append(p,b)}}else{if(Xu(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Du,s=null,o=Uu,h=t}return d&&o==="text/plain"&&(h=d,d=void 0),{action:s,method:l.toLowerCase(),encType:o,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Lh(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Fw(t,a,l,s){let o=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return l?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:a&&za(o.pathname,a)==="/"?o.pathname=`${a.replace(/\/$/,"")}/_root.${s}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${s}`,o}async function Xw(t,a){if(t.id in a)return a[t.id];try{let l=await import(t.module);return a[t.id]=l,l}catch(l){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Jw(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Ww(t,a,l){let s=await Promise.all(t.map(async o=>{let d=a.routes[o.route.id];if(d){let h=await Xw(d,l);return h.links?h.links():[]}return[]}));return a_(s.flat(1).filter(Jw).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Dy(t,a,l,s,o,d){let h=(g,p)=>l[p]?g.route.id!==l[p].route.id:!0,m=(g,p)=>{var x;return l[p].pathname!==g.pathname||((x=l[p].route.path)==null?void 0:x.endsWith("*"))&&l[p].params["*"]!==g.params["*"]};return d==="assets"?a.filter((g,p)=>h(g,p)||m(g,p)):d==="data"?a.filter((g,p)=>{var b;let x=s.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(h(g,p)||m(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:((b=l[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function e_(t,a,{includeHydrateFallback:l}={}){return t_(t.map(s=>{let o=a.routes[s.route.id];if(!o)return[];let d=[o.module];return o.clientActionModule&&(d=d.concat(o.clientActionModule)),o.clientLoaderModule&&(d=d.concat(o.clientLoaderModule)),l&&o.hydrateFallbackModule&&(d=d.concat(o.hydrateFallbackModule)),o.imports&&(d=d.concat(o.imports)),d}).flat(1))}function t_(t){return[...new Set(t)]}function n_(t){let a={},l=Object.keys(t).sort();for(let s of l)a[s]=t[s];return a}function a_(t,a){let l=new Set;return new Set(a),t.reduce((s,o)=>{let d=JSON.stringify(n_(o));return l.has(d)||(l.add(d),s.push({key:d,link:o})),s},[])}function xx(){let t=y.useContext(Ts);return Lh(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function r_(){let t=y.useContext(Fu);return Lh(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Zh=y.createContext(void 0);Zh.displayName="FrameworkContext";function Sx(){let t=y.useContext(Zh);return Lh(t,"You must render this element inside a <HydratedRouter> element"),t}function l_(t,a){let l=y.useContext(Zh),[s,o]=y.useState(!1),[d,h]=y.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:p,onMouseLeave:x,onTouchStart:b}=a,j=y.useRef(null);y.useEffect(()=>{if(t==="render"&&h(!0),t==="viewport"){let N=R=>{R.forEach(Q=>{h(Q.isIntersecting)})},_=new IntersectionObserver(N,{threshold:.5});return j.current&&_.observe(j.current),()=>{_.disconnect()}}},[t]),y.useEffect(()=>{if(s){let N=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(N)}}},[s]);let w=()=>{o(!0)},C=()=>{o(!1),h(!1)};return l?t!=="intent"?[d,j,{}]:[d,j,{onFocus:zi(m,w),onBlur:zi(g,C),onMouseEnter:zi(p,w),onMouseLeave:zi(x,C),onTouchStart:zi(b,w)}]:[!1,j,{}]}function zi(t,a){return l=>{t&&t(l),l.defaultPrevented||a(l)}}function s_({page:t,...a}){let{router:l}=xx(),s=y.useMemo(()=>sx(l.routes,t,l.basename),[l.routes,t,l.basename]);return s?y.createElement(o_,{page:t,matches:s,...a}):null}function i_(t){let{manifest:a,routeModules:l}=Sx(),[s,o]=y.useState([]);return y.useEffect(()=>{let d=!1;return Ww(t,a,l).then(h=>{d||o(h)}),()=>{d=!0}},[t,a,l]),s}function o_({page:t,matches:a,...l}){let s=Dn(),{future:o,manifest:d,routeModules:h}=Sx(),{basename:m}=xx(),{loaderData:g,matches:p}=r_(),x=y.useMemo(()=>Dy(t,a,p,d,s,"data"),[t,a,p,d,s]),b=y.useMemo(()=>Dy(t,a,p,d,s,"assets"),[t,a,p,d,s]),j=y.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let N=new Set,_=!1;if(a.forEach(Q=>{var B;let q=d.routes[Q.route.id];!q||!q.hasLoader||(!x.some(F=>F.route.id===Q.route.id)&&Q.route.id in g&&((B=h[Q.route.id])!=null&&B.shouldRevalidate)||q.hasClientLoader?_=!0:N.add(Q.route.id))}),N.size===0)return[];let R=Fw(t,m,o.unstable_trailingSlashAwareDataRequests,"data");return _&&N.size>0&&R.searchParams.set("_routes",a.filter(Q=>N.has(Q.route.id)).map(Q=>Q.route.id).join(",")),[R.pathname+R.search]},[m,o.unstable_trailingSlashAwareDataRequests,g,s,d,x,a,t,h]),w=y.useMemo(()=>e_(b,d),[b,d]),C=i_(b);return y.createElement(y.Fragment,null,j.map(N=>y.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...l})),w.map(N=>y.createElement("link",{key:N,rel:"modulepreload",href:N,...l})),C.map(({key:N,link:_})=>y.createElement("link",{key:N,nonce:l.nonce,..._,crossOrigin:_.crossOrigin??l.crossOrigin})))}function u_(...t){return a=>{t.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.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 d_({basename:t,children:a,unstable_useTransitions:l,window:s}){let o=y.useRef();o.current==null&&(o.current=$N({window:s,v5Compat:!0}));let d=o.current,[h,m]=y.useState({action:d.action,location:d.location}),g=y.useCallback(p=>{l===!1?m(p):y.startTransition(()=>m(p))},[l]);return y.useLayoutEffect(()=>d.listen(g),[d,g]),y.createElement(qw,{basename:t,children:a,location:h.location,navigationType:h.action,navigator:d,unstable_useTransitions:l})}var jx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Nx=y.forwardRef(function({onClick:a,discover:l="render",prefetch:s="none",relative:o,reloadDocument:d,replace:h,unstable_mask:m,state:g,target:p,to:x,preventScrollReset:b,viewTransition:j,unstable_defaultShouldRevalidate:w,...C},N){let{basename:_,navigator:R,unstable_useTransitions:Q}=y.useContext(bn),q=typeof x=="string"&&jx.test(x),B=cx(x,_);x=B.to;let F=Sw(x,{relative:o}),J=Dn(),K=null;if(m){let xe=Pu(m,[],J.unstable_mask?J.unstable_mask.pathname:"/",!0);_!=="/"&&(xe.pathname=xe.pathname==="/"?_:Wn([_,xe.pathname])),K=R.createHref(xe)}let[k,ee,be]=l_(s,C),_e=m_(x,{replace:h,unstable_mask:m,state:g,target:p,preventScrollReset:b,relative:o,viewTransition:j,unstable_defaultShouldRevalidate:w,unstable_useTransitions:Q});function Ue(xe){a&&a(xe),xe.defaultPrevented||_e(xe)}let jt=!(B.isExternal||d),Ge=y.createElement("a",{...C,...be,href:(jt?K:void 0)||B.absoluteURL||F,onClick:jt?Ue:a,ref:u_(N,ee),target:p,"data-discover":!q&&l==="render"?"true":void 0});return k&&!q?y.createElement(y.Fragment,null,Ge,y.createElement(s_,{page:F})):Ge});Nx.displayName="Link";var wx=y.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:s="",end:o=!1,style:d,to:h,viewTransition:m,children:g,...p},x){let b=Xi(h,{relative:p.relative}),j=Dn(),w=y.useContext(Fu),{navigator:C,basename:N}=y.useContext(bn),_=w!=null&&b_(b)&&m===!0,R=C.encodeLocation?C.encodeLocation(b).pathname:b.pathname,Q=j.pathname,q=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(Q=Q.toLowerCase(),q=q?q.toLowerCase():null,R=R.toLowerCase()),q&&N&&(q=za(q,N)||q);const B=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let F=Q===R||!o&&Q.startsWith(R)&&Q.charAt(B)==="/",J=q!=null&&(q===R||!o&&q.startsWith(R)&&q.charAt(R.length)==="/"),K={isActive:F,isPending:J,isTransitioning:_},k=F?a:void 0,ee;typeof s=="function"?ee=s(K):ee=[s,F?"active":null,J?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let be=typeof d=="function"?d(K):d;return y.createElement(Nx,{...p,"aria-current":k,className:ee,ref:x,style:be,to:h,viewTransition:m},typeof g=="function"?g(K):g)});wx.displayName="NavLink";var f_=y.forwardRef(({discover:t="render",fetcherKey:a,navigate:l,reloadDocument:s,replace:o,state:d,method:h=Du,action:m,onSubmit:g,relative:p,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:j,...w},C)=>{let{unstable_useTransitions:N}=y.useContext(bn),_=v_(),R=y_(m,{relative:p}),Q=h.toLowerCase()==="get"?"get":"post",q=typeof m=="string"&&jx.test(m),B=F=>{if(g&&g(F),F.defaultPrevented)return;F.preventDefault();let J=F.nativeEvent.submitter,K=(J==null?void 0:J.getAttribute("formmethod"))||h,k=()=>_(J||F.currentTarget,{fetcherKey:a,method:K,navigate:l,replace:o,state:d,relative:p,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:j});N&&l!==!1?y.startTransition(()=>k()):k()};return y.createElement("form",{ref:C,method:Q,action:R,onSubmit:s?g:B,...w,"data-discover":!q&&t==="render"?"true":void 0})});f_.displayName="Form";function h_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _x(t){let a=y.useContext(Ts);return ct(a,h_(t)),a}function m_(t,{target:a,replace:l,unstable_mask:s,state:o,preventScrollReset:d,relative:h,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:p}={}){let x=Ar(),b=Dn(),j=Xi(t,{relative:h});return y.useCallback(w=>{if(Iw(w,a)){w.preventDefault();let C=l!==void 0?l:Li(b)===Li(j),N=()=>x(t,{replace:C,unstable_mask:s,state:o,preventScrollReset:d,relative:h,viewTransition:m,unstable_defaultShouldRevalidate:g});p?y.startTransition(()=>N()):N()}},[b,x,j,l,s,o,a,t,d,h,m,g,p])}function Ex(t){Rn(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=y.useRef(vh(t)),l=y.useRef(!1),s=Dn(),o=y.useMemo(()=>Vw(s.search,l.current?null:a.current),[s.search]),d=Ar(),h=y.useCallback((m,g)=>{const p=vh(typeof m=="function"?m(new URLSearchParams(o)):m);l.current=!0,d("?"+p,g)},[d,o]);return[o,h]}var p_=0,g_=()=>`__${String(++p_)}__`;function v_(){let{router:t}=_x("useSubmit"),{basename:a}=y.useContext(bn),l=Dw(),s=t.fetch,o=t.navigate;return y.useCallback(async(d,h={})=>{let{action:m,method:g,encType:p,formData:x,body:b}=Pw(d,a);if(h.navigate===!1){let j=h.fetcherKey||g_();await s(j,l,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:b,formMethod:h.method||g,formEncType:h.encType||p,flushSync:h.flushSync})}else await o(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:b,formMethod:h.method||g,formEncType:h.encType||p,replace:h.replace,state:h.state,fromRouteId:l,flushSync:h.flushSync,viewTransition:h.viewTransition})},[s,o,a,l])}function y_(t,{relative:a}={}){let{basename:l}=y.useContext(bn),s=y.useContext(kn);ct(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),d={...Xi(t||".",{relative:a})},h=Dn();if(t==null){d.search=h.search;let m=new URLSearchParams(d.search),g=m.getAll("index");if(g.some(x=>x==="")){m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let x=m.toString();d.search=x?`?${x}`:""}}return(!t||t===".")&&o.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(d.pathname=d.pathname==="/"?l:Wn([l,d.pathname])),Li(d)}function b_(t,{relative:a}={}){let l=y.useContext(fx);ct(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=_x("useViewTransitionState"),o=Xi(t,{relative:a});if(!l.isTransitioning)return!1;let d=za(l.currentLocation.pathname,s)||l.currentLocation.pathname,h=za(l.nextLocation.pathname,s)||l.nextLocation.pathname;return $u(o.pathname,h)!=null||$u(o.pathname,d)!=null}const x_="/api/v1";async function S_(t,a){const l=await fetch(`${x_}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:a})});if(!l.ok){const s=await l.text();let o;try{o=JSON.parse(s).error??s}catch{o=s}throw new Error(o)}return await l.json()}const Cx="/api/v1",qh="first-tree-hub:tokens";function Bh(){const t=localStorage.getItem(qh);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function Ax(t){localStorage.setItem(qh,JSON.stringify(t))}function Tx(){localStorage.removeItem(qh)}class $h extends Error{constructor(a,l){super(l),this.status=a,this.name="ApiError"}}let Oi=null;async function j_(t){return Oi||(Oi=(async()=>{try{const a=await fetch(`${Cx}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!a.ok)return null;const l=await a.json(),s={accessToken:l.accessToken,refreshToken:l.refreshToken??t};return Ax(s),s}catch{return null}finally{Oi=null}})(),Oi)}async function Nu(t,a){const{method:l="GET",body:s}=a??{},o=m=>{const g={};return m&&(g.Authorization=`Bearer ${m}`),s!==void 0&&(g["Content-Type"]="application/json"),fetch(`${Cx}${t}`,{method:l,headers:g,body:s!==void 0?JSON.stringify(s):void 0})},d=Bh();let h=await o(d==null?void 0:d.accessToken);if(h.status===401&&(d!=null&&d.refreshToken)){const m=await j_(d.refreshToken);m&&(h=await o(m.accessToken))}if(!h.ok){h.status===401&&(Tx(),window.dispatchEvent(new CustomEvent("auth:logout")));const m=await h.text();let g;try{g=JSON.parse(m).error??m}catch{g=m}throw new $h(h.status,g)}if(h.status!==204)return await h.json()}const we={get:t=>Nu(t),post:(t,a)=>Nu(t,{method:"POST",body:a}),patch:(t,a)=>Nu(t,{method:"PATCH",body:a}),delete:t=>Nu(t,{method:"DELETE"})},zx=y.createContext(null);function N_({children:t}){const[a,l]=y.useState(()=>!!Bh()),[s,o]=y.useState(null),[d,h]=y.useState(null),[m,g]=y.useState(null),p=y.useCallback(()=>{Tx(),l(!1),o(null),h(null),g(null)},[]),x=y.useCallback(async()=>{try{const j=await we.get("/me");o(j.member.role),h(j.member.id),g(j.member.agentId)}catch{}},[]),b=y.useCallback(async(j,w)=>{const C=await S_(j,w);Ax({accessToken:C.accessToken,refreshToken:C.refreshToken}),l(!0),await we.get("/me").then(N=>{o(N.member.role),h(N.member.id),g(N.member.agentId)}).catch(()=>{})},[]);return y.useEffect(()=>{a&&!s&&x()},[a,s,x]),y.useEffect(()=>{const j=()=>p();return window.addEventListener("auth:logout",j),()=>window.removeEventListener("auth:logout",j)},[p]),u.jsx(zx.Provider,{value:{isAuthenticated:a,role:s,memberId:d,agentId:m,login:b,logout:p},children:t})}function Os(){const t=y.useContext(zx);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function w_(){const{isAuthenticated:t}=Os();return t?u.jsx(ph,{}):u.jsx(bx,{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 Ox=(...t)=>t.filter((a,l,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===l).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 __=t=>t.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 E_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,s)=>s?s.toUpperCase():l.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 Uy=t=>{const a=E_(t);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 C_={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 A_=t=>{for(const a in t)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 T_=y.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:s,className:o="",children:d,iconNode:h,...m},g)=>y.createElement("svg",{ref:g,...C_,width:a,height:a,stroke:t,strokeWidth:s?Number(l)*24/Number(a):l,className:Ox("lucide",o),...!d&&!A_(m)&&{"aria-hidden":"true"},...m},[...h.map(([p,x])=>y.createElement(p,x)),...Array.isArray(d)?d:[d]]));/**
|
|
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 ot=(t,a)=>{const l=y.forwardRef(({className:s,...o},d)=>y.createElement(T_,{ref:d,iconNode:a,className:Ox(`lucide-${__(Uy(t))}`,`lucide-${t}`,s),...o}));return l.displayName=Uy(t),l};/**
|
|
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 z_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Rx=ot("arrow-left",z_);/**
|
|
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 O_=[["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"}]],R_=ot("bell",O_);/**
|
|
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 M_=[["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"}]],k_=ot("bot",M_);/**
|
|
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 D_=[["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"}]],U_=ot("cable",D_);/**
|
|
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 L_=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mx=ot("check",L_);/**
|
|
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 Z_=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],q_=ot("chevron-down",Z_);/**
|
|
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 B_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kx=ot("chevron-right",B_);/**
|
|
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 $_=[["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"}]],Hh=ot("copy",$_);/**
|
|
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 H_=[["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"}]],Dx=ot("ellipsis",H_);/**
|
|
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 Q_=[["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"}]],G_=ot("link-2",Q_);/**
|
|
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 I_=[["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"}]],V_=ot("lock",I_);/**
|
|
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 Y_=[["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"}]],K_=ot("log-out",Y_);/**
|
|
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 P_=[["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"}]],F_=ot("message-square",P_);/**
|
|
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 X_=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],J_=ot("panel-right-close",X_);/**
|
|
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 W_=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],eE=ot("panel-right-open",W_);/**
|
|
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 tE=[["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"}]],Ux=ot("pencil",tE);/**
|
|
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 nE=[["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"}]],aE=ot("play",nE);/**
|
|
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 rE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],hl=ot("plus",rE);/**
|
|
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 lE=[["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"}]],sE=ot("send",lE);/**
|
|
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 iE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ly=ot("terminal",iE);/**
|
|
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 oE=[["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"}]],Zi=ot("trash-2",oE);/**
|
|
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 uE=[["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"}]],Lx=ot("triangle-alert",uE);/**
|
|
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 cE=[["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"}]],dE=ot("undo-2",cE);/**
|
|
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 fE=[["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"}]],hE=ot("unplug",fE);/**
|
|
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 mE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pE=ot("x",mE);function Zx(t){var a,l,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(a=0;a<o;a++)t[a]&&(l=Zx(t[a]))&&(s&&(s+=" "),s+=l)}else for(l in t)t[l]&&(s&&(s+=" "),s+=l);return s}function qx(){for(var t,a,l=0,s="",o=arguments.length;l<o;l++)(t=arguments[l])&&(a=Zx(t))&&(s&&(s+=" "),s+=a);return s}const gE=(t,a)=>{const l=new Array(t.length+a.length);for(let s=0;s<t.length;s++)l[s]=t[s];for(let s=0;s<a.length;s++)l[t.length+s]=a[s];return l},vE=(t,a)=>({classGroupId:t,validator:a}),Bx=(t=new Map,a=null,l)=>({nextPart:t,validators:a,classGroupId:l}),Hu="-",Zy=[],yE="arbitrary..",bE=t=>{const a=SE(t),{conflictingClassGroups:l,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return xE(h);const m=h.split(Hu),g=m[0]===""&&m.length>1?1:0;return $x(m,g,a)},getConflictingClassGroupIds:(h,m)=>{if(m){const g=s[h],p=l[h];return g?p?gE(p,g):g:p||Zy}return l[h]||Zy}}},$x=(t,a,l)=>{if(t.length-a===0)return l.classGroupId;const o=t[a],d=l.nextPart.get(o);if(d){const p=$x(t,a+1,d);if(p)return p}const h=l.validators;if(h===null)return;const m=a===0?t.join(Hu):t.slice(a).join(Hu),g=h.length;for(let p=0;p<g;p++){const x=h[p];if(x.validator(m))return x.classGroupId}},xE=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=t.slice(1,-1),l=a.indexOf(":"),s=a.slice(0,l);return s?yE+s:void 0})(),SE=t=>{const{theme:a,classGroups:l}=t;return jE(l,a)},jE=(t,a)=>{const l=Bx();for(const s in t){const o=t[s];Qh(o,l,s,a)}return l},Qh=(t,a,l,s)=>{const o=t.length;for(let d=0;d<o;d++){const h=t[d];NE(h,a,l,s)}},NE=(t,a,l,s)=>{if(typeof t=="string"){wE(t,a,l);return}if(typeof t=="function"){_E(t,a,l,s);return}EE(t,a,l,s)},wE=(t,a,l)=>{const s=t===""?a:Hx(a,t);s.classGroupId=l},_E=(t,a,l,s)=>{if(CE(t)){Qh(t(s),a,l,s);return}a.validators===null&&(a.validators=[]),a.validators.push(vE(l,t))},EE=(t,a,l,s)=>{const o=Object.entries(t),d=o.length;for(let h=0;h<d;h++){const[m,g]=o[h];Qh(g,Hx(a,m),l,s)}},Hx=(t,a)=>{let l=t;const s=a.split(Hu),o=s.length;for(let d=0;d<o;d++){const h=s[d];let m=l.nextPart.get(h);m||(m=Bx(),l.nextPart.set(h,m)),l=m}return l},CE=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,AE=t=>{if(t<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),s=Object.create(null);const o=(d,h)=>{l[d]=h,a++,a>t&&(a=0,s=l,l=Object.create(null))};return{get(d){let h=l[d];if(h!==void 0)return h;if((h=s[d])!==void 0)return o(d,h),h},set(d,h){d in l?l[d]=h:o(d,h)}}},yh="!",qy=":",TE=[],By=(t,a,l,s,o)=>({modifiers:t,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:s,isExternal:o}),zE=t=>{const{prefix:a,experimentalParseClassName:l}=t;let s=o=>{const d=[];let h=0,m=0,g=0,p;const x=o.length;for(let N=0;N<x;N++){const _=o[N];if(h===0&&m===0){if(_===qy){d.push(o.slice(g,N)),g=N+1;continue}if(_==="/"){p=N;continue}}_==="["?h++:_==="]"?h--:_==="("?m++:_===")"&&m--}const b=d.length===0?o:o.slice(g);let j=b,w=!1;b.endsWith(yh)?(j=b.slice(0,-1),w=!0):b.startsWith(yh)&&(j=b.slice(1),w=!0);const C=p&&p>g?p-g:void 0;return By(d,w,j,C)};if(a){const o=a+qy,d=s;s=h=>h.startsWith(o)?d(h.slice(o.length)):By(TE,!1,h,void 0,!0)}if(l){const o=s;s=d=>l({className:d,parseClassName:o})}return s},OE=t=>{const a=new Map;return t.orderSensitiveModifiers.forEach((l,s)=>{a.set(l,1e6+s)}),l=>{const s=[];let o=[];for(let d=0;d<l.length;d++){const h=l[d],m=h[0]==="[",g=a.has(h);m||g?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(h)):o.push(h)}return o.length>0&&(o.sort(),s.push(...o)),s}},RE=t=>({cache:AE(t.cacheSize),parseClassName:zE(t),sortModifiers:OE(t),...bE(t)}),ME=/\s+/,kE=(t,a)=>{const{parseClassName:l,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:d}=a,h=[],m=t.trim().split(ME);let g="";for(let p=m.length-1;p>=0;p-=1){const x=m[p],{isExternal:b,modifiers:j,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:N}=l(x);if(b){g=x+(g.length>0?" "+g:g);continue}let _=!!N,R=s(_?C.substring(0,N):C);if(!R){if(!_){g=x+(g.length>0?" "+g:g);continue}if(R=s(C),!R){g=x+(g.length>0?" "+g:g);continue}_=!1}const Q=j.length===0?"":j.length===1?j[0]:d(j).join(":"),q=w?Q+yh:Q,B=q+R;if(h.indexOf(B)>-1)continue;h.push(B);const F=o(R,_);for(let J=0;J<F.length;++J){const K=F[J];h.push(q+K)}g=x+(g.length>0?" "+g:g)}return g},DE=(...t)=>{let a=0,l,s,o="";for(;a<t.length;)(l=t[a++])&&(s=Qx(l))&&(o&&(o+=" "),o+=s);return o},Qx=t=>{if(typeof t=="string")return t;let a,l="";for(let s=0;s<t.length;s++)t[s]&&(a=Qx(t[s]))&&(l&&(l+=" "),l+=a);return l},UE=(t,...a)=>{let l,s,o,d;const h=g=>{const p=a.reduce((x,b)=>b(x),t());return l=RE(p),s=l.cache.get,o=l.cache.set,d=m,m(g)},m=g=>{const p=s(g);if(p)return p;const x=kE(g,l);return o(g,x),x};return d=h,(...g)=>d(DE(...g))},LE=[],Tt=t=>{const a=l=>l[t]||LE;return a.isThemeGetter=!0,a},Gx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ix=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ZE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BE=/\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$/,$E=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=t=>ZE.test(t),Te=t=>!!t&&!Number.isNaN(Number(t)),dr=t=>!!t&&Number.isInteger(Number(t)),Lf=t=>t.endsWith("%")&&Te(t.slice(0,-1)),ja=t=>qE.test(t),Vx=()=>!0,GE=t=>BE.test(t)&&!$E.test(t),Gh=()=>!1,IE=t=>HE.test(t),VE=t=>QE.test(t),YE=t=>!ie(t)&&!oe(t),KE=t=>Tr(t,Px,Gh),ie=t=>Gx.test(t),Xr=t=>Tr(t,Fx,GE),$y=t=>Tr(t,n2,Te),PE=t=>Tr(t,Jx,Vx),FE=t=>Tr(t,Xx,Gh),Hy=t=>Tr(t,Yx,Gh),XE=t=>Tr(t,Kx,VE),wu=t=>Tr(t,Wx,IE),oe=t=>Ix.test(t),Ri=t=>ml(t,Fx),JE=t=>ml(t,Xx),Qy=t=>ml(t,Yx),WE=t=>ml(t,Px),e2=t=>ml(t,Kx),_u=t=>ml(t,Wx,!0),t2=t=>ml(t,Jx,!0),Tr=(t,a,l)=>{const s=Gx.exec(t);return s?s[1]?a(s[1]):l(s[2]):!1},ml=(t,a,l=!1)=>{const s=Ix.exec(t);return s?s[1]?a(s[1]):l:!1},Yx=t=>t==="position"||t==="percentage",Kx=t=>t==="image"||t==="url",Px=t=>t==="length"||t==="size"||t==="bg-size",Fx=t=>t==="length",n2=t=>t==="number",Xx=t=>t==="family-name",Jx=t=>t==="number"||t==="weight",Wx=t=>t==="shadow",a2=()=>{const t=Tt("color"),a=Tt("font"),l=Tt("text"),s=Tt("font-weight"),o=Tt("tracking"),d=Tt("leading"),h=Tt("breakpoint"),m=Tt("container"),g=Tt("spacing"),p=Tt("radius"),x=Tt("shadow"),b=Tt("inset-shadow"),j=Tt("text-shadow"),w=Tt("drop-shadow"),C=Tt("blur"),N=Tt("perspective"),_=Tt("aspect"),R=Tt("ease"),Q=Tt("animate"),q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...B(),oe,ie],J=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],k=()=>[oe,ie,g],ee=()=>[cr,"full","auto",...k()],be=()=>[dr,"none","subgrid",oe,ie],_e=()=>["auto",{span:["full",dr,oe,ie]},dr,oe,ie],Ue=()=>[dr,"auto",oe,ie],jt=()=>["auto","min","max","fr",oe,ie],Ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],xe=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...k()],D=()=>[cr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],ae=()=>[cr,"screen","full","dvw","lvw","svw","min","max","fit",...k()],ze=()=>[cr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],W=()=>[t,oe,ie],O=()=>[...B(),Qy,Hy,{position:[oe,ie]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",WE,KE,{size:[oe,ie]}],le=()=>[Lf,Ri,Xr],ue=()=>["","none","full",p,oe,ie],me=()=>["",Te,Ri,Xr],Oe=()=>["solid","dashed","dotted","double"],pt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Te,Lf,Qy,Hy],gt=()=>["","none",C,oe,ie],Dt=()=>["none",Te,oe,ie],Ln=()=>["none",Te,oe,ie],La=()=>[Te,oe,ie],Xt=()=>[cr,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ja],breakpoint:[ja],color:[Vx],container:[ja],"drop-shadow":[ja],ease:["in","out","in-out"],font:[YE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ja],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ja],shadow:[ja],spacing:["px",Te],text:[ja],"text-shadow":[ja],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cr,ie,oe,_]}],container:["container"],columns:[{columns:[Te,ie,oe,m]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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:F()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[dr,"auto",oe,ie]}],basis:[{basis:[cr,"full","auto",m,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,cr,"auto","initial","none",ie]}],grow:[{grow:["",Te,oe,ie]}],shrink:[{shrink:["",Te,oe,ie]}],order:[{order:[dr,"first","last","none",oe,ie]}],"grid-cols":[{"grid-cols":be()}],"col-start-end":[{col:_e()}],"col-start":[{"col-start":Ue()}],"col-end":[{"col-end":Ue()}],"grid-rows":[{"grid-rows":be()}],"row-start-end":[{row:_e()}],"row-start":[{"row-start":Ue()}],"row-end":[{"row-end":Ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":jt()}],"auto-rows":[{"auto-rows":jt()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...Ge(),"normal"]}],"justify-items":[{"justify-items":[...xe(),"normal"]}],"justify-self":[{"justify-self":["auto",...xe()]}],"align-content":[{content:["normal",...Ge()]}],"align-items":[{items:[...xe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...xe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ge()}],"place-items":[{"place-items":[...xe(),"baseline"]}],"place-self":[{"place-self":["auto",...xe()]}],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:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...ze()]}],"min-block-size":[{"min-block":["auto",...ze()]}],"max-block-size":[{"max-block":["none",...ze()]}],w:[{w:[m,"screen",...D()]}],"min-w":[{"min-w":[m,"screen","none",...D()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[h]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",l,Ri,Xr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,t2,PE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lf,ie]}],"font-family":[{font:[JE,FE,a]}],"font-features":[{"font-features":[ie]}],"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,oe,ie]}],"line-clamp":[{"line-clamp":[Te,"none",oe,$y]}],leading:[{leading:[d,...k()]}],"list-image":[{"list-image":["none",oe,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",oe,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",oe,Xr]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Te,"auto",oe,ie]}],"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",oe,ie]}],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",oe,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dr,oe,ie],radial:["",oe,ie],conic:[dr,oe,ie]},e2,XE]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Oe(),"hidden","none"]}],"divide-style":[{divide:[...Oe(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,oe,ie]}],"outline-w":[{outline:["",Te,Ri,Xr]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",x,_u,wu]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",b,_u,wu]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Te,Xr]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",j,_u,wu]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Te,oe,ie]}],"mix-blend":[{"mix-blend":[...pt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pt()}],"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":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[oe,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"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":B()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",oe,ie]}],filter:[{filter:["","none",oe,ie]}],blur:[{blur:gt()}],brightness:[{brightness:[Te,oe,ie]}],contrast:[{contrast:[Te,oe,ie]}],"drop-shadow":[{"drop-shadow":["","none",w,_u,wu]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Te,oe,ie]}],"hue-rotate":[{"hue-rotate":[Te,oe,ie]}],invert:[{invert:["",Te,oe,ie]}],saturate:[{saturate:[Te,oe,ie]}],sepia:[{sepia:["",Te,oe,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",oe,ie]}],"backdrop-blur":[{"backdrop-blur":gt()}],"backdrop-brightness":[{"backdrop-brightness":[Te,oe,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Te,oe,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,oe,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,oe,ie]}],"backdrop-invert":[{"backdrop-invert":["",Te,oe,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Te,oe,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Te,oe,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,oe,ie]}],"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",oe,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",oe,ie]}],ease:[{ease:["linear","initial",R,oe,ie]}],delay:[{delay:[Te,oe,ie]}],animate:[{animate:["none",Q,oe,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,oe,ie]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:Dt()}],"rotate-x":[{"rotate-x":Dt()}],"rotate-y":[{"rotate-y":Dt()}],"rotate-z":[{"rotate-z":Dt()}],scale:[{scale:Ln()}],"scale-x":[{"scale-x":Ln()}],"scale-y":[{"scale-y":Ln()}],"scale-z":[{"scale-z":Ln()}],"scale-3d":["scale-3d"],skew:[{skew:La()}],"skew-x":[{"skew-x":La()}],"skew-y":[{"skew-y":La()}],transform:[{transform:[oe,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xt()}],"translate-x":[{"translate-x":Xt()}],"translate-y":[{"translate-y":Xt()}],"translate-z":[{"translate-z":Xt()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"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",oe,ie]}],"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",oe,ie]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Te,Ri,Xr,$y]}],stroke:[{stroke:["none",...W()]}],"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"]}},r2=UE(a2);function je(...t){return r2(qx(t))}function un(t){return t?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"—"}function qi(t){const a=new URLSearchParams;t!=null&&t.limit&&a.set("limit",String(t.limit)),t!=null&&t.cursor&&a.set("cursor",t.cursor),t!=null&&t.severity&&a.set("severity",t.severity),(t==null?void 0:t.read)!==void 0&&a.set("read",String(t.read)),t!=null&&t.agentId&&a.set("agentId",t.agentId);const l=a.toString();return we.get(`/admin/notifications${l?`?${l}`:""}`)}function e0(t){return we.post(`/admin/notifications/${t}/read`)}function l2(){return we.post("/admin/notifications/read-all")}function Ju(t){const a=new URLSearchParams;t!=null&&t.limit&&a.set("limit",String(t.limit)),t!=null&&t.cursor&&a.set("cursor",t.cursor),t!=null&&t.type&&a.set("type",t.type);const l=a.toString();return we.get(`/admin/agents${l?`?${l}`:""}`)}function s2(t){return we.get(`/admin/agents/${encodeURIComponent(t)}`)}function i2(t){return we.post("/admin/agents",t)}function o2(t,a){return we.patch(`/admin/agents/${encodeURIComponent(t)}`,a)}function u2(t){return we.delete(`/admin/agents/${encodeURIComponent(t)}`)}function c2(t){return we.post(`/admin/agents/${encodeURIComponent(t)}/suspend`,{})}function d2(t){return we.post(`/admin/agents/${encodeURIComponent(t)}/reactivate`,{})}function f2(t){return we.post(`/admin/agents/${encodeURIComponent(t)}/test`,{})}function Qn(){const{data:t}=De({queryKey:["agents","name-map"],queryFn:()=>Ju({limit:100}),staleTime:3e4});return y.useMemo(()=>{const a=new Map;if(t!=null&&t.items)for(const l of t.items)a.set(l.uuid,l.name??l.displayName??l.uuid);return l=>l?a.get(l)??l:"—"},[t])}function h2(t){switch(t){case"high":return"bg-red-500";case"medium":return"bg-yellow-500";default:return"bg-gray-400"}}function m2(t){const a=Date.now()-new Date(t).getTime(),l=Math.floor(a/6e4);if(l<1)return"just now";if(l<60)return`${l}m`;const s=Math.floor(l/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`}function p2(){var b;const[t,a]=y.useState(!1),l=y.useRef(null),s=Ar(),o=Qn(),{data:d}=De({queryKey:["notifications","bell"],queryFn:()=>qi({limit:5}),refetchInterval:1e4}),{data:h}=De({queryKey:["notifications","unread-count"],queryFn:()=>qi({read:!1,limit:100}),refetchInterval:1e4}),m=((b=h==null?void 0:h.items)==null?void 0:b.length)??0,g=m>0,p=y.useCallback(async j=>{j.read||e0(j.id).catch(()=>{}),a(!1),j.agentId&&j.chatId?s(`/?a=${j.agentId}&c=${j.chatId}`):j.agentId&&s(`/?a=${j.agentId}`)},[s]),x=y.useCallback(()=>{l2().catch(()=>{})},[]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>a(!t),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(R_,{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:m>99?"99+":m})]}),t&&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:l,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:x,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all"})]}),u.jsx("div",{className:"max-h-80 overflow-y-auto",children:!(d!=null&&d.items)||d.items.length===0?u.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No notifications"}):d.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",h2(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):""," ",m2(j.createdAt)]})]})]},j.id))})]})]})]})}const Gy=[{to:"/",label:"Workspace",end:!0},{to:"/agents",label:"Agents",end:!1}],g2={to:"/admin",label:"Admin",end:!1};function v2(){const{role:t,logout:a}=Os(),s=t==="admin"?[...Gy,g2]:Gy,o=Dn(),d=o.pathname==="/"||o.search.includes("a=");return u.jsxs("div",{className:"flex flex-col h-screen bg-background",children:[u.jsxs("header",{className:"relative h-12 shrink-0 border-b border-border bg-card flex items-center px-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(k_,{className:"h-5 w-5 text-primary"}),u.jsx("span",{className:"font-semibold text-sm tracking-tight",children:"First Tree"})]}),u.jsx("nav",{className:"absolute inset-x-0 flex items-center justify-center gap-1 pointer-events-none",children:s.map(h=>u.jsx(wx,{to:h.to,end:h.end,className:({isActive:m})=>je("pointer-events-auto px-3 py-1.5 rounded-md text-sm font-medium transition-colors",m?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:h.label},h.to))}),u.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[u.jsx(p2,{}),u.jsx("button",{type:"button",onClick:a,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:u.jsx(K_,{className:"h-4 w-4"})})]})]}),d?u.jsx(ph,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 max-w-5xl mx-auto",children:u.jsx(ph,{})})})]})}function t0(){return we.get("/admin/adapter-mappings")}function y2(t){return we.post("/admin/adapter-mappings",t)}function b2(t){return we.delete(`/admin/adapter-mappings/${t}`)}function n0(){return we.get("/admin/adapters/status")}function a0(){return we.get("/admin/adapters")}function x2(t){return we.post("/admin/adapters",t)}function S2(t,a){return we.patch(`/admin/adapters/${t}`,a)}function j2(t){return we.delete(`/admin/adapters/${t}`)}const Iy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Vy=qx,r0=(t,a)=>l=>{var s;if((a==null?void 0:a.variants)==null)return Vy(t,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:o,defaultVariants:d}=a,h=Object.keys(o).map(p=>{const x=l==null?void 0:l[p],b=d==null?void 0:d[p];if(x===null)return null;const j=Iy(x)||Iy(b);return o[p][j]}),m=l&&Object.entries(l).reduce((p,x)=>{let[b,j]=x;return j===void 0||(p[b]=j),p},{}),g=a==null||(s=a.compoundVariants)===null||s===void 0?void 0:s.reduce((p,x)=>{let{class:b,className:j,...w}=x;return Object.entries(w).every(C=>{let[N,_]=C;return Array.isArray(_)?_.includes({...d,...m}[N]):{...d,...m}[N]===_})?[...p,b,j]:p},[]);return Vy(t,h,g,l==null?void 0:l.class,l==null?void 0:l.className)},N2=r0("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 $t({className:t,variant:a,...l}){return u.jsx("div",{className:je(N2({variant:a}),t),...l})}const cl=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{ref:l,className:je("rounded-xl border bg-card text-card-foreground shadow-sm",t),...a}));cl.displayName="Card";const Ns=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{ref:l,className:je("flex flex-col space-y-1.5 p-6",t),...a}));Ns.displayName="CardHeader";const ws=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{ref:l,className:je("font-semibold leading-none tracking-tight",t),...a}));ws.displayName="CardTitle";const l0=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{ref:l,className:je("text-sm text-muted-foreground",t),...a}));l0.displayName="CardDescription";const dl=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{ref:l,className:je("p-6 pt-0",t),...a}));dl.displayName="CardContent";const w2=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{ref:l,className:je("flex items-center p-6 pt-0",t),...a}));w2.displayName="CardFooter";const Oa=y.forwardRef(({className:t,...a},l)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:l,className:je("w-full caption-bottom text-sm",t),...a})}));Oa.displayName="Table";const Ra=y.forwardRef(({className:t,...a},l)=>u.jsx("thead",{ref:l,className:je("[&_tr]:border-b",t),...a}));Ra.displayName="TableHeader";const Ma=y.forwardRef(({className:t,...a},l)=>u.jsx("tbody",{ref:l,className:je("[&_tr:last-child]:border-0",t),...a}));Ma.displayName="TableBody";const at=y.forwardRef(({className:t,...a},l)=>u.jsx("tr",{ref:l,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a}));at.displayName="TableRow";const ye=y.forwardRef(({className:t,...a},l)=>u.jsx("th",{ref:l,className:je("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...a}));ye.displayName="TableHead";const ve=y.forwardRef(({className:t,...a},l)=>u.jsx("td",{ref:l,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a}));ve.displayName="TableCell";function _2(){const t=Ar(),a=Qn(),{data:l,isLoading:s}=De({queryKey:["adapters"],queryFn:a0}),{data:o,isLoading:d}=De({queryKey:["adapter-mappings"],queryFn:t0}),{data:h}=De({queryKey:["adapter-statuses"],queryFn:n0,refetchInterval:15e3}),m=s||d;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(cl,{children:[u.jsx(Ns,{children:u.jsx(ws,{children:"Bot Bindings"})}),u.jsx(dl,{children:u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Agent"}),u.jsx(ye,{children:"Platform"}),u.jsx(ye,{children:"Status"}),u.jsx(ye,{children:"Connection"}),u.jsx(ye,{children:"Created"})]})}),u.jsx(Ma,{children:m?u.jsx(at,{children:u.jsx(ve,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):l!=null&&l.length?l.map(g=>{const p=h==null?void 0:h.find(x=>x.configId===g.id);return u.jsxs(at,{className:"cursor-pointer",onClick:()=>t(`/agents/${g.agentId}`),children:[u.jsx(ve,{className:"font-mono text-sm",children:a(g.agentId)}),u.jsx(ve,{children:u.jsx($t,{variant:"secondary",children:g.platform})}),u.jsx(ve,{children:u.jsx($t,{variant:g.status==="active"?"default":"destructive",children:g.status})}),u.jsx(ve,{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(ve,{className:"text-muted-foreground",children:un(g.createdAt)})]},g.id)}):u.jsx(at,{children:u.jsx(ve,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No bot bindings"})})})]})})]}),u.jsxs(cl,{children:[u.jsx(Ns,{children:u.jsx(ws,{children:"User Bindings"})}),u.jsx(dl,{children:u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Agent"}),u.jsx(ye,{children:"Platform"}),u.jsx(ye,{children:"External User ID"}),u.jsx(ye,{children:"Display Name"}),u.jsx(ye,{children:"Bound Via"}),u.jsx(ye,{children:"Created"})]})}),u.jsx(Ma,{children:m?u.jsx(at,{children:u.jsx(ve,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"Loading..."})}):o!=null&&o.length?o.map(g=>u.jsxs(at,{className:"cursor-pointer",onClick:()=>t(`/agents/${g.agentId}`),children:[u.jsx(ve,{className:"font-mono text-sm",children:a(g.agentId)}),u.jsx(ve,{children:u.jsx($t,{variant:"secondary",children:g.platform})}),u.jsx(ve,{className:"font-mono text-sm",children:g.externalUserId}),u.jsx(ve,{children:g.displayName??"—"}),u.jsx(ve,{children:u.jsx($t,{variant:"outline",children:g.boundVia??"—"})}),u.jsx(ve,{className:"text-muted-foreground",children:un(g.createdAt)})]},g.id)):u.jsx(at,{children:u.jsx(ve,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No user bindings"})})})]})})]})]})}function E2(t){return we.delete(`/admin/clients/${encodeURIComponent(t)}`)}function Ji(){return we.get("/admin/agents/activity")}function Ih(){return we.get("/admin/clients")}function C2(t){return we.post(`/admin/clients/${t}/disconnect`)}function A2(){return we.post("/connect-tokens")}function Yy(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function Vh(...t){return a=>{let l=!1;const s=t.map(o=>{const d=Yy(o,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let o=0;o<s.length;o++){const d=s[o];typeof d=="function"?d():Yy(t[o],null)}}}}function pl(...t){return y.useCallback(Vh(...t),t)}var T2=Symbol.for("react.lazy"),Qu=Ch[" use ".trim().toString()];function z2(t){return typeof t=="object"&&t!==null&&"then"in t}function s0(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===T2&&"_payload"in t&&z2(t._payload)}function i0(t){const a=R2(t),l=y.forwardRef((s,o)=>{let{children:d,...h}=s;s0(d)&&typeof Qu=="function"&&(d=Qu(d._payload));const m=y.Children.toArray(d),g=m.find(k2);if(g){const p=g.props.children,x=m.map(b=>b===g?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:b);return u.jsx(a,{...h,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,x):null})}return u.jsx(a,{...h,ref:o,children:d})});return l.displayName=`${t}.Slot`,l}var O2=i0("Slot");function R2(t){const a=y.forwardRef((l,s)=>{let{children:o,...d}=l;if(s0(o)&&typeof Qu=="function"&&(o=Qu(o._payload)),y.isValidElement(o)){const h=U2(o),m=D2(d,o.props);return o.type!==y.Fragment&&(m.ref=s?Vh(s,h):h),y.cloneElement(o,m)}return y.Children.count(o)>1?y.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var M2=Symbol("radix.slottable");function k2(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===M2}function D2(t,a){const l={...a};for(const s in a){const o=t[s],d=a[s];/^on[A-Z]/.test(s)?o&&d?l[s]=(...m)=>{const g=d(...m);return o(...m),g}:o&&(l[s]=o):s==="style"?l[s]={...o,...d}:s==="className"&&(l[s]=[o,d].filter(Boolean).join(" "))}return{...t,...l}}function U2(t){var s,o;let a=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?t.props.ref:t.props.ref||t.ref)}const L2=r0("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"}}),de=y.forwardRef(({className:t,variant:a,size:l,asChild:s=!1,...o},d)=>{const h=s?O2:"button";return u.jsx(h,{className:je(L2({variant:a,size:l,className:t})),ref:d,...o})});de.displayName="Button";function o0({state:t}){if(!t)return u.jsx("span",{className:"text-xs text-muted-foreground",children:"offline"});const a={idle:"text-green-600",working:"text-blue-600",blocked:"text-yellow-600",error:"text-red-600"};return u.jsx("span",{className:je("text-xs font-medium",a[t]??"text-muted-foreground"),children:t})}function Z2(){const[t,a]=y.useState(null),[l,s]=y.useState(!1),o=st({mutationFn:A2,onSuccess:h=>{a(h),s(!1)}}),d=async()=>{t&&(await navigator.clipboard.writeText(t.command),s(!0),setTimeout(()=>s(!1),2e3))};return t?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(Ly,{className:"h-4 w-4 shrink-0"}),u.jsxs("span",{children:["Run this command in your terminal (expires in ",t.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:t.command}),u.jsxs(de,{variant:"outline",size:"sm",onClick:d,className:"shrink-0",children:[l?u.jsx(Mx,{className:"h-3 w-3 mr-1"}):u.jsx(Hh,{className:"h-3 w-3 mr-1"}),l?"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(Ly,{className:"h-4 w-4 text-muted-foreground shrink-0"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"Connect a new client to this Hub"}),u.jsx(de,{variant:"outline",size:"sm",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Generating...":"Generate Connect Command"})]})}function q2(){const t=Mn(),a=Qn(),[l,s]=y.useState(null),[o,d]=y.useState(null),[h,m]=y.useState(null),[g,p]=y.useState(null),{data:x}=De({queryKey:["clients"],queryFn:Ih,refetchInterval:1e4}),{data:b}=De({queryKey:["activity"],queryFn:Ji,refetchInterval:1e4}),j=st({mutationFn:C2,onSuccess:()=>{d(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),w=st({mutationFn:E2,onSuccess:()=>{m(null),p(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:_=>{_ instanceof $h?p(_.message):p(_ instanceof Error?_.message:String(_))}}),C=y.useMemo(()=>{const _=new Map;for(const R of(b==null?void 0:b.agents)??[]){if(!R.clientId)continue;const Q=_.get(R.clientId)??[];Q.push(R),_.set(R.clientId,Q)}return _},[b==null?void 0:b.agents]),N=_=>C.get(_)??[];return u.jsxs("div",{children:[u.jsx(Z2,{}),h&&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 Client"}),u.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["Permanently remove"," ",u.jsx("span",{className:"font-medium text-foreground",children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this client — you must delete those agents first (reassign is not available in this milestone)."]}),N(h.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 client (delete them first):"}),u.jsx("ul",{className:"text-sm space-y-0.5",children:N(h.id).map(_=>u.jsx("li",{className:"font-medium",children:a(_.agentId)},_.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(de,{variant:"outline",size:"sm",onClick:()=>{m(null),p(null)},children:"Cancel"}),u.jsx(de,{variant:"destructive",size:"sm",onClick:()=>w.mutate(h.id),disabled:w.isPending,children:w.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 Client"}),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:N(o.id).length===0?u.jsx("li",{className:"text-sm text-muted-foreground",children:"No bound agents"}):N(o.id).map(_=>u.jsxs("li",{className:"text-sm flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:a(_.agentId)}),u.jsx(o0,{state:_.runtimeState})]},_.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(de,{variant:"outline",size:"sm",onClick:()=>d(null),children:"Cancel"}),u.jsx(de,{variant:"destructive",size:"sm",onClick:()=>j.mutate(o.id),disabled:j.isPending,children:j.isPending?"Disconnecting...":"Disconnect"})]})]})}),!x||x.length===0?u.jsx("div",{className:"text-center text-muted-foreground py-12",children:"No connected clients. Use the button above to generate a connect command."}):u.jsx("div",{className:"border rounded-lg overflow-hidden",children:u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{className:"w-8"}),u.jsx(ye,{children:"Hostname"}),u.jsx(ye,{children:"OS"}),u.jsx(ye,{children:"SDK"}),u.jsx(ye,{children:"Agents"}),u.jsx(ye,{children:"Connected"}),u.jsx(ye,{children:"Status"}),u.jsx(ye,{})]})}),u.jsx(Ma,{children:x.map(_=>{const R=l===_.id,Q=N(_.id);return u.jsx(B2,{client:_,boundAgents:Q,isExpanded:R,agentName:a,onToggle:()=>s(R?null:_.id),onDisconnect:()=>d(_),onRetire:()=>{p(null),m(_)}},_.id)})})]})})]})}function B2({client:t,boundAgents:a,isExpanded:l,agentName:s,onToggle:o,onDisconnect:d,onRetire:h}){return u.jsxs(u.Fragment,{children:[u.jsxs(at,{className:"cursor-pointer hover:bg-accent/50",onClick:o,children:[u.jsx(ve,{className:"px-2",children:l?u.jsx(q_,{className:"h-4 w-4"}):u.jsx(kx,{className:"h-4 w-4"})}),u.jsx(ve,{className:"font-medium",children:t.hostname??"—"}),u.jsx(ve,{className:"text-muted-foreground",children:t.os??"—"}),u.jsx(ve,{className:"font-mono text-xs text-muted-foreground",children:t.sdkVersion??"—"}),u.jsx(ve,{children:t.agentCount}),u.jsx(ve,{className:"text-muted-foreground text-sm",children:t.connectedAt?un(t.connectedAt):"—"}),u.jsx(ve,{children:u.jsx($t,{variant:t.status==="connected"?"default":"secondary",children:t.status})}),u.jsx(ve,{children:u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsxs(de,{variant:"outline",size:"sm",onClick:m=>{m.stopPropagation(),d()},children:[u.jsx(hE,{className:"h-3 w-3 mr-1"}),"Disconnect"]}),u.jsxs(de,{variant:"outline",size:"sm",onClick:m=>{m.stopPropagation(),h()},children:[u.jsx(Zi,{className:"h-3 w-3 mr-1"}),"Retire"]})]})})]}),l&&u.jsx(at,{children:u.jsxs(ve,{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 client"}):u.jsx("div",{className:"space-y-1",children:a.map(m=>u.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[u.jsx("span",{className:"font-medium",children:s(m.agentId)}),u.jsx(o0,{state:m.runtimeState}),u.jsx("span",{className:"text-xs text-muted-foreground",children:m.activeSessions!==null?`${m.activeSessions}/${m.totalSessions??0} sessions`:""})]},m.agentId))})]})})]})}function I(t,a,l){function s(m,g){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:g,constr:h,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),a(m,g);const p=h.prototype,x=Object.keys(p);for(let b=0;b<x.length;b++){const j=x[b];j in m||(m[j]=p[j].bind(m))}}const o=(l==null?void 0:l.Parent)??Object;class d extends o{}Object.defineProperty(d,"name",{value:t});function h(m){var g;const p=l!=null&&l.Parent?new d:this;s(p,m),(g=p._zod).deferred??(g.deferred=[]);for(const x of p._zod.deferred)x();return p}return Object.defineProperty(h,"init",{value:s}),Object.defineProperty(h,Symbol.hasInstance,{value:m=>{var g,p;return l!=null&&l.Parent&&m instanceof l.Parent?!0:(p=(g=m==null?void 0:m._zod)==null?void 0:g.traits)==null?void 0:p.has(t)}}),Object.defineProperty(h,"name",{value:t}),h}class us extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class u0 extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const c0={};function Er(t){return c0}function d0(t){const a=Object.values(t).filter(s=>typeof s=="number");return Object.entries(t).filter(([s,o])=>a.indexOf(+s)===-1).map(([s,o])=>o)}function bh(t,a){return typeof a=="bigint"?a.toString():a}function Wu(t){return{get value(){{const a=t();return Object.defineProperty(this,"value",{value:a}),a}}}}function Yh(t){return t==null}function Kh(t){const a=t.startsWith("^")?1:0,l=t.endsWith("$")?t.length-1:t.length;return t.slice(a,l)}function $2(t,a){const l=(t.toString().split(".")[1]||"").length,s=a.toString();let o=(s.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(s)){const g=s.match(/\d?e-(\d?)/);g!=null&&g[1]&&(o=Number.parseInt(g[1]))}const d=l>o?l:o,h=Number.parseInt(t.toFixed(d).replace(".","")),m=Number.parseInt(a.toFixed(d).replace(".",""));return h%m/10**d}const Ky=Symbol("evaluating");function Ye(t,a,l){let s;Object.defineProperty(t,a,{get(){if(s!==Ky)return s===void 0&&(s=Ky,s=l()),s},set(o){Object.defineProperty(t,a,{value:o})},configurable:!0})}function gl(t,a,l){Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0})}function zr(...t){const a={};for(const l of t){const s=Object.getOwnPropertyDescriptors(l);Object.assign(a,s)}return Object.defineProperties({},a)}function Py(t){return JSON.stringify(t)}function H2(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const f0="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Bi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const Q2=Wu(()=>{var t;if(typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const a=Function;return new a(""),!0}catch{return!1}});function _s(t){if(Bi(t)===!1)return!1;const a=t.constructor;if(a===void 0||typeof a!="function")return!0;const l=a.prototype;return!(Bi(l)===!1||Object.prototype.hasOwnProperty.call(l,"isPrototypeOf")===!1)}function h0(t){return _s(t)?{...t}:Array.isArray(t)?[...t]:t}const G2=new Set(["string","number","symbol"]);function Es(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Or(t,a,l){const s=new t._zod.constr(a??t._zod.def);return(!a||l!=null&&l.parent)&&(s._zod.parent=t),s}function he(t){const a=t;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 I2(t){return Object.keys(t).filter(a=>t[a]._zod.optin==="optional"&&t[a]._zod.optout==="optional")}const V2={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 Y2(t,a){const l=t._zod.def,s=l.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const d=zr(t._zod.def,{get shape(){const h={};for(const m in a){if(!(m in l.shape))throw new Error(`Unrecognized key: "${m}"`);a[m]&&(h[m]=l.shape[m])}return gl(this,"shape",h),h},checks:[]});return Or(t,d)}function K2(t,a){const l=t._zod.def,s=l.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const d=zr(t._zod.def,{get shape(){const h={...t._zod.def.shape};for(const m in a){if(!(m in l.shape))throw new Error(`Unrecognized key: "${m}"`);a[m]&&delete h[m]}return gl(this,"shape",h),h},checks:[]});return Or(t,d)}function P2(t,a){if(!_s(a))throw new Error("Invalid input to extend: expected a plain object");const l=t._zod.def.checks;if(l&&l.length>0){const d=t._zod.def.shape;for(const h in a)if(Object.getOwnPropertyDescriptor(d,h)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=zr(t._zod.def,{get shape(){const d={...t._zod.def.shape,...a};return gl(this,"shape",d),d}});return Or(t,o)}function F2(t,a){if(!_s(a))throw new Error("Invalid input to safeExtend: expected a plain object");const l=zr(t._zod.def,{get shape(){const s={...t._zod.def.shape,...a};return gl(this,"shape",s),s}});return Or(t,l)}function X2(t,a){const l=zr(t._zod.def,{get shape(){const s={...t._zod.def.shape,...a._zod.def.shape};return gl(this,"shape",s),s},get catchall(){return a._zod.def.catchall},checks:[]});return Or(t,l)}function J2(t,a,l){const o=a._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const h=zr(a._zod.def,{get shape(){const m=a._zod.def.shape,g={...m};if(l)for(const p in l){if(!(p in m))throw new Error(`Unrecognized key: "${p}"`);l[p]&&(g[p]=t?new t({type:"optional",innerType:m[p]}):m[p])}else for(const p in m)g[p]=t?new t({type:"optional",innerType:m[p]}):m[p];return gl(this,"shape",g),g},checks:[]});return Or(a,h)}function W2(t,a,l){const s=zr(a._zod.def,{get shape(){const o=a._zod.def.shape,d={...o};if(l)for(const h in l){if(!(h in d))throw new Error(`Unrecognized key: "${h}"`);l[h]&&(d[h]=new t({type:"nonoptional",innerType:o[h]}))}else for(const h in o)d[h]=new t({type:"nonoptional",innerType:o[h]});return gl(this,"shape",d),d}});return Or(a,s)}function is(t,a=0){var l;if(t.aborted===!0)return!0;for(let s=a;s<t.issues.length;s++)if(((l=t.issues[s])==null?void 0:l.continue)!==!0)return!0;return!1}function os(t,a){return a.map(l=>{var s;return(s=l).path??(s.path=[]),l.path.unshift(t),l})}function Eu(t){return typeof t=="string"?t:t==null?void 0:t.message}function Cr(t,a,l){var o,d,h,m,g,p;const s={...t,path:t.path??[]};if(!t.message){const x=Eu((h=(d=(o=t.inst)==null?void 0:o._zod.def)==null?void 0:d.error)==null?void 0:h.call(d,t))??Eu((m=a==null?void 0:a.error)==null?void 0:m.call(a,t))??Eu((g=l.customError)==null?void 0:g.call(l,t))??Eu((p=l.localeError)==null?void 0:p.call(l,t))??"Invalid input";s.message=x}return delete s.inst,delete s.continue,a!=null&&a.reportInput||delete s.input,s}function Ph(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function $i(...t){const[a,l,s]=t;return typeof a=="string"?{message:a,code:"custom",input:l,inst:s}:{...a}}const m0=(t,a)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:a,enumerable:!1}),t.message=JSON.stringify(a,bh,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},p0=I("$ZodError",m0),g0=I("$ZodError",m0,{Parent:Error});function eC(t,a=l=>l.message){const l={},s=[];for(const o of t.issues)o.path.length>0?(l[o.path[0]]=l[o.path[0]]||[],l[o.path[0]].push(a(o))):s.push(a(o));return{formErrors:s,fieldErrors:l}}function tC(t,a=l=>l.message){const l={_errors:[]},s=o=>{for(const d of o.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(h=>s({issues:h}));else if(d.code==="invalid_key")s({issues:d.issues});else if(d.code==="invalid_element")s({issues:d.issues});else if(d.path.length===0)l._errors.push(a(d));else{let h=l,m=0;for(;m<d.path.length;){const g=d.path[m];m===d.path.length-1?(h[g]=h[g]||{_errors:[]},h[g]._errors.push(a(d))):h[g]=h[g]||{_errors:[]},h=h[g],m++}}};return s(t),l}const Fh=t=>(a,l,s,o)=>{const d=s?Object.assign(s,{async:!1}):{async:!1},h=a._zod.run({value:l,issues:[]},d);if(h instanceof Promise)throw new us;if(h.issues.length){const m=new((o==null?void 0:o.Err)??t)(h.issues.map(g=>Cr(g,d,Er())));throw f0(m,o==null?void 0:o.callee),m}return h.value},Xh=t=>async(a,l,s,o)=>{const d=s?Object.assign(s,{async:!0}):{async:!0};let h=a._zod.run({value:l,issues:[]},d);if(h instanceof Promise&&(h=await h),h.issues.length){const m=new((o==null?void 0:o.Err)??t)(h.issues.map(g=>Cr(g,d,Er())));throw f0(m,o==null?void 0:o.callee),m}return h.value},ec=t=>(a,l,s)=>{const o=s?{...s,async:!1}:{async:!1},d=a._zod.run({value:l,issues:[]},o);if(d instanceof Promise)throw new us;return d.issues.length?{success:!1,error:new(t??p0)(d.issues.map(h=>Cr(h,o,Er())))}:{success:!0,data:d.value}},nC=ec(g0),tc=t=>async(a,l,s)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let d=a._zod.run({value:l,issues:[]},o);return d instanceof Promise&&(d=await d),d.issues.length?{success:!1,error:new t(d.issues.map(h=>Cr(h,o,Er())))}:{success:!0,data:d.value}},aC=tc(g0),rC=t=>(a,l,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Fh(t)(a,l,o)},lC=t=>(a,l,s)=>Fh(t)(a,l,s),sC=t=>async(a,l,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Xh(t)(a,l,o)},iC=t=>async(a,l,s)=>Xh(t)(a,l,s),oC=t=>(a,l,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ec(t)(a,l,o)},uC=t=>(a,l,s)=>ec(t)(a,l,s),cC=t=>async(a,l,s)=>{const o=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return tc(t)(a,l,o)},dC=t=>async(a,l,s)=>tc(t)(a,l,s),fC=/^[cC][^\s-]{8,}$/,hC=/^[0-9a-z]+$/,mC=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pC=/^[0-9a-vA-V]{20}$/,gC=/^[A-Za-z0-9]{27}$/,vC=/^[a-zA-Z0-9_-]{21}$/,yC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bC=/^([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})$/,Fy=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,xC=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,SC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jC(){return new RegExp(SC,"u")}const NC=/^(?:(?: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])$/,wC=/^(([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}|:))$/,_C=/^((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])$/,EC=/^(([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])$/,CC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,v0=/^[A-Za-z0-9_-]*$/,AC=/^\+[1-9]\d{6,14}$/,y0="(?:(?:\\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])))",TC=new RegExp(`^${y0}$`);function b0(t){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${a}`:t.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${t.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zC(t){return new RegExp(`^${b0(t)}$`)}function OC(t){const a=b0({precision:t.precision}),l=["Z"];t.local&&l.push(""),t.offset&&l.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${a}(?:${l.join("|")})`;return new RegExp(`^${y0}T(?:${s})$`)}const RC=t=>{const a=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},MC=/^-?\d+$/,x0=/^-?\d+(?:\.\d+)?$/,kC=/^(?:true|false)$/i,DC=/^[^A-Z]*$/,UC=/^[^a-z]*$/,cn=I("$ZodCheck",(t,a)=>{var l;t._zod??(t._zod={}),t._zod.def=a,(l=t._zod).onattach??(l.onattach=[])}),S0={number:"number",bigint:"bigint",object:"date"},j0=I("$ZodCheckLessThan",(t,a)=>{cn.init(t,a);const l=S0[typeof a.value];t._zod.onattach.push(s=>{const o=s._zod.bag,d=(a.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value<d&&(a.inclusive?o.maximum=a.value:o.exclusiveMaximum=a.value)}),t._zod.check=s=>{(a.inclusive?s.value<=a.value:s.value<a.value)||s.issues.push({origin:l,code:"too_big",maximum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:t,continue:!a.abort})}}),N0=I("$ZodCheckGreaterThan",(t,a)=>{cn.init(t,a);const l=S0[typeof a.value];t._zod.onattach.push(s=>{const o=s._zod.bag,d=(a.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>d&&(a.inclusive?o.minimum=a.value:o.exclusiveMinimum=a.value)}),t._zod.check=s=>{(a.inclusive?s.value>=a.value:s.value>a.value)||s.issues.push({origin:l,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:t,continue:!a.abort})}}),LC=I("$ZodCheckMultipleOf",(t,a)=>{cn.init(t,a),t._zod.onattach.push(l=>{var s;(s=l._zod.bag).multipleOf??(s.multipleOf=a.value)}),t._zod.check=l=>{if(typeof l.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof l.value=="bigint"?l.value%a.value===BigInt(0):$2(l.value,a.value)===0)||l.issues.push({origin:typeof l.value,code:"not_multiple_of",divisor:a.value,input:l.value,inst:t,continue:!a.abort})}}),ZC=I("$ZodCheckNumberFormat",(t,a)=>{var h;cn.init(t,a),a.format=a.format||"float64";const l=(h=a.format)==null?void 0:h.includes("int"),s=l?"int":"number",[o,d]=V2[a.format];t._zod.onattach.push(m=>{const g=m._zod.bag;g.format=a.format,g.minimum=o,g.maximum=d,l&&(g.pattern=MC)}),t._zod.check=m=>{const g=m.value;if(l){if(!Number.isInteger(g)){m.issues.push({expected:s,format:a.format,code:"invalid_type",continue:!1,input:g,inst:t});return}if(!Number.isSafeInteger(g)){g>0?m.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:s,inclusive:!0,continue:!a.abort}):m.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:s,inclusive:!0,continue:!a.abort});return}}g<o&&m.issues.push({origin:"number",input:g,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!a.abort}),g>d&&m.issues.push({origin:"number",input:g,code:"too_big",maximum:d,inclusive:!0,inst:t,continue:!a.abort})}}),qC=I("$ZodCheckMaxLength",(t,a)=>{var l;cn.init(t,a),(l=t._zod.def).when??(l.when=s=>{const o=s.value;return!Yh(o)&&o.length!==void 0}),t._zod.onattach.push(s=>{const o=s._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum<o&&(s._zod.bag.maximum=a.maximum)}),t._zod.check=s=>{const o=s.value;if(o.length<=a.maximum)return;const h=Ph(o);s.issues.push({origin:h,code:"too_big",maximum:a.maximum,inclusive:!0,input:o,inst:t,continue:!a.abort})}}),BC=I("$ZodCheckMinLength",(t,a)=>{var l;cn.init(t,a),(l=t._zod.def).when??(l.when=s=>{const o=s.value;return!Yh(o)&&o.length!==void 0}),t._zod.onattach.push(s=>{const o=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>o&&(s._zod.bag.minimum=a.minimum)}),t._zod.check=s=>{const o=s.value;if(o.length>=a.minimum)return;const h=Ph(o);s.issues.push({origin:h,code:"too_small",minimum:a.minimum,inclusive:!0,input:o,inst:t,continue:!a.abort})}}),$C=I("$ZodCheckLengthEquals",(t,a)=>{var l;cn.init(t,a),(l=t._zod.def).when??(l.when=s=>{const o=s.value;return!Yh(o)&&o.length!==void 0}),t._zod.onattach.push(s=>{const o=s._zod.bag;o.minimum=a.length,o.maximum=a.length,o.length=a.length}),t._zod.check=s=>{const o=s.value,d=o.length;if(d===a.length)return;const h=Ph(o),m=d>a.length;s.issues.push({origin:h,...m?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:s.value,inst:t,continue:!a.abort})}}),nc=I("$ZodCheckStringFormat",(t,a)=>{var l,s;cn.init(t,a),t._zod.onattach.push(o=>{const d=o._zod.bag;d.format=a.format,a.pattern&&(d.patterns??(d.patterns=new Set),d.patterns.add(a.pattern))}),a.pattern?(l=t._zod).check??(l.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:t,continue:!a.abort})}):(s=t._zod).check??(s.check=()=>{})}),HC=I("$ZodCheckRegex",(t,a)=>{nc.init(t,a),t._zod.check=l=>{a.pattern.lastIndex=0,!a.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:"regex",input:l.value,pattern:a.pattern.toString(),inst:t,continue:!a.abort})}}),QC=I("$ZodCheckLowerCase",(t,a)=>{a.pattern??(a.pattern=DC),nc.init(t,a)}),GC=I("$ZodCheckUpperCase",(t,a)=>{a.pattern??(a.pattern=UC),nc.init(t,a)}),IC=I("$ZodCheckIncludes",(t,a)=>{cn.init(t,a);const l=Es(a.includes),s=new RegExp(typeof a.position=="number"?`^.{${a.position}}${l}`:l);a.pattern=s,t._zod.onattach.push(o=>{const d=o._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(s)}),t._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:t,continue:!a.abort})}}),VC=I("$ZodCheckStartsWith",(t,a)=>{cn.init(t,a);const l=new RegExp(`^${Es(a.prefix)}.*`);a.pattern??(a.pattern=l),t._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(l)}),t._zod.check=s=>{s.value.startsWith(a.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:s.value,inst:t,continue:!a.abort})}}),YC=I("$ZodCheckEndsWith",(t,a)=>{cn.init(t,a);const l=new RegExp(`.*${Es(a.suffix)}$`);a.pattern??(a.pattern=l),t._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(l)}),t._zod.check=s=>{s.value.endsWith(a.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:s.value,inst:t,continue:!a.abort})}}),KC=I("$ZodCheckOverwrite",(t,a)=>{cn.init(t,a),t._zod.check=l=>{l.value=a.tx(l.value)}});class PC{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 s=a.split(`
|
|
226
|
-
`).filter(h=>h),o=Math.min(...s.map(h=>h.length-h.trimStart().length)),d=s.map(h=>h.slice(o)).map(h=>" ".repeat(this.indent*2)+h);for(const h of d)this.content.push(h)}compile(){const a=Function,l=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(d=>` ${d}`)];return new a(...l,o.join(`
|
|
227
|
-
`))}}const FC={major:4,minor:3,patch:6},ft=I("$ZodType",(t,a)=>{var o;var l;t??(t={}),t._zod.def=a,t._zod.bag=t._zod.bag||{},t._zod.version=FC;const s=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&s.unshift(t);for(const d of s)for(const h of d._zod.onattach)h(t);if(s.length===0)(l=t._zod).deferred??(l.deferred=[]),(o=t._zod.deferred)==null||o.push(()=>{t._zod.run=t._zod.parse});else{const d=(m,g,p)=>{let x=is(m),b;for(const j of g){if(j._zod.def.when){if(!j._zod.def.when(m))continue}else if(x)continue;const w=m.issues.length,C=j._zod.check(m);if(C instanceof Promise&&(p==null?void 0:p.async)===!1)throw new us;if(b||C instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await C,m.issues.length!==w&&(x||(x=is(m,w)))});else{if(m.issues.length===w)continue;x||(x=is(m,w))}}return b?b.then(()=>m):m},h=(m,g,p)=>{if(is(m))return m.aborted=!0,m;const x=d(g,s,p);if(x instanceof Promise){if(p.async===!1)throw new us;return x.then(b=>t._zod.parse(b,p))}return t._zod.parse(x,p)};t._zod.run=(m,g)=>{if(g.skipChecks)return t._zod.parse(m,g);if(g.direction==="backward"){const x=t._zod.parse({value:m.value,issues:[]},{...g,skipChecks:!0});return x instanceof Promise?x.then(b=>h(b,m,g)):h(x,m,g)}const p=t._zod.parse(m,g);if(p instanceof Promise){if(g.async===!1)throw new us;return p.then(x=>d(x,s,g))}return d(p,s,g)}}Ye(t,"~standard",()=>({validate:d=>{var h;try{const m=nC(t,d);return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}}catch{return aC(t,d).then(g=>{var p;return g.success?{value:g.data}:{issues:(p=g.error)==null?void 0:p.issues}})}},vendor:"zod",version:1}))}),Jh=I("$ZodString",(t,a)=>{var l;ft.init(t,a),t._zod.pattern=[...((l=t==null?void 0:t._zod.bag)==null?void 0:l.patterns)??[]].pop()??RC(t._zod.bag),t._zod.parse=(s,o)=>{if(a.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:t}),s}}),dt=I("$ZodStringFormat",(t,a)=>{nc.init(t,a),Jh.init(t,a)}),XC=I("$ZodGUID",(t,a)=>{a.pattern??(a.pattern=bC),dt.init(t,a)}),JC=I("$ZodUUID",(t,a)=>{if(a.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(s===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Fy(s))}else a.pattern??(a.pattern=Fy());dt.init(t,a)}),WC=I("$ZodEmail",(t,a)=>{a.pattern??(a.pattern=xC),dt.init(t,a)}),eA=I("$ZodURL",(t,a)=>{dt.init(t,a),t._zod.check=l=>{try{const s=l.value.trim(),o=new URL(s);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(o.hostname)||l.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:l.value,inst:t,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||l.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:l.value,inst:t,continue:!a.abort})),a.normalize?l.value=o.href:l.value=s;return}catch{l.issues.push({code:"invalid_format",format:"url",input:l.value,inst:t,continue:!a.abort})}}}),tA=I("$ZodEmoji",(t,a)=>{a.pattern??(a.pattern=jC()),dt.init(t,a)}),nA=I("$ZodNanoID",(t,a)=>{a.pattern??(a.pattern=vC),dt.init(t,a)}),aA=I("$ZodCUID",(t,a)=>{a.pattern??(a.pattern=fC),dt.init(t,a)}),rA=I("$ZodCUID2",(t,a)=>{a.pattern??(a.pattern=hC),dt.init(t,a)}),lA=I("$ZodULID",(t,a)=>{a.pattern??(a.pattern=mC),dt.init(t,a)}),sA=I("$ZodXID",(t,a)=>{a.pattern??(a.pattern=pC),dt.init(t,a)}),iA=I("$ZodKSUID",(t,a)=>{a.pattern??(a.pattern=gC),dt.init(t,a)}),oA=I("$ZodISODateTime",(t,a)=>{a.pattern??(a.pattern=OC(a)),dt.init(t,a)}),uA=I("$ZodISODate",(t,a)=>{a.pattern??(a.pattern=TC),dt.init(t,a)}),cA=I("$ZodISOTime",(t,a)=>{a.pattern??(a.pattern=zC(a)),dt.init(t,a)}),dA=I("$ZodISODuration",(t,a)=>{a.pattern??(a.pattern=yC),dt.init(t,a)}),fA=I("$ZodIPv4",(t,a)=>{a.pattern??(a.pattern=NC),dt.init(t,a),t._zod.bag.format="ipv4"}),hA=I("$ZodIPv6",(t,a)=>{a.pattern??(a.pattern=wC),dt.init(t,a),t._zod.bag.format="ipv6",t._zod.check=l=>{try{new URL(`http://[${l.value}]`)}catch{l.issues.push({code:"invalid_format",format:"ipv6",input:l.value,inst:t,continue:!a.abort})}}}),mA=I("$ZodCIDRv4",(t,a)=>{a.pattern??(a.pattern=_C),dt.init(t,a)}),pA=I("$ZodCIDRv6",(t,a)=>{a.pattern??(a.pattern=EC),dt.init(t,a),t._zod.check=l=>{const s=l.value.split("/");try{if(s.length!==2)throw new Error;const[o,d]=s;if(!d)throw new Error;const h=Number(d);if(`${h}`!==d)throw new Error;if(h<0||h>128)throw new Error;new URL(`http://[${o}]`)}catch{l.issues.push({code:"invalid_format",format:"cidrv6",input:l.value,inst:t,continue:!a.abort})}}});function w0(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const gA=I("$ZodBase64",(t,a)=>{a.pattern??(a.pattern=CC),dt.init(t,a),t._zod.bag.contentEncoding="base64",t._zod.check=l=>{w0(l.value)||l.issues.push({code:"invalid_format",format:"base64",input:l.value,inst:t,continue:!a.abort})}});function vA(t){if(!v0.test(t))return!1;const a=t.replace(/[-_]/g,s=>s==="-"?"+":"/"),l=a.padEnd(Math.ceil(a.length/4)*4,"=");return w0(l)}const yA=I("$ZodBase64URL",(t,a)=>{a.pattern??(a.pattern=v0),dt.init(t,a),t._zod.bag.contentEncoding="base64url",t._zod.check=l=>{vA(l.value)||l.issues.push({code:"invalid_format",format:"base64url",input:l.value,inst:t,continue:!a.abort})}}),bA=I("$ZodE164",(t,a)=>{a.pattern??(a.pattern=AC),dt.init(t,a)});function xA(t,a=null){try{const l=t.split(".");if(l.length!==3)return!1;const[s]=l;if(!s)return!1;const o=JSON.parse(atob(s));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||a&&(!("alg"in o)||o.alg!==a))}catch{return!1}}const SA=I("$ZodJWT",(t,a)=>{dt.init(t,a),t._zod.check=l=>{xA(l.value,a.alg)||l.issues.push({code:"invalid_format",format:"jwt",input:l.value,inst:t,continue:!a.abort})}}),_0=I("$ZodNumber",(t,a)=>{ft.init(t,a),t._zod.pattern=t._zod.bag.pattern??x0,t._zod.parse=(l,s)=>{if(a.coerce)try{l.value=Number(l.value)}catch{}const o=l.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return l;const d=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return l.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...d?{received:d}:{}}),l}}),jA=I("$ZodNumberFormat",(t,a)=>{ZC.init(t,a),_0.init(t,a)}),NA=I("$ZodBoolean",(t,a)=>{ft.init(t,a),t._zod.pattern=kC,t._zod.parse=(l,s)=>{if(a.coerce)try{l.value=!!l.value}catch{}const o=l.value;return typeof o=="boolean"||l.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),l}}),wA=I("$ZodUnknown",(t,a)=>{ft.init(t,a),t._zod.parse=l=>l}),_A=I("$ZodNever",(t,a)=>{ft.init(t,a),t._zod.parse=(l,s)=>(l.issues.push({expected:"never",code:"invalid_type",input:l.value,inst:t}),l)});function Xy(t,a,l){t.issues.length&&a.issues.push(...os(l,t.issues)),a.value[l]=t.value}const EA=I("$ZodArray",(t,a)=>{ft.init(t,a),t._zod.parse=(l,s)=>{const o=l.value;if(!Array.isArray(o))return l.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),l;l.value=Array(o.length);const d=[];for(let h=0;h<o.length;h++){const m=o[h],g=a.element._zod.run({value:m,issues:[]},s);g instanceof Promise?d.push(g.then(p=>Xy(p,l,h))):Xy(g,l,h)}return d.length?Promise.all(d).then(()=>l):l}});function Gu(t,a,l,s,o){if(t.issues.length){if(o&&!(l in s))return;a.issues.push(...os(l,t.issues))}t.value===void 0?l in s&&(a.value[l]=void 0):a.value[l]=t.value}function E0(t){var s,o,d,h;const a=Object.keys(t.shape);for(const m of a)if(!((h=(d=(o=(s=t.shape)==null?void 0:s[m])==null?void 0:o._zod)==null?void 0:d.traits)!=null&&h.has("$ZodType")))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const l=I2(t.shape);return{...t,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(l)}}function C0(t,a,l,s,o,d){const h=[],m=o.keySet,g=o.catchall._zod,p=g.def.type,x=g.optout==="optional";for(const b in a){if(m.has(b))continue;if(p==="never"){h.push(b);continue}const j=g.run({value:a[b],issues:[]},s);j instanceof Promise?t.push(j.then(w=>Gu(w,l,b,a,x))):Gu(j,l,b,a,x)}return h.length&&l.issues.push({code:"unrecognized_keys",keys:h,input:a,inst:d}),t.length?Promise.all(t).then(()=>l):l}const CA=I("$ZodObject",(t,a)=>{ft.init(t,a);const l=Object.getOwnPropertyDescriptor(a,"shape");if(!(l!=null&&l.get)){const m=a.shape;Object.defineProperty(a,"shape",{get:()=>{const g={...m};return Object.defineProperty(a,"shape",{value:g}),g}})}const s=Wu(()=>E0(a));Ye(t._zod,"propValues",()=>{const m=a.shape,g={};for(const p in m){const x=m[p]._zod;if(x.values){g[p]??(g[p]=new Set);for(const b of x.values)g[p].add(b)}}return g});const o=Bi,d=a.catchall;let h;t._zod.parse=(m,g)=>{h??(h=s.value);const p=m.value;if(!o(p))return m.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),m;m.value={};const x=[],b=h.shape;for(const j of h.keys){const w=b[j],C=w._zod.optout==="optional",N=w._zod.run({value:p[j],issues:[]},g);N instanceof Promise?x.push(N.then(_=>Gu(_,m,j,p,C))):Gu(N,m,j,p,C)}return d?C0(x,p,m,g,s.value,t):x.length?Promise.all(x).then(()=>m):m}}),AA=I("$ZodObjectJIT",(t,a)=>{CA.init(t,a);const l=t._zod.parse,s=Wu(()=>E0(a)),o=j=>{var q;const w=new PC(["shape","payload","ctx"]),C=s.value,N=B=>{const F=Py(B);return`shape[${F}]._zod.run({ value: input[${F}], issues: [] }, ctx)`};w.write("const input = payload.value;");const _=Object.create(null);let R=0;for(const B of C.keys)_[B]=`key_${R++}`;w.write("const newResult = {};");for(const B of C.keys){const F=_[B],J=Py(B),K=j[B],k=((q=K==null?void 0:K._zod)==null?void 0:q.optout)==="optional";w.write(`const ${F} = ${N(B)};`),k?w.write(`
|
|
228
|
-
if (${F}.issues.length) {
|
|
229
|
-
if (${J} in input) {
|
|
230
|
-
payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
|
|
231
|
-
...iss,
|
|
232
|
-
path: iss.path ? [${J}, ...iss.path] : [${J}]
|
|
233
|
-
})));
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (${F}.value === undefined) {
|
|
238
|
-
if (${J} in input) {
|
|
239
|
-
newResult[${J}] = undefined;
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
newResult[${J}] = ${F}.value;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
`):w.write(`
|
|
246
|
-
if (${F}.issues.length) {
|
|
247
|
-
payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
|
|
248
|
-
...iss,
|
|
249
|
-
path: iss.path ? [${J}, ...iss.path] : [${J}]
|
|
250
|
-
})));
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (${F}.value === undefined) {
|
|
254
|
-
if (${J} in input) {
|
|
255
|
-
newResult[${J}] = undefined;
|
|
256
|
-
}
|
|
257
|
-
} else {
|
|
258
|
-
newResult[${J}] = ${F}.value;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
`)}w.write("payload.value = newResult;"),w.write("return payload;");const Q=w.compile();return(B,F)=>Q(j,B,F)};let d;const h=Bi,m=!c0.jitless,p=m&&Q2.value,x=a.catchall;let b;t._zod.parse=(j,w)=>{b??(b=s.value);const C=j.value;return h(C)?m&&p&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(d||(d=o(a.shape)),j=d(j,w),x?C0([],C,j,w,b,t):j):l(j,w):(j.issues.push({expected:"object",code:"invalid_type",input:C,inst:t}),j)}});function Jy(t,a,l,s){for(const d of t)if(d.issues.length===0)return a.value=d.value,a;const o=t.filter(d=>!is(d));return o.length===1?(a.value=o[0].value,o[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:l,errors:t.map(d=>d.issues.map(h=>Cr(h,s,Er())))}),a)}const A0=I("$ZodUnion",(t,a)=>{ft.init(t,a),Ye(t._zod,"optin",()=>a.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ye(t._zod,"optout",()=>a.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ye(t._zod,"values",()=>{if(a.options.every(o=>o._zod.values))return new Set(a.options.flatMap(o=>Array.from(o._zod.values)))}),Ye(t._zod,"pattern",()=>{if(a.options.every(o=>o._zod.pattern)){const o=a.options.map(d=>d._zod.pattern);return new RegExp(`^(${o.map(d=>Kh(d.source)).join("|")})$`)}});const l=a.options.length===1,s=a.options[0]._zod.run;t._zod.parse=(o,d)=>{if(l)return s(o,d);let h=!1;const m=[];for(const g of a.options){const p=g._zod.run({value:o.value,issues:[]},d);if(p instanceof Promise)m.push(p),h=!0;else{if(p.issues.length===0)return p;m.push(p)}}return h?Promise.all(m).then(g=>Jy(g,o,t,d)):Jy(m,o,t,d)}}),TA=I("$ZodDiscriminatedUnion",(t,a)=>{a.inclusive=!1,A0.init(t,a);const l=t._zod.parse;Ye(t._zod,"propValues",()=>{const o={};for(const d of a.options){const h=d._zod.propValues;if(!h||Object.keys(h).length===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(d)}"`);for(const[m,g]of Object.entries(h)){o[m]||(o[m]=new Set);for(const p of g)o[m].add(p)}}return o});const s=Wu(()=>{var h;const o=a.options,d=new Map;for(const m of o){const g=(h=m._zod.propValues)==null?void 0:h[a.discriminator];if(!g||g.size===0)throw new Error(`Invalid discriminated union option at index "${a.options.indexOf(m)}"`);for(const p of g){if(d.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);d.set(p,m)}}return d});t._zod.parse=(o,d)=>{const h=o.value;if(!Bi(h))return o.issues.push({code:"invalid_type",expected:"object",input:h,inst:t}),o;const m=s.value.get(h==null?void 0:h[a.discriminator]);return m?m._zod.run(o,d):a.unionFallback?l(o,d):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:a.discriminator,input:h,path:[a.discriminator],inst:t}),o)}}),zA=I("$ZodIntersection",(t,a)=>{ft.init(t,a),t._zod.parse=(l,s)=>{const o=l.value,d=a.left._zod.run({value:o,issues:[]},s),h=a.right._zod.run({value:o,issues:[]},s);return d instanceof Promise||h instanceof Promise?Promise.all([d,h]).then(([g,p])=>Wy(l,g,p)):Wy(l,d,h)}});function xh(t,a){if(t===a)return{valid:!0,data:t};if(t instanceof Date&&a instanceof Date&&+t==+a)return{valid:!0,data:t};if(_s(t)&&_s(a)){const l=Object.keys(a),s=Object.keys(t).filter(d=>l.indexOf(d)!==-1),o={...t,...a};for(const d of s){const h=xh(t[d],a[d]);if(!h.valid)return{valid:!1,mergeErrorPath:[d,...h.mergeErrorPath]};o[d]=h.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(a)){if(t.length!==a.length)return{valid:!1,mergeErrorPath:[]};const l=[];for(let s=0;s<t.length;s++){const o=t[s],d=a[s],h=xh(o,d);if(!h.valid)return{valid:!1,mergeErrorPath:[s,...h.mergeErrorPath]};l.push(h.data)}return{valid:!0,data:l}}return{valid:!1,mergeErrorPath:[]}}function Wy(t,a,l){const s=new Map;let o;for(const m of a.issues)if(m.code==="unrecognized_keys"){o??(o=m);for(const g of m.keys)s.has(g)||s.set(g,{}),s.get(g).l=!0}else t.issues.push(m);for(const m of l.issues)if(m.code==="unrecognized_keys")for(const g of m.keys)s.has(g)||s.set(g,{}),s.get(g).r=!0;else t.issues.push(m);const d=[...s].filter(([,m])=>m.l&&m.r).map(([m])=>m);if(d.length&&o&&t.issues.push({...o,keys:d}),is(t))return t;const h=xh(a.value,l.value);if(!h.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(h.mergeErrorPath)}`);return t.value=h.data,t}const OA=I("$ZodRecord",(t,a)=>{ft.init(t,a),t._zod.parse=(l,s)=>{const o=l.value;if(!_s(o))return l.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),l;const d=[],h=a.keyType._zod.values;if(h){l.value={};const m=new Set;for(const p of h)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){m.add(typeof p=="number"?p.toString():p);const x=a.valueType._zod.run({value:o[p],issues:[]},s);x instanceof Promise?d.push(x.then(b=>{b.issues.length&&l.issues.push(...os(p,b.issues)),l.value[p]=b.value})):(x.issues.length&&l.issues.push(...os(p,x.issues)),l.value[p]=x.value)}let g;for(const p in o)m.has(p)||(g=g??[],g.push(p));g&&g.length>0&&l.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:g})}else{l.value={};for(const m of Reflect.ownKeys(o)){if(m==="__proto__")continue;let g=a.keyType._zod.run({value:m,issues:[]},s);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&x0.test(m)&&g.issues.length){const b=a.keyType._zod.run({value:Number(m),issues:[]},s);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(g=b)}if(g.issues.length){a.mode==="loose"?l.value[m]=o[m]:l.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(b=>Cr(b,s,Er())),input:m,path:[m],inst:t});continue}const x=a.valueType._zod.run({value:o[m],issues:[]},s);x instanceof Promise?d.push(x.then(b=>{b.issues.length&&l.issues.push(...os(m,b.issues)),l.value[g.value]=b.value})):(x.issues.length&&l.issues.push(...os(m,x.issues)),l.value[g.value]=x.value)}}return d.length?Promise.all(d).then(()=>l):l}}),RA=I("$ZodEnum",(t,a)=>{ft.init(t,a);const l=d0(a.entries),s=new Set(l);t._zod.values=s,t._zod.pattern=new RegExp(`^(${l.filter(o=>G2.has(typeof o)).map(o=>typeof o=="string"?Es(o):o.toString()).join("|")})$`),t._zod.parse=(o,d)=>{const h=o.value;return s.has(h)||o.issues.push({code:"invalid_value",values:l,input:h,inst:t}),o}}),MA=I("$ZodLiteral",(t,a)=>{if(ft.init(t,a),a.values.length===0)throw new Error("Cannot create literal schema with no valid values");const l=new Set(a.values);t._zod.values=l,t._zod.pattern=new RegExp(`^(${a.values.map(s=>typeof s=="string"?Es(s):s?Es(s.toString()):String(s)).join("|")})$`),t._zod.parse=(s,o)=>{const d=s.value;return l.has(d)||s.issues.push({code:"invalid_value",values:a.values,input:d,inst:t}),s}}),kA=I("$ZodTransform",(t,a)=>{ft.init(t,a),t._zod.parse=(l,s)=>{if(s.direction==="backward")throw new u0(t.constructor.name);const o=a.transform(l.value,l);if(s.async)return(o instanceof Promise?o:Promise.resolve(o)).then(h=>(l.value=h,l));if(o instanceof Promise)throw new us;return l.value=o,l}});function eb(t,a){return t.issues.length&&a===void 0?{issues:[],value:void 0}:t}const T0=I("$ZodOptional",(t,a)=>{ft.init(t,a),t._zod.optin="optional",t._zod.optout="optional",Ye(t._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),Ye(t._zod,"pattern",()=>{const l=a.innerType._zod.pattern;return l?new RegExp(`^(${Kh(l.source)})?$`):void 0}),t._zod.parse=(l,s)=>{if(a.innerType._zod.optin==="optional"){const o=a.innerType._zod.run(l,s);return o instanceof Promise?o.then(d=>eb(d,l.value)):eb(o,l.value)}return l.value===void 0?l:a.innerType._zod.run(l,s)}}),DA=I("$ZodExactOptional",(t,a)=>{T0.init(t,a),Ye(t._zod,"values",()=>a.innerType._zod.values),Ye(t._zod,"pattern",()=>a.innerType._zod.pattern),t._zod.parse=(l,s)=>a.innerType._zod.run(l,s)}),UA=I("$ZodNullable",(t,a)=>{ft.init(t,a),Ye(t._zod,"optin",()=>a.innerType._zod.optin),Ye(t._zod,"optout",()=>a.innerType._zod.optout),Ye(t._zod,"pattern",()=>{const l=a.innerType._zod.pattern;return l?new RegExp(`^(${Kh(l.source)}|null)$`):void 0}),Ye(t._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),t._zod.parse=(l,s)=>l.value===null?l:a.innerType._zod.run(l,s)}),LA=I("$ZodDefault",(t,a)=>{ft.init(t,a),t._zod.optin="optional",Ye(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(l,s)=>{if(s.direction==="backward")return a.innerType._zod.run(l,s);if(l.value===void 0)return l.value=a.defaultValue,l;const o=a.innerType._zod.run(l,s);return o instanceof Promise?o.then(d=>tb(d,a)):tb(o,a)}});function tb(t,a){return t.value===void 0&&(t.value=a.defaultValue),t}const ZA=I("$ZodPrefault",(t,a)=>{ft.init(t,a),t._zod.optin="optional",Ye(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(l,s)=>(s.direction==="backward"||l.value===void 0&&(l.value=a.defaultValue),a.innerType._zod.run(l,s))}),qA=I("$ZodNonOptional",(t,a)=>{ft.init(t,a),Ye(t._zod,"values",()=>{const l=a.innerType._zod.values;return l?new Set([...l].filter(s=>s!==void 0)):void 0}),t._zod.parse=(l,s)=>{const o=a.innerType._zod.run(l,s);return o instanceof Promise?o.then(d=>nb(d,t)):nb(o,t)}});function nb(t,a){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:a}),t}const BA=I("$ZodCatch",(t,a)=>{ft.init(t,a),Ye(t._zod,"optin",()=>a.innerType._zod.optin),Ye(t._zod,"optout",()=>a.innerType._zod.optout),Ye(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(l,s)=>{if(s.direction==="backward")return a.innerType._zod.run(l,s);const o=a.innerType._zod.run(l,s);return o instanceof Promise?o.then(d=>(l.value=d.value,d.issues.length&&(l.value=a.catchValue({...l,error:{issues:d.issues.map(h=>Cr(h,s,Er()))},input:l.value}),l.issues=[]),l)):(l.value=o.value,o.issues.length&&(l.value=a.catchValue({...l,error:{issues:o.issues.map(d=>Cr(d,s,Er()))},input:l.value}),l.issues=[]),l)}}),$A=I("$ZodPipe",(t,a)=>{ft.init(t,a),Ye(t._zod,"values",()=>a.in._zod.values),Ye(t._zod,"optin",()=>a.in._zod.optin),Ye(t._zod,"optout",()=>a.out._zod.optout),Ye(t._zod,"propValues",()=>a.in._zod.propValues),t._zod.parse=(l,s)=>{if(s.direction==="backward"){const d=a.out._zod.run(l,s);return d instanceof Promise?d.then(h=>Cu(h,a.in,s)):Cu(d,a.in,s)}const o=a.in._zod.run(l,s);return o instanceof Promise?o.then(d=>Cu(d,a.out,s)):Cu(o,a.out,s)}});function Cu(t,a,l){return t.issues.length?(t.aborted=!0,t):a._zod.run({value:t.value,issues:t.issues},l)}const HA=I("$ZodReadonly",(t,a)=>{ft.init(t,a),Ye(t._zod,"propValues",()=>a.innerType._zod.propValues),Ye(t._zod,"values",()=>a.innerType._zod.values),Ye(t._zod,"optin",()=>{var l,s;return(s=(l=a.innerType)==null?void 0:l._zod)==null?void 0:s.optin}),Ye(t._zod,"optout",()=>{var l,s;return(s=(l=a.innerType)==null?void 0:l._zod)==null?void 0:s.optout}),t._zod.parse=(l,s)=>{if(s.direction==="backward")return a.innerType._zod.run(l,s);const o=a.innerType._zod.run(l,s);return o instanceof Promise?o.then(ab):ab(o)}});function ab(t){return t.value=Object.freeze(t.value),t}const QA=I("$ZodCustom",(t,a)=>{cn.init(t,a),ft.init(t,a),t._zod.parse=(l,s)=>l,t._zod.check=l=>{const s=l.value,o=a.fn(s);if(o instanceof Promise)return o.then(d=>rb(d,l,s,t));rb(o,l,s,t)}});function rb(t,a,l,s){if(!t){const o={code:"custom",input:l,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(o.params=s._zod.def.params),a.issues.push($i(o))}}var lb;class GA{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...l){const s=l[0];return this._map.set(a,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const l=this._map.get(a);return l&&typeof l=="object"&&"id"in l&&this._idmap.delete(l.id),this._map.delete(a),this}get(a){const l=a._zod.parent;if(l){const s={...this.get(l)??{}};delete s.id;const o={...s,...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 IA(){return new GA}(lb=globalThis).__zod_globalRegistry??(lb.__zod_globalRegistry=IA());const ki=globalThis.__zod_globalRegistry;function VA(t,a){return new t({type:"string",...he(a)})}function YA(t,a){return new t({type:"string",format:"email",check:"string_format",abort:!1,...he(a)})}function sb(t,a){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...he(a)})}function KA(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...he(a)})}function PA(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...he(a)})}function FA(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...he(a)})}function XA(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...he(a)})}function JA(t,a){return new t({type:"string",format:"url",check:"string_format",abort:!1,...he(a)})}function WA(t,a){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...he(a)})}function eT(t,a){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...he(a)})}function tT(t,a){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...he(a)})}function nT(t,a){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...he(a)})}function aT(t,a){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...he(a)})}function rT(t,a){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...he(a)})}function lT(t,a){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...he(a)})}function sT(t,a){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...he(a)})}function iT(t,a){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...he(a)})}function oT(t,a){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...he(a)})}function uT(t,a){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...he(a)})}function cT(t,a){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...he(a)})}function dT(t,a){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...he(a)})}function fT(t,a){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...he(a)})}function hT(t,a){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...he(a)})}function mT(t,a){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...he(a)})}function pT(t,a){return new t({type:"string",format:"date",check:"string_format",...he(a)})}function gT(t,a){return new t({type:"string",format:"time",check:"string_format",precision:null,...he(a)})}function vT(t,a){return new t({type:"string",format:"duration",check:"string_format",...he(a)})}function yT(t,a){return new t({type:"number",checks:[],...he(a)})}function bT(t,a){return new t({type:"number",coerce:!0,checks:[],...he(a)})}function xT(t,a){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...he(a)})}function ST(t,a){return new t({type:"boolean",...he(a)})}function jT(t){return new t({type:"unknown"})}function NT(t,a){return new t({type:"never",...he(a)})}function ib(t,a){return new j0({check:"less_than",...he(a),value:t,inclusive:!1})}function Zf(t,a){return new j0({check:"less_than",...he(a),value:t,inclusive:!0})}function ob(t,a){return new N0({check:"greater_than",...he(a),value:t,inclusive:!1})}function qf(t,a){return new N0({check:"greater_than",...he(a),value:t,inclusive:!0})}function ub(t,a){return new LC({check:"multiple_of",...he(a),value:t})}function z0(t,a){return new qC({check:"max_length",...he(a),maximum:t})}function Iu(t,a){return new BC({check:"min_length",...he(a),minimum:t})}function O0(t,a){return new $C({check:"length_equals",...he(a),length:t})}function wT(t,a){return new HC({check:"string_format",format:"regex",...he(a),pattern:t})}function _T(t){return new QC({check:"string_format",format:"lowercase",...he(t)})}function ET(t){return new GC({check:"string_format",format:"uppercase",...he(t)})}function CT(t,a){return new IC({check:"string_format",format:"includes",...he(a),includes:t})}function AT(t,a){return new VC({check:"string_format",format:"starts_with",...he(a),prefix:t})}function TT(t,a){return new YC({check:"string_format",format:"ends_with",...he(a),suffix:t})}function Rs(t){return new KC({check:"overwrite",tx:t})}function zT(t){return Rs(a=>a.normalize(t))}function OT(){return Rs(t=>t.trim())}function RT(){return Rs(t=>t.toLowerCase())}function MT(){return Rs(t=>t.toUpperCase())}function kT(){return Rs(t=>H2(t))}function DT(t,a,l){return new t({type:"array",element:a,...he(l)})}function UT(t,a,l){return new t({type:"custom",check:"custom",fn:a,...he(l)})}function LT(t){const a=ZT(l=>(l.addIssue=s=>{if(typeof s=="string")l.issues.push($i(s,l.value,a._zod.def));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=l.value),o.inst??(o.inst=a),o.continue??(o.continue=!a._zod.def.abort),l.issues.push($i(o))}},t(l.value,l)));return a}function ZT(t,a){const l=new cn({check:"custom",...he(a)});return l._zod.check=t,l}function R0(t){let a=(t==null?void 0:t.target)??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??ki,target:a,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function Ct(t,a,l={path:[],schemaPath:[]}){var x,b;var s;const o=t._zod.def,d=a.seen.get(t);if(d)return d.count++,l.schemaPath.includes(t)&&(d.cycle=l.path),d.schema;const h={schema:{},count:1,cycle:void 0,path:l.path};a.seen.set(t,h);const m=(b=(x=t._zod).toJSONSchema)==null?void 0:b.call(x);if(m)h.schema=m;else{const j={...l,schemaPath:[...l.schemaPath,t],path:l.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(a,h.schema,j);else{const C=h.schema,N=a.processors[o.type];if(!N)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);N(t,a,C,j)}const w=t._zod.parent;w&&(h.ref||(h.ref=w),Ct(w,a,j),a.seen.get(w).isParent=!0)}const g=a.metadataRegistry.get(t);return g&&Object.assign(h.schema,g),a.io==="input"&&Kt(t)&&(delete h.schema.examples,delete h.schema.default),a.io==="input"&&h.schema._prefault&&((s=h.schema).default??(s.default=h.schema._prefault)),delete h.schema._prefault,a.seen.get(t).schema}function M0(t,a){var h,m,g,p;const l=t.seen.get(a);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const x of t.seen.entries()){const b=(h=t.metadataRegistry.get(x[0]))==null?void 0:h.id;if(b){const j=s.get(b);if(j&&j!==x[0])throw new Error(`Duplicate schema id "${b}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(b,x[0])}}const o=x=>{var N;const b=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const _=(N=t.external.registry.get(x[0]))==null?void 0:N.id,R=t.external.uri??(q=>q);if(_)return{ref:R(_)};const Q=x[1].defId??x[1].schema.id??`schema${t.counter++}`;return x[1].defId=Q,{defId:Q,ref:`${R("__shared")}#/${b}/${Q}`}}if(x[1]===l)return{ref:"#"};const w=`#/${b}/`,C=x[1].schema.id??`__schema${t.counter++}`;return{defId:C,ref:w+C}},d=x=>{if(x[1].schema.$ref)return;const b=x[1],{ref:j,defId:w}=o(x);b.def={...b.schema},w&&(b.defId=w);const C=b.schema;for(const N in C)delete C[N];C.$ref=j};if(t.cycles==="throw")for(const x of t.seen.entries()){const b=x[1];if(b.cycle)throw new Error(`Cycle detected: #/${(m=b.cycle)==null?void 0:m.join("/")}/<root>
|
|
262
|
-
|
|
263
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const x of t.seen.entries()){const b=x[1];if(a===x[0]){d(x);continue}if(t.external){const w=(g=t.external.registry.get(x[0]))==null?void 0:g.id;if(a!==x[0]&&w){d(x);continue}}if((p=t.metadataRegistry.get(x[0]))==null?void 0:p.id){d(x);continue}if(b.cycle){d(x);continue}if(b.count>1&&t.reused==="ref"){d(x);continue}}}function k0(t,a){var h,m,g;const l=t.seen.get(a);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=p=>{const x=t.seen.get(p);if(x.ref===null)return;const b=x.def??x.schema,j={...b},w=x.ref;if(x.ref=null,w){s(w);const N=t.seen.get(w),_=N.schema;if(_.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(b.allOf=b.allOf??[],b.allOf.push(_)):Object.assign(b,_),Object.assign(b,j),p._zod.parent===w)for(const Q in b)Q==="$ref"||Q==="allOf"||Q in j||delete b[Q];if(_.$ref&&N.def)for(const Q in b)Q==="$ref"||Q==="allOf"||Q in N.def&&JSON.stringify(b[Q])===JSON.stringify(N.def[Q])&&delete b[Q]}const C=p._zod.parent;if(C&&C!==w){s(C);const N=t.seen.get(C);if(N!=null&&N.schema.$ref&&(b.$ref=N.schema.$ref,N.def))for(const _ in b)_==="$ref"||_==="allOf"||_ in N.def&&JSON.stringify(b[_])===JSON.stringify(N.def[_])&&delete b[_]}t.override({zodSchema:p,jsonSchema:b,path:x.path??[]})};for(const p of[...t.seen.entries()].reverse())s(p[0]);const o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,(h=t.external)!=null&&h.uri){const p=(m=t.external.registry.get(a))==null?void 0:m.id;if(!p)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(p)}Object.assign(o,l.def??l.schema);const d=((g=t.external)==null?void 0:g.defs)??{};for(const p of t.seen.entries()){const x=p[1];x.def&&x.defId&&(d[x.defId]=x.def)}t.external||Object.keys(d).length>0&&(t.target==="draft-2020-12"?o.$defs=d:o.definitions=d);try{const p=JSON.parse(JSON.stringify(o));return Object.defineProperty(p,"~standard",{value:{...a["~standard"],jsonSchema:{input:Vu(a,"input",t.processors),output:Vu(a,"output",t.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Kt(t,a){const l=a??{seen:new Set};if(l.seen.has(t))return!1;l.seen.add(t);const s=t._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return Kt(s.element,l);if(s.type==="set")return Kt(s.valueType,l);if(s.type==="lazy")return Kt(s.getter(),l);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return Kt(s.innerType,l);if(s.type==="intersection")return Kt(s.left,l)||Kt(s.right,l);if(s.type==="record"||s.type==="map")return Kt(s.keyType,l)||Kt(s.valueType,l);if(s.type==="pipe")return Kt(s.in,l)||Kt(s.out,l);if(s.type==="object"){for(const o in s.shape)if(Kt(s.shape[o],l))return!0;return!1}if(s.type==="union"){for(const o of s.options)if(Kt(o,l))return!0;return!1}if(s.type==="tuple"){for(const o of s.items)if(Kt(o,l))return!0;return!!(s.rest&&Kt(s.rest,l))}return!1}const qT=(t,a={})=>l=>{const s=R0({...l,processors:a});return Ct(t,s),M0(s,t),k0(s,t)},Vu=(t,a,l={})=>s=>{const{libraryOptions:o,target:d}=s??{},h=R0({...o??{},target:d,io:a,processors:l});return Ct(t,h),M0(h,t),k0(h,t)},BT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$T=(t,a,l,s)=>{const o=l;o.type="string";const{minimum:d,maximum:h,format:m,patterns:g,contentEncoding:p}=t._zod.bag;if(typeof d=="number"&&(o.minLength=d),typeof h=="number"&&(o.maxLength=h),m&&(o.format=BT[m]??m,o.format===""&&delete o.format,m==="time"&&delete o.format),p&&(o.contentEncoding=p),g&&g.size>0){const x=[...g];x.length===1?o.pattern=x[0].source:x.length>1&&(o.allOf=[...x.map(b=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:b.source}))])}},HT=(t,a,l,s)=>{const o=l,{minimum:d,maximum:h,format:m,multipleOf:g,exclusiveMaximum:p,exclusiveMinimum:x}=t._zod.bag;typeof m=="string"&&m.includes("int")?o.type="integer":o.type="number",typeof x=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(o.minimum=x,o.exclusiveMinimum=!0):o.exclusiveMinimum=x),typeof d=="number"&&(o.minimum=d,typeof x=="number"&&a.target!=="draft-04"&&(x>=d?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 h=="number"&&(o.maximum=h,typeof p=="number"&&a.target!=="draft-04"&&(p<=h?delete o.maximum:delete o.exclusiveMaximum)),typeof g=="number"&&(o.multipleOf=g)},QT=(t,a,l,s)=>{l.type="boolean"},GT=(t,a,l,s)=>{l.not={}},IT=(t,a,l,s)=>{},VT=(t,a,l,s)=>{const o=t._zod.def,d=d0(o.entries);d.every(h=>typeof h=="number")&&(l.type="number"),d.every(h=>typeof h=="string")&&(l.type="string"),l.enum=d},YT=(t,a,l,s)=>{const o=t._zod.def,d=[];for(const h of o.values)if(h===void 0){if(a.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof h=="bigint"){if(a.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");d.push(Number(h))}else d.push(h);if(d.length!==0)if(d.length===1){const h=d[0];l.type=h===null?"null":typeof h,a.target==="draft-04"||a.target==="openapi-3.0"?l.enum=[h]:l.const=h}else d.every(h=>typeof h=="number")&&(l.type="number"),d.every(h=>typeof h=="string")&&(l.type="string"),d.every(h=>typeof h=="boolean")&&(l.type="boolean"),d.every(h=>h===null)&&(l.type="null"),l.enum=d},KT=(t,a,l,s)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PT=(t,a,l,s)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},FT=(t,a,l,s)=>{const o=l,d=t._zod.def,{minimum:h,maximum:m}=t._zod.bag;typeof h=="number"&&(o.minItems=h),typeof m=="number"&&(o.maxItems=m),o.type="array",o.items=Ct(d.element,a,{...s,path:[...s.path,"items"]})},XT=(t,a,l,s)=>{var p;const o=l,d=t._zod.def;o.type="object",o.properties={};const h=d.shape;for(const x in h)o.properties[x]=Ct(h[x],a,{...s,path:[...s.path,"properties",x]});const m=new Set(Object.keys(h)),g=new Set([...m].filter(x=>{const b=d.shape[x]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));g.size>0&&(o.required=Array.from(g)),((p=d.catchall)==null?void 0:p._zod.def.type)==="never"?o.additionalProperties=!1:d.catchall?d.catchall&&(o.additionalProperties=Ct(d.catchall,a,{...s,path:[...s.path,"additionalProperties"]})):a.io==="output"&&(o.additionalProperties=!1)},JT=(t,a,l,s)=>{const o=t._zod.def,d=o.inclusive===!1,h=o.options.map((m,g)=>Ct(m,a,{...s,path:[...s.path,d?"oneOf":"anyOf",g]}));d?l.oneOf=h:l.anyOf=h},WT=(t,a,l,s)=>{const o=t._zod.def,d=Ct(o.left,a,{...s,path:[...s.path,"allOf",0]}),h=Ct(o.right,a,{...s,path:[...s.path,"allOf",1]}),m=p=>"allOf"in p&&Object.keys(p).length===1,g=[...m(d)?d.allOf:[d],...m(h)?h.allOf:[h]];l.allOf=g},ez=(t,a,l,s)=>{const o=l,d=t._zod.def;o.type="object";const h=d.keyType,m=h._zod.bag,g=m==null?void 0:m.patterns;if(d.mode==="loose"&&g&&g.size>0){const x=Ct(d.valueType,a,{...s,path:[...s.path,"patternProperties","*"]});o.patternProperties={};for(const b of g)o.patternProperties[b.source]=x}else(a.target==="draft-07"||a.target==="draft-2020-12")&&(o.propertyNames=Ct(d.keyType,a,{...s,path:[...s.path,"propertyNames"]})),o.additionalProperties=Ct(d.valueType,a,{...s,path:[...s.path,"additionalProperties"]});const p=h._zod.values;if(p){const x=[...p].filter(b=>typeof b=="string"||typeof b=="number");x.length>0&&(o.required=x)}},tz=(t,a,l,s)=>{const o=t._zod.def,d=Ct(o.innerType,a,s),h=a.seen.get(t);a.target==="openapi-3.0"?(h.ref=o.innerType,l.nullable=!0):l.anyOf=[d,{type:"null"}]},nz=(t,a,l,s)=>{const o=t._zod.def;Ct(o.innerType,a,s);const d=a.seen.get(t);d.ref=o.innerType},az=(t,a,l,s)=>{const o=t._zod.def;Ct(o.innerType,a,s);const d=a.seen.get(t);d.ref=o.innerType,l.default=JSON.parse(JSON.stringify(o.defaultValue))},rz=(t,a,l,s)=>{const o=t._zod.def;Ct(o.innerType,a,s);const d=a.seen.get(t);d.ref=o.innerType,a.io==="input"&&(l._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},lz=(t,a,l,s)=>{const o=t._zod.def;Ct(o.innerType,a,s);const d=a.seen.get(t);d.ref=o.innerType;let h;try{h=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=h},sz=(t,a,l,s)=>{const o=t._zod.def,d=a.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ct(d,a,s);const h=a.seen.get(t);h.ref=d},iz=(t,a,l,s)=>{const o=t._zod.def;Ct(o.innerType,a,s);const d=a.seen.get(t);d.ref=o.innerType,l.readOnly=!0},D0=(t,a,l,s)=>{const o=t._zod.def;Ct(o.innerType,a,s);const d=a.seen.get(t);d.ref=o.innerType},oz=I("ZodISODateTime",(t,a)=>{oA.init(t,a),mt.init(t,a)});function uz(t){return mT(oz,t)}const cz=I("ZodISODate",(t,a)=>{uA.init(t,a),mt.init(t,a)});function dz(t){return pT(cz,t)}const fz=I("ZodISOTime",(t,a)=>{cA.init(t,a),mt.init(t,a)});function hz(t){return gT(fz,t)}const mz=I("ZodISODuration",(t,a)=>{dA.init(t,a),mt.init(t,a)});function pz(t){return vT(mz,t)}const gz=(t,a)=>{p0.init(t,a),t.name="ZodError",Object.defineProperties(t,{format:{value:l=>tC(t,l)},flatten:{value:l=>eC(t,l)},addIssue:{value:l=>{t.issues.push(l),t.message=JSON.stringify(t.issues,bh,2)}},addIssues:{value:l=>{t.issues.push(...l),t.message=JSON.stringify(t.issues,bh,2)}},isEmpty:{get(){return t.issues.length===0}}})},Un=I("ZodError",gz,{Parent:Error}),vz=Fh(Un),yz=Xh(Un),bz=ec(Un),xz=tc(Un),Sz=rC(Un),jz=lC(Un),Nz=sC(Un),wz=iC(Un),_z=oC(Un),Ez=uC(Un),Cz=cC(Un),Az=dC(Un),ht=I("ZodType",(t,a)=>(ft.init(t,a),Object.assign(t["~standard"],{jsonSchema:{input:Vu(t,"input"),output:Vu(t,"output")}}),t.toJSONSchema=qT(t,{}),t.def=a,t.type=a.type,Object.defineProperty(t,"_def",{value:a}),t.check=(...l)=>t.clone(zr(a,{checks:[...a.checks??[],...l.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),t.with=t.check,t.clone=(l,s)=>Or(t,l,s),t.brand=()=>t,t.register=((l,s)=>(l.add(t,s),t)),t.parse=(l,s)=>vz(t,l,s,{callee:t.parse}),t.safeParse=(l,s)=>bz(t,l,s),t.parseAsync=async(l,s)=>yz(t,l,s,{callee:t.parseAsync}),t.safeParseAsync=async(l,s)=>xz(t,l,s),t.spa=t.safeParseAsync,t.encode=(l,s)=>Sz(t,l,s),t.decode=(l,s)=>jz(t,l,s),t.encodeAsync=async(l,s)=>Nz(t,l,s),t.decodeAsync=async(l,s)=>wz(t,l,s),t.safeEncode=(l,s)=>_z(t,l,s),t.safeDecode=(l,s)=>Ez(t,l,s),t.safeEncodeAsync=async(l,s)=>Cz(t,l,s),t.safeDecodeAsync=async(l,s)=>Az(t,l,s),t.refine=(l,s)=>t.check(NO(l,s)),t.superRefine=l=>t.check(wO(l)),t.overwrite=l=>t.check(Rs(l)),t.optional=()=>fb(t),t.exactOptional=()=>cO(t),t.nullable=()=>hb(t),t.nullish=()=>fb(hb(t)),t.nonoptional=l=>gO(t,l),t.array=()=>ea(t),t.or=l=>eO([t,l]),t.and=l=>rO(t,l),t.transform=l=>mb(t,oO(l)),t.default=l=>hO(t,l),t.prefault=l=>pO(t,l),t.catch=l=>yO(t,l),t.pipe=l=>mb(t,l),t.readonly=()=>SO(t),t.describe=l=>{const s=t.clone();return ki.add(s,{description:l}),s},Object.defineProperty(t,"description",{get(){var l;return(l=ki.get(t))==null?void 0:l.description},configurable:!0}),t.meta=(...l)=>{if(l.length===0)return ki.get(t);const s=t.clone();return ki.add(s,l[0]),s},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=l=>l(t),t)),U0=I("_ZodString",(t,a)=>{Jh.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(s,o,d)=>$T(t,s,o);const l=t._zod.bag;t.format=l.format??null,t.minLength=l.minimum??null,t.maxLength=l.maximum??null,t.regex=(...s)=>t.check(wT(...s)),t.includes=(...s)=>t.check(CT(...s)),t.startsWith=(...s)=>t.check(AT(...s)),t.endsWith=(...s)=>t.check(TT(...s)),t.min=(...s)=>t.check(Iu(...s)),t.max=(...s)=>t.check(z0(...s)),t.length=(...s)=>t.check(O0(...s)),t.nonempty=(...s)=>t.check(Iu(1,...s)),t.lowercase=s=>t.check(_T(s)),t.uppercase=s=>t.check(ET(s)),t.trim=()=>t.check(OT()),t.normalize=(...s)=>t.check(zT(...s)),t.toLowerCase=()=>t.check(RT()),t.toUpperCase=()=>t.check(MT()),t.slugify=()=>t.check(kT())}),Tz=I("ZodString",(t,a)=>{Jh.init(t,a),U0.init(t,a),t.email=l=>t.check(YA(zz,l)),t.url=l=>t.check(JA(Oz,l)),t.jwt=l=>t.check(hT(Vz,l)),t.emoji=l=>t.check(WA(Rz,l)),t.guid=l=>t.check(sb(cb,l)),t.uuid=l=>t.check(KA(Au,l)),t.uuidv4=l=>t.check(PA(Au,l)),t.uuidv6=l=>t.check(FA(Au,l)),t.uuidv7=l=>t.check(XA(Au,l)),t.nanoid=l=>t.check(eT(Mz,l)),t.guid=l=>t.check(sb(cb,l)),t.cuid=l=>t.check(tT(kz,l)),t.cuid2=l=>t.check(nT(Dz,l)),t.ulid=l=>t.check(aT(Uz,l)),t.base64=l=>t.check(cT(Qz,l)),t.base64url=l=>t.check(dT(Gz,l)),t.xid=l=>t.check(rT(Lz,l)),t.ksuid=l=>t.check(lT(Zz,l)),t.ipv4=l=>t.check(sT(qz,l)),t.ipv6=l=>t.check(iT(Bz,l)),t.cidrv4=l=>t.check(oT($z,l)),t.cidrv6=l=>t.check(uT(Hz,l)),t.e164=l=>t.check(fT(Iz,l)),t.datetime=l=>t.check(uz(l)),t.date=l=>t.check(dz(l)),t.time=l=>t.check(hz(l)),t.duration=l=>t.check(pz(l))});function E(t){return VA(Tz,t)}const mt=I("ZodStringFormat",(t,a)=>{dt.init(t,a),U0.init(t,a)}),zz=I("ZodEmail",(t,a)=>{WC.init(t,a),mt.init(t,a)}),cb=I("ZodGUID",(t,a)=>{XC.init(t,a),mt.init(t,a)}),Au=I("ZodUUID",(t,a)=>{JC.init(t,a),mt.init(t,a)}),Oz=I("ZodURL",(t,a)=>{eA.init(t,a),mt.init(t,a)}),Rz=I("ZodEmoji",(t,a)=>{tA.init(t,a),mt.init(t,a)}),Mz=I("ZodNanoID",(t,a)=>{nA.init(t,a),mt.init(t,a)}),kz=I("ZodCUID",(t,a)=>{aA.init(t,a),mt.init(t,a)}),Dz=I("ZodCUID2",(t,a)=>{rA.init(t,a),mt.init(t,a)}),Uz=I("ZodULID",(t,a)=>{lA.init(t,a),mt.init(t,a)}),Lz=I("ZodXID",(t,a)=>{sA.init(t,a),mt.init(t,a)}),Zz=I("ZodKSUID",(t,a)=>{iA.init(t,a),mt.init(t,a)}),qz=I("ZodIPv4",(t,a)=>{fA.init(t,a),mt.init(t,a)}),Bz=I("ZodIPv6",(t,a)=>{hA.init(t,a),mt.init(t,a)}),$z=I("ZodCIDRv4",(t,a)=>{mA.init(t,a),mt.init(t,a)}),Hz=I("ZodCIDRv6",(t,a)=>{pA.init(t,a),mt.init(t,a)}),Qz=I("ZodBase64",(t,a)=>{gA.init(t,a),mt.init(t,a)}),Gz=I("ZodBase64URL",(t,a)=>{yA.init(t,a),mt.init(t,a)}),Iz=I("ZodE164",(t,a)=>{bA.init(t,a),mt.init(t,a)}),Vz=I("ZodJWT",(t,a)=>{SA.init(t,a),mt.init(t,a)}),Wh=I("ZodNumber",(t,a)=>{_0.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(s,o,d)=>HT(t,s,o),t.gt=(s,o)=>t.check(ob(s,o)),t.gte=(s,o)=>t.check(qf(s,o)),t.min=(s,o)=>t.check(qf(s,o)),t.lt=(s,o)=>t.check(ib(s,o)),t.lte=(s,o)=>t.check(Zf(s,o)),t.max=(s,o)=>t.check(Zf(s,o)),t.int=s=>t.check(db(s)),t.safe=s=>t.check(db(s)),t.positive=s=>t.check(ob(0,s)),t.nonnegative=s=>t.check(qf(0,s)),t.negative=s=>t.check(ib(0,s)),t.nonpositive=s=>t.check(Zf(0,s)),t.multipleOf=(s,o)=>t.check(ub(s,o)),t.step=(s,o)=>t.check(ub(s,o)),t.finite=()=>t;const l=t._zod.bag;t.minValue=Math.max(l.minimum??Number.NEGATIVE_INFINITY,l.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(l.maximum??Number.POSITIVE_INFINITY,l.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(l.format??"").includes("int")||Number.isSafeInteger(l.multipleOf??.5),t.isFinite=!0,t.format=l.format??null});function Ve(t){return yT(Wh,t)}const Yz=I("ZodNumberFormat",(t,a)=>{jA.init(t,a),Wh.init(t,a)});function db(t){return xT(Yz,t)}const Kz=I("ZodBoolean",(t,a)=>{NA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>QT(t,l,s)});function ac(t){return ST(Kz,t)}const Pz=I("ZodUnknown",(t,a)=>{wA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>IT()});function it(){return jT(Pz)}const Fz=I("ZodNever",(t,a)=>{_A.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>GT(t,l,s)});function Xz(t){return NT(Fz,t)}const Jz=I("ZodArray",(t,a)=>{EA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>FT(t,l,s,o),t.element=a.element,t.min=(l,s)=>t.check(Iu(l,s)),t.nonempty=l=>t.check(Iu(1,l)),t.max=(l,s)=>t.check(z0(l,s)),t.length=(l,s)=>t.check(O0(l,s)),t.unwrap=()=>t.element});function ea(t,a){return DT(Jz,t,a)}const Wz=I("ZodObject",(t,a)=>{AA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>XT(t,l,s,o),Ye(t,"shape",()=>a.shape),t.keyof=()=>Xe(Object.keys(t._zod.def.shape)),t.catchall=l=>t.clone({...t._zod.def,catchall:l}),t.passthrough=()=>t.clone({...t._zod.def,catchall:it()}),t.loose=()=>t.clone({...t._zod.def,catchall:it()}),t.strict=()=>t.clone({...t._zod.def,catchall:Xz()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=l=>P2(t,l),t.safeExtend=l=>F2(t,l),t.merge=l=>X2(t,l),t.pick=l=>Y2(t,l),t.omit=l=>K2(t,l),t.partial=(...l)=>J2(Z0,t,l[0]),t.required=(...l)=>W2(q0,t,l[0])});function ne(t,a){const l={type:"object",shape:t??{},...he(a)};return new Wz(l)}const L0=I("ZodUnion",(t,a)=>{A0.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>JT(t,l,s,o),t.options=a.options});function eO(t,a){return new L0({type:"union",options:t,...he(a)})}const tO=I("ZodDiscriminatedUnion",(t,a)=>{L0.init(t,a),TA.init(t,a)});function nO(t,a,l){return new tO({type:"union",options:a,discriminator:t,...he(l)})}const aO=I("ZodIntersection",(t,a)=>{zA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>WT(t,l,s,o)});function rO(t,a){return new aO({type:"intersection",left:t,right:a})}const lO=I("ZodRecord",(t,a)=>{OA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>ez(t,l,s,o),t.keyType=a.keyType,t.valueType=a.valueType});function Ot(t,a,l){return new lO({type:"record",keyType:t,valueType:a,...he(l)})}const Sh=I("ZodEnum",(t,a)=>{RA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(s,o,d)=>VT(t,s,o),t.enum=a.entries,t.options=Object.values(a.entries);const l=new Set(Object.keys(a.entries));t.extract=(s,o)=>{const d={};for(const h of s)if(l.has(h))d[h]=a.entries[h];else throw new Error(`Key ${h} not found in enum`);return new Sh({...a,checks:[],...he(o),entries:d})},t.exclude=(s,o)=>{const d={...a.entries};for(const h of s)if(l.has(h))delete d[h];else throw new Error(`Key ${h} not found in enum`);return new Sh({...a,checks:[],...he(o),entries:d})}});function Xe(t,a){const l=Array.isArray(t)?Object.fromEntries(t.map(s=>[s,s])):t;return new Sh({type:"enum",entries:l,...he(a)})}const sO=I("ZodLiteral",(t,a)=>{MA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>YT(t,l,s),t.values=new Set(a.values),Object.defineProperty(t,"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 rc(t,a){return new sO({type:"literal",values:Array.isArray(t)?t:[t],...he(a)})}const iO=I("ZodTransform",(t,a)=>{kA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>PT(t,l),t._zod.parse=(l,s)=>{if(s.direction==="backward")throw new u0(t.constructor.name);l.addIssue=d=>{if(typeof d=="string")l.issues.push($i(d,l.value,a));else{const h=d;h.fatal&&(h.continue=!1),h.code??(h.code="custom"),h.input??(h.input=l.value),h.inst??(h.inst=t),l.issues.push($i(h))}};const o=a.transform(l.value,l);return o instanceof Promise?o.then(d=>(l.value=d,l)):(l.value=o,l)}});function oO(t){return new iO({type:"transform",transform:t})}const Z0=I("ZodOptional",(t,a)=>{T0.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>D0(t,l,s,o),t.unwrap=()=>t._zod.def.innerType});function fb(t){return new Z0({type:"optional",innerType:t})}const uO=I("ZodExactOptional",(t,a)=>{DA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>D0(t,l,s,o),t.unwrap=()=>t._zod.def.innerType});function cO(t){return new uO({type:"optional",innerType:t})}const dO=I("ZodNullable",(t,a)=>{UA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>tz(t,l,s,o),t.unwrap=()=>t._zod.def.innerType});function hb(t){return new dO({type:"nullable",innerType:t})}const fO=I("ZodDefault",(t,a)=>{LA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>az(t,l,s,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function hO(t,a){return new fO({type:"default",innerType:t,get defaultValue(){return typeof a=="function"?a():h0(a)}})}const mO=I("ZodPrefault",(t,a)=>{ZA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>rz(t,l,s,o),t.unwrap=()=>t._zod.def.innerType});function pO(t,a){return new mO({type:"prefault",innerType:t,get defaultValue(){return typeof a=="function"?a():h0(a)}})}const q0=I("ZodNonOptional",(t,a)=>{qA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>nz(t,l,s,o),t.unwrap=()=>t._zod.def.innerType});function gO(t,a){return new q0({type:"nonoptional",innerType:t,...he(a)})}const vO=I("ZodCatch",(t,a)=>{BA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>lz(t,l,s,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function yO(t,a){return new vO({type:"catch",innerType:t,catchValue:typeof a=="function"?a:()=>a})}const bO=I("ZodPipe",(t,a)=>{$A.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>sz(t,l,s,o),t.in=a.in,t.out=a.out});function mb(t,a){return new bO({type:"pipe",in:t,out:a})}const xO=I("ZodReadonly",(t,a)=>{HA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>iz(t,l,s,o),t.unwrap=()=>t._zod.def.innerType});function SO(t){return new xO({type:"readonly",innerType:t})}const jO=I("ZodCustom",(t,a)=>{QA.init(t,a),ht.init(t,a),t._zod.processJSONSchema=(l,s,o)=>KT(t,l)});function NO(t,a={}){return UT(jO,t,a)}function wO(t){return LT(t)}const Bf={custom:"custom"};function lc(t){return bT(Wh,t)}const _O={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},B0=Xe(["feishu","slack","kael"]),$0=Xe(["active","inactive"]);ne({platform:B0,agentId:E().min(1),credentials:Ot(E(),it()),status:$0.default("active")});ne({agentId:E().min(1).optional(),credentials:Ot(E(),it()).optional(),status:$0.optional()});ne({id:Ve(),platform:E(),agentId:E(),hasCredentials:ac(),status:E(),createdAt:E(),updatedAt:E()});const EO=Xe(["code","reverse_token","oauth","manual"]);ne({appId:E().min(1),appSecret:E().min(1)});ne({platform:B0,externalUserId:E().min(1),agentId:E().min(1),boundVia:EO.default("manual"),displayName:E().max(200).optional()});ne({id:Ve(),platform:E(),externalUserId:E(),agentId:E(),boundVia:E().nullable(),displayName:E().nullable(),createdAt:E()});ne({feishuUserId:E().min(1),displayName:E().max(200).optional()});ne({configId:Ve(),platform:E(),agentId:E(),appId:E(),connected:ac(),lastActiveAt:E().nullable()});const H0=Xe(["online","offline"]),Q0=Xe(["idle","working","blocked","error"]),CO=Xe(["active","suspended","evicted"]);ne({chatId:E().min(1),state:CO});ne({runtimeState:Q0});ne({agentId:E().min(1),runtimeType:E().max(50),runtimeVersion:E().max(50).optional()});Xe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);ne({agentId:E(),status:H0,connectedAt:E().nullable(),lastSeenAt:E(),clientId:E().nullable().optional(),runtimeType:E().nullable().optional(),runtimeVersion:E().nullable().optional(),runtimeState:Q0.nullable().optional(),activeSessions:Ve().int().nullable().optional(),totalSessions:Ve().int().nullable().optional(),runtimeUpdatedAt:E().nullable().optional()});ne({total:Ve().int(),running:Ve().int(),byState:ne({idle:Ve().int(),working:Ve().int(),blocked:Ve().int(),error:Ve().int()}),clients:Ve().int()});const G0={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},em=Xe(["human","personal_assistant","autonomous_agent"]),tm=Xe(["private","organization"]),AO=Xe(["admin-api","portal"]);Xe(["active","suspended"]);ne({name:E().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:em,displayName:E().max(200).optional(),delegateMention:E().max(100).optional(),organizationId:E().max(100).optional(),source:AO.optional(),visibility:tm.optional(),metadata:Ot(E(),it()).optional(),managerId:E().optional(),clientId:E().min(1).max(100).optional()});ne({type:em.optional(),displayName:E().max(200).nullable().optional(),delegateMention:E().max(100).nullable().optional(),visibility:tm.optional(),metadata:Ot(E(),it()).optional(),managerId:E().nullable().optional(),clientId:E().min(1).max(100).nullable().optional()});ne({uuid:E(),name:E().nullable(),organizationId:E(),type:em,displayName:E().nullable(),delegateMention:E().nullable(),inboxId:E(),status:E(),source:E().nullable().optional(),cloudUserId:E().nullable().optional(),visibility:tm,metadata:Ot(E(),it()),managerId:E().nullable(),clientId:E().nullable(),presenceStatus:H0.optional(),createdAt:E(),updatedAt:E()});ne({repo:E().nullable(),branch:E().nullable()});const TO=32e3,nm=/^[a-z0-9][a-z0-9_-]{0,63}$/i,zO=/^[A-Z][A-Z0-9_]*$/,OO=ne({append:E().max(TO).default("")}),RO=ne({name:E().regex(nm,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:rc("stdio"),command:E().min(1),args:ea(E()).optional()}),MO=ne({name:E().regex(nm,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:rc("http"),url:E().url(),headers:Ot(E(),E()).optional()}),kO=ne({name:E().regex(nm,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:rc("sse"),url:E().url(),headers:Ot(E(),E()).optional()}),DO=nO("transport",[RO,MO,kO]),UO=ne({key:E().regex(zO,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:E(),sensitive:ac().default(!1)}),LO=ne({url:E().min(1),ref:E().min(1).optional(),localPath:E().min(1).optional()}),am=ne({prompt:OO.default({append:""}),model:E().default(""),mcpServers:ea(DO).default([]),env:ea(UO).default([]),gitRepos:ea(LO).default([])}),ZO=(t,a)=>{const l=new Set;t.mcpServers.forEach((d,h)=>{const m=d.name.toLowerCase();l.has(m)&&a.addIssue({code:Bf.custom,path:["mcpServers",h,"name"],message:`Duplicate MCP server name "${d.name}"`}),l.add(m)});const s=new Set;t.env.forEach((d,h)=>{s.has(d.key)&&a.addIssue({code:Bf.custom,path:["env",h,"key"],message:`Duplicate env key "${d.key}"`}),s.add(d.key)});const o=new Set;t.gitRepos.forEach((d,h)=>{const m=d.localPath??Yu(d.url);m&&(o.has(m)&&a.addIssue({code:Bf.custom,path:["gitRepos",h,"localPath"],message:`Duplicate git repo local path "${m}"`}),o.add(m))})},I0=am.superRefine(ZO),qO=ne({agentId:E(),version:Ve().int().positive(),payload:I0,updatedAt:E(),updatedBy:E()});ne({expectedVersion:Ve().int().positive(),payload:am.partial()});ne({payload:am.partial()});ne({current:qO,next:I0,diff:ea(ne({path:E(),op:Xe(["add","remove","replace"]),before:it().optional(),after:it().optional()}))});const jh="***";function Yu(t){const a=t.trim();return a?((a.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}ne({username:E().min(1),password:E().min(1)});ne({accessToken:E(),refreshToken:E()});ne({refreshToken:E().min(1)});ne({token:E().min(1)});ne({token:E(),expiresIn:Ve(),command:E()});const BO=Xe(["direct","group","thread"]);ne({type:BO,topic:E().max(500).optional(),participantIds:ea(E()).min(1),metadata:Ot(E(),it()).optional()});const $O=ne({agentId:E(),role:E(),mode:E(),joinedAt:E()}),HO=ne({id:E(),organizationId:E(),type:E(),topic:E().nullable(),lifecyclePolicy:E().nullable().optional(),metadata:Ot(E(),it()),createdAt:E(),updatedAt:E()});HO.extend({participants:ea($O)});ne({agentId:E().min(1),mode:Xe(["full","mention_only"]).default("full")});ne({agentId:E().min(1)});const QO=Xe(["connected","disconnected"]);ne({id:E(),userId:E().nullable(),status:QO,sdkVersion:E().max(50).nullable(),hostname:E().max(100).nullable(),os:E().max(50).nullable(),agentCount:Ve().int().min(0),connectedAt:E().nullable(),lastSeenAt:E(),metadata:Ot(E(),it()).nullable()});ne({clientId:E().min(1).max(100),hostname:E().max(100).optional(),os:E().max(50).optional(),sdkVersion:E().max(50).optional()});ne({limit:lc().int().min(1).max(100).default(20),cursor:E().optional()});const rm=Xe(["hub_ui","cli","feishu","github","api"]),V0=Xe(["text","markdown","card","reference","file","task"]);ne({format:V0.default("text"),content:it(),metadata:Ot(E(),it()).optional(),inReplyTo:E().optional(),replyToInbox:E().optional(),replyToChat:E().optional(),source:rm.optional()});ne({format:V0.default("text"),content:it(),metadata:Ot(E(),it()).optional(),replyToInbox:E().optional(),replyToChat:E().optional(),source:rm.optional()});const GO=ne({id:E(),chatId:E(),senderId:E(),format:E(),content:it(),metadata:Ot(E(),it()),replyToInbox:E().nullable(),replyToChat:E().nullable(),inReplyTo:E().nullable(),source:rm.nullable(),createdAt:E()}),IO=GO.extend({configVersion:Ve().int().positive()});Xe(["pending","delivered","acked","failed"]);const VO=ne({id:Ve(),inboxId:E(),messageId:E(),chatId:E().nullable(),status:E(),retryCount:Ve(),createdAt:E(),deliveredAt:E().nullable(),ackedAt:E().nullable()});VO.extend({message:IO});ne({limit:lc().int().min(1).max(50).default(10)});const YO={ADMIN:"admin",MEMBER:"member"},lm=Xe(["admin","member"]),KO=ne({id:E(),userId:E(),organizationId:E(),agentId:E(),role:lm,createdAt:E()});ne({username:E().min(1).max(100),displayName:E().min(1).max(200),role:lm.default("member")});ne({role:lm.optional()});KO.extend({username:E(),displayName:E(),password:E()});const PO=Xe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),Y0=Xe(["high","medium","low"]);ne({id:E(),organizationId:E(),type:PO,severity:Y0,agentId:E().nullable(),chatId:E().nullable(),message:E(),read:ac(),createdAt:E()});ne({limit:lc().int().min(1).max(100).default(20),cursor:E().optional(),severity:Y0.optional(),read:Xe(["true","false"]).transform(t=>t==="true").optional(),agentId:E().optional()});const K0=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ne({name:E().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(t=>!K0.test(t),"Name must not be a UUID format"),displayName:E().min(1).max(200),maxAgents:Ve().int().min(0).default(0),maxMessagesPerMinute:Ve().int().min(0).default(0),features:Ot(E(),it()).default({})});ne({name:E().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(t=>!K0.test(t),"Name must not be a UUID format").optional(),displayName:E().min(1).max(200).optional(),maxAgents:Ve().int().min(0).optional(),maxMessagesPerMinute:Ve().int().min(0).optional(),features:Ot(E(),it()).optional()});ne({id:E(),name:E(),displayName:E(),maxAgents:Ve(),maxMessagesPerMinute:Ve(),features:Ot(E(),it()),createdAt:E(),updatedAt:E()});ne({id:E(),agentId:E(),chatId:E(),content:E(),updatedAt:E()});ne({agentId:E(),chatId:E(),content:E().max(5e4)});const FO=ne({organizationId:E(),agentCount:Ve(),chatCount:Ve(),messageCount:Ve()});ne({totalAgents:Ve(),totalChats:Ve(),totalMessages:Ve(),byOrganization:ea(FO)});ne({key:E(),value:it(),updatedAt:E()});Ot(E(),it());const Aa={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},$f={[Aa.INBOX_TIMEOUT_SECONDS]:300,[Aa.MAX_RETRY_COUNT]:3,[Aa.POLLING_INTERVAL_SECONDS]:5,[Aa.PRESENCE_CLEANUP_SECONDS]:60},Hi=Xe(["pending","assigned","working","completed","failed","cancelled"]),pb=Xe(["agent","admin"]),XO=Xe(["assigned","status_changed","cancelled"]);ne({taskId:E(),event:XO,title:E(),body:E().default(""),status:Hi,fromStatus:Hi.optional(),originRef:E().nullable().optional()});const JO=ne({title:E().min(1).max(500),body:E().optional(),assigneeAgentId:E().optional(),originRef:E().max(500).optional(),metadata:Ot(E(),it()).optional()});JO.extend({organizationId:E().optional()});ne({status:Xe(["working","completed","failed"]),result:E().optional()});ne({assigneeAgentId:E().nullable().optional(),status:Hi.optional(),result:E().optional()});ne({chatId:E().min(1)});const WO=ne({id:E(),organizationId:E(),title:E(),body:E(),status:Hi,assigneeAgentId:E().nullable(),createdByType:pb,createdById:E(),originRef:E().nullable(),result:E().nullable(),metadata:Ot(E(),it()),createdAt:E(),updatedAt:E(),cancelledAt:E().nullable(),cancelledByType:pb.nullable(),cancelledById:E().nullable()}),eR=ne({taskId:E(),chatId:E(),linkedByAgentId:E().nullable(),linkedAt:E()});WO.extend({chats:ea(eR)});ne({status:Hi.optional(),assigneeAgentId:E().optional(),originRef:E().optional(),limit:lc().int().min(1).max(100).default(20),cursor:E().optional()});const tR=Xe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ne({taskId:E(),signal:tR,reason:E()});const nR=Xe(["active","suspended"]);ne({id:E(),username:E(),displayName:E(),avatarUrl:E().nullable(),status:nR,createdAt:E(),updatedAt:E()});ne({username:E().min(1).max(100),displayName:E().min(1).max(200),password:E().min(8).max(200)});ne({displayName:E().min(1).max(200).optional(),password:E().min(8).max(200).optional()});ne({type:rc("auth"),token:E().min(1)});function sm(){return we.get("/members")}function aR(t){return we.post("/members",t)}function rR(t){return we.delete(`/members/${encodeURIComponent(t)}`)}function _r(t,a,{checkForDefaultPrevented:l=!0}={}){return function(o){if(t==null||t(o),l===!1||!o.defaultPrevented)return a==null?void 0:a(o)}}function lR(t,a){const l=y.createContext(a),s=d=>{const{children:h,...m}=d,g=y.useMemo(()=>m,Object.values(m));return u.jsx(l.Provider,{value:g,children:h})};s.displayName=t+"Provider";function o(d){const h=y.useContext(l);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${t}\``)}return[s,o]}function sR(t,a=[]){let l=[];function s(d,h){const m=y.createContext(h),g=l.length;l=[...l,h];const p=b=>{var R;const{scope:j,children:w,...C}=b,N=((R=j==null?void 0:j[t])==null?void 0:R[g])||m,_=y.useMemo(()=>C,Object.values(C));return u.jsx(N.Provider,{value:_,children:w})};p.displayName=d+"Provider";function x(b,j){var N;const w=((N=j==null?void 0:j[t])==null?void 0:N[g])||m,C=y.useContext(w);if(C)return C;if(h!==void 0)return h;throw new Error(`\`${b}\` must be used within \`${d}\``)}return[p,x]}const o=()=>{const d=l.map(h=>y.createContext(h));return function(m){const g=(m==null?void 0:m[t])||d;return y.useMemo(()=>({[`__scope${t}`]:{...m,[t]:g}}),[m,g])}};return o.scopeName=t,[s,iR(o,...a)]}function iR(...t){const a=t[0];if(t.length===1)return a;const l=()=>{const s=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(d){const h=s.reduce((m,{useScope:g,scopeName:p})=>{const b=g(d)[`__scope${p}`];return{...m,...b}},{});return y.useMemo(()=>({[`__scope${a.scopeName}`]:h}),[h])}};return l.scopeName=a.scopeName,l}var Qi=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},oR=Ch[" useId ".trim().toString()]||(()=>{}),uR=0;function Hf(t){const[a,l]=y.useState(oR());return Qi(()=>{l(s=>s??String(uR++))},[t]),t||(a?`radix-${a}`:"")}var cR=Ch[" useInsertionEffect ".trim().toString()]||Qi;function dR({prop:t,defaultProp:a,onChange:l=()=>{},caller:s}){const[o,d,h]=fR({defaultProp:a,onChange:l}),m=t!==void 0,g=m?t:o;{const x=y.useRef(t!==void 0);y.useEffect(()=>{const b=x.current;b!==m&&console.warn(`${s} is changing from ${b?"controlled":"uncontrolled"} to ${m?"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.`),x.current=m},[m,s])}const p=y.useCallback(x=>{var b;if(m){const j=hR(x)?x(t):x;j!==t&&((b=h.current)==null||b.call(h,j))}else d(x)},[m,t,d,h]);return[g,p]}function fR({defaultProp:t,onChange:a}){const[l,s]=y.useState(t),o=y.useRef(l),d=y.useRef(a);return cR(()=>{d.current=a},[a]),y.useEffect(()=>{var h;o.current!==l&&((h=d.current)==null||h.call(d,l),o.current=l)},[l,o]),[l,s,d]}function hR(t){return typeof t=="function"}var P0=Yb();const mR=Vb(P0);function F0(t){const a=pR(t),l=y.forwardRef((s,o)=>{const{children:d,...h}=s,m=y.Children.toArray(d),g=m.find(vR);if(g){const p=g.props.children,x=m.map(b=>b===g?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:b);return u.jsx(a,{...h,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,x):null})}return u.jsx(a,{...h,ref:o,children:d})});return l.displayName=`${t}.Slot`,l}function pR(t){const a=y.forwardRef((l,s)=>{const{children:o,...d}=l;if(y.isValidElement(o)){const h=bR(o),m=yR(d,o.props);return o.type!==y.Fragment&&(m.ref=s?Vh(s,h):h),y.cloneElement(o,m)}return y.Children.count(o)>1?y.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var gR=Symbol("radix.slottable");function vR(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===gR}function yR(t,a){const l={...a};for(const s in a){const o=t[s],d=a[s];/^on[A-Z]/.test(s)?o&&d?l[s]=(...m)=>{const g=d(...m);return o(...m),g}:o&&(l[s]=o):s==="style"?l[s]={...o,...d}:s==="className"&&(l[s]=[o,d].filter(Boolean).join(" "))}return{...t,...l}}function bR(t){var s,o;let a=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?t.props.ref:t.props.ref||t.ref)}var xR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ka=xR.reduce((t,a)=>{const l=F0(`Primitive.${a}`),s=y.forwardRef((o,d)=>{const{asChild:h,...m}=o,g=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...m,ref:d})});return s.displayName=`Primitive.${a}`,{...t,[a]:s}},{});function SR(t,a){t&&P0.flushSync(()=>t.dispatchEvent(a))}function Gi(t){const a=y.useRef(t);return y.useEffect(()=>{a.current=t}),y.useMemo(()=>(...l)=>{var s;return(s=a.current)==null?void 0:s.call(a,...l)},[])}function jR(t,a=globalThis==null?void 0:globalThis.document){const l=Gi(t);y.useEffect(()=>{const s=o=>{o.key==="Escape"&&l(o)};return a.addEventListener("keydown",s,{capture:!0}),()=>a.removeEventListener("keydown",s,{capture:!0})},[l,a])}var NR="DismissableLayer",Nh="dismissableLayer.update",wR="dismissableLayer.pointerDownOutside",_R="dismissableLayer.focusOutside",gb,X0=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),J0=y.forwardRef((t,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d,onInteractOutside:h,onDismiss:m,...g}=t,p=y.useContext(X0),[x,b]=y.useState(null),j=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=y.useState({}),C=pl(a,K=>b(K)),N=Array.from(p.layers),[_]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),R=N.indexOf(_),Q=x?N.indexOf(x):-1,q=p.layersWithOutsidePointerEventsDisabled.size>0,B=Q>=R,F=AR(K=>{const k=K.target,ee=[...p.branches].some(be=>be.contains(k));!B||ee||(o==null||o(K),h==null||h(K),K.defaultPrevented||m==null||m())},j),J=TR(K=>{const k=K.target;[...p.branches].some(be=>be.contains(k))||(d==null||d(K),h==null||h(K),K.defaultPrevented||m==null||m())},j);return jR(K=>{Q===p.layers.size-1&&(s==null||s(K),!K.defaultPrevented&&m&&(K.preventDefault(),m()))},j),y.useEffect(()=>{if(x)return l&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(gb=j.body.style.pointerEvents,j.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(x)),p.layers.add(x),vb(),()=>{l&&p.layersWithOutsidePointerEventsDisabled.size===1&&(j.body.style.pointerEvents=gb)}},[x,j,l,p]),y.useEffect(()=>()=>{x&&(p.layers.delete(x),p.layersWithOutsidePointerEventsDisabled.delete(x),vb())},[x,p]),y.useEffect(()=>{const K=()=>w({});return document.addEventListener(Nh,K),()=>document.removeEventListener(Nh,K)},[]),u.jsx(ka.div,{...g,ref:C,style:{pointerEvents:q?B?"auto":"none":void 0,...t.style},onFocusCapture:_r(t.onFocusCapture,J.onFocusCapture),onBlurCapture:_r(t.onBlurCapture,J.onBlurCapture),onPointerDownCapture:_r(t.onPointerDownCapture,F.onPointerDownCapture)})});J0.displayName=NR;var ER="DismissableLayerBranch",CR=y.forwardRef((t,a)=>{const l=y.useContext(X0),s=y.useRef(null),o=pl(a,s);return y.useEffect(()=>{const d=s.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),u.jsx(ka.div,{...t,ref:o})});CR.displayName=ER;function AR(t,a=globalThis==null?void 0:globalThis.document){const l=Gi(t),s=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const d=m=>{if(m.target&&!s.current){let g=function(){W0(wR,l,p,{discrete:!0})};const p={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",o.current),o.current=g,a.addEventListener("click",o.current,{once:!0})):g()}else a.removeEventListener("click",o.current);s.current=!1},h=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(h),a.removeEventListener("pointerdown",d),a.removeEventListener("click",o.current)}},[a,l]),{onPointerDownCapture:()=>s.current=!0}}function TR(t,a=globalThis==null?void 0:globalThis.document){const l=Gi(t),s=y.useRef(!1);return y.useEffect(()=>{const o=d=>{d.target&&!s.current&&W0(_R,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",o),()=>a.removeEventListener("focusin",o)},[a,l]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function vb(){const t=new CustomEvent(Nh);document.dispatchEvent(t)}function W0(t,a,l,{discrete:s}){const o=l.originalEvent.target,d=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:l});a&&o.addEventListener(t,a,{once:!0}),s?SR(o,d):o.dispatchEvent(d)}var Qf="focusScope.autoFocusOnMount",Gf="focusScope.autoFocusOnUnmount",yb={bubbles:!1,cancelable:!0},zR="FocusScope",eS=y.forwardRef((t,a)=>{const{loop:l=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:d,...h}=t,[m,g]=y.useState(null),p=Gi(o),x=Gi(d),b=y.useRef(null),j=pl(a,N=>g(N)),w=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(s){let N=function(q){if(w.paused||!m)return;const B=q.target;m.contains(B)?b.current=B:mr(b.current,{select:!0})},_=function(q){if(w.paused||!m)return;const B=q.relatedTarget;B!==null&&(m.contains(B)||mr(b.current,{select:!0}))},R=function(q){if(document.activeElement===document.body)for(const F of q)F.removedNodes.length>0&&mr(m)};document.addEventListener("focusin",N),document.addEventListener("focusout",_);const Q=new MutationObserver(R);return m&&Q.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",_),Q.disconnect()}}},[s,m,w.paused]),y.useEffect(()=>{if(m){xb.add(w);const N=document.activeElement;if(!m.contains(N)){const R=new CustomEvent(Qf,yb);m.addEventListener(Qf,p),m.dispatchEvent(R),R.defaultPrevented||(OR(UR(tS(m)),{select:!0}),document.activeElement===N&&mr(m))}return()=>{m.removeEventListener(Qf,p),setTimeout(()=>{const R=new CustomEvent(Gf,yb);m.addEventListener(Gf,x),m.dispatchEvent(R),R.defaultPrevented||mr(N??document.body,{select:!0}),m.removeEventListener(Gf,x),xb.remove(w)},0)}}},[m,p,x,w]);const C=y.useCallback(N=>{if(!l&&!s||w.paused)return;const _=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,R=document.activeElement;if(_&&R){const Q=N.currentTarget,[q,B]=RR(Q);q&&B?!N.shiftKey&&R===B?(N.preventDefault(),l&&mr(q,{select:!0})):N.shiftKey&&R===q&&(N.preventDefault(),l&&mr(B,{select:!0})):R===Q&&N.preventDefault()}},[l,s,w.paused]);return u.jsx(ka.div,{tabIndex:-1,...h,ref:j,onKeyDown:C})});eS.displayName=zR;function OR(t,{select:a=!1}={}){const l=document.activeElement;for(const s of t)if(mr(s,{select:a}),document.activeElement!==l)return}function RR(t){const a=tS(t),l=bb(a,t),s=bb(a.reverse(),t);return[l,s]}function tS(t){const a=[],l=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function bb(t,a){for(const l of t)if(!MR(l,{upTo:a}))return l}function MR(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function kR(t){return t instanceof HTMLInputElement&&"select"in t}function mr(t,{select:a=!1}={}){if(t&&t.focus){const l=document.activeElement;t.focus({preventScroll:!0}),t!==l&&kR(t)&&a&&t.select()}}var xb=DR();function DR(){let t=[];return{add(a){const l=t[0];a!==l&&(l==null||l.pause()),t=Sb(t,a),t.unshift(a)},remove(a){var l;t=Sb(t,a),(l=t[0])==null||l.resume()}}}function Sb(t,a){const l=[...t],s=l.indexOf(a);return s!==-1&&l.splice(s,1),l}function UR(t){return t.filter(a=>a.tagName!=="A")}var LR="Portal",nS=y.forwardRef((t,a)=>{var m;const{container:l,...s}=t,[o,d]=y.useState(!1);Qi(()=>d(!0),[]);const h=l||o&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return h?mR.createPortal(u.jsx(ka.div,{...s,ref:a}),h):null});nS.displayName=LR;function ZR(t,a){return y.useReducer((l,s)=>a[l][s]??l,t)}var sc=t=>{const{present:a,children:l}=t,s=qR(a),o=typeof l=="function"?l({present:s.isPresent}):y.Children.only(l),d=pl(s.ref,BR(o));return typeof l=="function"||s.isPresent?y.cloneElement(o,{ref:d}):null};sc.displayName="Presence";function qR(t){const[a,l]=y.useState(),s=y.useRef(null),o=y.useRef(t),d=y.useRef("none"),h=t?"mounted":"unmounted",[m,g]=ZR(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const p=Tu(s.current);d.current=m==="mounted"?p:"none"},[m]),Qi(()=>{const p=s.current,x=o.current;if(x!==t){const j=d.current,w=Tu(p);t?g("MOUNT"):w==="none"||(p==null?void 0:p.display)==="none"?g("UNMOUNT"):g(x&&j!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,g]),Qi(()=>{if(a){let p;const x=a.ownerDocument.defaultView??window,b=w=>{const N=Tu(s.current).includes(CSS.escape(w.animationName));if(w.target===a&&N&&(g("ANIMATION_END"),!o.current)){const _=a.style.animationFillMode;a.style.animationFillMode="forwards",p=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=_)})}},j=w=>{w.target===a&&(d.current=Tu(s.current))};return a.addEventListener("animationstart",j),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{x.clearTimeout(p),a.removeEventListener("animationstart",j),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:y.useCallback(p=>{s.current=p?getComputedStyle(p):null,l(p)},[])}}function Tu(t){return(t==null?void 0:t.animationName)||"none"}function BR(t){var s,o;let a=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?t.props.ref:t.props.ref||t.ref)}var If=0;function $R(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??jb()),document.body.insertAdjacentElement("beforeend",t[1]??jb()),If++,()=>{If===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),If--}},[])}function jb(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Jn=function(){return Jn=Object.assign||function(a){for(var l,s=1,o=arguments.length;s<o;s++){l=arguments[s];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(a[d]=l[d])}return a},Jn.apply(this,arguments)};function aS(t,a){var l={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&a.indexOf(s)<0&&(l[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)a.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(l[s[o]]=t[s[o]]);return l}function HR(t,a,l){if(l||arguments.length===2)for(var s=0,o=a.length,d;s<o;s++)(d||!(s in a))&&(d||(d=Array.prototype.slice.call(a,0,s)),d[s]=a[s]);return t.concat(d||Array.prototype.slice.call(a))}var Lu="right-scroll-bar-position",Zu="width-before-scroll-bar",QR="with-scroll-bars-hidden",GR="--removed-body-scroll-bar-size";function Vf(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function IR(t,a){var l=y.useState(function(){return{value:t,callback:a,facade:{get current(){return l.value},set current(s){var o=l.value;o!==s&&(l.value=s,l.callback(s,o))}}}})[0];return l.callback=a,l.facade}var VR=typeof window<"u"?y.useLayoutEffect:y.useEffect,Nb=new WeakMap;function YR(t,a){var l=IR(null,function(s){return t.forEach(function(o){return Vf(o,s)})});return VR(function(){var s=Nb.get(l);if(s){var o=new Set(s),d=new Set(t),h=l.current;o.forEach(function(m){d.has(m)||Vf(m,null)}),d.forEach(function(m){o.has(m)||Vf(m,h)})}Nb.set(l,t)},[t]),l}function KR(t){return t}function PR(t,a){a===void 0&&(a=KR);var l=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:t},useMedium:function(d){var h=a(d,s);return l.push(h),function(){l=l.filter(function(m){return m!==h})}},assignSyncMedium:function(d){for(s=!0;l.length;){var h=l;l=[],h.forEach(d)}l={push:function(m){return d(m)},filter:function(){return l}}},assignMedium:function(d){s=!0;var h=[];if(l.length){var m=l;l=[],m.forEach(d),h=l}var g=function(){var x=h;h=[],x.forEach(d)},p=function(){return Promise.resolve().then(g)};p(),l={push:function(x){h.push(x),p()},filter:function(x){return h=h.filter(x),l}}}};return o}function FR(t){t===void 0&&(t={});var a=PR(null);return a.options=Jn({async:!0,ssr:!1},t),a}var rS=function(t){var a=t.sideCar,l=aS(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=a.read();if(!s)throw new Error("Sidecar medium not found");return y.createElement(s,Jn({},l))};rS.isSideCarExport=!0;function XR(t,a){return t.useMedium(a),rS}var lS=FR(),Yf=function(){},ic=y.forwardRef(function(t,a){var l=y.useRef(null),s=y.useState({onScrollCapture:Yf,onWheelCapture:Yf,onTouchMoveCapture:Yf}),o=s[0],d=s[1],h=t.forwardProps,m=t.children,g=t.className,p=t.removeScrollBar,x=t.enabled,b=t.shards,j=t.sideCar,w=t.noRelative,C=t.noIsolation,N=t.inert,_=t.allowPinchZoom,R=t.as,Q=R===void 0?"div":R,q=t.gapMode,B=aS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=j,J=YR([l,a]),K=Jn(Jn({},B),o);return y.createElement(y.Fragment,null,x&&y.createElement(F,{sideCar:lS,removeScrollBar:p,shards:b,noRelative:w,noIsolation:C,inert:N,setCallbacks:d,allowPinchZoom:!!_,lockRef:l,gapMode:q}),h?y.cloneElement(y.Children.only(m),Jn(Jn({},K),{ref:J})):y.createElement(Q,Jn({},K,{className:g,ref:J}),m))});ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ic.classNames={fullWidth:Zu,zeroRight:Lu};var JR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WR(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=JR();return a&&t.setAttribute("nonce",a),t}function eM(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function tM(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var nM=function(){var t=0,a=null;return{add:function(l){t==0&&(a=WR())&&(eM(a,l),tM(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},aM=function(){var t=nM();return function(a,l){y.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&l])}},sS=function(){var t=aM(),a=function(l){var s=l.styles,o=l.dynamic;return t(s,o),null};return a},rM={left:0,top:0,right:0,gap:0},Kf=function(t){return parseInt(t||"",10)||0},lM=function(t){var a=window.getComputedStyle(document.body),l=a[t==="padding"?"paddingLeft":"marginLeft"],s=a[t==="padding"?"paddingTop":"marginTop"],o=a[t==="padding"?"paddingRight":"marginRight"];return[Kf(l),Kf(s),Kf(o)]},sM=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return rM;var a=lM(t),l=document.documentElement.clientWidth,s=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,s-l+a[2]-a[0])}},iM=sS(),cs="data-scroll-locked",oM=function(t,a,l,s){var o=t.left,d=t.top,h=t.right,m=t.gap;return l===void 0&&(l="margin"),`
|
|
264
|
-
.`.concat(QR,` {
|
|
265
|
-
overflow: hidden `).concat(s,`;
|
|
266
|
-
padding-right: `).concat(m,"px ").concat(s,`;
|
|
267
|
-
}
|
|
268
|
-
body[`).concat(cs,`] {
|
|
269
|
-
overflow: hidden `).concat(s,`;
|
|
270
|
-
overscroll-behavior: contain;
|
|
271
|
-
`).concat([a&&"position: relative ".concat(s,";"),l==="margin"&&`
|
|
272
|
-
padding-left: `.concat(o,`px;
|
|
273
|
-
padding-top: `).concat(d,`px;
|
|
274
|
-
padding-right: `).concat(h,`px;
|
|
275
|
-
margin-left:0;
|
|
276
|
-
margin-top:0;
|
|
277
|
-
margin-right: `).concat(m,"px ").concat(s,`;
|
|
278
|
-
`),l==="padding"&&"padding-right: ".concat(m,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.`).concat(Lu,` {
|
|
282
|
-
right: `).concat(m,"px ").concat(s,`;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.`).concat(Zu,` {
|
|
286
|
-
margin-right: `).concat(m,"px ").concat(s,`;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.`).concat(Lu," .").concat(Lu,` {
|
|
290
|
-
right: 0 `).concat(s,`;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.`).concat(Zu," .").concat(Zu,` {
|
|
294
|
-
margin-right: 0 `).concat(s,`;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
body[`).concat(cs,`] {
|
|
298
|
-
`).concat(GR,": ").concat(m,`px;
|
|
299
|
-
}
|
|
300
|
-
`)},wb=function(){var t=parseInt(document.body.getAttribute(cs)||"0",10);return isFinite(t)?t:0},uM=function(){y.useEffect(function(){return document.body.setAttribute(cs,(wb()+1).toString()),function(){var t=wb()-1;t<=0?document.body.removeAttribute(cs):document.body.setAttribute(cs,t.toString())}},[])},cM=function(t){var a=t.noRelative,l=t.noImportant,s=t.gapMode,o=s===void 0?"margin":s;uM();var d=y.useMemo(function(){return sM(o)},[o]);return y.createElement(iM,{styles:oM(d,!a,o,l?"":"!important")})},wh=!1;if(typeof window<"u")try{var zu=Object.defineProperty({},"passive",{get:function(){return wh=!0,!0}});window.addEventListener("test",zu,zu),window.removeEventListener("test",zu,zu)}catch{wh=!1}var rs=wh?{passive:!1}:!1,dM=function(t){return t.tagName==="TEXTAREA"},iS=function(t,a){if(!(t instanceof Element))return!1;var l=window.getComputedStyle(t);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!dM(t)&&l[a]==="visible")},fM=function(t){return iS(t,"overflowY")},hM=function(t){return iS(t,"overflowX")},_b=function(t,a){var l=a.ownerDocument,s=a;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=oS(t,s);if(o){var d=uS(t,s),h=d[1],m=d[2];if(h>m)return!0}s=s.parentNode}while(s&&s!==l.body);return!1},mM=function(t){var a=t.scrollTop,l=t.scrollHeight,s=t.clientHeight;return[a,l,s]},pM=function(t){var a=t.scrollLeft,l=t.scrollWidth,s=t.clientWidth;return[a,l,s]},oS=function(t,a){return t==="v"?fM(a):hM(a)},uS=function(t,a){return t==="v"?mM(a):pM(a)},gM=function(t,a){return t==="h"&&a==="rtl"?-1:1},vM=function(t,a,l,s,o){var d=gM(t,window.getComputedStyle(a).direction),h=d*s,m=l.target,g=a.contains(m),p=!1,x=h>0,b=0,j=0;do{if(!m)break;var w=uS(t,m),C=w[0],N=w[1],_=w[2],R=N-_-d*C;(C||R)&&oS(t,m)&&(b+=R,j+=C);var Q=m.parentNode;m=Q&&Q.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Q.host:Q}while(!g&&m!==document.body||g&&(a.contains(m)||a===m));return(x&&Math.abs(b)<1||!x&&Math.abs(j)<1)&&(p=!0),p},Ou=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Eb=function(t){return[t.deltaX,t.deltaY]},Cb=function(t){return t&&"current"in t?t.current:t},yM=function(t,a){return t[0]===a[0]&&t[1]===a[1]},bM=function(t){return`
|
|
301
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
302
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
303
|
-
`)},xM=0,ls=[];function SM(t){var a=y.useRef([]),l=y.useRef([0,0]),s=y.useRef(),o=y.useState(xM++)[0],d=y.useState(sS)[0],h=y.useRef(t);y.useEffect(function(){h.current=t},[t]),y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var N=HR([t.lockRef.current],(t.shards||[]).map(Cb),!0).filter(Boolean);return N.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),N.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var m=y.useCallback(function(N,_){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!h.current.allowPinchZoom;var R=Ou(N),Q=l.current,q="deltaX"in N?N.deltaX:Q[0]-R[0],B="deltaY"in N?N.deltaY:Q[1]-R[1],F,J=N.target,K=Math.abs(q)>Math.abs(B)?"h":"v";if("touches"in N&&K==="h"&&J.type==="range")return!1;var k=window.getSelection(),ee=k&&k.anchorNode,be=ee?ee===J||ee.contains(J):!1;if(be)return!1;var _e=_b(K,J);if(!_e)return!0;if(_e?F=K:(F=K==="v"?"h":"v",_e=_b(K,J)),!_e)return!1;if(!s.current&&"changedTouches"in N&&(q||B)&&(s.current=F),!F)return!0;var Ue=s.current||F;return vM(Ue,_,N,Ue==="h"?q:B)},[]),g=y.useCallback(function(N){var _=N;if(!(!ls.length||ls[ls.length-1]!==d)){var R="deltaY"in _?Eb(_):Ou(_),Q=a.current.filter(function(F){return F.name===_.type&&(F.target===_.target||_.target===F.shadowParent)&&yM(F.delta,R)})[0];if(Q&&Q.should){_.cancelable&&_.preventDefault();return}if(!Q){var q=(h.current.shards||[]).map(Cb).filter(Boolean).filter(function(F){return F.contains(_.target)}),B=q.length>0?m(_,q[0]):!h.current.noIsolation;B&&_.cancelable&&_.preventDefault()}}},[]),p=y.useCallback(function(N,_,R,Q){var q={name:N,delta:_,target:R,should:Q,shadowParent:jM(R)};a.current.push(q),setTimeout(function(){a.current=a.current.filter(function(B){return B!==q})},1)},[]),x=y.useCallback(function(N){l.current=Ou(N),s.current=void 0},[]),b=y.useCallback(function(N){p(N.type,Eb(N),N.target,m(N,t.lockRef.current))},[]),j=y.useCallback(function(N){p(N.type,Ou(N),N.target,m(N,t.lockRef.current))},[]);y.useEffect(function(){return ls.push(d),t.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:j}),document.addEventListener("wheel",g,rs),document.addEventListener("touchmove",g,rs),document.addEventListener("touchstart",x,rs),function(){ls=ls.filter(function(N){return N!==d}),document.removeEventListener("wheel",g,rs),document.removeEventListener("touchmove",g,rs),document.removeEventListener("touchstart",x,rs)}},[]);var w=t.removeScrollBar,C=t.inert;return y.createElement(y.Fragment,null,C?y.createElement(d,{styles:bM(o)}):null,w?y.createElement(cM,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function jM(t){for(var a=null;t!==null;)t instanceof ShadowRoot&&(a=t.host,t=t.host),t=t.parentNode;return a}const NM=XR(lS,SM);var cS=y.forwardRef(function(t,a){return y.createElement(ic,Jn({},t,{ref:a,sideCar:NM}))});cS.classNames=ic.classNames;var wM=function(t){if(typeof document>"u")return null;var a=Array.isArray(t)?t[0]:t;return a.ownerDocument.body},ss=new WeakMap,Ru=new WeakMap,Mu={},Pf=0,dS=function(t){return t&&(t.host||dS(t.parentNode))},_M=function(t,a){return a.map(function(l){if(t.contains(l))return l;var s=dS(l);return s&&t.contains(s)?s:(console.error("aria-hidden",l,"in not contained inside",t,". Doing nothing"),null)}).filter(function(l){return!!l})},EM=function(t,a,l,s){var o=_M(a,Array.isArray(t)?t:[t]);Mu[l]||(Mu[l]=new WeakMap);var d=Mu[l],h=[],m=new Set,g=new Set(o),p=function(b){!b||m.has(b)||(m.add(b),p(b.parentNode))};o.forEach(p);var x=function(b){!b||g.has(b)||Array.prototype.forEach.call(b.children,function(j){if(m.has(j))x(j);else try{var w=j.getAttribute(s),C=w!==null&&w!=="false",N=(ss.get(j)||0)+1,_=(d.get(j)||0)+1;ss.set(j,N),d.set(j,_),h.push(j),N===1&&C&&Ru.set(j,!0),_===1&&j.setAttribute(l,"true"),C||j.setAttribute(s,"true")}catch(R){console.error("aria-hidden: cannot operate on ",j,R)}})};return x(a),m.clear(),Pf++,function(){h.forEach(function(b){var j=ss.get(b)-1,w=d.get(b)-1;ss.set(b,j),d.set(b,w),j||(Ru.has(b)||b.removeAttribute(s),Ru.delete(b)),w||b.removeAttribute(l)}),Pf--,Pf||(ss=new WeakMap,ss=new WeakMap,Ru=new WeakMap,Mu={})}},CM=function(t,a,l){l===void 0&&(l="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),o=wM(t);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),EM(s,o,l,"aria-hidden")):function(){return null}},oc="Dialog",[fS]=sR(oc),[AM,Gn]=fS(oc),hS=t=>{const{__scopeDialog:a,children:l,open:s,defaultOpen:o,onOpenChange:d,modal:h=!0}=t,m=y.useRef(null),g=y.useRef(null),[p,x]=dR({prop:s,defaultProp:o??!1,onChange:d,caller:oc});return u.jsx(AM,{scope:a,triggerRef:m,contentRef:g,contentId:Hf(),titleId:Hf(),descriptionId:Hf(),open:p,onOpenChange:x,onOpenToggle:y.useCallback(()=>x(b=>!b),[x]),modal:h,children:l})};hS.displayName=oc;var mS="DialogTrigger",pS=y.forwardRef((t,a)=>{const{__scopeDialog:l,...s}=t,o=Gn(mS,l),d=pl(a,o.triggerRef);return u.jsx(ka.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":um(o.open),...s,ref:d,onClick:_r(t.onClick,o.onOpenToggle)})});pS.displayName=mS;var im="DialogPortal",[TM,gS]=fS(im,{forceMount:void 0}),vS=t=>{const{__scopeDialog:a,forceMount:l,children:s,container:o}=t,d=Gn(im,a);return u.jsx(TM,{scope:a,forceMount:l,children:y.Children.map(s,h=>u.jsx(sc,{present:l||d.open,children:u.jsx(nS,{asChild:!0,container:o,children:h})}))})};vS.displayName=im;var Ku="DialogOverlay",yS=y.forwardRef((t,a)=>{const l=gS(Ku,t.__scopeDialog),{forceMount:s=l.forceMount,...o}=t,d=Gn(Ku,t.__scopeDialog);return d.modal?u.jsx(sc,{present:s||d.open,children:u.jsx(OM,{...o,ref:a})}):null});yS.displayName=Ku;var zM=F0("DialogOverlay.RemoveScroll"),OM=y.forwardRef((t,a)=>{const{__scopeDialog:l,...s}=t,o=Gn(Ku,l);return u.jsx(cS,{as:zM,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(ka.div,{"data-state":um(o.open),...s,ref:a,style:{pointerEvents:"auto",...s.style}})})}),fl="DialogContent",bS=y.forwardRef((t,a)=>{const l=gS(fl,t.__scopeDialog),{forceMount:s=l.forceMount,...o}=t,d=Gn(fl,t.__scopeDialog);return u.jsx(sc,{present:s||d.open,children:d.modal?u.jsx(RM,{...o,ref:a}):u.jsx(MM,{...o,ref:a})})});bS.displayName=fl;var RM=y.forwardRef((t,a)=>{const l=Gn(fl,t.__scopeDialog),s=y.useRef(null),o=pl(a,l.contentRef,s);return y.useEffect(()=>{const d=s.current;if(d)return CM(d)},[]),u.jsx(xS,{...t,ref:o,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_r(t.onCloseAutoFocus,d=>{var h;d.preventDefault(),(h=l.triggerRef.current)==null||h.focus()}),onPointerDownOutside:_r(t.onPointerDownOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0;(h.button===2||m)&&d.preventDefault()}),onFocusOutside:_r(t.onFocusOutside,d=>d.preventDefault())})}),MM=y.forwardRef((t,a)=>{const l=Gn(fl,t.__scopeDialog),s=y.useRef(!1),o=y.useRef(!1);return u.jsx(xS,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var h,m;(h=t.onCloseAutoFocus)==null||h.call(t,d),d.defaultPrevented||(s.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:d=>{var g,p;(g=t.onInteractOutside)==null||g.call(t,d),d.defaultPrevented||(s.current=!0,d.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const h=d.target;((p=l.triggerRef.current)==null?void 0:p.contains(h))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&o.current&&d.preventDefault()}})}),xS=y.forwardRef((t,a)=>{const{__scopeDialog:l,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:d,...h}=t,m=Gn(fl,l),g=y.useRef(null),p=pl(a,g);return $R(),u.jsxs(u.Fragment,{children:[u.jsx(eS,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:d,children:u.jsx(J0,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":um(m.open),...h,ref:p,onDismiss:()=>m.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(kM,{titleId:m.titleId}),u.jsx(UM,{contentRef:g,descriptionId:m.descriptionId})]})]})}),om="DialogTitle",SS=y.forwardRef((t,a)=>{const{__scopeDialog:l,...s}=t,o=Gn(om,l);return u.jsx(ka.h2,{id:o.titleId,...s,ref:a})});SS.displayName=om;var jS="DialogDescription",NS=y.forwardRef((t,a)=>{const{__scopeDialog:l,...s}=t,o=Gn(jS,l);return u.jsx(ka.p,{id:o.descriptionId,...s,ref:a})});NS.displayName=jS;var wS="DialogClose",_S=y.forwardRef((t,a)=>{const{__scopeDialog:l,...s}=t,o=Gn(wS,l);return u.jsx(ka.button,{type:"button",...s,ref:a,onClick:_r(t.onClick,()=>o.onOpenChange(!1))})});_S.displayName=wS;function um(t){return t?"open":"closed"}var ES="DialogTitleWarning",[_3,CS]=lR(ES,{contentName:fl,titleName:om,docsSlug:"dialog"}),kM=({titleId:t})=>{const a=CS(ES),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
|
|
304
|
-
|
|
305
|
-
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
306
|
-
|
|
307
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(l))},[l,t]),null},DM="DialogDescriptionWarning",UM=({contentRef:t,descriptionId:a})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${CS(DM).contentName}}.`;return y.useEffect(()=>{var d;const o=(d=t.current)==null?void 0:d.getAttribute("aria-describedby");a&&o&&(document.getElementById(a)||console.warn(s))},[s,t,a]),null},LM=hS,ZM=pS,qM=vS,BM=yS,$M=bS,HM=SS,QM=NS,GM=_S;const Da=LM,IM=ZM,VM=qM,AS=y.forwardRef(({className:t,...a},l)=>u.jsx(BM,{ref:l,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",t),...a}));AS.displayName="DialogOverlay";const na=y.forwardRef(({className:t,children:a,...l},s)=>u.jsxs(VM,{children:[u.jsx(AS,{}),u.jsxs($M,{ref:s,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",t),...l,children:[a,u.jsxs(GM,{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(pE,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));na.displayName="DialogContent";function Ua({className:t,...a}){return u.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})}function ta({className:t,...a}){return u.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})}const aa=y.forwardRef(({className:t,...a},l)=>u.jsx(HM,{ref:l,className:je("text-lg font-semibold leading-none tracking-tight",t),...a}));aa.displayName="DialogTitle";const YM=y.forwardRef(({className:t,...a},l)=>u.jsx(QM,{ref:l,className:je("text-sm text-muted-foreground",t),...a}));YM.displayName="DialogDescription";const tt=y.forwardRef(({className:t,type:a,...l},s)=>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",t),ref:s,...l}));tt.displayName="Input";var KM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],PM=KM.reduce((t,a)=>{const l=i0(`Primitive.${a}`),s=y.forwardRef((o,d)=>{const{asChild:h,...m}=o,g=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...m,ref:d})});return s.displayName=`Primitive.${a}`,{...t,[a]:s}},{}),FM="Label",TS=y.forwardRef((t,a)=>u.jsx(PM.label,{...t,ref:a,onMouseDown:l=>{var o;l.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));TS.displayName=FM;var XM=TS;const $e=y.forwardRef(({className:t,...a},l)=>u.jsx(XM,{ref:l,className:je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...a}));$e.displayName="Label";const JM=Object.values(YO);function WM(){const t=Mn(),[a,l]=y.useState(!1),[s,o]=y.useState({username:"",displayName:"",role:"member"}),[d,h]=y.useState(null),{data:m,isLoading:g,error:p}=De({queryKey:["members"],queryFn:sm}),x=st({mutationFn:()=>aR({username:s.username,displayName:s.displayName,role:s.role}),onSuccess:N=>{t.invalidateQueries({queryKey:["members"]}),h(N.password)}}),b=st({mutationFn:rR,onSuccess:()=>t.invalidateQueries({queryKey:["members"]})});function j(){l(!1),o({username:"",displayName:"",role:"member"}),h(null)}function w(N){N.preventDefault(),x.mutate()}function C(N){window.confirm("Delete this member? Their human agent will also be deactivated.")&&b.mutate(N)}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(Da,{open:a,onOpenChange:N=>N?l(!0):j(),children:[u.jsx(IM,{asChild:!0,children:u.jsxs(de,{children:[u.jsx(hl,{className:"h-4 w-4 mr-2"}),"Add Member"]})}),u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:d?"Member Created":"Create Member"})}),d?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:d}),u.jsx(de,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(d),title:"Copy password",children:u.jsx(Hh,{className:"h-4 w-4"})})]}),u.jsx(ta,{children:u.jsx(de,{onClick:j,children:"Done"})})]}):u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"member-username",children:"Username"}),u.jsx(tt,{id:"member-username",type:"text",value:s.username,onChange:N=>o({...s,username:N.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"member-name",children:"Display Name"}),u.jsx(tt,{id:"member-name",value:s.displayName,onChange:N=>o({...s,displayName:N.target.value}),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"member-role",children:"Role"}),u.jsx("select",{id:"member-role",value:s.role,onChange:N=>o({...s,role:N.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:JM.map(N=>u.jsx("option",{value:N,children:N},N))})]}),x.error instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:x.error.message}),u.jsx(ta,{children:u.jsx(de,{type:"submit",disabled:x.isPending,children:x.isPending?"Creating...":"Create"})})]})]})]})]}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Username"}),u.jsx(ye,{children:"Name"}),u.jsx(ye,{children:"Role"}),u.jsx(ye,{children:"Created"}),u.jsx(ye,{className:"w-16"})]})}),u.jsx(Ma,{children:g?u.jsx(at,{children:u.jsx(ve,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"Loading..."})}):p?u.jsx(at,{children:u.jsxs(ve,{colSpan:5,className:"text-center py-8 text-destructive",children:["Failed to load members: ",p instanceof Error?p.message:"Unknown error"]})}):(m==null?void 0:m.length)===0?u.jsx(at,{children:u.jsx(ve,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No members"})}):m==null?void 0:m.map(N=>u.jsxs(at,{children:[u.jsx(ve,{className:"font-medium",children:N.username}),u.jsx(ve,{children:N.displayName}),u.jsx(ve,{children:u.jsx($t,{variant:N.role==="admin"?"default":"secondary",children:N.role})}),u.jsx(ve,{className:"text-muted-foreground",children:un(N.createdAt)}),u.jsx(ve,{children:u.jsx(de,{variant:"ghost",size:"icon",onClick:()=>C(N.id),disabled:b.isPending,title:"Delete",children:u.jsx(Zi,{className:"h-4 w-4"})})})]},N.id))})]})})]})}function ek(){return we.get("/admin/system/config")}function tk(t){return we.patch("/admin/system/config",t)}const nk={[Aa.INBOX_TIMEOUT_SECONDS]:"Inbox Timeout (seconds)",[Aa.MAX_RETRY_COUNT]:"Max Retry Count",[Aa.POLLING_INTERVAL_SECONDS]:"Polling Interval (seconds)",[Aa.PRESENCE_CLEANUP_SECONDS]:"Presence Cleanup (seconds)"},Ab=Object.values(Aa);function ak(){const t=Mn(),{data:a,isLoading:l}=De({queryKey:["system-config"],queryFn:ek}),[s,o]=y.useState({}),[d,h]=y.useState(!1);y.useEffect(()=>{if(!a)return;const p={};for(const x of Ab){const b=a[x]??$f[x]??"";p[x]=String(b)}o(p)},[a]);const m=st({mutationFn:()=>{const p={};for(const[x,b]of Object.entries(s)){const j=b.trim();if(j==="")p[x]=$f[x]??0;else{const w=Number(j);p[x]=Number.isNaN(w)?j:w}}return tk(p)},onSuccess:()=>{t.invalidateQueries({queryKey:["system-config"]}),h(!0),setTimeout(()=>h(!1),2e3)}}),g=p=>{p.preventDefault(),m.mutate()};return l?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(cl,{children:[u.jsx(Ns,{children:u.jsx(ws,{children:"System Configuration"})}),u.jsx(dl,{children:u.jsxs("form",{onSubmit:g,className:"space-y-4",children:[Ab.map(p=>u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:p,children:nk[p]??p}),u.jsx(tt,{id:p,value:s[p]??"",onChange:x=>o({...s,[p]:x.target.value})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",String($f[p]??"—")]})]},p)),m.error instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:m.error.message}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(de,{type:"submit",disabled:m.isPending,children:m.isPending?"Saving...":"Save Changes"}),d&&u.jsx("span",{className:"text-sm text-green-600",children:"Saved!"})]})]})})]})]})}const Tb=[{key:"members",label:"Members"},{key:"clients",label:"Clients"},{key:"settings",label:"Settings"},{key:"bindings",label:"Bindings"}];function rk(){const t=Dn(),a=Ar(),l=t.hash.replace("#",""),s=Tb.some(d=>d.key===l)?l:"members",o=d=>{a({hash:d},{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:Tb.map(d=>u.jsx("button",{type:"button",onClick:()=>o(d.key),className:je("px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",s===d.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:d.label},d.key))}),s==="members"&&u.jsx(WM,{}),s==="clients"&&u.jsx(q2,{}),s==="settings"&&u.jsx(ak,{}),s==="bindings"&&u.jsx(_2,{})]})}function lk(t){return we.get(`/admin/agents/${t}/config`)}function sk(t,a){return we.patch(`/admin/agents/${t}/config`,a)}function ik(t,a){return we.post(`/admin/agents/${t}/config/dry-run`,{payload:a})}function ok(t){return we.get(`/admin/agents/${t}/client-status`)}function uc(t,a){const l=new URLSearchParams;a!=null&&a.state&&l.set("state",a.state),a!=null&&a.runtimeState&&l.set("runtimeState",a.runtimeState);const s=l.toString();return we.get(`/admin/sessions/agents/${t}${s?`?${s}`:""}`)}function uk(t,a){return we.post(`/admin/sessions/agents/${t}/${a}/suspend`)}function ck(t,a){return we.post(`/admin/sessions/agents/${t}/${a}/resume`)}function dk(t,a){return we.post(`/admin/sessions/agents/${t}/${a}/terminate`)}function fk(t){const{agent:a}=t,[l,s]=y.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(Lx,{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(Ff,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(de,{variant:"outline",size:"sm",onClick:t.onSuspend,disabled:t.suspendPending,children:t.suspendPending?"Suspending…":"Suspend"})}):u.jsx(Ff,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(de,{variant:"outline",size:"sm",onClick:t.onReactivate,disabled:t.reactivatePending,children:t.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(Ff,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(de,{variant:"destructive",size:"sm",onClick:()=>s(!0),disabled:t.deletePending,children:[u.jsx(Zi,{className:"h-3.5 w-3.5 mr-1.5"}),"Delete"]})})]}),u.jsx(hk,{open:l,onOpenChange:s,expected:o,onDelete:()=>{s(!1),t.onDelete()},deleting:t.deletePending})]})}function Ff(t){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:t.title}),u.jsx("p",{className:"text-xs text-red-800/80",children:t.body})]}),u.jsx("div",{children:t.action})]})}function hk({open:t,onOpenChange:a,expected:l,onDelete:s,deleting:o}){const[d,h]=y.useState("");function m(g){g.preventDefault(),d===l&&s()}return u.jsx(Da,{open:t,onOpenChange:g=>{a(g),g||h("")},children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsxs(aa,{children:['Delete "',l,'"?']})}),u.jsxs("form",{onSubmit:m,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:l})," ","to confirm."]}),u.jsx(tt,{value:d,onChange:g=>h(g.target.value),autoFocus:!0,placeholder:l,className:"font-mono"}),u.jsxs(ta,{children:[u.jsx(de,{type:"button",variant:"ghost",onClick:()=>a(!1),disabled:o,children:"Cancel"}),u.jsx(de,{type:"submit",variant:"destructive",disabled:d!==l||o,children:o?"Deleting…":"Delete"})]})]})]})})}const mk={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 cm({status:t,onEdit:a,onDelete:l,onUndo:s,children:o,disabled:d}){const h=mk[t],m=t==="deleted";return u.jsxs("div",{className:je("flex items-center gap-2 rounded border px-3 py-2 text-sm",m?"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}),h.label&&u.jsx("span",{className:je("text-xs rounded px-1.5 py-0.5 whitespace-nowrap",h.tone),children:h.label}),!d&&(m?u.jsxs(de,{size:"sm",variant:"ghost",onClick:s,children:[u.jsx(dE,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsx(pk,{onEdit:a,onDelete:l}))]})}function pk({onEdit:t,onDelete:a}){return u.jsxs("div",{className:"flex gap-1",children:[u.jsx(de,{size:"sm",variant:"ghost",onClick:t,title:"Edit",children:"Edit"}),u.jsxs(de,{size:"sm",variant:"ghost",onClick:a,title:"Delete",children:[u.jsx(Dx,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function gk(t){const[a,l]=y.useState(null),s=t.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 (",s,")"]}),!t.disabled&&u.jsxs(de,{size:"sm",variant:"outline",onClick:()=>l({mode:"add"}),children:[u.jsx(hl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:t.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No environment variables."}):t.items.map(o=>u.jsxs(cm,{status:o.status,onEdit:()=>l({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>t.onDelete(o.key),onUndo:()=>t.onUndoDelete(o.key),disabled:t.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(V_,{className:"h-3 w-3 text-muted-foreground"})]},o.key))}),a&&u.jsx(vk,{open:!!a,onOpenChange:o=>!o&&l(null),initial:a.mode==="edit"?a.initial:null,forbiddenKeys:t.otherKeys(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?t.onUpdate(a.key,o):t.onAdd(o),l(null)}})]})}function vk({open:t,onOpenChange:a,initial:l,forbiddenKeys:s,onSubmit:o}){const[d,h]=y.useState((l==null?void 0:l.key)??""),[m,g]=y.useState(l!=null&&l.sensitive?"":(l==null?void 0:l.value)??""),[p,x]=y.useState((l==null?void 0:l.sensitive)??!1),[b,j]=y.useState(null);y.useEffect(()=>{t&&(h((l==null?void 0:l.key)??""),g(l!=null&&l.sensitive?"":(l==null?void 0:l.value)??""),x((l==null?void 0:l.sensitive)??!1),j(null))},[t,l]);function w(C){if(C.preventDefault(),!d.match(/^[A-Z][A-Z0-9_]*$/)){j("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(s.has(d)){j(`Another entry already uses key "${d}".`);return}let N=m;if(p&&(l!=null&&l.sensitive)&&!m&&(N=jh),!p&&!l&&!m){j("Value is required for non-sensitive entries.");return}o({key:d,value:N,sensitive:p})}return u.jsx(Da,{open:t,onOpenChange:a,children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:l?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"env-key",children:"Key"}),u.jsx(tt,{id:"env-key",value:d,onChange:C=>h(C.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!l}),l&&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($e,{htmlFor:"env-value",children:"Value"}),u.jsx(tt,{id:"env-value",type:p?"password":"text",autoComplete:"new-password",value:m,onChange:C=>g(C.target.value),placeholder:l!=null&&l.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:C=>x(C.target.checked),className:"h-4 w-4",disabled:!!l&&l.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."}),b&&u.jsx("p",{className:"text-sm text-destructive",children:b}),u.jsxs(ta,{children:[u.jsx(de,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(de,{type:"submit",children:l?"Done":"Add"})]})]})]})})}function yk(t){const[a,l]=y.useState(null),s=t.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 (",s,")"]}),!t.disabled&&u.jsxs(de,{size:"sm",variant:"outline",onClick:()=>l({mode:"add"}),children:[u.jsx(hl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:t.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No Git repositories."}):t.items.map(o=>{const d=o.value.localPath??Yu(o.value.url);return u.jsxs(cm,{status:o.status,onEdit:()=>l({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>t.onDelete(o.key),onUndo:()=>t.onUndoDelete(o.key),disabled:t.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:["→ ",d||"./"]})]},o.key)})}),a&&u.jsx(bk,{open:!!a,onOpenChange:o=>!o&&l(null),initial:a.mode==="edit"?a.initial:null,forbiddenPaths:t.otherPaths(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?t.onUpdate(a.key,o):t.onAdd(o),l(null)}})]})}function bk({open:t,onOpenChange:a,initial:l,forbiddenPaths:s,onSubmit:o}){const[d,h]=y.useState((l==null?void 0:l.url)??""),[m,g]=y.useState((l==null?void 0:l.ref)??""),[p,x]=y.useState((l==null?void 0:l.localPath)??""),[b,j]=y.useState(null);y.useEffect(()=>{t&&(h((l==null?void 0:l.url)??""),g((l==null?void 0:l.ref)??""),x((l==null?void 0:l.localPath)??""),j(null))},[t,l]);function w(C){C.preventDefault();const N=d.trim();if(!N){j("URL is required.");return}const _=p.trim()||Yu(N);if(_&&s.has(_)){j(`Another repo already occupies local path "${_}".`);return}const R={url:N,...m.trim()?{ref:m.trim()}:{},...p.trim()?{localPath:p.trim()}:{}};o(R)}return u.jsx(Da,{open:t,onOpenChange:a,children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:l?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"git-url",children:"URL"}),u.jsx(tt,{id:"git-url",value:d,onChange:C=>h(C.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(tt,{id:"git-ref",value:m,onChange:C=>g(C.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(tt,{id:"git-path",value:p,onChange:C=>x(C.target.value),placeholder:Yu(d)||"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."})]}),b&&u.jsx("p",{className:"text-sm text-destructive",children:b}),u.jsxs(ta,{children:[u.jsx(de,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(de,{type:"submit",children:l?"Done":"Add"})]})]})]})})}function zS(){const{data:t}=De({queryKey:["members","name-map"],queryFn:sm,staleTime:3e4});return y.useMemo(()=>{const a=new Map;if(t)for(const l of t)a.set(l.id,l.displayName||l.username);return l=>l?a.get(l)??l:"—"},[t])}function xk({agent:t,onSave:a}){const[l,s]=y.useState(!1),o=Qn(),d=zS(),h=t.metadata,m=h==null?void 0:h.tree,g=typeof(m==null?void 0:m.role)=="string"?m.role:null,p=Array.isArray(m==null?void 0:m.domains)?(m==null?void 0:m.domains).filter(j=>typeof j=="string"):[],x=t.managerId?d(t.managerId):null,b=t.delegateMention?o(t.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"}),t.status==="active"&&u.jsxs(de,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[u.jsx(Ux,{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:t.name??t.uuid}),u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsx("span",{children:t.displayName??u.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),b&&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:b})]})]})]}),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:x??"—"})]}),g&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-gray-900",children:g})]}),u.jsxs("span",{children:["type ",u.jsx($t,{variant:"secondary",children:t.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($t,{variant:"outline",children:j},j))})]})]})]}),u.jsx(Sk,{agent:t,open:l,onOpenChange:s,onSave:a})]})}function Sk({agent:t,open:a,onOpenChange:l,onSave:s}){var N;const[o,d]=y.useState(t.displayName??""),[h,m]=y.useState(t.delegateMention??""),[g,p]=y.useState(!1),[x,b]=y.useState(null);y.useEffect(()=>{a&&(d(t.displayName??""),m(t.delegateMention??""),b(null))},[a,t]);const j=t.type==="human",w=De({queryKey:["agents-for-delegate"],queryFn:async()=>(await Ju({limit:100})).items.filter(R=>R.type==="personal_assistant"&&R.status==="active"),enabled:a&&j});async function C(_){_.preventDefault(),b(null),p(!0);try{await s({displayName:o||null,delegateMention:h||null}),l(!1)}catch(R){b(R instanceof Error?R.message:String(R))}finally{p(!1)}}return u.jsx(Da,{open:a,onOpenChange:l,children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{children:"Name (mention)"}),u.jsx(tt,{value:t.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($e,{htmlFor:"id-display",children:"Display Name"}),u.jsx(tt,{id:"id-display",value:o,onChange:_=>d(_.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),j&&u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"id-delegate",value:h,onChange:_=>m(_.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"}),(N=w.data)==null?void 0:N.map(_=>u.jsx("option",{value:_.uuid,children:_.displayName?`${_.displayName} (${_.name??_.uuid})`:_.name??_.uuid},_.uuid))]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),x&&u.jsx("p",{className:"text-sm text-destructive",children:x}),u.jsxs(ta,{children:[u.jsx(de,{type:"button",variant:"ghost",onClick:()=>l(!1),disabled:g,children:"Cancel"}),u.jsx(de,{type:"submit",disabled:g,children:g?"Saving…":"Save"})]})]})]})})}function jk(t){const[a,l]=y.useState(null),s=t.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 (",s,")"]}),!t.disabled&&u.jsxs(de,{size:"sm",variant:"outline",onClick:()=>l({mode:"add"}),children:[u.jsx(hl,{className:"h-3.5 w-3.5 mr-1.5"})," Add"]})]}),u.jsx("div",{className:"px-4 py-3 space-y-2",children:t.items.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):t.items.map(o=>u.jsxs(cm,{status:o.status,onEdit:()=>l({mode:"edit",key:o.key,initial:o.value}),onDelete:()=>t.onDelete(o.key),onUndo:()=>t.onUndoDelete(o.key),disabled:t.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:Nk(o.value)})]},o.key))}),a&&u.jsx(wk,{open:!!a,onOpenChange:o=>!o&&l(null),initial:a.mode==="edit"?a.initial:null,forbiddenNames:t.otherNames(a.mode==="edit"?a.key:null),onSubmit:o=>{a.mode==="edit"?t.onUpdate(a.key,o):t.onAdd(o),l(null)}})]})}function Nk(t){var a;if(t.transport==="stdio"){const l=(a=t.args)!=null&&a.length?` ${t.args.join(" ")}`:"";return`${t.command}${l}`}return t.url}function wk({open:t,onOpenChange:a,initial:l,forbiddenNames:s,onSubmit:o}){const[d,h]=y.useState((l==null?void 0:l.transport)??"stdio"),[m,g]=y.useState((l==null?void 0:l.name)??""),[p,x]=y.useState((l==null?void 0:l.transport)==="stdio"?l.command:""),[b,j]=y.useState((l==null?void 0:l.transport)==="stdio"&&l.args?l.args.join(" "):""),[w,C]=y.useState(l&&(l.transport==="http"||l.transport==="sse")?l.url:""),[N,_]=y.useState(null);y.useEffect(()=>{t&&(h((l==null?void 0:l.transport)??"stdio"),g((l==null?void 0:l.name)??""),x((l==null?void 0:l.transport)==="stdio"?l.command:""),j((l==null?void 0:l.transport)==="stdio"&&l.args?l.args.join(" "):""),C(l&&(l.transport==="http"||l.transport==="sse")?l.url:""),_(null))},[t,l]);function R(Q){if(Q.preventDefault(),!m.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){_("Name must start alphanumeric and contain only a-z0-9_-.");return}if(s.has(m.toLowerCase())){_(`Another MCP server is already named "${m}".`);return}let q;if(d==="stdio"){if(!p.trim()){_("stdio transport requires a command.");return}const B=b.trim().split(/\s+/).filter(F=>F.length>0);q={name:m,transport:"stdio",command:p.trim(),...B.length?{args:B}:{}}}else{const B=w.trim();try{new URL(B)}catch{_("URL is not valid.");return}q={name:m,transport:d,url:B}}o(q)}return u.jsx(Da,{open:t,onOpenChange:a,children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:l?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:R,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:d,onChange:Q=>h(Q.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($e,{htmlFor:"mcp-name",children:"Name"}),u.jsx(tt,{id:"mcp-name",value:m,onChange:Q=>g(Q.target.value),placeholder:"playwright",className:"font-mono"})]}),d==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"mcp-command",children:"Command"}),u.jsx(tt,{id:"mcp-command",value:p,onChange:Q=>x(Q.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(tt,{id:"mcp-args",value:b,onChange:Q=>j(Q.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"mcp-url",children:"URL"}),u.jsx(tt,{id:"mcp-url",value:w,onChange:Q=>C(Q.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),N&&u.jsx("p",{className:"text-sm text-destructive",children:N}),u.jsxs(ta,{children:[u.jsx(de,{type:"button",variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),u.jsx(de,{type:"submit",children:l?"Done":"Add"})]})]})]})})}const zb=[{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 _k({value:t,baseline:a,onChange:l,onRevert:s,disabled:o}){const d=t!==a,h=!zb.some(m=>m.value===t)&&t!=="";return u.jsxs("section",{className:`rounded-md border bg-white ${d?"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",d&&u.jsx("span",{className:"text-xs rounded bg-amber-100 px-1.5 py-0.5 text-amber-900",children:"changed"})]}),d&&u.jsx(de,{size:"sm",variant:"ghost",onClick:s,disabled:o,children:"Revert"})]}),u.jsxs("div",{className:"px-4 py-3 space-y-2",children:[u.jsxs("select",{value:t,onChange:m=>l(m.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)"}),zb.map(m=>u.jsxs("option",{value:m.value,children:[m.label,m.hint?` — ${m.hint}`:""]},m.value)),h&&u.jsxs("option",{value:t,children:[t," — 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 Ek({value:t,baseline:a,onChange:l,onRevert:s,disabled:o}){const[d,h]=y.useState(!1),m=y.useRef(null),g=t!==a;return y.useEffect(()=>{var p;d&&((p=m.current)==null||p.focus())},[d]),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:!d&&!o&&u.jsxs(de,{size:"sm",variant:"outline",onClick:()=>h(!0),children:[u.jsx(Ux,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]})})]}),u.jsx("div",{className:"px-4 py-3",children:d?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:m,value:t,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),h(!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(de,{size:"sm",variant:"ghost",onClick:()=>{s(),h(!1)},disabled:!g,children:"Revert"}),u.jsx(de,{size:"sm",onClick:()=>h(!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:t||u.jsx("span",{className:"text-muted-foreground italic font-sans",children:"No prompt append."})})})]})}const Ck={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function Ak(t){return!t.summary.anyDirty&&!t.conflictMessage&&!t.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:[t.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:[t.summary.dirtySections.length," section",t.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:t.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:()=>t.onJumpTo(a),children:Ck[a]},a))})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:t.saveHint}),t.conflictMessage&&u.jsx("p",{className:"text-xs text-amber-900 font-medium",children:t.conflictMessage}),t.errorMessage&&u.jsx("p",{className:"text-xs text-red-800 font-medium",children:t.errorMessage})]}),u.jsxs("div",{className:"flex gap-2",children:[t.conflictMessage&&u.jsx(de,{variant:"outline",size:"sm",onClick:t.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(de,{variant:"ghost",size:"sm",onClick:t.onDiscard,disabled:t.saving,children:"Discard changes"}),u.jsx(de,{size:"sm",onClick:t.onSave,disabled:t.saving||!t.summary.anyDirty,children:t.saving?"Saving…":"Save"})]})]})})}function Jr(t){return`agent-cfg-${t}`}function Tk(t){switch(t){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 zk(t){switch(t){case"danger":return"bg-red-500";case"warning":return"bg-amber-500";case"muted":return"bg-gray-400";default:return"bg-green-500"}}function Ok(t){const{agent:a,clientStatus:l,runtimeState:s,isHuman:o}=t;return a.status==="suspended"?{tone:"muted",symbol:"◌",label:"Suspended"}:o?{tone:"neutral",symbol:"●",label:"Active"}:l!=null&&l.offlineSince&&!l.clientId?{tone:"muted",symbol:"○",label:"Unclaimed"}:l&&!l.online?{tone:"warning",symbol:"⚠",label:"Client offline"}:s==="error"?{tone:"danger",symbol:"●",label:"Error"}:s==="working"?{tone:"neutral",symbol:"●",label:"Working"}:s==="idle"?{tone:"neutral",symbol:"●",label:"Idle"}:{tone:"neutral",symbol:"●",label:"Online"}}function Rk(t){if(!t)return"—";const a=new Date(t).getTime(),l=Date.now()-a;if(!Number.isFinite(l)||l<0)return un(t);const s=Math.floor(l/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const o=Math.floor(s/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Mk(t){const{agent:a,cfg:l,clientStatus:s,runtimeType:o,activeSessions:d,isHuman:h}=t,m=Ok(t),g=[];!h&&o&&g.push(o),!h&&typeof d=="number"&&g.push(`${d} session${d===1?"":"s"}`),l&&g.push(`config v${l.version}`);const p=s==null?void 0:s.offlineSince,x=!h&&s&&!s.online;return u.jsxs("div",{className:je("rounded-md border px-4 py-3 text-sm space-y-1",Tk(m.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",zk(m.tone)),"aria-hidden":!0}),u.jsx("span",{children:m.symbol==="⚠"?m.symbol:null}),u.jsx("span",{children:m.label}),g.length>0&&u.jsxs("span",{className:"text-muted-foreground font-normal",children:["· ",g.join(" · ")]})]}),!h&&u.jsx("div",{className:"text-xs text-muted-foreground",children:s!=null&&s.clientId?u.jsxs(u.Fragment,{children:["Client ",u.jsx("span",{className:"font-mono",children:s.clientId}),s.online?null:u.jsxs(u.Fragment,{children:[" · offline since ",u.jsx("span",{children:un(p)})]})]}):u.jsx("span",{children:"No client bound yet"})}),l&&u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Config updated by ",u.jsx("span",{className:"font-medium",children:l.updatedBy||"—"})," · ",Rk(l.updatedAt)]}),x&&u.jsx("p",{className:"mt-1 text-xs text-amber-900",children:"Changes saved here won't take effect until the client reconnects."}),!h&&!(s!=null&&s.clientId)&&a.status==="active"&&u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Configure now; it will apply when a client claims this agent."})]})}function kk(t){return t.isUnclaimed?"Saving: configuration stored; will apply when a client claims this agent.":t.isOffline?"Saving: configuration stored; will apply when the client reconnects.":t.activeSessions>0?`Saving: new chats use this immediately; ${t.activeSessions} active chat${t.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function Dk(t,a){let l=a.size+1;for(;a.has(`${t}-${l}`);)l++;return`${t}-${l}`}function Uk(t,a){return JSON.stringify(t)===JSON.stringify(a)}function Xf(t,a){return t.map((l,s)=>({key:`${a}-${s+1}`,value:l,baseline:l,status:"unchanged"}))}function Ob(t){return t.map(a=>a.status==="deleted"?a:a.baseline==null?{...a,status:"added"}:Uk(a.value,a.baseline)?{...a,status:"unchanged"}:{...a,status:"modified"})}function Jf(t,a){const l=t;return{add:s=>a(o=>{const d=o[t],h=new Set(d.map(p=>p.key)),m=Dk(l,h),g=[...d,{key:m,value:s,baseline:null,status:"added"}];return{...o,[t]:Ob(g)}}),update:(s,o)=>a(d=>{const m=d[t].map(g=>g.key===s?{...g,value:o}:g);return{...d,[t]:Ob(m)}}),remove:s=>a(o=>{const h=o[t].map(m=>m.key!==s?m:m.baseline==null?null:{...m,status:"deleted"}).filter(m=>m!==null);return{...o,[t]:h}}),undo:s=>a(o=>{const h=o[t].map(m=>m.key!==s||m.baseline==null?m:{...m,value:m.baseline,status:"unchanged"});return{...o,[t]:h}})}}function Lk(t){return{promptAppend:t.payload.prompt.append,model:t.payload.model,mcp:Xf(t.payload.mcpServers,"mcp"),env:Xf(t.payload.env,"env"),git:Xf(t.payload.gitRepos,"git")}}function Zk(t){const[a,l]=y.useState(null);y.useEffect(()=>{t&&a===null&&l(Lk(t))},[t,a]);const s=a??{promptAppend:"",model:"",mcp:[],env:[],git:[]},o=(t==null?void 0:t.payload.prompt.append)??"",d=(t==null?void 0:t.payload.model)??"",h=s.promptAppend!==o,m=s.model!==d,g=y.useMemo(()=>{const q=[],B=k=>k.reduce((ee,be)=>be.status==="unchanged"?ee:ee+1,0),F=B(s.mcp),J=B(s.env),K=B(s.git);return h&&q.push("prompt"),m&&q.push("model"),F>0&&q.push("mcp"),J>0&&q.push("env"),K>0&&q.push("git"),{anyDirty:q.length>0,dirtySections:q,counts:{prompt:h?1:0,model:m?1:0,mcp:F,env:J,git:K}}},[s,h,m]),p=y.useCallback(q=>{l(B=>B&&q(B))},[]),x=y.useCallback(q=>p(B=>({...B,promptAppend:q})),[p]),b=y.useCallback(()=>p(q=>({...q,promptAppend:o})),[p,o]),j=y.useCallback(q=>p(B=>({...B,model:q})),[p]),w=y.useCallback(()=>p(q=>({...q,model:d})),[p,d]),C=y.useMemo(()=>Jf("mcp",p),[p]),N=y.useMemo(()=>Jf("env",p),[p]),_=y.useMemo(()=>Jf("git",p),[p]),R=y.useCallback(()=>{l(null)},[]),Q=y.useCallback(()=>{if(!a||!t)return{};const q={};h&&(q.prompt={append:a.promptAppend}),m&&(q.model=a.model);const B=g.counts.mcp>0,F=g.counts.env>0,J=g.counts.git>0;return B&&(q.mcpServers=a.mcp.filter(K=>K.status!=="deleted").map(K=>K.value)),F&&(q.env=a.env.filter(K=>K.status!=="deleted").map(K=>{const k=K.value;return k.sensitive&&k.value===jh?{key:k.key,value:jh,sensitive:!0}:k})),J&&(q.gitRepos=a.git.filter(K=>K.status!=="deleted").map(K=>K.value)),q},[a,t,h,m,g]);return{draft:s,summary:g,promptDirty:h,modelDirty:m,setPromptAppend:x,revertPrompt:b,setModel:j,revertModel:w,addMcp:C.add,updateMcp:C.update,deleteMcp:C.remove,undoDeleteMcp:C.undo,addEnv:N.add,updateEnv:N.update,deleteEnv:N.remove,undoDeleteEnv:N.undo,addGit:_.add,updateGit:_.update,deleteGit:_.remove,undoDeleteGit:_.undo,resetAll:R,buildPayloadPatch:Q}}const qk=Object.values(_O);function Bk(){var Us,no,ao,Za,Ht,Zn,Qt,ro,lo;const a=_w().uuid??"",l=Ar(),s=Mn(),o=De({queryKey:["agent",a],queryFn:()=>s2(a),enabled:!!a}),d=De({queryKey:["agent-config",a],queryFn:()=>lk(a),enabled:!!a&&((Us=o.data)==null?void 0:Us.type)!=="human"}),h=De({queryKey:["agent-client-status",a],queryFn:()=>ok(a),enabled:!!a&&((no=o.data)==null?void 0:no.type)!=="human"}),m=De({queryKey:["agent-sessions-active",a],queryFn:()=>uc(a,{state:"active"}),enabled:!!a&&((ao=o.data)==null?void 0:ao.type)!=="human"}),g=De({queryKey:["adapters"],queryFn:a0}),p=De({queryKey:["adapter-mappings"],queryFn:t0}),{data:x}=De({queryKey:["adapter-statuses"],queryFn:n0,refetchInterval:15e3}),b=((Za=g.data)==null?void 0:Za.filter(X=>X.agentId===a))??[],j=((Ht=p.data)==null?void 0:Ht.filter(X=>X.agentId===a))??[],w=Zk(d.data),[C,N]=y.useState(null),[_,R]=y.useState(null),Q=st({mutationFn:async()=>{if(!d.data)throw new Error("config not loaded");const X=w.buildPayloadPatch();return sk(a,{expectedVersion:d.data.version,payload:X})},onSuccess:X=>{s.setQueryData(["agent-config",a],X),N(null),R(null)},onError:X=>{if(X instanceof $h&&X.status===409){R("Someone else saved a newer version while you were editing."),N(null);return}N(X instanceof Error?X.message:String(X))}}),q=y.useCallback(()=>{R(null),N(null),s.invalidateQueries({queryKey:["agent-config",a]}),w.resetAll()},[s,a,w]),B=y.useCallback(X=>{const Re=document.getElementById(Jr(X));Re&&Re.scrollIntoView({behavior:"smooth",block:"start"})},[]),F=st({mutationFn:X=>o2(a,X),onSuccess:()=>{s.invalidateQueries({queryKey:["agent",a]}),s.invalidateQueries({queryKey:["agents"]})}}),J=st({mutationFn:()=>c2(a),onSuccess:()=>s.invalidateQueries({queryKey:["agent",a]})}),K=st({mutationFn:()=>d2(a),onSuccess:()=>s.invalidateQueries({queryKey:["agent",a]})}),k=st({mutationFn:()=>u2(a),onSuccess:()=>l("/agents")}),ee=st({mutationFn:()=>f2(a)}),[be,_e]=y.useState(!1),Ue=y.useRef(null);y.useEffect(()=>{if(!be)return;function X(Re){Ue.current&&!Ue.current.contains(Re.target)&&_e(!1)}return window.addEventListener("mousedown",X),()=>window.removeEventListener("mousedown",X)},[be]);const[jt,Ge]=y.useState(!1),[xe,$]=y.useState(null),[D,ae]=y.useState(Wf),[ze,W]=y.useState(""),O=st({mutationFn:async()=>{const X=Rb(D);if(!X)throw new Error("Credentials are required");return x2({platform:D.platform,agentId:a,credentials:X,status:D.status})},onSuccess:()=>{s.invalidateQueries({queryKey:["adapters"]}),Rr()}}),Y=st({mutationFn:()=>{if(!xe)throw new Error("No adapter selected");const X={status:D.status},Re=Rb(D);return Re&&(X.credentials=Re),S2(xe,X)},onSuccess:()=>{s.invalidateQueries({queryKey:["adapters"]}),Rr()}}),te=st({mutationFn:j2,onSuccess:()=>s.invalidateQueries({queryKey:["adapters"]})}),le=st({mutationFn:()=>y2({platform:D.platform,externalUserId:D.externalUserId,agentId:a,boundVia:"manual",displayName:D.displayName||void 0}),onSuccess:()=>{s.invalidateQueries({queryKey:["adapter-mappings"]}),Rr()}}),ue=st({mutationFn:b2,onSuccess:()=>s.invalidateQueries({queryKey:["adapter-mappings"]})}),[me,Oe]=y.useState(null),pt=st({mutationFn:()=>ik(a,w.buildPayloadPatch()),onSuccess:X=>{const Re=X.diff.length?X.diff.map(Jt=>`${Jt.op} ${Jt.path}`).join(`
|
|
308
|
-
`):"(no changes)";Oe(Re)},onError:X=>Oe(`Dry run failed: ${X instanceof Error?X.message:String(X)}`)});if(y.useEffect(()=>{if(!w.summary.anyDirty)return;const X=Re=>{Re.preventDefault(),Re.returnValue=""};return window.addEventListener("beforeunload",X),()=>window.removeEventListener("beforeunload",X)},[w.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 fe=o.data;if(!fe)return u.jsx("div",{className:"text-muted-foreground",children:"Agent not found"});const gt=fe.type==="human",Dt=h.data,Ln=((Zn=m.data)==null?void 0:Zn.length)??0,La=!gt&&!(Dt!=null&&Dt.clientId),Xt=!gt&&Dt?!Dt.online&&!!Dt.clientId:!1,vl=fe,Ms=vl.runtimeState??null,cc=vl.runtimeType??null;function Rr(){Ge(!1),$(null),ae(Wf),W("")}function ks(X){$(X.id),ae({...Wf,platform:X.platform,status:X.status}),Ge(!0)}function Ds(X){if(X.preventDefault(),W(""),gt){if(!D.externalUserId)return;le.mutate();return}if(D.platform==="feishu"){if(!xe&&(!D.feishuAppId||!D.feishuAppSecret)){W("App ID and App Secret are required");return}}else if(D.platform==="kael"){if(!xe&&(!D.kaelUserId||!D.kaelProjectId)){W("User ID and Project ID are required");return}}else{const Re=D.credentialsJson.trim();if(!xe&&!Re){W("Credentials are required");return}if(Re)try{JSON.parse(Re)}catch{W("Invalid JSON");return}}xe?Y.mutate():O.mutate()}const yl=O.error??Y.error??le.error,Wi=O.isPending||Y.isPending||le.isPending,dc=kk({activeSessions:Ln,isUnclaimed:La,isOffline:Xt}),Vt=w.draft.mcp.filter(X=>X.status!=="deleted"),fc=w.draft.env.filter(X=>X.status!=="deleted"),eo=w.draft.git.filter(X=>X.status!=="deleted"),to=X=>new Set(Vt.filter(Re=>Re.key!==X).map(Re=>Re.value.name.toLowerCase())),bl=X=>new Set(fc.filter(Re=>Re.key!==X).map(Re=>Re.value.key)),hc=X=>new Set(eo.filter(Re=>Re.key!==X).map(Re=>{const{value:Jt}=Re;return Jt.localPath?Jt.localPath:((Jt.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(de,{variant:"ghost",size:"icon",onClick:()=>l("/agents"),children:u.jsx(Rx,{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:fe.displayName??fe.name}),u.jsxs("p",{className:"text-xs text-muted-foreground font-mono truncate",children:["@",fe.name??fe.uuid," · ",fe.type]})]}),u.jsxs("div",{className:"relative",ref:Ue,children:[u.jsx(de,{variant:"outline",size:"icon",onClick:()=>_e(X=>!X),title:"More actions",children:u.jsx(Dx,{className:"h-4 w-4"})}),be&&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:[!gt&&fe.status==="active"&&u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{_e(!1),ee.reset(),ee.mutate()},className:"w-full text-left px-3 py-1.5 hover:bg-gray-50 flex items-center gap-2",disabled:ee.isPending,children:[u.jsx(aE,{className:"h-3.5 w-3.5"}),ee.isPending?"Testing…":"Test connection"]})}),fe.status==="active"?u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{_e(!1),confirm("Suspend this agent? All tokens will be revoked.")&&J.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),K.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:`#${Jr("prompt")}`,onClick:()=>_e(!1),className:"block px-3 py-1.5 text-xs text-muted-foreground hover:bg-gray-50",children:"Jump to Behavior"})})]})})]})]}),(ee.data||ee.error)&&u.jsx(Gk,{result:ee.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>ee.reset()}),u.jsx(Mk,{agent:fe,cfg:d.data,clientStatus:Dt,runtimeState:Ms,runtimeType:cc,activeSessions:Ln,isHuman:gt}),u.jsx(xk,{agent:fe,onSave:async X=>{await F.mutateAsync(X)}}),!gt&&u.jsxs($k,{loaded:!!d.data,loading:d.isLoading,error:d.error?String(d.error):null,version:((Qt=d.data)==null?void 0:Qt.version)??null,dirty:w.summary.anyDirty,children:[u.jsx("div",{id:Jr("prompt"),children:u.jsx(Ek,{value:w.draft.promptAppend,baseline:((ro=d.data)==null?void 0:ro.payload.prompt.append)??"",onChange:w.setPromptAppend,onRevert:w.revertPrompt,disabled:fe.status!=="active"})}),u.jsx("div",{id:Jr("model"),children:u.jsx(_k,{value:w.draft.model,baseline:((lo=d.data)==null?void 0:lo.payload.model)??"",onChange:w.setModel,onRevert:w.revertModel,disabled:fe.status!=="active"})}),u.jsx("div",{id:Jr("mcp"),children:u.jsx(jk,{items:w.draft.mcp,otherNames:to,onAdd:w.addMcp,onUpdate:w.updateMcp,onDelete:w.deleteMcp,onUndoDelete:w.undoDeleteMcp,disabled:fe.status!=="active"})}),u.jsx("div",{id:Jr("env"),children:u.jsx(gk,{items:w.draft.env,otherKeys:bl,onAdd:w.addEnv,onUpdate:w.updateEnv,onDelete:w.deleteEnv,onUndoDelete:w.undoDeleteEnv,disabled:fe.status!=="active"})}),u.jsx("div",{id:Jr("git"),children:u.jsx(yk,{items:w.draft.git,otherPaths:hc,onAdd:w.addGit,onUpdate:w.updateGit,onDelete:w.deleteGit,onUndoDelete:w.undoDeleteGit,disabled:fe.status!=="active"})}),me&&u.jsx("pre",{className:"whitespace-pre-wrap rounded border bg-gray-50 p-2 text-xs",children:me})]}),u.jsxs(cl,{children:[u.jsxs(Ns,{className:"flex flex-row items-center justify-between",children:[u.jsxs(ws,{className:"flex items-center gap-2 text-base",children:[gt?u.jsx(G_,{className:"h-4 w-4"}):u.jsx(U_,{className:"h-4 w-4"}),"Platform Bindings"]}),u.jsxs(de,{size:"sm",variant:"outline",onClick:()=>Ge(!0),children:[u.jsx(hl,{className:"h-4 w-4 mr-2"}),gt?"Bind User":"Bind Bot"]})]}),u.jsx(dl,{children:gt?u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Platform"}),u.jsx(ye,{children:"External User ID"}),u.jsx(ye,{children:"Display Name"}),u.jsx(ye,{children:"Bound Via"}),u.jsx(ye,{children:"Created"}),u.jsx(ye,{className:"w-16"})]})}),u.jsx(Ma,{children:j.length===0?u.jsx(at,{children:u.jsx(ve,{colSpan:6,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):j.map(X=>u.jsxs(at,{children:[u.jsx(ve,{children:u.jsx($t,{variant:"secondary",children:X.platform})}),u.jsx(ve,{className:"font-mono text-sm",children:X.externalUserId}),u.jsx(ve,{children:X.displayName??"—"}),u.jsx(ve,{children:u.jsx($t,{variant:"outline",children:X.boundVia??"—"})}),u.jsx(ve,{className:"text-muted-foreground",children:un(X.createdAt)}),u.jsx(ve,{children:u.jsx(de,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this binding?")&&ue.mutate(X.id)},disabled:ue.isPending,children:u.jsx(Zi,{className:"h-4 w-4"})})})]},X.id))})]}):u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Platform"}),u.jsx(ye,{children:"Status"}),u.jsx(ye,{children:"Connection"}),u.jsx(ye,{children:"Created"}),u.jsx(ye,{className:"w-24"})]})}),u.jsx(Ma,{children:b.length===0?u.jsx(at,{children:u.jsx(ve,{colSpan:5,className:"text-center py-4 text-muted-foreground",children:"No platform bindings"})}):b.map(X=>{const Re=x==null?void 0:x.find(Mr=>Mr.configId===X.id),Jt=X.platform==="kael"?X.status==="active":!!(Re!=null&&Re.connected);return u.jsxs(at,{children:[u.jsx(ve,{children:u.jsx($t,{variant:"secondary",children:X.platform})}),u.jsx(ve,{children:u.jsx($t,{variant:X.status==="active"?"default":"destructive",children:X.status})}),u.jsx(ve,{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",Jt?"bg-green-500":"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:Jt?"Online":"Offline"})]})}),u.jsx(ve,{className:"text-muted-foreground",children:un(X.createdAt)}),u.jsx(ve,{children:u.jsxs("div",{className:"flex gap-1",children:[u.jsx(de,{variant:"ghost",size:"icon",onClick:()=>ks(X),title:"Edit",children:"…"}),u.jsx(de,{variant:"ghost",size:"icon",onClick:()=>{confirm("Remove this bot binding?")&&te.mutate(X.id)},disabled:te.isPending,title:"Delete",children:u.jsx(Zi,{className:"h-4 w-4"})})]})})]},X.id)})})]})})]}),u.jsx(fk,{agent:fe,suspendPending:J.isPending,reactivatePending:K.isPending,deletePending:k.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&J.mutate()},onReactivate:()=>K.mutate(),onDelete:()=>k.mutate()}),!gt&&u.jsx(Ak,{summary:w.summary,saveHint:dc,conflictMessage:_,errorMessage:C,saving:Q.isPending,onSave:()=>Q.mutate(),onDiscard:()=>{(!w.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(w.resetAll(),N(null),R(null))},onReloadRemote:q,onJumpTo:B}),!gt&&w.summary.anyDirty&&u.jsx("div",{className:"text-xs text-muted-foreground",children:u.jsx("button",{type:"button",onClick:()=>pt.mutate(),className:"underline hover:text-gray-900",disabled:pt.isPending,children:pt.isPending?"Computing dry-run…":"Preview server-side diff"})}),u.jsx(Da,{open:jt,onOpenChange:X=>X?Ge(!0):Rr(),children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:gt?"Bind External User":xe?"Edit Bot Binding":"Bind Bot"})}),u.jsxs("form",{onSubmit:Ds,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:D.platform,onChange:X=>ae({...D,platform:X.target.value}),disabled:!!xe,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:qk.map(X=>u.jsx("option",{value:X,children:X},X))})]}),gt?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"binding-ext-id",children:"External User ID"}),u.jsx(tt,{id:"binding-ext-id",value:D.externalUserId,onChange:X=>ae({...D,externalUserId:X.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"binding-name",children:"Display Name (optional)"}),u.jsx(tt,{id:"binding-name",value:D.displayName,onChange:X=>ae({...D,displayName:X.target.value})})]})]}):u.jsxs(u.Fragment,{children:[D.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs($e,{htmlFor:"feishu-app-id",children:["App ID",xe?" — leave empty to keep existing":""]}),u.jsx(tt,{id:"feishu-app-id",value:D.feishuAppId,onChange:X=>ae({...D,feishuAppId:X.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs($e,{htmlFor:"feishu-app-secret",children:["App Secret",xe?" — leave empty to keep existing":""]}),u.jsx(tt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:D.feishuAppSecret,onChange:X=>ae({...D,feishuAppSecret:X.target.value}),placeholder:"••••••••"})]})]}):D.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs($e,{htmlFor:"kael-user-id",children:["User ID",xe?" — leave empty to keep existing":""]}),u.jsx(tt,{id:"kael-user-id",value:D.kaelUserId,onChange:X=>ae({...D,kaelUserId:X.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs($e,{htmlFor:"kael-project-id",children:["Project ID",xe?" — leave empty to keep existing":""]}),u.jsx(tt,{id:"kael-project-id",value:D.kaelProjectId,onChange:X=>ae({...D,kaelProjectId:X.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!xe&&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($e,{htmlFor:"binding-creds",children:["Credentials (JSON)",xe?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:D.credentialsJson,onChange:X=>ae({...D,credentialsJson:X.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": "..."}'})]}),ze&&u.jsx("p",{className:"text-sm text-destructive",children:ze}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:D.status,onChange:X=>ae({...D,status:X.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"})]})]})]}),yl instanceof Error&&u.jsx("div",{className:"text-sm text-destructive",children:yl.message}),u.jsx(ta,{children:u.jsx(de,{type:"submit",disabled:Wi,children:Wi?"Saving...":xe?"Update":"Create"})})]})]})})]})}function $k(t){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:[t.version!=null&&u.jsxs("span",{children:["v",t.version]}),t.dirty&&u.jsx("span",{className:"ml-2 text-amber-700",children:"· draft"})]})]}),t.loading&&u.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading configuration…"}),t.error&&u.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load configuration: ",t.error]}),t.loaded&&u.jsx("div",{className:"space-y-3",children:t.children})]})}const Wf={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function Rb(t){if(t.platform==="feishu"){if(!t.feishuAppId&&!t.feishuAppSecret)return null;if(!t.feishuAppId||!t.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:t.feishuAppId,app_secret:t.feishuAppSecret}}if(t.platform==="kael"){if(!t.kaelUserId&&!t.kaelProjectId)return null;if(!t.kaelUserId||!t.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:t.kaelUserId,kaelProjectId:t.kaelProjectId}}const a=t.credentialsJson.trim();return a?JSON.parse(a):null}const Hk={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},Qk={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 Gk({result:t,onDismiss:a}){const l={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"}[t.status],s=t.status==="success"?"default":t.status==="timeout"||t.status==="stale"?"secondary":"destructive",o=t.connection,d=o?Qk[o.health]:null;return u.jsx(cl,{className:je("border-l-4",l),children:u.jsx(dl,{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($t,{variant:s,children:Hk[t.status]}),t.responseTime!=null&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:[(t.responseTime/1e3).toFixed(1),"s"]})]}),t.message&&u.jsx("p",{className:"text-sm text-muted-foreground",children:t.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:[d&&u.jsxs("span",{className:d.color,children:[d.icon," ",d.label]}),o.runtimeState&&u.jsxs("span",{className:"text-muted-foreground",children:["runtime: ",o.runtimeState]})]}),o.client?u.jsxs("div",{className:"text-muted-foreground",children:["Client: ",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 client bound"}),o.lastSeenAt&&u.jsxs("div",{className:"text-muted-foreground",children:["Last seen: ",new Date(o.lastSeenAt).toLocaleString()]})]}),t.responseContent&&u.jsx("p",{className:"text-sm mt-2 whitespace-pre-wrap bg-muted rounded p-2 max-h-40 overflow-auto",children:t.responseContent})]}),u.jsx(de,{variant:"ghost",size:"sm",onClick:a,children:"Dismiss"})]})})})}const Ik=Object.values(G0);function Vk(t){var xe,$;const{open:a,onOpenChange:l,onSubmit:s,isPending:o,error:d,mode:h}=t,m=h==="edit"?t.agent:void 0,{memberId:g,role:p}=Os(),x=p==="admin",[b,j]=y.useState(""),[w,C]=y.useState("personal_assistant"),[N,_]=y.useState(""),[R,Q]=y.useState(""),[q,B]=y.useState(""),[F,J]=y.useState(""),K=h==="create"&&w!=="human",k=De({queryKey:["clients-for-pin"],queryFn:Ih,enabled:a&&K}),ee=w==="human",be=De({queryKey:["agents-for-delegate"],queryFn:async()=>(await Ju({limit:100})).items.filter(ae=>ae.type==="personal_assistant"&&ae.status==="active"),enabled:a&&ee}),_e=De({queryKey:["members-for-manager"],queryFn:sm,enabled:a&&h==="create"&&x}),Ue=y.useMemo(()=>{var ze;const D=k.data??[];if(!K||!x)return D;if(!q)return[];const ae=(ze=_e.data)==null?void 0:ze.find(W=>W.id===q);return ae?D.filter(W=>(W.userId??null)===ae.userId):[]},[k.data,x,q,_e.data,K]);y.useEffect(()=>{a&&(m?(j(m.name??""),C(m.type),_(m.displayName??""),Q(m.delegateMention??""),B(m.managerId??"")):(j(""),C("personal_assistant"),_(""),Q(""),B(x?"":g??""),J("")))},[a,m,x,g]);const jt=D=>{D.preventDefault(),s({name:h==="create"&&b?b:void 0,type:w,displayName:N||null,delegateMention:R||null,managerId:q||null,clientId:F||null})},Ge=h==="edit";return u.jsx(Da,{open:a,onOpenChange:l,children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:Ge?"Edit Agent":"New Agent"})}),u.jsxs("form",{onSubmit:jt,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"agent-name",children:"Name"}),Ge?u.jsx(tt,{id:"agent-name",value:b,disabled:!0,className:"font-mono"}):u.jsx(tt,{id:"agent-name",value:b,onChange:D=>j(D.target.value),placeholder:"Leave empty to auto-generate",pattern:"^[a-z0-9_-]*$",title:"Only lowercase alphanumeric, hyphens, and underscores",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"agent-type",children:"Type"}),u.jsx("select",{id:"agent-type",value:w,onChange:D=>{const ae=D.target.value;C(ae),ae!=="human"&&Q(""),J("")},disabled:Ge,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 disabled:opacity-50",children:Ik.map(D=>u.jsx("option",{value:D,children:D},D))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"agent-display-name",children:"Display Name"}),u.jsx(tt,{id:"agent-display-name",value:N,onChange:D=>_(D.target.value),placeholder:"Optional",maxLength:200})]}),h==="create"&&x&&u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"agent-manager",children:"Manager"}),u.jsxs("select",{id:"agent-manager",value:q,onChange:D=>{B(D.target.value),J("")},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:"Select a member…"}),(xe=_e.data)==null?void 0:xe.map(D=>u.jsxs("option",{value:D.id,children:[D.displayName," (",D.role,")"]},D.id))]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Non-human agents must pin a client belonging to this user."})]}),ee&&u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"agent-delegate",children:"Delegate Mention"}),u.jsxs("select",{id:"agent-delegate",value:R,onChange:D=>Q(D.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"}),($=be.data)==null?void 0:$.map(D=>u.jsx("option",{value:D.uuid,children:D.displayName?`${D.displayName} (${D.name??D.uuid})`:D.name??D.uuid},D.uuid))]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"The personal assistant that acts on behalf of this agent"})]}),K&&u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"agent-client",children:"Client"}),Ue.length>0?u.jsxs("select",{id:"agent-client",value:F,onChange:D=>J(D.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:"Select a client…"}),Ue.map(D=>u.jsx("option",{value:D.id,children:D.hostname??D.id.slice(0,12)},D.id))]}):u.jsx("p",{className:"text-xs text-muted-foreground",children:x&&!q?"Pick a manager first to see their clients.":"No eligible clients. Run `first-tree-hub client connect` on the target machine to register one."}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Pinned at creation — clientId is immutable in this milestone. Move = delete + recreate."})]}),d&&u.jsx("div",{className:"text-sm text-destructive",children:d.message}),u.jsx(ta,{children:u.jsx(de,{type:"submit",disabled:o,children:o?"Saving...":Ge?"Save":"Create"})})]})]})})}const Yk=Object.values(G0);function Mb(t){return[...t].sort((a,l)=>{const s=(a.name??a.displayName??"").toLowerCase(),o=(l.name??l.displayName??"").toLowerCase();return s.localeCompare(o)})}function Kk(){const t=Ar(),a=Mn(),{memberId:l}=Os(),[s,o]=y.useState(),[d,h]=y.useState(""),[m,g]=y.useState(!1),[p,x]=y.useState(null),[b,j]=y.useState(!1),w=Qn(),C=zS(),{data:N,isLoading:_,error:R}=De({queryKey:["agents",s,d],queryFn:()=>Ju({limit:100,cursor:s,type:d||void 0})}),{myAgents:Q,teamAgents:q}=y.useMemo(()=>{if(!(N!=null&&N.items))return{myAgents:[],teamAgents:[]};const k=[],ee=[];for(const be of N.items)l&&be.managerId===l?k.push(be):ee.push(be);return{myAgents:Mb(k),teamAgents:Mb(ee)}},[N,l]),B=st({mutationFn:async k=>await i2({name:k.name,type:k.type,displayName:k.displayName??void 0,delegateMention:k.delegateMention??void 0,managerId:k.managerId??void 0,clientId:k.clientId??void 0}),onSuccess:k=>{if(g(!1),a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),k.type==="human"){t(`/agents/${k.uuid}`);return}x(k),j(!1)}});function F(k){const be=k.runtimeState,_e={idle:"bg-green-500",working:"bg-blue-500",error:"bg-red-500"};return u.jsxs(at,{className:"cursor-pointer",onClick:()=>t(`/agents/${k.uuid}`),children:[u.jsx(ve,{className:"font-mono text-sm",children:k.name}),u.jsx(ve,{children:k.displayName??"—"}),u.jsx(ve,{children:u.jsx($t,{variant:"secondary",children:k.type})}),u.jsx(ve,{className:"font-mono text-sm text-muted-foreground",children:k.delegateMention?w(k.delegateMention):"—"}),u.jsx(ve,{className:"text-sm text-muted-foreground",children:C(k.managerId)}),u.jsx(ve,{children:be?u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",_e[be]??"bg-gray-300")}),u.jsx("span",{className:"text-xs text-muted-foreground",children:be})]}):u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-gray-300",title:"not running"})}),u.jsx(ve,{children:u.jsx($t,{variant:k.status==="active"?"default":"destructive",children:k.status})}),u.jsx(ve,{className:"text-muted-foreground",children:un(k.createdAt)})]},k.uuid)}const J=p?`first-tree-hub agent add ${p.name??p.uuid} --agent-id ${p.uuid}`:"",K=()=>{navigator.clipboard.writeText(J),j(!0),setTimeout(()=>j(!1),2e3)};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:d,onChange:k=>{h(k.target.value),o(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"}),Yk.map(k=>u.jsx("option",{value:k,children:k},k))]})]}),_?u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):R?u.jsxs("div",{className:"text-center py-8 text-destructive",children:["Failed to load agents: ",R instanceof Error?R.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(de,{size:"sm",onClick:()=>g(!0),children:[u.jsx(hl,{className:"h-4 w-4 mr-2"}),"New Agent"]})]}),u.jsx("div",{className:"border rounded-lg",children:u.jsxs(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Name"}),u.jsx(ye,{children:"Display Name"}),u.jsx(ye,{children:"Type"}),u.jsx(ye,{children:"Delegate"}),u.jsx(ye,{children:"Owner"}),u.jsx(ye,{children:"Runtime"}),u.jsx(ye,{children:"Status"}),u.jsx(ye,{children:"Created"})]})}),u.jsx(Ma,{children:Q.length===0?u.jsx(at,{children:u.jsx(ve,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"No agents yet — create one to get started"})}):Q.map(k=>F(k))})]})})]}),q.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(Oa,{children:[u.jsx(Ra,{children:u.jsxs(at,{children:[u.jsx(ye,{children:"Name"}),u.jsx(ye,{children:"Display Name"}),u.jsx(ye,{children:"Type"}),u.jsx(ye,{children:"Delegate"}),u.jsx(ye,{children:"Owner"}),u.jsx(ye,{children:"Runtime"}),u.jsx(ye,{children:"Status"}),u.jsx(ye,{children:"Created"})]})}),u.jsx(Ma,{children:q.map(k=>F(k))})]})})]})]}),(N==null?void 0:N.nextCursor)&&u.jsx("div",{className:"flex justify-end",children:u.jsx(de,{variant:"outline",onClick:()=>o(N.nextCursor??void 0),children:"Next Page"})}),u.jsx(Vk,{mode:"create",open:m,onOpenChange:g,onSubmit:k=>B.mutate(k),isPending:B.isPending,error:B.error instanceof Error?B.error:null}),u.jsx(Da,{open:p!==null,onOpenChange:k=>{if(!k){const ee=p==null?void 0:p.uuid;x(null),ee&&t(`/agents/${ee}`)}},children:u.jsxs(na,{children:[u.jsx(Ua,{children:u.jsx(aa,{children:"Agent Created"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Run this on the pinned client machine to register a local alias; the client connects with your JWT, not a per-agent token."}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 bg-muted rounded-md px-3 py-2 text-xs font-mono break-all select-all",children:J}),u.jsx(de,{variant:"outline",size:"icon",className:"shrink-0",onClick:K,children:b?u.jsx(Mx,{className:"h-4 w-4 text-green-600"}):u.jsx(Hh,{className:"h-4 w-4"})})]})]}),u.jsx(ta,{children:u.jsx(de,{onClick:()=>{const k=p==null?void 0:p.uuid;x(null),k&&t(`/agents/${k}`)},children:"Done"})})]})})]})}function Pk(){const{isAuthenticated:t,login:a}=Os(),[l,s]=y.useState(""),[o,d]=y.useState(""),[h,m]=y.useState(null),[g,p]=y.useState(!1);if(t)return u.jsx(bx,{to:"/",replace:!0});const x=async b=>{b.preventDefault(),m(null),p(!0);try{await a(l,o)}catch(j){m(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(cl,{className:"w-full max-w-sm",children:[u.jsxs(Ns,{className:"text-center",children:[u.jsx(ws,{className:"text-2xl",children:"First Tree"}),u.jsx(l0,{children:"Sign in to your workspace"})]}),u.jsx(dl,{children:u.jsxs("form",{onSubmit:x,className:"space-y-4",children:[h&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:h}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"username",children:"Username"}),u.jsx(tt,{id:"username",value:l,onChange:b=>s(b.target.value),required:!0,autoFocus:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{htmlFor:"password",children:"Password"}),u.jsx(tt,{id:"password",type:"password",value:o,onChange:b=>d(b.target.value),required:!0})]}),u.jsx(de,{type:"submit",className:"w-full",disabled:g,children:g?"Signing in...":"Sign in"})]})})]})})}function Fk(t,a){return we.post(`/admin/chats/${encodeURIComponent(t)}/messages`,{format:"text",content:a})}function Xk(t){return we.post(`/admin/agents/${encodeURIComponent(t)}/chats`,{})}function Jk(t,a){const l=new URLSearchParams;l.set("limit",String(a.limit)),a!=null&&a.cursor&&l.set("cursor",a.cursor);const s=l.toString();return we.get(`/admin/chats/${encodeURIComponent(t)}/messages${s?`?${s}`:""}`)}function OS(){return we.get("/admin/overview")}const Wk=2e3,e3=3e4;function t3(t){const{onMessage:a,enabled:l=!0}={},s=Mn(),o=y.useRef(null),d=y.useRef(0),h=y.useRef(null),m=y.useRef(!1),g=y.useRef(a);g.current=a;const p=y.useRef(s);p.current=s,y.useEffect(()=>{if(!l)return;m.current=!1;function x(){const b=Bh();if(!(b!=null&&b.accessToken))return;const w=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${b.accessToken}`,C=new WebSocket(w);o.current=C,C.onmessage=N=>{var _;try{const R=JSON.parse(N.data);(_=g.current)==null||_.call(g,R),R.type==="notification"?p.current.invalidateQueries({queryKey:["notifications"]}):R.type==="session:state"&&(p.current.invalidateQueries({queryKey:["activity"]}),p.current.invalidateQueries({queryKey:["sessions"]}))}catch{}},C.onopen=()=>{d.current=0},C.onclose=()=>{if(o.current=null,!m.current){d.current++;const N=Math.min(Wk*2**(d.current-1),e3);h.current=setTimeout(()=>{h.current=null,m.current||x()},N)}}}return x(),()=>{m.current=!0,h.current&&(clearTimeout(h.current),h.current=null),o.current&&(o.current.close(1e3,"unmount"),o.current=null)}},[l])}function RS(){const{data:t}=De({queryKey:["clients"],queryFn:Ih,staleTime:1e4,refetchInterval:1e4});return y.useMemo(()=>{const a=t??[],l=new Map;for(const s of a)l.set(s.id,s);return{resolve:s=>s?l.get(s)??null:null,clients:a,connectedClients:a.filter(s=>s.status==="connected")}},[t])}function n3(){const[t,a]=Ex(),l=t.get("a"),s=t.get("c"),[o,d]=y.useState(!0);t3();const h=y.useCallback(p=>{a(p?{a:p}:{})},[a]),m=y.useCallback((p,x)=>{a({a:p,c:x})},[a]),g=y.useCallback(()=>{l&&a({a:l})},[l,a]);return u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(u3,{selectedAgentId:l,selectedChatId:s,onSelectAgent:h,onSelectChat:m}),u.jsx("div",{className:"flex-1 flex flex-col overflow-hidden border-x border-border",children:u.jsx(c3,{selectedAgentId:l,selectedChatId:s,onSelectChat:m,onClearChat:g})}),o?u.jsxs("div",{className:"w-80 shrink-0 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s?"Session":l?"Agent Info":"Dashboard"}),u.jsx("button",{type:"button",onClick:()=>d(!1),className:"text-muted-foreground hover:text-foreground",children:u.jsx(J_,{className:"h-4 w-4"})})]}),u.jsx(m3,{selectedAgentId:l,selectedChatId:s})]}):u.jsx("div",{className:"shrink-0 border-l border-border flex items-start pt-2 px-1",children:u.jsx("button",{type:"button",onClick:()=>d(!0),className:"text-muted-foreground hover:text-foreground p-1",children:u.jsx(eE,{className:"h-4 w-4"})})})]})}const a3={error:0,blocked:1,working:2,idle:3};function kb(t,a){return a?t?a3[t]??4:4:5}const r3={idle:"bg-green-500",working:"bg-green-500 animate-pulse",blocked:"bg-yellow-500",error:"bg-red-500"};function l3({runtimeState:t,clientId:a}){if(!a||!t)return u.jsx("span",{className:"h-2 w-2 rounded-full bg-gray-400 shrink-0 mt-1.5"});const l=r3[t]??"bg-gray-400";return u.jsx("span",{className:`h-2 w-2 rounded-full ${l} shrink-0 mt-1.5`})}function s3({state:t}){if(!t)return u.jsx("span",{className:"text-xs text-muted-foreground",children:"offline"});const a={idle:"text-green-600",working:"text-blue-600",blocked:"text-yellow-600",error:"text-red-600"};return u.jsx("span",{className:je("text-xs font-medium",a[t]??"text-muted-foreground"),children:t})}function i3({state:t}){const a={active:"border-green-500/50 text-green-600 bg-green-500/10",suspended:"border-yellow-500/50 text-yellow-600 bg-yellow-500/10",evicted:"border-muted text-muted-foreground"};return u.jsx($t,{variant:"outline",className:je("text-xs",a[t]),children:t})}function o3({msg:t,myAgentId:a}){if(!a||t.senderId!==a)return null;const l=t.deliveryStatus??"sent";return l==="acked"?u.jsx("span",{className:"text-blue-500 text-xs ml-1",title:"Agent has started processing",children:"✓✓"}):l==="delivered"?u.jsx("span",{className:"text-muted-foreground text-xs ml-1",title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"text-muted-foreground text-xs ml-1",title:"Sent",children:"✓"})}function u3({selectedAgentId:t,selectedChatId:a,onSelectAgent:l,onSelectChat:s}){const o=Qn(),{resolve:d}=RS(),h=Mn(),{data:m}=De({queryKey:["activity"],queryFn:Ji,refetchInterval:1e4}),g=[...(m==null?void 0:m.agents)??[]].sort((b,j)=>kb(b.runtimeState,b.clientId)-kb(j.runtimeState,j.clientId)),{data:p}=De({queryKey:["agent-sessions",t],queryFn:()=>t?uc(t):Promise.resolve([]),enabled:!!t,refetchInterval:1e4}),x=st({mutationFn:b=>Xk(b),onSuccess:(b,j)=>{h.invalidateQueries({queryKey:["agent-sessions",j]}),s(j,b.id)}});return u.jsxs("aside",{className:"w-60 shrink-0 flex flex-col overflow-y-auto bg-card",children:[u.jsx("div",{className:"px-3 py-2 border-b border-border",children:u.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Agents"})}),u.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[g.length===0&&u.jsx("div",{className:"px-3 py-6 text-sm text-muted-foreground text-center",children:"No agents"}),g.map(b=>{var w;const j=t===b.agentId;return u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>l(j?null:b.agentId),className:je("w-full flex items-start gap-2 px-3 py-1.5 text-left transition-colors",j?"bg-accent":"hover:bg-accent/50"),children:[u.jsx(l3,{runtimeState:b.runtimeState,clientId:b.clientId}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium truncate flex-1",children:o(b.agentId)}),u.jsx(s3,{state:b.runtimeState})]}),u.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:b.clientId?((w=d(b.clientId))==null?void 0:w.hostname)??b.clientId.slice(0,8):"disconnected"})]})]}),j&&u.jsxs("div",{className:"pl-5 pr-2 py-1 space-y-0.5",children:[(!p||p.length===0)&&u.jsx("div",{className:"text-xs text-muted-foreground py-1 pl-2",children:"No active sessions"}),p==null?void 0:p.map(C=>u.jsxs("button",{type:"button",onClick:()=>s(b.agentId,C.chatId),className:je("w-full flex items-center gap-1.5 px-2 py-1 rounded text-left text-xs transition-colors",a===C.chatId?"bg-primary/10 text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[u.jsx(kx,{className:"h-3 w-3 shrink-0"}),u.jsxs("span",{className:"truncate flex-1",children:[C.chatId.slice(0,8),"..."]}),u.jsx("span",{className:je("h-1.5 w-1.5 rounded-full shrink-0",C.state==="active"&&"bg-green-500",C.state==="suspended"&&"bg-yellow-500",C.state==="evicted"&&"bg-gray-400"),title:C.state})]},C.chatId)),u.jsxs("button",{type:"button",onClick:()=>x.mutate(b.agentId),disabled:x.isPending,className:"w-full flex items-center gap-1.5 px-2 py-1 rounded text-xs text-muted-foreground hover:bg-accent/50 transition-colors",children:[u.jsx(hl,{className:"h-3 w-3"}),"New Chat"]})]})]},b.agentId)})]})]})}function c3({selectedAgentId:t,selectedChatId:a,onSelectChat:l,onClearChat:s}){return a&&t?u.jsx(h3,{agentId:t,chatId:a,onBack:s}):t?u.jsx(f3,{agentId:t,onSelectChat:l}):u.jsx(d3,{})}function d3(){const t=Qn(),{data:a}=De({queryKey:["overview"],queryFn:OS,refetchInterval:3e4}),{data:l}=De({queryKey:["activity"],queryFn:Ji,refetchInterval:1e4}),{data:s}=De({queryKey:["notifications","feed"],queryFn:()=>qi({limit:20}),refetchInterval:1e4});return u.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[u.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Activity"}),u.jsx("div",{className:"grid grid-cols-4 gap-3 mb-6",children:[{label:"Agents",value:(a==null?void 0:a.agents)??0},{label:"Online",value:(a==null?void 0:a.onlineAgents)??0},{label:"Working",value:(l==null?void 0:l.byState.working)??0},{label:"Blocked",value:(l==null?void 0:l.byState.blocked)??0}].map(o=>u.jsxs("div",{className:"rounded-lg border border-border p-3",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:o.label}),u.jsx("div",{className:"text-xl font-bold",children:o.value})]},o.label))}),u.jsxs("div",{className:"space-y-1",children:[(!(s!=null&&s.items)||s.items.length===0)&&u.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"No recent activity"}),s==null?void 0:s.items.map(o=>u.jsxs("div",{className:je("flex items-start gap-2 px-3 py-2 rounded-md text-sm",!o.read&&"bg-accent/20"),children:[u.jsx(Lx,{className:je("h-4 w-4 mt-0.5 shrink-0",o.severity==="high"&&"text-red-500",o.severity==="medium"&&"text-yellow-500",o.severity==="low"&&"text-muted-foreground")}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"font-medium",children:o.agentId?t(o.agentId):""})," ",u.jsx("span",{className:"text-muted-foreground",children:o.message})]}),u.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:un(o.createdAt)})]},o.id))]})]})}function f3({agentId:t,onSelectChat:a}){const l=Qn(),{data:s}=De({queryKey:["agent-sessions-all",t],queryFn:()=>uc(t),refetchInterval:1e4}),o=(s==null?void 0:s.filter(m=>m.state==="active"))??[],d=(s==null?void 0:s.length)??0,h=(s==null?void 0:s.filter(m=>m.runtimeState==="error"))??[];return u.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[u.jsx("h2",{className:"text-lg font-semibold mb-1",children:l(t)}),u.jsx("p",{className:"text-sm text-muted-foreground mb-4 font-mono",children:t}),u.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[u.jsxs("div",{className:"rounded-lg border border-border p-3",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Active"}),u.jsx("div",{className:"text-xl font-bold",children:o.length})]}),u.jsxs("div",{className:"rounded-lg border border-border p-3",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Total"}),u.jsx("div",{className:"text-xl font-bold",children:d})]}),u.jsxs("div",{className:"rounded-lg border border-border p-3",children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),u.jsx("div",{className:"text-xl font-bold text-red-600",children:h.length})]})]}),u.jsx("h3",{className:"text-sm font-medium mb-2",children:"All Sessions"}),u.jsx("div",{className:"border rounded-lg overflow-hidden",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[u.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Chat"}),u.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"State"}),u.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Messages"}),u.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground",children:"Last Active"})]})}),u.jsxs("tbody",{children:[(!s||s.length===0)&&u.jsx("tr",{children:u.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-muted-foreground",children:"No sessions"})}),s==null?void 0:s.map(m=>u.jsxs("tr",{className:"border-b border-border last:border-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>a(t,m.chatId),children:[u.jsxs("td",{className:"px-3 py-2 font-mono text-xs",children:[m.chatId.slice(0,12),"..."]}),u.jsx("td",{className:"px-3 py-2",children:u.jsx(i3,{state:m.state})}),u.jsx("td",{className:"px-3 py-2 text-muted-foreground text-xs",children:m.messageCount}),u.jsx("td",{className:"px-3 py-2 text-muted-foreground text-xs",children:un(m.lastActivityAt)})]},m.chatId))]})]})})]})}function h3({agentId:t,chatId:a,onBack:l}){var w;const s=Mn(),o=Qn(),{agentId:d}=Os(),[h,m]=y.useState(""),g=y.useRef(null),{data:p}=De({queryKey:["chat-messages",a],queryFn:()=>Jk(a,{limit:50}),refetchInterval:5e3}),x=st({mutationFn:C=>Fk(a,C),onSuccess:()=>{m(""),s.invalidateQueries({queryKey:["chat-messages",a]})}}),b=()=>{const C=h.trim();C&&x.mutate(C)},j=((w=p==null?void 0:p.items)==null?void 0:w.length)??0;return y.useEffect(()=>{var C;j>0&&((C=g.current)==null||C.scrollIntoView({behavior:"smooth"}))},[j]),u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border shrink-0",children:[u.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground",children:u.jsx(Rx,{className:"h-4 w-4"})}),u.jsx("span",{className:"text-sm font-medium",children:o(t)}),u.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[a.slice(0,8),"..."]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[(!(p!=null&&p.items)||p.items.length===0)&&u.jsxs("div",{className:"text-sm text-muted-foreground text-center py-8",children:[u.jsx(F_,{className:"h-8 w-8 mx-auto mb-2 opacity-30"}),"Send a message to start the conversation"]}),[...(p==null?void 0:p.items)??[]].reverse().map(C=>u.jsxs("div",{className:"rounded-md border border-border p-3",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium",children:o(C.senderId)}),C.source&&u.jsx($t,{variant:"outline",className:"text-[10px] opacity-70 px-1 py-0",children:C.source})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-xs text-muted-foreground",children:un(C.createdAt)}),u.jsx(o3,{msg:C,myAgentId:d})]})]}),u.jsx("div",{className:"text-sm",children:C.format==="text"?u.jsx("p",{className:"whitespace-pre-wrap",children:typeof C.content=="string"?C.content:JSON.stringify(C.content)}):u.jsx("pre",{className:"text-xs bg-muted p-2 rounded overflow-auto max-h-40",children:JSON.stringify(C.content,null,2)})})]},C.id)),u.jsx("div",{ref:g})]}),u.jsxs("div",{className:"shrink-0 border-t border-border p-3 flex gap-2",children:[u.jsx(tt,{placeholder:"Type a message...",value:h,onChange:C=>m(C.target.value),onKeyDown:C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),b())},disabled:x.isPending}),u.jsx(de,{size:"icon",onClick:b,disabled:x.isPending||!h.trim(),children:u.jsx(sE,{className:"h-4 w-4"})})]}),x.isError&&u.jsx("p",{className:"text-destructive text-xs px-3 pb-2",children:x.error instanceof Error?x.error.message:"Failed to send"})]})}function m3({selectedAgentId:t,selectedChatId:a}){return a&&t?u.jsx(x3,{agentId:t,chatId:a}):t?u.jsx(b3,{agentId:t}):u.jsx(p3,{})}function p3(){const t=Qn(),{data:a}=De({queryKey:["overview"],queryFn:OS,refetchInterval:3e4}),{data:l}=De({queryKey:["activity"],queryFn:Ji,refetchInterval:1e4}),{data:s}=De({queryKey:["notifications","context"],queryFn:()=>qi({limit:5}),refetchInterval:3e4});return u.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[u.jsx("div",{className:"space-y-2",children:[{label:"Clients",value:(l==null?void 0:l.clients)??0},{label:"Agents",value:(a==null?void 0:a.agents)??0},{label:"Online",value:(a==null?void 0:a.onlineAgents)??0},{label:"Working",value:(l==null?void 0:l.byState.working)??0},{label:"Idle",value:(l==null?void 0:l.byState.idle)??0},{label:"Blocked",value:(l==null?void 0:l.byState.blocked)??0},{label:"Error",value:(l==null?void 0:l.byState.error)??0}].map(o=>u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:o.label}),u.jsx("span",{className:"font-medium",children:o.value})]},o.label))}),u.jsxs("div",{className:"border-t border-border pt-3",children:[u.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Notifications"}),!(s!=null&&s.items)||s.items.length===0?u.jsx("div",{className:"text-xs text-muted-foreground text-center py-3",children:"No notifications"}):u.jsx("div",{className:"space-y-2",children:s.items.map(o=>u.jsxs("div",{className:je("text-xs",!o.read&&"font-medium"),children:[u.jsx("span",{className:je(o.severity==="high"&&"text-red-500",o.severity==="medium"&&"text-yellow-500"),children:o.agentId?t(o.agentId):"System"})," ",u.jsx("span",{className:"text-muted-foreground",children:o.message})]},o.id))})]})]})}function g3(t){if(!t)return"—";const a=Date.now()-new Date(t).getTime(),l=Math.floor(a/6e4);if(l<60)return`${l}m`;const s=Math.floor(l/60);return s<24?`${s}h ${l%60}m`:`${Math.floor(s/24)}d ${s%24}h`}const v3={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 y3({notifications:t,agentId:a}){const[,l]=Ex(),s=Mn(),o=st({mutationFn:d=>e0(d),onSuccess:()=>{s.invalidateQueries({queryKey:["notifications","agent",a]})}});return u.jsx("div",{className:"space-y-1",children:t.map(d=>{const h=!!d.chatId,m=v3[d.type]??d.type;return u.jsxs("button",{type:"button",className:je("w-full flex items-start gap-1.5 px-2 py-1.5 rounded text-xs text-left transition-colors",!d.read&&"bg-accent/30",h&&"cursor-pointer hover:bg-accent/50"),onClick:()=>{d.read||o.mutate(d.id),h&&l({a,c:d.chatId})},children:[u.jsx("span",{className:je("h-1.5 w-1.5 rounded-full mt-1 shrink-0",d.read?"bg-transparent":"bg-primary")}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:je("font-medium",d.severity==="high"&&"text-red-500",d.severity==="medium"&&"text-yellow-600",d.severity==="low"&&"text-muted-foreground"),children:m}),u.jsx("span",{className:"text-muted-foreground ml-auto shrink-0",children:un(d.createdAt)})]}),u.jsx("span",{className:"text-muted-foreground line-clamp-2",children:d.message})]})]},d.id)})})}function b3({agentId:t}){var m;const a=Qn(),{resolve:l}=RS(),{data:s}=De({queryKey:["activity"],queryFn:Ji,refetchInterval:1e4}),o=(m=s==null?void 0:s.agents)==null?void 0:m.find(g=>g.agentId===t),d=l(o==null?void 0:o.clientId),{data:h}=De({queryKey:["notifications","agent",t],queryFn:()=>qi({agentId:t,limit:5}),refetchInterval:3e4});return u.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[u.jsx("div",{className:"space-y-2",children:[{label:"Name",value:a(t)},{label:"Status",value:(o==null?void 0:o.runtimeState)??"offline"},{label:"Runtime",value:(o==null?void 0:o.runtimeType)??"—"},{label:"Active",value:String((o==null?void 0:o.activeSessions)??0)},{label:"Total",value:String((o==null?void 0:o.totalSessions)??0)}].map(g=>u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:g.label}),u.jsx("span",{className:"font-medium",children:g.value})]},g.label))}),u.jsxs("div",{className:"border-t border-border pt-3",children:[u.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Client"}),d?u.jsx("div",{className:"space-y-2",children:[{label:"Hostname",value:d.hostname??"—"},{label:"OS",value:d.os??"—"},{label:"SDK",value:d.sdkVersion??"—"},{label:"Connected",value:g3(d.connectedAt)}].map(g=>u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:g.label}),u.jsx("span",{className:"font-medium",children:g.value})]},g.label))}):u.jsx("div",{className:"text-xs text-muted-foreground",children:"disconnected"})]}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("a",{href:`/agents/${t}`,className:"text-xs text-primary hover:underline",children:"Manage Agent →"}),u.jsx("a",{href:"/admin#clients",className:"text-xs text-primary hover:underline",children:"Admin: Clients →"})]}),u.jsxs("div",{className:"border-t border-border pt-3",children:[u.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Notifications"}),!(h!=null&&h.items)||h.items.length===0?u.jsx("div",{className:"text-xs text-muted-foreground text-center py-3",children:"No notifications for this agent"}):u.jsx(y3,{notifications:h.items,agentId:t})]})]})}function x3({agentId:t,chatId:a}){const l=Mn(),{data:s}=De({queryKey:["session",t,a],queryFn:()=>uc(t).then(j=>j.find(w=>w.chatId===a)??null),refetchInterval:5e3}),o=st({mutationFn:()=>uk(t,a),onSuccess:()=>l.invalidateQueries({queryKey:["session",t,a]})}),d=st({mutationFn:()=>ck(t,a),onSuccess:()=>l.invalidateQueries({queryKey:["session",t,a]})}),h=st({mutationFn:()=>dk(t,a),onSuccess:()=>l.invalidateQueries({queryKey:["session",t,a]})}),m=(s==null?void 0:s.state)==="active",g=(s==null?void 0:s.state)==="suspended",p=(s==null?void 0:s.state)==="evicted",x=s!=null&&s.startedAt?new Date(s.startedAt):null,b=x?Math.floor((Date.now()-x.getTime())/6e4):null;return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-3",children:[u.jsx("div",{className:"space-y-2 mb-3",children:[{label:"State",value:(s==null?void 0:s.state)??"—"},{label:"Runtime",value:(s==null?void 0:s.runtimeState)??"—"},{label:"Started",value:s!=null&&s.startedAt?un(s.startedAt):"—"},{label:"Duration",value:b!==null?`${b} min`:"—"},{label:"Messages",value:String((s==null?void 0:s.messageCount)??0)}].map(j=>u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:j.label}),u.jsx("span",{className:"font-medium",children:j.value})]},j.label))}),u.jsxs("div",{className:"flex gap-2 mb-3",children:[m&&u.jsx(de,{variant:"outline",size:"sm",onClick:()=>o.mutate(),disabled:o.isPending,children:"Suspend"}),g&&u.jsx(de,{variant:"outline",size:"sm",onClick:()=>d.mutate(),disabled:d.isPending,children:"Resume"}),!p&&u.jsx(de,{variant:"destructive",size:"sm",onClick:()=>{window.confirm("Terminate this session?")&&h.mutate()},disabled:h.isPending,children:"Terminate"})]}),u.jsxs("div",{className:"border-t border-border pt-3 flex-1 overflow-y-auto",children:[u.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Session Info"}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:["Chat ID: ",u.jsxs("span",{className:"font-mono",children:[a.slice(0,12),"..."]})]})]})]})}const S3=new AN({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function j3(){return u.jsx(TN,{client:S3,children:u.jsx(N_,{children:u.jsx(d_,{children:u.jsxs(Bw,{children:[u.jsx(hr,{path:"/login",element:u.jsx(Pk,{})}),u.jsx(hr,{element:u.jsx(w_,{}),children:u.jsxs(hr,{element:u.jsx(v2,{}),children:[u.jsx(hr,{index:!0,element:u.jsx(n3,{})}),u.jsx(hr,{path:"agents",element:u.jsx(Kk,{})}),u.jsx(hr,{path:"agents/:uuid",element:u.jsx(Bk,{})}),u.jsx(hr,{path:"admin",element:u.jsx(rk,{})})]})})]})})})})}const MS=document.getElementById("root");if(!MS)throw new Error("Root element not found");aN.createRoot(MS).render(u.jsx(y.StrictMode,{children:u.jsx(j3,{})}));
|